From fc96fd780b8b4ded00c646ca40e4bb06a9ca8ca6 Mon Sep 17 00:00:00 2001 From: Joshua Barretto Date: Sun, 13 Dec 2020 23:08:15 +0000 Subject: [PATCH] Moved plugin API to Uid instead of usize for entity IDs, hello plugin to an example --- Cargo.toml | 5 +- assets/plugins/hello.plugin.tar | 3 - common/net/src/plugin/errors.rs | 21 - common/net/src/plugin/mod.rs | 138 -- common/net/src/plugin/module.rs | 150 -- network/examples/fileshare/server.rs | 2 - plugin/api/src/lib.rs | 6 +- plugin/derive/src/lib.rs | 6 +- plugin/hello/.gitignore | 2 - plugin/hello/Cargo.lock | 1276 ----------------- plugin/hello/Cargo.toml | 17 - plugin/rt/Cargo.toml | 7 + .../src/lib.rs => rt/examples/hello.rs} | 6 +- 13 files changed, 18 insertions(+), 1621 deletions(-) delete mode 100644 assets/plugins/hello.plugin.tar delete mode 100644 common/net/src/plugin/errors.rs delete mode 100644 common/net/src/plugin/mod.rs delete mode 100644 common/net/src/plugin/module.rs delete mode 100644 plugin/hello/.gitignore delete mode 100644 plugin/hello/Cargo.lock delete mode 100644 plugin/hello/Cargo.toml rename plugin/{hello/src/lib.rs => rt/examples/hello.rs} (94%) diff --git a/Cargo.toml b/Cargo.toml index 465694a3b6..6bd656493d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,11 +3,12 @@ cargo-features = ["named-profiles","profile-overrides"] [workspace] members = [ "common", + "common/net", "common/sys", - "plugin/rt", + "client", "plugin/api", "plugin/derive", - "client", + "plugin/rt", "server", "server-cli", "voxygen", diff --git a/assets/plugins/hello.plugin.tar b/assets/plugins/hello.plugin.tar deleted file mode 100644 index a816db0047..0000000000 --- a/assets/plugins/hello.plugin.tar +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b77282b297edf542e9de80cf16d109fe727569d9933d0918abac7164b0f5d3a1 -size 2058752 diff --git a/common/net/src/plugin/errors.rs b/common/net/src/plugin/errors.rs deleted file mode 100644 index ad6bfef789..0000000000 --- a/common/net/src/plugin/errors.rs +++ /dev/null @@ -1,21 +0,0 @@ -use bincode::ErrorKind; -use wasmer_runtime::error::{ResolveError, RuntimeError}; - -#[derive(Debug)] -pub enum PluginError { - Io(std::io::Error), - Toml(toml::de::Error), - NoConfig, - NoSuchModule, - PluginModuleError(PluginModuleError) -} - -#[derive(Debug)] -pub enum PluginModuleError { - FindFunction(String), - FunctionGet(ResolveError), - Compile(wasmer_runtime::error::CompileError), - Instantiate(wasmer_runtime::error::Error), - RunFunction(RuntimeError), - Encoding(Box), -} \ No newline at end of file diff --git a/common/net/src/plugin/mod.rs b/common/net/src/plugin/mod.rs deleted file mode 100644 index afc88cd944..0000000000 --- a/common/net/src/plugin/mod.rs +++ /dev/null @@ -1,138 +0,0 @@ - -pub mod errors; -pub mod module; - -use common::assets::ASSETS_PATH; -use serde::{Deserialize, Serialize}; -use std::{collections::{HashMap, HashSet}, fs, io::Read, path::{Path, PathBuf}}; -use tracing::{error, info}; - -use plugin_api::Event; - -use self::{ errors::PluginError, module::{PluginModule, PreparedEventQuery}}; - -use rayon::prelude::*; - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct PluginData { - name: String, - modules: HashSet, - dependencies: HashSet, -} - -#[derive(Clone)] -pub struct Plugin { - data: PluginData, - modules: Vec, - files: HashMap>, -} - -impl Plugin { - pub fn from_reader(mut reader: R) -> Result { - let mut buf = Vec::new(); - reader.read_to_end(&mut buf).map_err(PluginError::Io)?; - - let mut files = tar::Archive::new(&*buf) - .entries() - .map_err(PluginError::Io)? - .map(|e| { - e.and_then(|e| { - Ok((e.path()?.into_owned(), { - let offset = e.raw_file_position() as usize; - buf[offset..offset + e.size() as usize].to_vec() - })) - }) - }) - .collect::, _>>() - .map_err(PluginError::Io)?; - - let data = toml::de::from_slice::( - &files - .get(Path::new("plugin.toml")) - .ok_or(PluginError::NoConfig)?, - ) - .map_err(PluginError::Toml)?; - - let modules = data - .modules - .iter() - .map(|path| { - let wasm_data = files.remove(path).ok_or(PluginError::NoSuchModule)?; - PluginModule::new(&wasm_data).map_err(|e| PluginError::PluginModuleError(e)) - }) - .collect::>()?; - - Ok(Plugin { - data, - modules, - files, - }) - } - - pub fn execute_prepared(&self, event_name: &str, event: &PreparedEventQuery) -> Result, PluginError> where T: Event { - self.modules.iter().flat_map(|module| { - module.try_execute(event_name, event).map(|x| x.map_err(|e| PluginError::PluginModuleError(e))) - }).collect::,_>>() - } -} - -#[derive(Clone, Default)] -pub struct PluginMgr { - plugins: Vec, -} - -impl PluginMgr { - pub fn from_assets() -> Result { - let mut assets_path = (&*ASSETS_PATH).clone(); - assets_path.push("plugins"); - info!("Searching {:?} for assets...", assets_path); - Self::from_dir(assets_path) - } - - pub fn execute_prepared(&self, event_name: &str,event: &PreparedEventQuery) -> Result, PluginError> where T: Event { - Ok(self.plugins.par_iter().map(|plugin| { - plugin.execute_prepared(event_name, event) - }).collect::,_>>()?.into_iter().flatten().collect()) - } - - pub fn execute_event(&self, event_name: &str,event: &T) -> Result, PluginError> where T: Event { - self.execute_prepared(event_name, &PreparedEventQuery::new(event)?) - } - - pub fn from_dir>(path: P) -> Result { - let plugins = fs::read_dir(path) - .map_err(PluginError::Io)? - .filter_map(|e| e.ok()) - .map(|entry| { - if entry.file_type().map(|ft| ft.is_file()).unwrap_or(false) - && entry - .path() - .file_name() - .and_then(|n| n.to_str()) - .map(|s| s.ends_with(".plugin.tar")) - .unwrap_or(false) - { - info!("Loading plugin at {:?}", entry.path()); - Plugin::from_reader(fs::File::open(entry.path()).map_err(PluginError::Io)?) - .map(Some) - } else { - Ok(None) - } - }) - .filter_map(Result::transpose) - .inspect(|p| { - let _ = p.as_ref().map_err(|e| error!(?e, "Failed to load plugin")); - }) - .collect::, _>>()?; - - for plugin in &plugins { - info!( - "Loaded plugin '{}' with {} module(s)", - plugin.data.name, - plugin.modules.len() - ); - } - - Ok(Self { plugins }) - } -} diff --git a/common/net/src/plugin/module.rs b/common/net/src/plugin/module.rs deleted file mode 100644 index 2610195636..0000000000 --- a/common/net/src/plugin/module.rs +++ /dev/null @@ -1,150 +0,0 @@ -use std::{ - cell::Cell, - collections::HashSet, - marker::PhantomData, - sync::{Arc, Mutex}, -}; - -use error::RuntimeError; -use wasmer_runtime::*; - -use super::errors::{PluginError, PluginModuleError}; -use plugin_api::{Action, Event}; - -// This represent a WASM function interface -pub type Function<'a> = Func<'a, (i32, u32), i32>; - -#[derive(Clone)] -// This structure represent the WASM State of the plugin. -pub struct PluginModule { - wasm_instance: Arc>, - events: HashSet, -} - -impl PluginModule { - - // This function takes bytes from a WASM File and compile them - pub fn new(wasm_data: &Vec) -> Result { - let module = compile(&wasm_data).map_err(|e| PluginModuleError::Compile(e))?; - let instance = module - .instantiate(&imports! {"env" => { - "raw_emit_actions" => func!(read_action), - }}).map_err(|e| PluginModuleError::Instantiate(e))?; - - Ok(Self { - events: instance.exports.into_iter().map(|(name, _)| name).collect(), - wasm_instance: Arc::new(Mutex::new(instance)), - }) - } - - // This function tries to execute an event for the current module. Will return None if the event doesn't exists - pub fn try_execute( - &self, - event_name: &str, - request: &PreparedEventQuery, - ) -> Option> - where - T: Event, - { - if !self.events.contains(event_name) { - return None; - } - let bytes = { - let instance = self.wasm_instance.lock().unwrap(); - let func = match instance.exports.get(event_name).map_err(|e| PluginModuleError::FunctionGet(e)) { - Ok(e) => e, - Err(e) => return Some(Err(e)) - }; - let mem = instance.context().memory(0); - match execute_raw(&mem, &func, &request.bytes).map_err(|e| PluginModuleError::RunFunction(e)) { - Ok(e) => e, - Err(e) => return Some(Err(e)) - } - }; - Some(bincode::deserialize(&bytes).map_err(|e| PluginModuleError::Encoding(e))) - } -} - -// This structure represent a Pre-encoded event object (Useful to avoid reencoding for each module in every plugin) -pub struct PreparedEventQuery { - bytes: Vec, - _phantom: PhantomData, -} - -impl PreparedEventQuery { - // Create a prepared query from an event reference (Encode to bytes the struct) - // This Prepared Query is used by the `try_execute` method in `PluginModule` - pub fn new(event: &T) -> Result - where - T: Event, - { - Ok(Self { - bytes: bincode::serialize(&event).map_err(|e| PluginError::PluginModuleError(PluginModuleError::Encoding(e)))?, - _phantom: PhantomData::default(), - }) - } -} - -const MEMORY_POS: usize = 100000; - -// This function is not public because this function should not be used without an interface to limit unsafe behaviours -fn execute_raw( - memory: &Memory, - function: &Function, - bytes: &[u8], -) -> Result, RuntimeError> { - let view = memory.view::(); - let len = bytes.len(); - for (cell, byte) in view[MEMORY_POS..len + MEMORY_POS].iter().zip(bytes.iter()) { - cell.set(*byte) - } - let start = function - .call(MEMORY_POS as i32, len as u32)? as usize; - let view = memory.view::(); - let mut new_len_bytes = [0u8; 4]; - // TODO: It is probably better to dirrectly make the new_len_bytes - for i in 0..4 { - new_len_bytes[i] = view.get(i + 1).map(Cell::get).unwrap_or(0); - } - let new_len = u32::from_ne_bytes(new_len_bytes) as usize; - Ok(view[start..start + new_len] - .iter() - .map(|c| c.get()) - .collect()) -} - -pub fn read_action(ctx: &mut Ctx, ptr: u32, len: u32) { - let memory = ctx.memory(0); - - let memory = memory.view::(); - - let str_slice = &memory[ptr as usize..(ptr + len) as usize]; - - let bytes: Vec = str_slice.iter().map(|x| x.get()).collect(); - - let e: Vec = match bincode::deserialize(&bytes) { - Ok(e) => e, - Err(e) => { - tracing::error!(?e, "Can't decode action"); - return; - } - }; - - for action in e { - match action { - Action::ServerClose => { - tracing::info!("Server closed by plugin"); - std::process::exit(-1); - } - Action::Print(e) => { - tracing::info!("{}",e); - } - Action::PlayerSendMessage(a, b) => { - tracing::info!("SendMessage {} -> {}",a,b); - } - Action::KillEntity(e) => { - tracing::info!("Kill Entity {}",e); - } - } - } -} diff --git a/network/examples/fileshare/server.rs b/network/examples/fileshare/server.rs index d56b07c116..33ceda100f 100644 --- a/network/examples/fileshare/server.rs +++ b/network/examples/fileshare/server.rs @@ -1,5 +1,3 @@ -#![allow(clippy::eval_order_dependence)] - use crate::commands::{Command, FileInfo, LocalCommand, RemoteInfo}; use async_std::{ fs, diff --git a/plugin/api/src/lib.rs b/plugin/api/src/lib.rs index ac246cc5ef..3974b53f3a 100644 --- a/plugin/api/src/lib.rs +++ b/plugin/api/src/lib.rs @@ -5,8 +5,8 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; pub enum Action { ServerClose, Print(String), - PlayerSendMessage(usize, String), - KillEntity(usize), + PlayerSendMessage(Uid, String), + KillEntity(Uid), } pub trait Event: Serialize + DeserializeOwned + Send + Sync { @@ -38,7 +38,7 @@ pub mod event { #[derive(Serialize, Deserialize, Debug, Clone, Eq, PartialEq)] pub struct PlayerJoinEvent { pub player_name: String, - pub player_id: usize, + pub player_id: Uid, } impl Event for PlayerJoinEvent { diff --git a/plugin/derive/src/lib.rs b/plugin/derive/src/lib.rs index 58de769dc5..860c98179a 100644 --- a/plugin/derive/src/lib.rs +++ b/plugin/derive/src/lib.rs @@ -16,16 +16,16 @@ pub fn event_handler(_args: TokenStream, item: TokenStream) -> TokenStream { let out: proc_macro2::TokenStream = quote! { #[no_mangle] pub fn #fn_name(intern__ptr: i32, intern__len: u32) -> i32 { - let input = ::plugin_rt::read_input(intern__ptr,intern__len).unwrap(); + let input = ::veloren_plugin_rt::read_input(intern__ptr,intern__len).unwrap(); #[inline] fn inner(#fn_args) #fn_return { #fn_body } // Artificially force the event handler to be type-correct - fn force_event(event: E, inner: fn(E) -> E::Response) -> E::Response { + fn force_event(event: E, inner: fn(E) -> E::Response) -> E::Response { inner(event) } - ::plugin_rt::write_output(&force_event(input, inner)) + ::veloren_plugin_rt::write_output(&force_event(input, inner)) } }; out.into() diff --git a/plugin/hello/.gitignore b/plugin/hello/.gitignore deleted file mode 100644 index fd513af6d5..0000000000 --- a/plugin/hello/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -# Rust -target diff --git a/plugin/hello/Cargo.lock b/plugin/hello/Cargo.lock deleted file mode 100644 index 464cb7fe0d..0000000000 --- a/plugin/hello/Cargo.lock +++ /dev/null @@ -1,1276 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -[[package]] -name = "adler32" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" - -[[package]] -name = "ahash" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" - -[[package]] -name = "anymap" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33954243bd79057c2de7338850b85983a44588021f8a5fee574a8888c6de4344" - -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - -[[package]] -name = "arraygen" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1ae06b5f52588295bfd019b837b6fb1a6914d58ece30b0c43ae439ef08e562" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "atom" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9ff149ed9780025acfdb36862d35b28856bb693ceb451259a7164442f22fdc3" - -[[package]] -name = "autocfg" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" - -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - -[[package]] -name = "bincode" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30d3a39baa26f9651f17b375061f3233dde33424a8b72b0dbe93a68a0bc896d" -dependencies = [ - "byteorder", - "serde", -] - -[[package]] -name = "bitflags" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "bytemuck" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41aa2ec95ca3b5c54cf73c91acf06d24f4495d5f1b1c12506ae3483d646177ac" - -[[package]] -name = "byteorder" -version = "1.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" - -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - -[[package]] -name = "cfg-if" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "color_quant" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" - -[[package]] -name = "const_fn" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826" - -[[package]] -name = "crc32fast" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-channel 0.4.4", - "crossbeam-deque 0.7.3", - "crossbeam-epoch 0.8.2", - "crossbeam-queue", - "crossbeam-utils 0.7.2", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-channel" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca26ee1f8d361640700bde38b2c37d8c22b3ce2d360e1fc1c74ea4b0aa7d775" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils 0.8.1", -] - -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", - "crossbeam-utils 0.8.1", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.6", - "scopeguard", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1aaa739f95311c2c7887a76863f500026092fb1dce0161dab577e559ef3569d" -dependencies = [ - "cfg-if 1.0.0", - "const_fn", - "crossbeam-utils 0.8.1", - "lazy_static", - "memoffset 0.6.1", - "scopeguard", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -dependencies = [ - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "lazy_static", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "lazy_static", -] - -[[package]] -name = "deflate" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" -dependencies = [ - "adler32", - "byteorder", -] - -[[package]] -name = "directories-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d" -dependencies = [ - "libc", - "redox_users", - "winapi 0.3.9", -] - -[[package]] -name = "dot_vox" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c18405ef54de0398b77a3ec8394d3a1639e7bf060e1385201e8db40c44ab41" -dependencies = [ - "byteorder", - "lazy_static", - "log", - "nom 4.2.3", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - -[[package]] -name = "enum-iterator" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7" -dependencies = [ - "enum-iterator-derive", -] - -[[package]] -name = "enum-iterator-derive" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "filetime" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "winapi 0.3.9", -] - -[[package]] -name = "fsevent" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97f347202c95c98805c216f9e1df210e8ebaec9fdb2365700a43c10797a35e63" -dependencies = [ - "bitflags", - "fsevent-sys", -] - -[[package]] -name = "fsevent-sys" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a29c77f1ca394c3e73a9a5d24cfcabb734682d9634fc398f2204a63c994120" -dependencies = [ - "libc", -] - -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - -[[package]] -name = "getrandom" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "wasi", -] - -[[package]] -name = "hashbrown" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96282e96bfcd3da0d3aa9938bedf1e50df3269b6db08b4876d2da0bb1a0841cf" -dependencies = [ - "ahash", - "autocfg", - "rayon", - "serde", -] - -[[package]] -name = "hashbrown" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" - -[[package]] -name = "hello" -version = "0.1.0" -dependencies = [ - "veloren-plugin-rt", -] - -[[package]] -name = "hermit-abi" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" -dependencies = [ - "libc", -] - -[[package]] -name = "hibitset" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a1bb8316a44459a7d14253c4d28dd7395cbd23cc04a68c46e851b8e46d64b1" -dependencies = [ - "atom", - "rayon", -] - -[[package]] -name = "image" -version = "0.23.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce04077ead78e39ae8610ad26216aed811996b043d47beed5090db674f9e9b5" -dependencies = [ - "bytemuck", - "byteorder", - "color_quant", - "num-iter", - "num-rational", - "num-traits", - "png", -] - -[[package]] -name = "indexmap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" -dependencies = [ - "autocfg", - "hashbrown 0.9.1", -] - -[[package]] -name = "inotify" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46dd0a94b393c730779ccfd2a872b67b1eb67be3fc33082e733bdb38b5fde4d4" -dependencies = [ - "bitflags", - "inotify-sys", - "libc", -] - -[[package]] -name = "inotify-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4563555856585ab3180a5bf0b2f9f8d301a728462afffc8195b3f5394229c55" -dependencies = [ - "libc", -] - -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - -[[package]] -name = "itoa" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - -[[package]] -name = "libc" -version = "0.2.81" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" - -[[package]] -name = "log" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" -dependencies = [ - "cfg-if 0.1.10", -] - -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - -[[package]] -name = "memchr" -version = "2.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" - -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memoffset" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157b4208e3059a8f9e78d559edc658e13df41410cb3ae03979c83130067fdd87" -dependencies = [ - "autocfg", -] - -[[package]] -name = "miniz_oxide" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" -dependencies = [ - "adler32", -] - -[[package]] -name = "mio" -version = "0.6.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" -dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", - "libc", - "log", - "miow", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-extras" -version = "2.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52403fe290012ce777c4626790c8951324a2b9e3316b3143779c72b029742f19" -dependencies = [ - "lazycell", - "log", - "mio", - "slab", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", -] - -[[package]] -name = "mopa" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a785740271256c230f57462d3b83e52f998433a7062fc18f96d5999474a9f915" - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", -] - -[[package]] -name = "nom" -version = "4.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ad2a91a8e869eeb30b9cb3119ae87773a8f4ae617f41b1eb9c154b2905f7bd6" -dependencies = [ - "memchr", - "version_check 0.1.5", -] - -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check 0.9.2", -] - -[[package]] -name = "notify" -version = "5.0.0-pre.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b946889dfdad884379cd56367d93b6d0ce8889cc027d26a69a3a31c0a03bb5" -dependencies = [ - "anymap", - "bitflags", - "crossbeam-channel 0.4.4", - "filetime", - "fsevent", - "fsevent-sys", - "inotify", - "libc", - "mio", - "mio-extras", - "walkdir", - "winapi 0.3.9", -] - -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-integer" -version = "0.1.44" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "once_cell" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" - -[[package]] -name = "ordered-float" -version = "2.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dacdec97876ef3ede8c50efc429220641a0b11ba0048b4b0c357bccbc47c5204" -dependencies = [ - "num-traits", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" - -[[package]] -name = "png" -version = "0.16.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3287920cb847dee3de33d301c463fba14dda99db24214ddf93f83d3021f4c6" -dependencies = [ - "bitflags", - "crc32fast", - "deflate", - "miniz_oxide", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check 0.9.2", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check 0.9.2", -] - -[[package]] -name = "proc-macro2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "quote" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "rand" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" -dependencies = [ - "getrandom", - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" -dependencies = [ - "rand_core", -] - -[[package]] -name = "rayon" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" -dependencies = [ - "autocfg", - "crossbeam-deque 0.8.0", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" -dependencies = [ - "crossbeam-channel 0.5.0", - "crossbeam-deque 0.8.0", - "crossbeam-utils 0.8.1", - "lazy_static", - "num_cpus", -] - -[[package]] -name = "redox_syscall" -version = "0.1.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "redox_users" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" -dependencies = [ - "getrandom", - "redox_syscall", -] - -[[package]] -name = "ron" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a58080b7bb83b2ea28c3b7a9a994fd5e310330b7c8ca5258d99b98128ecfe4" -dependencies = [ - "base64", - "bitflags", - "serde", -] - -[[package]] -name = "roots" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84348444bd7ad45729d0c49a4240d7cdc11c9d512c06c5ad1835c1ad4acda6db" - -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - -[[package]] -name = "ryu" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - -[[package]] -name = "serde" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06c64263859d87aa2eb554587e2d23183398d617427327cf2b3d0ed8c69e4800" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.118" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84d3526699cd55261af4b941e4e725444df67aa4f9e6a3564f18030d12672df" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_repr" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc6b7951b17b051f3210b063f12cc17320e2fe30ae05b0fe2a3abb068551c76" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "shred" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f08237e667ac94ad20f8878b5943d91a93ccb231428446c57c21c57779016d" -dependencies = [ - "arrayvec", - "hashbrown 0.7.2", - "mopa", - "rayon", - "smallvec", - "tynm", -] - -[[package]] -name = "shrev" -version = "1.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5752e017e03af9d735b4b069f53b7a7fd90fefafa04d8bd0c25581b0bff437f" - -[[package]] -name = "slab" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" - -[[package]] -name = "slotmap" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46a3482db8f247956e464d783693ece164ca056e6e67563ee5505bdb86452cd" -dependencies = [ - "serde", -] - -[[package]] -name = "smallvec" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" - -[[package]] -name = "specs" -version = "0.16.1" -source = "git+https://github.com/amethyst/specs.git?rev=7a2e348ab2223818bad487695c66c43db88050a5#7a2e348ab2223818bad487695c66c43db88050a5" -dependencies = [ - "crossbeam-queue", - "hashbrown 0.7.2", - "hibitset", - "log", - "rayon", - "serde", - "shred", - "shrev", - "tuple_utils", -] - -[[package]] -name = "specs-idvs" -version = "0.1.0" -source = "git+https://gitlab.com/veloren/specs-idvs.git?branch=specs-git#fcb0b2306b571f62f9f85d89e79e087454d95efd" -dependencies = [ - "specs", -] - -[[package]] -name = "spin_sleep" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a98101bdc3833e192713c2af0b0dd2614f50d1cf1f7a97c5221b7aac052acc7" -dependencies = [ - "once_cell", - "winapi 0.3.9", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "syn" -version = "1.0.54" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2af957a63d6bd42255c359c93d9bfdb97076bd3b820897ce55ffbfbf107f44" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "tracing" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" -dependencies = [ - "cfg-if 1.0.0", - "pin-project-lite", - "tracing-core", -] - -[[package]] -name = "tracing-core" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" - -[[package]] -name = "tuple_utils" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44834418e2c5b16f47bedf35c28e148db099187dd5feee6367fb2525863af4f1" - -[[package]] -name = "tynm" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4df2caa2dc9c3d1f7641ba981f4cd40ab229775aa7aeb834c9ab2850d50623d" -dependencies = [ - "nom 5.1.2", -] - -[[package]] -name = "unicode-xid" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" - -[[package]] -name = "uuid" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" -dependencies = [ - "rand", - "serde", -] - -[[package]] -name = "vek" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b5ec6f1e1336c875817faba09752eeac76aa0c51c304b9030cbfcd0daf5e217" -dependencies = [ - "approx", - "num-integer", - "num-traits", - "rustc_version", - "serde", - "static_assertions", -] - -[[package]] -name = "veloren-common" -version = "0.8.0" -dependencies = [ - "arraygen", - "crossbeam", - "directories-next", - "dot_vox", - "enum-iterator", - "hashbrown 0.7.2", - "image", - "indexmap", - "lazy_static", - "notify", - "num-derive", - "num-traits", - "ordered-float", - "rand", - "rayon", - "ron", - "roots", - "serde", - "serde_json", - "serde_repr", - "slab", - "slotmap", - "specs", - "specs-idvs", - "spin_sleep", - "tracing", - "uuid", - "vek", -] - -[[package]] -name = "veloren-plugin-api" -version = "0.1.0" -dependencies = [ - "serde", - "veloren-common", -] - -[[package]] -name = "veloren-plugin-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "veloren-plugin-rt" -version = "0.1.0" -dependencies = [ - "bincode", - "serde", - "veloren-plugin-api", - "veloren-plugin-derive", -] - -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - -[[package]] -name = "version_check" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" - -[[package]] -name = "walkdir" -version = "2.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" -dependencies = [ - "same-file", - "winapi 0.3.9", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] diff --git a/plugin/hello/Cargo.toml b/plugin/hello/Cargo.toml deleted file mode 100644 index 07014803f5..0000000000 --- a/plugin/hello/Cargo.toml +++ /dev/null @@ -1,17 +0,0 @@ -[package] -name = "hello" -version = "0.1.0" -authors = ["Joshua Barretto "] -edition = "2018" - -[lib] -crate-type = ["cdylib"] - -[dependencies] -plugin-rt = { package = "veloren-plugin-rt", path = "../rt" } - -[workspace] - -[profile.dev] -opt-level = "s" -debug = false diff --git a/plugin/rt/Cargo.toml b/plugin/rt/Cargo.toml index 7ec08682b3..ec216fb887 100644 --- a/plugin/rt/Cargo.toml +++ b/plugin/rt/Cargo.toml @@ -9,3 +9,10 @@ plugin-api = { package = "veloren-plugin-api", path = "../api" } plugin-derive = { package = "veloren-plugin-derive", path = "../derive"} serde = {version = "1.0.118", features = ["derive"]} bincode = "1.3.1" + +[[example]] +name = "hello" +crate-type = ["cdylib"] + +[dev-dependencies] +plugin-derive = { package = "veloren-plugin-derive", path = "../derive"} diff --git a/plugin/hello/src/lib.rs b/plugin/rt/examples/hello.rs similarity index 94% rename from plugin/hello/src/lib.rs rename to plugin/rt/examples/hello.rs index fb0adf41a8..2de3c512ed 100644 --- a/plugin/hello/src/lib.rs +++ b/plugin/rt/examples/hello.rs @@ -1,11 +1,9 @@ -extern crate plugin_rt; - -use plugin_rt::{ +use veloren_plugin_rt::{ api::{event::*, Action, GameMode}, *, }; -#[event_handler] +#[veloren_plugin_rt::event_handler] pub fn on_load(load: PluginLoadEvent) { match load.game_mode { GameMode::Server => emit_action(Action::Print("Hello, server!".to_owned())),