Expire server info on connected/drop events

This commit is contained in:
Dennis Felsing 2019-11-04 15:33:17 +01:00
parent c2bcd3bd4d
commit 785ec3d345
2 changed files with 10 additions and 1 deletions

View file

@ -405,6 +405,10 @@ void CServer::SetClientScore(int ClientID, int Score)
{
if(ClientID < 0 || ClientID >= MAX_CLIENTS || m_aClients[ClientID].m_State < CClient::STATE_READY)
return;
if(m_aClients[ClientID].m_Score != Score)
ExpireServerInfo();
m_aClients[ClientID].m_Score = Score;
}
@ -1267,7 +1271,6 @@ void CServer::ProcessClientPacket(CNetChunk *pPacket)
Console()->Print(IConsole::OUTPUT_LEVEL_STANDARD, "server", aBuf);
m_aClients[ClientID].m_State = CClient::STATE_INGAME;
GameServer()->OnClientEnter(ClientID);
ExpireServerInfo();
}
}
else if(Msg == NETMSG_INPUT)

View file

@ -1078,6 +1078,8 @@ void CGameContext::OnClientEnter(int ClientID)
// send active vote
if(m_VoteCloseTime)
SendVoteSet(ClientID);
Server()->ExpireServerInfo();
}
void CGameContext::OnClientConnected(int ClientID)
@ -1126,6 +1128,8 @@ void CGameContext::OnClientConnected(int ClientID)
CNetMsg_Sv_Motd Msg;
Msg.m_pMessage = g_Config.m_SvMotd;
Server()->SendPackMsg(&Msg, MSGFLAG_VITAL, ClientID);
Server()->ExpireServerInfo();
}
void CGameContext::OnClientDrop(int ClientID, const char *pReason)
@ -1151,6 +1155,8 @@ void CGameContext::OnClientDrop(int ClientID, const char *pReason)
if(m_apPlayers[i] && m_apPlayers[i]->m_LastWhisperTo == ClientID)
m_apPlayers[i]->m_LastWhisperTo = -1;
}
Server()->ExpireServerInfo();
}
void CGameContext::OnClientEngineJoin(int ClientID)