Improved structure

This commit is contained in:
2025-09-14 14:20:36 +02:00
parent 59e96fe05e
commit a4ce0c0589
17 changed files with 357 additions and 321 deletions
+22
View File
@@ -0,0 +1,22 @@
use std::sync::Arc;
use crate::{
Server,
types::{ClientMessage, WsMessage},
utils::client::Client,
};
pub type DynPlugin = Box<dyn Plugin + Send + Sync>;
pub trait Plugin {
fn init(&mut self, server: &Arc<Server>);
#[allow(unused_variables)]
fn on_request(
&mut self,
req: &WsMessage<ClientMessage>,
client: &Client,
server: &Arc<Server>,
) -> bool {
false
}
}