From d08404bf500bc3e1128eb3a58ca1797f1affdef0 Mon Sep 17 00:00:00 2001 From: Cyd Date: Mon, 10 Aug 2026 20:52:15 -0500 Subject: [PATCH] The room calls you what you typed The lobby published SteamFriends()->GetPersonaName() as each member's name, so the callsign box on the setup screen changed nothing anybody could see - the room and the race both showed Steam personas instead. And because the name never came from a file, wiping the install directory did not shake it loose either, which is what made it look like stale data being read from somewhere. It now publishes the callsign. The persona stays as the fallback for a player who has never set one, on the grounds that appearing as yourself beats appearing as "Pilot". This fixes the race as well as the room: a member's name in the egg comes from the same published field, so the owner was building eggs full of Steam personas too. The owner's own entry already used the typed callsign, so the two were inconsistent in the same race. RPL4FrontEnd_Callsign exposes what the front end already keeps and persists in pilot.cfg. Verified the accessor reads it: a pilot.cfg carrying callsign=TESTCALL logs FrontEnd: callsign "TESTCALL". The lobby publish itself needs a room with a member in it, so that part rides on the next two-machine run. Co-Authored-By: Claude Opus 5 (1M context) --- RP_L4/RPL4FE.cpp | 6 ++++++ RP_L4/RPL4FE.h | 9 +++++++++ RP_L4/RPL4LOBBY.cpp | 21 ++++++++++++++++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/RP_L4/RPL4FE.cpp b/RP_L4/RPL4FE.cpp index 8628349..f96ba3c 100644 --- a/RP_L4/RPL4FE.cpp +++ b/RP_L4/RPL4FE.cpp @@ -2051,6 +2051,12 @@ const char * return gLastPilotNamesCsv; } +const char * + RPL4FrontEnd_Callsign() +{ + return gLastPilotName; +} + int RPL4FrontEnd_LastLaunchMode() { diff --git a/RP_L4/RPL4FE.h b/RP_L4/RPL4FE.h index 1ad3643..11c50c1 100644 --- a/RP_L4/RPL4FE.h +++ b/RP_L4/RPL4FE.h @@ -34,6 +34,15 @@ int const char * RPL4FrontEnd_LastPilotNames(); +// +// The callsign the player typed on the setup screen (persisted in +// pilot.cfg). The lobby publishes this as the member name: what somebody +// writes in the box is what the room and the race should call them. +// Empty, or still the untouched default, when they have never set one. +// +const char * + RPL4FrontEnd_Callsign(); + // How the last Run() ended: a plain race, hosting a network race (the // console marshals the other pods), or entering one as a member pod // (the lobby owner's console marshals us; no local egg, no console). diff --git a/RP_L4/RPL4LOBBY.cpp b/RP_L4/RPL4LOBBY.cpp index 549065d..48d5729 100644 --- a/RP_L4/RPL4LOBBY.cpp +++ b/RP_L4/RPL4LOBBY.cpp @@ -165,8 +165,27 @@ namespace sprintf(value, "%d", SteamNetTransport_GetFakeGamePort()); SteamMatchmaking()->SetLobbyMemberData(gLobby, "gp", value); + // + // The name in the room is the CALLSIGN from the setup screen, not + // the Steam persona. Publishing the persona meant the box a player + // types their name into had no effect on anything they could see - + // and because it never came from a file, wiping the install + // directory did not shake it loose either. + // + // The persona is kept as the fallback for somebody who has never + // set a callsign: better to appear as yourself than as "Pilot". + // char name[32]; - SanitizeName(SteamFriends()->GetPersonaName(), name, sizeof(name)); + const char *callsign = RPL4FrontEnd_Callsign(); + if (callsign != NULL && callsign[0] != '\0' && + strcmp(callsign, "Pilot") != 0) + { + SanitizeName(callsign, name, sizeof(name)); + } + else + { + SanitizeName(SteamFriends()->GetPersonaName(), name, sizeof(name)); + } SteamMatchmaking()->SetLobbyMemberData(gLobby, "nm", name); char vehicle[24], color[16], badge[24];