Working plugin loader
This commit is contained in:
@@ -57,6 +57,7 @@ impl PluginLoader {
|
||||
.get(&plugin_json.id)
|
||||
.is_none()
|
||||
{}
|
||||
LOGGER.info(format!("Loaded {}", plugin_json.id));
|
||||
Plugin(
|
||||
self.plugin_clients
|
||||
.lock()
|
||||
@@ -70,11 +71,9 @@ impl PluginLoader {
|
||||
|
||||
pub fn start_server(&self) {
|
||||
let plugin_clients = self.plugin_clients.clone();
|
||||
let listener = TcpListener::bind("0.0.0.0:7243").unwrap();
|
||||
|
||||
std::thread::spawn(move || {
|
||||
let listener = TcpListener::bind("0.0.0.0:7243").unwrap();
|
||||
LOGGER.info("Server listening at 0.0.0.0:7243");
|
||||
|
||||
for stream in listener.incoming() {
|
||||
let mut stream = stream.unwrap();
|
||||
let mut s = String::new();
|
||||
|
||||
@@ -67,6 +67,10 @@ impl Server {
|
||||
}
|
||||
|
||||
pub fn run(self: &Arc<Self>) -> crate::Result<()> {
|
||||
// Start plugin loader
|
||||
Self::LOGGER.info("Starting loader");
|
||||
self.plugin_loader.start_server();
|
||||
|
||||
// Load plugins
|
||||
Self::LOGGER.info("Loading plugins");
|
||||
for entry in fs::read_dir(self.root.join("plugins"))? {
|
||||
|
||||
Reference in New Issue
Block a user