Multiplayer: settable nickname for LAN / logged-out play #40
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
mintopia/blur#40
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Want
Let the player set their multiplayer nickname for LAN / when not logged in. Today, offline, it falls back to the computer's name or
blur.Preferred: an option under Options > Multiplayer (text entry, persisted like the Graphics host options via
Host.get/set/ NSUserDefaults). Acceptable fallback: a command-line parameter.What exists
src/host/misc_dlls.cpp:66:GetUserNameA/Wreturn$BLUR_PLAYER_NAME, else"blur". So there's already an env-var override, but you can't find it and it's not in the UI.src/host/ws2_32.cpp:373:gethostnamereturns the real Mac hostname. This is probably the "computer name" source.src/host/k32_misc.cpp:207:GetComputerNameAis hard-coded toBLURHOST.Tasks
Nicknamehost setting (default: current behaviour) that feeds that source.patches/Screens/Shared/Options_Graphics.post.lua). Needs a text-entry widget. If the stock UI has no usable keyboard/text entry, fall back to a CLI flag (e.g.--nickname NAME) and documentBLUR_PLAYER_NAME.Verify
On recomp: set a nickname, host a LAN game, join from a second instance. The other player sees the nickname in the lobby and in race standings. The setting survives a restart.
Update on the name source:
BLUR_PLAYER_NAMEcame in with356f58a(2026-10-18, #5). Before that commit,GetUserNameA/Wwasn't implemented.docs/state-websocket.md:61says the player name the game sees is the OS user name, which is this env var orblurif it's unset. It was added so test instances could be told apart in the MP standings feed.So step 1 (trace the name source) is probably already done:
GetUserNameA/Wis the source, notgethostname. Still to confirm on a real LAN lobby; if it holds, this ticket shrinks to:Nicknamehost setting that feedsuserinsrc/host/misc_dlls.cpp:66(env var still wins if set, so test setups keep working)Watch out:
useris a function-localstatic, read once on the first call. A change made in the UI may not show up until restart, or until the game asks for the name again.Added persisted
--nickname NAMECLI flag (NSUserDefaultsNickname, sanitised to A-Za-z0-9 space _-. max 15).GetUserNameA/Wnow reads BLUR_PLAYER_NAME > Nickname > "blur" on each call (no more static). No stock text-entry widget, so no Options > Multiplayer row (CLI fallback per ticket). Documented in play-macos-env-vars.md / state-websocket.md. Build OK, flag/sanitise/persist checked; NOT verified in a two-instance LAN lobby (needs game files); the 15-char limit is a guess, not checked against the packet.Completed and merged by Harmonic (task 40).