mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-30 15:38:05 +03:00
Fixed invalid host_client for SV_FullClientUpdate call (after #268)
This commit is contained in:
parent
9ea7e27ba4
commit
803a5525d1
@ -525,17 +525,7 @@ void SV_DropClient_internal(client_t *cl, qboolean crash, const char *string)
|
||||
g_GameClients[cl - g_psvs.clients]->SetSpawnedOnce(false);
|
||||
#endif // REHLDS_FIXES
|
||||
|
||||
#ifdef REHLDS_FIXES
|
||||
for (int i = 0; i < g_psvs.maxclients; i++)
|
||||
{
|
||||
if (!g_psvs.clients[i].connected)
|
||||
continue;
|
||||
|
||||
SV_FullClientUpdate(cl, &g_psvs.clients[i].netchan.message);
|
||||
}
|
||||
#else // REHLDS_FIXES
|
||||
SV_FullClientUpdate(cl, &g_psv.reliable_datagram);
|
||||
#endif // REHLDS_FIXES
|
||||
SV_SendFullClientUpdateForAll(cl);
|
||||
|
||||
NotifyDedicatedServerUI("UpdatePlayers");
|
||||
}
|
||||
|
@ -698,6 +698,7 @@ void SV_ReadPackets(void);
|
||||
//NOBODY int htons(void);
|
||||
void SV_CheckTimeouts(void);
|
||||
int SV_CalcPing(client_t *cl);
|
||||
void SV_SendFullClientUpdateForAll(client_t *client);
|
||||
void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb);
|
||||
void SV_EmitEvents(client_t *cl, packet_entities_t *pack, sizebuf_t *msg);
|
||||
void SV_EmitEvents_internal(client_t *cl, packet_entities_t *pack, sizebuf_t *msg);
|
||||
@ -723,7 +724,7 @@ void SV_EmitPings(client_t *client, sizebuf_t *msg);
|
||||
void SV_WriteEntitiesToClient(client_t *client, sizebuf_t *msg);
|
||||
void SV_CleanupEnts(void);
|
||||
qboolean SV_SendClientDatagram(client_t *client);
|
||||
void SV_UpdateUserInfo(client_t *pClient);
|
||||
void SV_UpdateUserInfo(client_t *client);
|
||||
void SV_UpdateToReliableMessages(void);
|
||||
void SV_SkipUpdates(void);
|
||||
void SV_SendClientMessages(void);
|
||||
|
@ -3748,6 +3748,24 @@ void EXT_FUNC SV_WriteFullClientUpdate_internal(IGameClient *client, char *info,
|
||||
MSG_WriteBuf(sb, sizeof(digest), digest);
|
||||
}
|
||||
|
||||
void SV_SendFullClientUpdateForAll(client_t *client)
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
auto oldHostClient = host_client;
|
||||
for (int i = 0; i < g_psvs.maxclients; i++)
|
||||
{
|
||||
host_client = &g_psvs.clients[i];
|
||||
if (!host_client->connected)
|
||||
continue;
|
||||
|
||||
SV_FullClientUpdate(client, &host_client->netchan.message);
|
||||
}
|
||||
host_client = oldHostClient;
|
||||
#else
|
||||
SV_FullClientUpdate(client, &g_psv.reliable_datagram);
|
||||
#endif
|
||||
}
|
||||
|
||||
void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb)
|
||||
{
|
||||
char info[MAX_INFO_STRING];
|
||||
@ -3765,7 +3783,7 @@ void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb)
|
||||
Info_RemovePrefixedKeys(info, '_');
|
||||
}
|
||||
|
||||
g_RehldsHookchains.m_SV_WriteFullClientUpdate.callChain(SV_WriteFullClientUpdate_internal, GetRehldsApiClient(cl), info, MAX_INFO_STRING, sb, GetRehldsApiClient((sb == &g_psv.reliable_datagram) ? NULL : host_client));
|
||||
g_RehldsHookchains.m_SV_WriteFullClientUpdate.callChain(SV_WriteFullClientUpdate_internal, GetRehldsApiClient(cl), info, MAX_INFO_STRING, sb, GetRehldsApiClient((sb == &g_psv.reliable_datagram) ? nullptr : host_client));
|
||||
}
|
||||
|
||||
void EXT_FUNC SV_EmitEvents_api(IGameClient *cl, packet_entities_t *pack, sizebuf_t *ms)
|
||||
@ -4602,22 +4620,12 @@ qboolean SV_SendClientDatagram(client_t *client)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void SV_UpdateUserInfo(client_t *pClient)
|
||||
void SV_UpdateUserInfo(client_t *client)
|
||||
{
|
||||
pClient->sendinfo = FALSE;
|
||||
pClient->sendinfo_time = realtime + 1.0;
|
||||
SV_ExtractFromUserinfo(pClient);
|
||||
#ifdef REHLDS_FIXES
|
||||
for (int i = 0; i < g_psvs.maxclients; i++)
|
||||
{
|
||||
if (!g_psvs.clients[i].connected)
|
||||
continue;
|
||||
|
||||
SV_FullClientUpdate(pClient, &g_psvs.clients[i].netchan.message);
|
||||
}
|
||||
#else // REHLDS_FIXES
|
||||
SV_FullClientUpdate(pClient, &g_psv.reliable_datagram);
|
||||
#endif // REHLDS_FIXES
|
||||
client->sendinfo = FALSE;
|
||||
client->sendinfo_time = realtime + 1.0;
|
||||
SV_ExtractFromUserinfo(client);
|
||||
SV_SendFullClientUpdateForAll(client);
|
||||
}
|
||||
|
||||
void SV_UpdateToReliableMessages(void)
|
||||
|
Loading…
x
Reference in New Issue
Block a user