2
0
mirror of https://github.com/rehlds/rehlds.git synced 2025-01-17 17:17:56 +03:00

Update sv_user.cpp

This commit is contained in:
pepepepito0147 2022-09-05 20:10:36 -04:00 committed by GitHub
parent 4174c250d6
commit 41f78f95b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -94,7 +94,7 @@ void SV_ParseConsistencyResponse(client_t *pSenderClient)
Q_memset(nullbuffer, 0, sizeof(nullbuffer)); Q_memset(nullbuffer, 0, sizeof(nullbuffer));
int value = MSG_ReadShort(); int value = MSG_ReadShort();
if (sv_invalid_length.value == 1) if (sv_invalid_length.value)
{ {
if (value <= 0 || !SZ_HasSomethingToRead(&net_message, value)) if (value <= 0 || !SZ_HasSomethingToRead(&net_message, value))
{ {
@ -1575,7 +1575,7 @@ void SV_ParseMove(client_t *pSenderClient)
mlen = MSG_ReadByte(); mlen = MSG_ReadByte();
cbchecksum = MSG_ReadByte(); cbchecksum = MSG_ReadByte();
if (sv_invalid_length.value == 1) if (sv_invalid_length.value)
{ {
if (mlen <= 0 || !SZ_HasSpaceToRead(&net_message, mlen)) if (mlen <= 0 || !SZ_HasSpaceToRead(&net_message, mlen))
{ {
@ -1793,7 +1793,7 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) {
static_assert(REHLDS_API_VERSION_MAJOR <= 3, "Bump major API DETECTED!! You shall rework the hookchain, make function returnable"); static_assert(REHLDS_API_VERSION_MAJOR <= 3, "Bump major API DETECTED!! You shall rework the hookchain, make function returnable");
msg_badread = 1; msg_badread = 1;
if (sv_msg_badread.value == 1) if (sv_msg_badread.value)
{ {
Con_Printf("SV_ReadClientMessage: unknown command char (%d)\n", opcode); Con_Printf("SV_ReadClientMessage: unknown command char (%d)\n", opcode);
} }
@ -1815,7 +1815,7 @@ void EXT_FUNC SV_HandleClientMessage_api(IGameClient* client, uint8 opcode) {
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (msg_badread) if (msg_badread)
{ {
if (sv_msg_badread.value == 1) if (sv_msg_badread.value)
{ {
Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", name, sv_clcfuncs[opcode].pszname); Con_Printf("SV_ReadClientMessage: badread on %s, opcode %s\n", name, sv_clcfuncs[opcode].pszname);
} }
@ -1847,7 +1847,7 @@ void SV_ExecuteClientMessage(client_t *cl)
if (msg_badread) if (msg_badread)
{ {
#ifdef REHLDS_FIXES #ifdef REHLDS_FIXES
if (sv_msg_badread.value == 1) if (sv_msg_badread.value)
{ {
Con_Printf("SV_ReadClientMessage: badread on %s\n", host_client->name); Con_Printf("SV_ReadClientMessage: badread on %s\n", host_client->name);
} }
@ -1855,7 +1855,7 @@ void SV_ExecuteClientMessage(client_t *cl)
if (host_client->active) if (host_client->active)
SV_ClientPrintf("Badread\n"); SV_ClientPrintf("Badread\n");
#else // REHLDS_FIXES #else // REHLDS_FIXES
if (sv_msg_badread.value == 1) if (sv_msg_badread.value)
{ {
Con_Printf("SV_ReadClientMessage: badread\n"); Con_Printf("SV_ReadClientMessage: badread\n");
} }