mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
initial commit, todo comment and realphabetized ServerChatCommand enum
This commit is contained in:
parent
436453556b
commit
75ccd65ec6
@ -252,8 +252,10 @@ pub enum ServerChatCommand {
|
||||
BuildAreaList,
|
||||
BuildAreaRemove,
|
||||
Campfire,
|
||||
CreateLocation,
|
||||
DebugColumn,
|
||||
DebugWays,
|
||||
DeleteLocation,
|
||||
DisconnectAllPlayers,
|
||||
DropAll,
|
||||
Dummy,
|
||||
@ -277,9 +279,12 @@ pub enum ServerChatCommand {
|
||||
Kit,
|
||||
Lantern,
|
||||
Light,
|
||||
Lightning,
|
||||
Location,
|
||||
MakeBlock,
|
||||
MakeNpc,
|
||||
MakeSprite,
|
||||
MakeVolume,
|
||||
Motd,
|
||||
Object,
|
||||
PermitBuild,
|
||||
@ -305,15 +310,10 @@ pub enum ServerChatCommand {
|
||||
Unban,
|
||||
Version,
|
||||
Waypoint,
|
||||
WeatherZone,
|
||||
Whitelist,
|
||||
Wiring,
|
||||
World,
|
||||
MakeVolume,
|
||||
Location,
|
||||
CreateLocation,
|
||||
DeleteLocation,
|
||||
WeatherZone,
|
||||
Lightning,
|
||||
}
|
||||
|
||||
impl ServerChatCommand {
|
||||
|
@ -121,6 +121,24 @@ impl FromStr for ChatCommandKind {
|
||||
} else if let Ok(cmd) = s.parse::<ServerChatCommand>() {
|
||||
Ok(ChatCommandKind::Server(cmd))
|
||||
} else {
|
||||
// Idea:
|
||||
// The ServerChatCommand enum in veloren/common/src/cmd.rs is a list of valid
|
||||
// commands. We should output something like:
|
||||
|
||||
// Could not find a command named "group_kcik"
|
||||
// Did you mean:
|
||||
// group_kick
|
||||
|
||||
// Could not find a command named "make"
|
||||
// Did you mean:
|
||||
// make_block
|
||||
// make_npc
|
||||
// make_sprite
|
||||
|
||||
// We should be suggesting command(s) similar to the ones typed
|
||||
// - a regex to match possible typos?
|
||||
// - Naively suggest the other commands that start with the same first letter?
|
||||
// (Might be ok, there most commands for a letter is "S" with 10 commands)
|
||||
Err(format!("Could not find a command named {}.", s))
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user