ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.55k stars 594 forks source link

The engine incorrectly sets the value for the "game:server_name" key in Rich Presence #3735

Open Splatt581 opened 4 months ago

Splatt581 commented 4 months ago

The engine always gets the server name from the local hostname variable, even if the client connects to an external game server:

CSteam3Client::UpdateRichPresence()
{
...
v31 = Cvar_VariableString("hostname");
v30(v29, "game:server_name", v31);
...
}

I believe that it would be more correct to get the name of the game server from the svc_serverinfo message, from this variable:

void __usercall CL_ParseServerInfo(int a1@<ebx>, char *a2@<ebp>, int a3@<edi>, __m128i a4@<xmm4>)
{
...
  v20 = MSG_ReadString();
  Con_DPrintf("Remote host:  %s\n", v20);
...
}