mirror of
https://github.com/rehlds/rehlds.git
synced 2025-02-05 02:00:34 +03:00
SV_New_f: Deny new connection twice at a time if user messages are received
SV_ReadClientMessage: Fix empty names on bad read
This commit is contained in:
parent
f3d60248fa
commit
3a9bfb9ca1
@ -1498,7 +1498,7 @@ void SV_New_f(void)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!host_client->active && host_client->spawned)
|
if ((host_client->hasusrmsgs && host_client->m_bSentNewResponse) || (!host_client->active && host_client->spawned))
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1564,6 +1564,7 @@ void SV_New_f(void)
|
|||||||
}
|
}
|
||||||
Netchan_CreateFragments(TRUE, &host_client->netchan, &msg);
|
Netchan_CreateFragments(TRUE, &host_client->netchan, &msg);
|
||||||
Netchan_FragSend(&host_client->netchan);
|
Netchan_FragSend(&host_client->netchan);
|
||||||
|
host_client->m_bSentNewResponse = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SV_SendRes_f(void)
|
void SV_SendRes_f(void)
|
||||||
@ -7371,6 +7372,8 @@ void SV_InactivateClients(void)
|
|||||||
cl->connected = TRUE;
|
cl->connected = TRUE;
|
||||||
cl->spawned = FALSE;
|
cl->spawned = FALSE;
|
||||||
cl->fully_connected = FALSE;
|
cl->fully_connected = FALSE;
|
||||||
|
cl->hasusrmsgs = FALSE;
|
||||||
|
cl->m_bSentNewResponse = FALSE;
|
||||||
|
|
||||||
SZ_Clear(&cl->netchan.message);
|
SZ_Clear(&cl->netchan.message);
|
||||||
SZ_Clear(&cl->datagram);
|
SZ_Clear(&cl->datagram);
|
||||||
|
@ -1779,6 +1779,12 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef REHLDS_FIXES
|
||||||
|
// Save current name of the client before a possible kick
|
||||||
|
char name[32];
|
||||||
|
Q_strlcpy(name, host_client->name);
|
||||||
|
#endif
|
||||||
|
|
||||||
void(*func)(client_t *) = sv_clcfuncs[opcode].pfnParse;
|
void(*func)(client_t *) = sv_clcfuncs[opcode].pfnParse;
|
||||||
if (func)
|
if (func)
|
||||||
func(cl);
|
func(cl);
|
||||||
@ -1786,7 +1792,7 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) {
|
|||||||
#ifdef REHLDS_FIXES
|
#ifdef REHLDS_FIXES
|
||||||
if (msg_badread)
|
if (msg_badread)
|
||||||
{
|
{
|
||||||
Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", host_client->name, sv_clcfuncs[opcode].pszname);
|
Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", name, sv_clcfuncs[opcode].pszname);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user