mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Add chunk reload command (admin only)
This commit is contained in:
parent
aa244b23c4
commit
8c06dc9a5c
@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- New rocks
|
- New rocks
|
||||||
- Weapon trails
|
- Weapon trails
|
||||||
- Hostile agent will now abort pursuing their target based on multiple metrics
|
- Hostile agent will now abort pursuing their target based on multiple metrics
|
||||||
|
- Admin command to reload all chunks on the server
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -86,6 +86,7 @@ pub enum ChatCommand {
|
|||||||
PermitBuild,
|
PermitBuild,
|
||||||
Players,
|
Players,
|
||||||
Region,
|
Region,
|
||||||
|
ReloadChunks,
|
||||||
RemoveLights,
|
RemoveLights,
|
||||||
RevokeBuild,
|
RevokeBuild,
|
||||||
RevokeBuildAll,
|
RevokeBuildAll,
|
||||||
@ -531,6 +532,11 @@ impl ChatCommand {
|
|||||||
Some(Admin),
|
Some(Admin),
|
||||||
),
|
),
|
||||||
ChatCommand::Players => cmd(vec![], "Lists players currently online", None),
|
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(
|
ChatCommand::RemoveLights => cmd(
|
||||||
vec![Float("radius", 20.0, Optional)],
|
vec![Float("radius", 20.0, Optional)],
|
||||||
"Removes all lights spawned by players",
|
"Removes all lights spawned by players",
|
||||||
@ -715,6 +721,7 @@ impl ChatCommand {
|
|||||||
ChatCommand::PermitBuild => "permit_build",
|
ChatCommand::PermitBuild => "permit_build",
|
||||||
ChatCommand::Players => "players",
|
ChatCommand::Players => "players",
|
||||||
ChatCommand::Region => "region",
|
ChatCommand::Region => "region",
|
||||||
|
ChatCommand::ReloadChunks => "reload_chunks",
|
||||||
ChatCommand::RemoveLights => "remove_lights",
|
ChatCommand::RemoveLights => "remove_lights",
|
||||||
ChatCommand::RevokeBuild => "revoke_build",
|
ChatCommand::RevokeBuild => "revoke_build",
|
||||||
ChatCommand::RevokeBuildAll => "revoke_build_all",
|
ChatCommand::RevokeBuildAll => "revoke_build_all",
|
||||||
|
@ -161,6 +161,7 @@ fn do_command(
|
|||||||
ChatCommand::PermitBuild => handle_permit_build,
|
ChatCommand::PermitBuild => handle_permit_build,
|
||||||
ChatCommand::Players => handle_players,
|
ChatCommand::Players => handle_players,
|
||||||
ChatCommand::Region => handle_region,
|
ChatCommand::Region => handle_region,
|
||||||
|
ChatCommand::ReloadChunks => handle_reload_chunks,
|
||||||
ChatCommand::RemoveLights => handle_remove_lights,
|
ChatCommand::RemoveLights => handle_remove_lights,
|
||||||
ChatCommand::RevokeBuild => handle_revoke_build,
|
ChatCommand::RevokeBuild => handle_revoke_build,
|
||||||
ChatCommand::RevokeBuildAll => handle_revoke_build_all,
|
ChatCommand::RevokeBuildAll => handle_revoke_build_all,
|
||||||
@ -2968,6 +2969,18 @@ fn parse_skill_tree(skill_tree: &str) -> CmdResult<comp::skillset::SkillGroupKin
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn handle_reload_chunks(
|
||||||
|
server: &mut Server,
|
||||||
|
_client: EcsEntity,
|
||||||
|
_target: EcsEntity,
|
||||||
|
_args: Vec<String>,
|
||||||
|
_action: &ChatCommand,
|
||||||
|
) -> CmdResult<()> {
|
||||||
|
server.state.clear_terrain();
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
fn handle_remove_lights(
|
fn handle_remove_lights(
|
||||||
server: &mut Server,
|
server: &mut Server,
|
||||||
client: EcsEntity,
|
client: EcsEntity,
|
||||||
|
Loading…
Reference in New Issue
Block a user