mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Expire server info on connected/drop events
This commit is contained in:
parent
c2bcd3bd4d
commit
785ec3d345
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue