Repository navigation
Conversation
New players often join a server without knowing where its community lives (Discord, league site, rules...). The MOTD is the first thing they see, so it is the natural place to point them there. k_motd_item1..9 add a small menu under the k_motd lines: set k_motd_item1 "Discord|https://discord.gg/invite" set k_motd_item2 "Website|https://example.com" set k_motd_item3 "Close" Forward/back moves the selection (read from the movement field, so it works with any binds: arrows, WASD...), jump confirms. "Label|url" sends "openurl <url>" to the client and prints the link to the console, so clients without openurl still see it. "Label" alone closes the MOTD. URLs with quotes, semicolons, spaces or newlines are refused because they go into a stuffcmd. k_motd_menu_hint changes the hint line (default "(forward/back + jump)"). k_motd_antilag "This server uses antilag" adds a line with the current sv_antilag value (or "off"), so players know what they are playing on. All new keys are empty by default, so existing servers see no change. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Players often join a server without knowing where its community lives. They don't know the Discord, they have never heard of the league running on that server (for example qwleague.com), and nobody tells them. The MOTD is the first thing every player sees, so this PR lets admins turn it into a small guide:
&cRGB/&rmarkup, now shown in the example config)The client part (
openurlcommand with an on-screen Y/N confirmation) is QW-Group/ezquake-source#1218. Clients without it still get the link printed in their console.All new keys are empty by default, so existing servers see no change.
Configuration
How the menu works
movementfield (forward move) andbutton2, so it works with whatever the player has bound: arrows, WASD... We first tried weapon keys 1..9 (impulses), but many configs bind them toweapon N, and the client does not send the impulse for a weapon the player does not have.> Label <in gold, the others in gray. The MOTD is redrawn at once when the selection changes.Label|url: printsLink: <url>to the player and stuffsopenurl "<url>". The MOTD stays open, so after declining the link the player can pick another entry.Labelwithout url: closes the MOTD.Security
The url goes into a
stuffcmd, so urls containing",;, spaces or newlines are refused. The client side only acceptshttp(s)and asks the player before opening anything.Code changes
src/motd.cPMOTDThink(): after thek_motdlines, adds the optional antilag line and the menu (MOTDMenuText).MOTDItem(),MOTDItemCount(),MOTDFind().MOTDMenuText(): builds the menu lines and the hint.MOTDMenuInput(): per-frame input. Selection inmotd->cnt, last direction inmotd->count, last jump state inmotd->lip.src/client.c:PlayerPostThink()callsMOTDMenuInput()beforeW_WeaponFrame(). It returns at once when there is no menu or no MOTD for that player.resources/example-configs/ktx/port1.cfg: commented example of the new keys.Testing
MVDSV + KTX from QW-Group master on Linux (WSL), client from the ezQuake PR on Windows:
sv_antilag(2, oroffwith0)k_motd_item*/k_motd_antilagset, the MOTD is identical to beforeA short video of the feature is attached below.
🤖 Generated with Claude Code