Expand description
This module handles client-side chat commands and command processing.
It provides functionality for:
- Defining client-side chat commands
- Processing and executing commands (both client and server commands)
- Command argument parsing and validation
- Tab completion for command arguments
- Entity targeting via special syntax (e.g., @target, @self)
The command system allows players to interact with the game through text commands prefixed with a slash (e.g., /help, /wiki).
Structsยง
- Client
Chat Command Iter - An iterator over the variants of ClientChatCommand
- Client
Entity ๐Target Iter - An iterator over the variants of ClientEntityTarget
Enumsยง
- Chat
Command Kind - Represents either a client-side or server-side command.
- Client
Chat Command - Represents all available client-side chat commands.
- Client
Entity ๐Target - Special entity targets that can be referenced in commands using @ syntax.
Traitsยง
- TabComplete ๐
- Trait for types that can provide tab completion suggestions.
Functionsยง
- complete
- Main tab completion function for chat input.
- complete_
command ๐ - Returns a list of
ClientChatCommand
andServerChatCommand
names that start with the given partial input. - complete_
player ๐ - Returns a list of player names that start with the given partial input.
- complete_
site ๐ - Returns a list of site names that start with the given partial input.
- handle_
clear ๐ - Handles
ClientChatCommand::Unmute
- handle_
experimental_ ๐shader - Handles
ClientChatCommand::ExperimentalShader
- handle_
help ๐ - Handles
ClientChatCommand::Help
- handle_
mute ๐ - Handles
ClientChatCommand::Mute
- handle_
unmute ๐ - Handles
ClientChatCommand::Unmute
- handle_
waypoint ๐ - Handles
ClientChatCommand::Waypoint
- handle_
wiki ๐ - Handles
ClientChatCommand::Wiki
- invalid_
command_ ๐message - Generates a helpful error message when an invalid command is entered.
- nth_
word ๐ - Gets the byte index of the nth word in a string.
- preproccess_
command ๐ - Preprocesses command arguments before execution.
- run_
client_ ๐command - Executes a client-side command.
- run_
command - Runs a command by either sending it to the server or processing it locally.
Type Aliasesยง
- Command
Result ๐ - Represents the feedback shown to the user of a command, if any. Server commands give their feedback as an event, so in those cases this will always be Ok(None). An Err variant will be be displayed with the error icon and text color.