diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de1daf941..cb8df52d77 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - New rocks - Weapon trails - Hostile agent will now abort pursuing their target based on multiple metrics +- Admin command to reload all chunks on the server ### Changed diff --git a/common/src/cmd.rs b/common/src/cmd.rs index b2c2d0aefb..d20d365552 100644 --- a/common/src/cmd.rs +++ b/common/src/cmd.rs @@ -86,6 +86,7 @@ pub enum ChatCommand { PermitBuild, Players, Region, + ReloadChunks, RemoveLights, RevokeBuild, RevokeBuildAll, @@ -531,6 +532,11 @@ impl ChatCommand { Some(Admin), ), ChatCommand::Players => cmd(vec![], "Lists players currently online", None), + ChatCommand::ReloadChunks => cmd( + vec![], + "Reloads all chunks loaded on the server", + Some(Admin), + ), ChatCommand::RemoveLights => cmd( vec![Float("radius", 20.0, Optional)], "Removes all lights spawned by players", @@ -715,6 +721,7 @@ impl ChatCommand { ChatCommand::PermitBuild => "permit_build", ChatCommand::Players => "players", ChatCommand::Region => "region", + ChatCommand::ReloadChunks => "reload_chunks", ChatCommand::RemoveLights => "remove_lights", ChatCommand::RevokeBuild => "revoke_build", ChatCommand::RevokeBuildAll => "revoke_build_all", diff --git a/server/src/cmd.rs b/server/src/cmd.rs index a50e36d2b5..fe5fd46f90 100644 --- a/server/src/cmd.rs +++ b/server/src/cmd.rs @@ -161,6 +161,7 @@ fn do_command( ChatCommand::PermitBuild => handle_permit_build, ChatCommand::Players => handle_players, ChatCommand::Region => handle_region, + ChatCommand::ReloadChunks => handle_reload_chunks, ChatCommand::RemoveLights => handle_remove_lights, ChatCommand::RevokeBuild => handle_revoke_build, ChatCommand::RevokeBuildAll => handle_revoke_build_all, @@ -2968,6 +2969,18 @@ fn parse_skill_tree(skill_tree: &str) -> CmdResult, + _action: &ChatCommand, +) -> CmdResult<()> { + server.state.clear_terrain(); + + Ok(()) +} + fn handle_remove_lights( server: &mut Server, client: EcsEntity,