mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-19 22:48:18 +00:00
Ignore all packets from other servers instead of only snapshots
The client should only ever handle game-related packets from the server that it is currently connecting/connected to.
This commit is contained in:
parent
87f9ccdb22
commit
b264570218
|
@ -1300,6 +1300,12 @@ static CServerCapabilities GetServerCapabilities(int Version, int Flags)
|
|||
|
||||
void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
||||
{
|
||||
// only allow packets from the server we actually want
|
||||
if(net_addr_comp(&pPacket->m_Address, &ServerAddress()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
CUnpacker Unpacker;
|
||||
Unpacker.Reset(pPacket->m_pData, pPacket->m_DataSize);
|
||||
CMsgPacker Packer(NETMSG_EX, true);
|
||||
|
@ -1662,12 +1668,6 @@ void CClient::ProcessServerPacket(CNetChunk *pPacket, int Conn, bool Dummy)
|
|||
}
|
||||
else if(Msg == NETMSG_SNAP || Msg == NETMSG_SNAPSINGLE || Msg == NETMSG_SNAPEMPTY)
|
||||
{
|
||||
// only allow packets from the server we actually want
|
||||
if(net_addr_comp(&pPacket->m_Address, &ServerAddress()))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// we are not allowed to process snapshot yet
|
||||
if(State() < IClient::STATE_LOADING)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue