Skip to content

Command Framework with source generation for the chat commands#939

Merged
notfood merged 26 commits into
rwmt:devfrom
NemusForks:feat/command-framework
Jun 5, 2026
Merged

Command Framework with source generation for the chat commands#939
notfood merged 26 commits into
rwmt:devfrom
NemusForks:feat/command-framework

Conversation

@NemuruYama
Copy link
Copy Markdown

A small command framework to make the command infra a bit less brittle and removing the need for manual registration of commands.

It uses source generation and is based on a command framework that I use for my own Discord/Steam bot framework.

Changelog

  • Added source-generated chat command registry and typed argument parsing.
  • Added chat command attribute contracts in ChatCommandContracts, as a shared library between the SourceGen and the Mod.
  • Added built-in commands: /mods, /announce, /players, /list, /resync, /status, /pause, /unpause, /speed, /whois.
  • Added player argument resolver with exact and unique partial username matching.
  • Added raw chat message support so usage text like <username> renders correctly.
  • Added server-requested rejoin packet for /resync.
  • Added client setting for filtering /help to usable commands.
  • Converted legacy commands to new typed command classes: /help, /?, /joinpoint, /kick, /stop.
  • Moved command metadata into command attributes: names, aliases, descriptions, usage, host requirements.
  • Updated /help output to use generated command metadata.
  • Updated /kick, /whois, and /resync to receive resolved players instead of raw username strings.
  • Updated chat packet serialization for raw message metadata.
  • Updated protocol version for packet/wire changes.
  • Removed the old monolithic Source/Common/ChatCommands.cs implementation.
  • Removed handwritten command registration for the migrated legacy commands.
  • Kept legacy command compatibility through the new legacy adapter layer, so older registration paths can still work. They are marked as obsolete.

@NemuruYama NemuruYama changed the title Feat/command framework Command Framework with source generation for the chat commands May 28, 2026
NemuruYama added a commit to NemusForks/Multiplayer-Locale that referenced this pull request May 28, 2026
Manaually translated:
- English
- Dutch

The rest was done using AI and google translate.
I figured a translation, even if it is bad, is better than none.

German was translated using google translate and AI, but my German is okay-ish, so I made some changes.
@NemuruYama
Copy link
Copy Markdown
Author

rwmt/Multiplayer-Locale#48

Should be done first probably, so that we can update the correct languages.

@NemuruYama NemuruYama marked this pull request as ready for review May 28, 2026 15:50
@notfood notfood added enhancement New feature or request. 1.6 Fixes or bugs relating to 1.6 (Not Odyssey). labels May 28, 2026
@notfood notfood moved this to In review in 1.6 and Odyssey May 28, 2026
Copy link
Copy Markdown
Member

@notfood notfood left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine.

Comment thread .gitmodules
Comment thread Source/Multiplayer.sln Outdated
@NemuruYama NemuruYama requested a review from notfood May 29, 2026 01:54
notfood pushed a commit to rwmt/Multiplayer-Locale that referenced this pull request Jun 5, 2026
* Translations for the rwmt/Multiplayer#939

Manaually translated:
- English
- Dutch

The rest was done using AI and google translate.
I figured a translation, even if it is bad, is better than none.

German was translated using google translate and AI, but my German is okay-ish, so I made some changes.

* Update Polish/Keyed/Multiplayer.xml

Co-authored-by: Jakub Bojarski <jakubbojarski92@gmail.com>

* Update German/Keyed/Multiplayer.xml

Like I said "okay-ish".
Thanks :D

Co-authored-by: Maximilian Hotter <Maxsiom@users.noreply.github.com>

---------

Co-authored-by: Jakub Bojarski <jakubbojarski92@gmail.com>
Co-authored-by: Maximilian Hotter <Maxsiom@users.noreply.github.com>
@notfood notfood merged commit 075ab81 into rwmt:dev Jun 5, 2026
1 check passed
@github-project-automation github-project-automation Bot moved this from In review to Done in 1.6 and Odyssey Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.6 Fixes or bugs relating to 1.6 (Not Odyssey). enhancement New feature or request.

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants