Small plugin structure fix
This commit is contained in:
+8
-17
@@ -1,9 +1,14 @@
|
|||||||
use crate::{logger, plugin::Plugin};
|
use crate::{
|
||||||
use serde::{Deserialize, Serialize};
|
logger,
|
||||||
|
plugin::{
|
||||||
|
Plugin,
|
||||||
|
types::{PluginHandshake, PluginJson},
|
||||||
|
},
|
||||||
|
};
|
||||||
use std::{
|
use std::{
|
||||||
collections::HashMap,
|
collections::HashMap,
|
||||||
fs,
|
fs,
|
||||||
io::{BufRead, BufReader, Read},
|
io::{BufRead, BufReader},
|
||||||
net::{TcpListener, TcpStream},
|
net::{TcpListener, TcpStream},
|
||||||
path::Path,
|
path::Path,
|
||||||
process::Command,
|
process::Command,
|
||||||
@@ -12,20 +17,6 @@ use std::{
|
|||||||
|
|
||||||
logger!(LOGGER "Plugin Loader");
|
logger!(LOGGER "Plugin Loader");
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
pub struct PluginJson {
|
|
||||||
pub id: String,
|
|
||||||
pub version: String,
|
|
||||||
pub supported_versions: Vec<String>,
|
|
||||||
pub file: String,
|
|
||||||
pub args: Vec<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
|
||||||
pub struct PluginHandshake {
|
|
||||||
pub id: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct PluginLoader {
|
pub struct PluginLoader {
|
||||||
plugin_clients: Arc<Mutex<HashMap<String, TcpStream>>>,
|
plugin_clients: Arc<Mutex<HashMap<String, TcpStream>>>,
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@ pub mod loader;
|
|||||||
pub mod types;
|
pub mod types;
|
||||||
|
|
||||||
use std::{
|
use std::{
|
||||||
io::{BufRead, BufReader, Read, Write},
|
io::{BufRead, BufReader, Write},
|
||||||
net::TcpStream,
|
net::TcpStream,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,19 @@
|
|||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
pub struct PluginJson {
|
||||||
|
pub id: String,
|
||||||
|
pub version: String,
|
||||||
|
pub supported_versions: Vec<String>,
|
||||||
|
pub file: String,
|
||||||
|
pub args: Vec<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
pub struct PluginHandshake {
|
||||||
|
pub id: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
#[serde(tag = "type", content = "params", rename_all = "snake_case")]
|
#[serde(tag = "type", content = "params", rename_all = "snake_case")]
|
||||||
pub enum LoaderMessage {}
|
pub enum LoaderMessage {}
|
||||||
|
|||||||
Reference in New Issue
Block a user