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) <noreply@anthropic.com>
This commit is contained in:
@@ -2051,6 +2051,12 @@ const char *
|
||||
return gLastPilotNamesCsv;
|
||||
}
|
||||
|
||||
const char *
|
||||
RPL4FrontEnd_Callsign()
|
||||
{
|
||||
return gLastPilotName;
|
||||
}
|
||||
|
||||
int
|
||||
RPL4FrontEnd_LastLaunchMode()
|
||||
{
|
||||
|
||||
@@ -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).
|
||||
|
||||
+20
-1
@@ -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];
|
||||
|
||||
Reference in New Issue
Block a user