Skip to content

Commit

Permalink
Allow the clients to connect on the server of different game Fixed #975
Browse files Browse the repository at this point in the history
Client should be use "setinfo _gd <game>"
  • Loading branch information
s1lentq committed Jul 1, 2023
1 parent a680f18 commit 62263b7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions rehlds/engine/sv_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,17 @@ void SV_SendServerinfo_internal(sizebuf_t *msg, client_t *client)
else
MSG_WriteByte(msg, 0);

COM_FileBase(com_gamedir, message);
MSG_WriteString(msg, message);
const char *pszGameDir = message;

#ifdef REHLDS_FIXES
// Give the client a chance to connect in to the server with different game
const char *gd = Info_ValueForKey(client->userinfo, "_gd");
if (gd[0])
pszGameDir = gd;
else
#endif
COM_FileBase(com_gamedir, message);

MSG_WriteString(msg, Cvar_VariableString("hostname"));
MSG_WriteString(msg, g_psv.modelname);

Expand Down

0 comments on commit 62263b7

Please sign in to comment.