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

Merge pull request #113 from s1lentq/master

Fixed #103
This commit is contained in:
theAsmodai 2015-12-27 20:41:13 +03:00
commit 34537a7fda
3 changed files with 18 additions and 1 deletions

View File

@ -1514,6 +1514,10 @@ void SV_WriteSpawn(sizebuf_t *msg)
host_client->connected = TRUE;
host_client->fully_connected = FALSE;
#ifdef REHLDS_FIXES
g_GameClients[host_client - g_psvs.clients]->SetSpawnedOnce(true);
#endif // REHLDS_FIXES
NotifyDedicatedServerUI("UpdatePlayers");
}
@ -2400,6 +2404,10 @@ void EXT_FUNC SV_ConnectClient_internal(void)
host_client->uploading = FALSE;
host_client->fully_connected = FALSE;
#ifdef REHLDS_FIXES
g_GameClients[host_client - g_psvs.clients]->SetSpawnedOnce(false);
#endif // REHLDS_FIXES
bIsSecure = Steam_GSBSecure();
Netchan_OutOfBandPrint(NS_SERVER, adr, "%c %i \"%s\" %i %i", 66, host_client->userid, NET_AdrToString(host_client->netchan.remote_address), bIsSecure, build_number());
Log_Printf("\"%s<%i><%s><>\" connected, address \"%s\"\n", name, host_client->userid, SV_GetClientIDString(host_client), NET_AdrToString(host_client->netchan.remote_address));
@ -4657,7 +4665,7 @@ void SV_UpdateToReliableMessages(void)
//Fix for the "server failed to transmit file 'AY&SY..." bug
//https://github.com/dreamstalker/rehlds/issues/38
#ifdef REHLDS_FIXES
if (!client->fakeclient && (client->active || client->connected))
if (!client->fakeclient && (client->active || g_GameClients[i]->GetSpawnedOnce()))
{
if (!svReliableCompressed && g_psv.reliable_datagram.cursize + client->netchan.message.cursize < client->netchan.message.maxsize)
{

View File

@ -35,6 +35,7 @@ CGameClient::CGameClient(int id, client_t* cl)
{
m_Id = id;
m_pClient = cl;
m_bSpawnedOnce = false;
}
int EXT_FUNC CGameClient::GetId()

View File

@ -52,6 +52,10 @@ private:
client_t* m_pClient;
CNetChan m_NetChan;
// added this field to handle a bug with hanging clients in scoreboard after a map change.
// we would also use the field client_t:connected, but actually can't because there is a bug in CS client when server sends TeamScore
// and client is not yet initialized ScoreBoard which leads to memory corruption in the client.
bool m_bSpawnedOnce;
public:
CGameClient(int id, client_t* cl);
@ -82,6 +86,10 @@ public:
virtual bool GetLoopback();
virtual client_t* GetClient();
public:
bool GetSpawnedOnce() const { return m_bSpawnedOnce; }
void SetSpawnedOnce(bool spawned) { m_bSpawnedOnce = spawned; }
};
class CRehldsServerStatic : public IRehldsServerStatic {