1959: Expire server info on connected/drop events r=Learath2 a=def-



Co-authored-by: Dennis Felsing <dennis@felsin9.de>
This commit is contained in:
bors[bot] 2019-11-04 15:22:56 +00:00 committed by GitHub
commit c0b3604fa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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)