mirror of
https://github.com/BeamMP/BeamMP-Server.git
synced 2026-04-07 08:16:24 +00:00
fixed the event handler registration stuff
This commit is contained in:
@@ -363,6 +363,13 @@ impl Server {
|
||||
match event {
|
||||
ServerBoundPluginEvent::PluginLoaded => plugin.send_event(PluginBoundPluginEvent::CallEventHandler((ScriptEvent::OnPluginLoaded, Vec::new()))).await,
|
||||
ServerBoundPluginEvent::RequestPlayerCount(responder) => { let _ = responder.send(PluginBoundPluginEvent::PlayerCount(self.clients.len())); }
|
||||
ServerBoundPluginEvent::RequestPlayers(responder) => {
|
||||
let mut players = HashMap::new();
|
||||
for client in &self.clients {
|
||||
players.insert(client.id, client.get_name().to_string());
|
||||
}
|
||||
let _ = responder.send(PluginBoundPluginEvent::Players(players));
|
||||
}
|
||||
_ => {},
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user