ValveSoftware / halflife

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

[HL25] Can't connect to the game server within the loopback network interface #3775

Open Splatt581 opened 3 weeks ago

Splatt581 commented 3 weeks ago

If you turn off the network connection and start the server on the loopback network interface (127.0.0.1), the game client will not be able to connect to the server. This happens because the SVC_GetChallenge server function does not send a packet with challenge number for further client connection. Let's take a look at the code snippet we're interested in:

void SVC_GetChallenge()
{
...
v18 = Steam_GSGetSteamID();
    if ( NET_IsConfigured() && !Steam_GSSteamIDIsValidOrLAN(v18) )
      return;
...

With the anniversary update, new checks were added to the engine. The bug is an incorrect return in the Steam_GSSteamIDIsValidOrLAN function. The Steam_GSGetSteamID function without connecting to Steam servers returns "1" as SteamID.