Commit Graph

9 Commits

Author SHA1 Message Date
MedzikUser b56357c085
fix(server): change from task::spawn to thread::spawn
Changed to thread::spawn due to task::spawn spawn max 2 tasks (accept max 2 clients) if your cpu has 2 cores.
2022-09-14 21:03:49 +02:00
MedzikUser 032ec88ed6
chore: add some comments in code
Moved `PluginsManager` and `PluginsManagerType` from `servers::plugin::manager` to the `servers::plugin` module.
Added some comments in code.
Implemented function `into()` to the `PluginsManager` struct.
2022-08-22 13:23:08 +02:00
MedzikUser d31e0fff2f
fix(plugin): execute `on_load` function
Now function `on_load` will be executed if the plugin is loads.
Added span to the logger on TRACE level in plugin loader.
Fixed clippy warning from previous commit.
2022-08-17 22:05:27 +02:00
MedzikUser 67fb1a0a3c
feat(server): add `onCommand` event and handle errors in message processing
Added `OnCommand` event e.g. to disable command for client. (BREAKING CHANGES IN EVENT PLUGINS)
Added function for error handling in message process.
2022-08-17 21:44:06 +02:00
MedzikUser 7da5daf522
feat(client): HashMap add Mutex and functions
Changed map type in Client struct to Arc<Mutex<HashMap<String, ClientMapValue>>>.
Implemented functions insert_key, get_value and delete_key to the Client type.
Re-export servers::server::ClientMapValue in servers::plugins::prelude.
2022-08-17 15:40:11 +02:00
MedzikUser 97b19ae413
feat(tcp client): add tcp-client 2022-08-16 23:24:21 +02:00
MedzikUser f27df56c47
feat(plugins): implement events
- Events: onConnect and onSend now works
2022-08-13 12:06:53 +02:00
MedzikUser 6f7edf3d30
fix(clippy): rename module to fix clippy warning 2022-08-12 23:16:13 +02:00
MedzikUser 84eed33e24
docs: comment code 2022-08-12 23:12:29 +02:00