Menu

#302 feat: implement /say, /me, and /msg chat commands

open
nobody
None
4 days ago
4 days ago
Anonymous
No

Originally created by: nglmercer

Summary

Implements the vanilla chat messaging commands:

  • /say <message> — operator-only, broadcasts to all players and logs to the server console.
  • /me <message> — available to all players, broadcasts an emote.
  • /msg <targets> <message> — available to all players, with /tell and /w aliases. Sends an incoming whisper to each target and an outgoing echo back to the sender.

Command-generated chat is delivered as unsigned disguised chat (CDisguisedChat) bound to the matching vanilla chat type (say_command, emote_command, msg_command_incoming, msg_command_outgoing), so the client applies the standard decorations ([%s] %s, * %s %s, %s whispers to you: %s, You whisper to %s: %s).

Changes

  • steel-core/src/command/builtins/message.rs — new module with the three commands and graph-shape tests.
  • steel-core/src/command/execution/text.rs — adds CommandTextResolver::for_source for resolving a message once against the command source.
  • steel-core/src/command/execution/source.rs — removes the now-used dead_code expectation on CommandSource::sender().
  • steel-core/src/command/builtins/mod.rs — registers the commands and extends the command graph-shape test.

Verification

  • cargo check -p steel-core — pass
  • cargo fmt --all --check — clean
  • cargo clippy -p steel-core --all-targets --all-features — 0 warnings
  • cargo test -p steel-core --lib command::builtins — 72 passed, including 3 new tests and the updated graph-shape test

Note on vanilla verification

The chat-type bindings and decoration parameters were taken from the repository's generated data (vanilla_chat_types.rs and the generated translations) rather than transcribed from memory. minecraft-src/ was not generated locally, so the /msg outgoing-echo binding follows stable vanilla behavior corroborated by the msg_command_outgoing parameter data ([target, content]); it can be confirmed against MessageCommand.java once the vanilla source is generated.

Discussion

  • Anonymous

    Anonymous - 4 days ago

    Originally posted by: nglmercer

    no existing handling (or test) for multi-word component arguments

     
  • Anonymous

    Anonymous - 4 days ago

    Originally posted by: nglmercer

    is added a new multi-word component arguments starts_structured_component and parse_structured_component.

     

Log in to post a comment.