diff --git a/common/src/event.rs b/common/src/event.rs index efb1ddf535..1056da4716 100644 --- a/common/src/event.rs +++ b/common/src/event.rs @@ -140,7 +140,7 @@ pub enum ServerEvent { ClientDisconnect(EcsEntity, DisconnectReason), ClientDisconnectWithoutPersistence(EcsEntity), ChunkRequest(EcsEntity, Vec2), - ChatCmd(EcsEntity, String, Vec), + Command(EcsEntity, String, Vec), /// Send a chat message to the player from an npc or other player Chat(comp::UnresolvedChatMsg), Aura { diff --git a/server/src/events/mod.rs b/server/src/events/mod.rs index 387f8c0fa1..38c73e6c52 100644 --- a/server/src/events/mod.rs +++ b/server/src/events/mod.rs @@ -51,7 +51,7 @@ impl Server { let mut frontend_events = Vec::new(); let mut requested_chunks = Vec::new(); - let mut chat_commands = Vec::new(); + let mut commands = Vec::new(); let mut chat_messages = Vec::new(); let events = self @@ -188,8 +188,8 @@ impl Server { ServerEvent::ChunkRequest(entity, key) => { requested_chunks.push((entity, key)); }, - ServerEvent::ChatCmd(entity, name, args) => { - chat_commands.push((entity, name, args)); + ServerEvent::Command(entity, name, args) => { + commands.push((entity, name, args)); }, ServerEvent::Chat(msg) => { chat_messages.push(msg); @@ -229,8 +229,8 @@ impl Server { self.generate_chunk(entity, key); } - for (entity, name, args) in chat_commands { - self.process_chat_cmd(entity, name, args); + for (entity, name, args) in commands { + self.process_command(entity, name, args); } for msg in chat_messages { diff --git a/server/src/lib.rs b/server/src/lib.rs index 5f5a944863..f1620b6680 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -983,7 +983,7 @@ impl Server { ); } - fn process_chat_cmd(&mut self, entity: EcsEntity, name: String, args: Vec) { + fn process_command(&mut self, entity: EcsEntity, name: String, args: Vec) { // Find the command object and run its handler. if let Ok(command) = name.parse::() { command.execute(self, entity, args); diff --git a/server/src/sys/msg/general.rs b/server/src/sys/msg/general.rs index 664efef403..e3787cc0ca 100644 --- a/server/src/sys/msg/general.rs +++ b/server/src/sys/msg/general.rs @@ -49,7 +49,7 @@ impl Sys { }, ClientGeneral::Command(name, args) => { if player.is_some() { - server_emitter.emit(ServerEvent::ChatCmd(entity, name, args)); + server_emitter.emit(ServerEvent::Command(entity, name, args)); } }, ClientGeneral::Terminate => {