mirror of
https://github.com/rehlds/rehlds.git
synced 2025-02-01 00:00:45 +03:00
Merge pull request #269 from WPMGPRoSToTeMa/master
Fixed invalid host_client for SV_FullClientUpdate call (after #268)
This commit is contained in:
commit
d9ef7ef035
@ -525,17 +525,7 @@ void SV_DropClient_internal(client_t *cl, qboolean crash, const char *string)
|
|||||||
g_GameClients[cl - g_psvs.clients]->SetSpawnedOnce(false);
|
g_GameClients[cl - g_psvs.clients]->SetSpawnedOnce(false);
|
||||||
#endif // REHLDS_FIXES
|
#endif // REHLDS_FIXES
|
||||||
|
|
||||||
#ifdef REHLDS_FIXES
|
SV_SendFullClientUpdateForAll(cl);
|
||||||
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
|
|
||||||
|
|
||||||
NotifyDedicatedServerUI("UpdatePlayers");
|
NotifyDedicatedServerUI("UpdatePlayers");
|
||||||
}
|
}
|
||||||
|
@ -698,6 +698,7 @@ void SV_ReadPackets(void);
|
|||||||
//NOBODY int htons(void);
|
//NOBODY int htons(void);
|
||||||
void SV_CheckTimeouts(void);
|
void SV_CheckTimeouts(void);
|
||||||
int SV_CalcPing(client_t *cl);
|
int SV_CalcPing(client_t *cl);
|
||||||
|
void SV_SendFullClientUpdateForAll(client_t *client);
|
||||||
void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb);
|
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(client_t *cl, packet_entities_t *pack, sizebuf_t *msg);
|
||||||
void SV_EmitEvents_internal(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_WriteEntitiesToClient(client_t *client, sizebuf_t *msg);
|
||||||
void SV_CleanupEnts(void);
|
void SV_CleanupEnts(void);
|
||||||
qboolean SV_SendClientDatagram(client_t *client);
|
qboolean SV_SendClientDatagram(client_t *client);
|
||||||
void SV_UpdateUserInfo(client_t *pClient);
|
void SV_UpdateUserInfo(client_t *client);
|
||||||
void SV_UpdateToReliableMessages(void);
|
void SV_UpdateToReliableMessages(void);
|
||||||
void SV_SkipUpdates(void);
|
void SV_SkipUpdates(void);
|
||||||
void SV_SendClientMessages(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);
|
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)
|
void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb)
|
||||||
{
|
{
|
||||||
char info[MAX_INFO_STRING];
|
char info[MAX_INFO_STRING];
|
||||||
@ -3765,7 +3783,7 @@ void SV_FullClientUpdate(client_t *cl, sizebuf_t *sb)
|
|||||||
Info_RemovePrefixedKeys(info, '_');
|
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)
|
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;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SV_UpdateUserInfo(client_t *pClient)
|
void SV_UpdateUserInfo(client_t *client)
|
||||||
{
|
{
|
||||||
pClient->sendinfo = FALSE;
|
client->sendinfo = FALSE;
|
||||||
pClient->sendinfo_time = realtime + 1.0;
|
client->sendinfo_time = realtime + 1.0;
|
||||||
SV_ExtractFromUserinfo(pClient);
|
SV_ExtractFromUserinfo(client);
|
||||||
#ifdef REHLDS_FIXES
|
SV_SendFullClientUpdateForAll(client);
|
||||||
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SV_UpdateToReliableMessages(void)
|
void SV_UpdateToReliableMessages(void)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user