mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Fix close messages not being shown when connecting
Previously, close messages were entirely ignored during the connection process, this meant that ban messages weren't shown to players. Instead, they'd see the standard "no answer from server yet" message. Fixes #5792.
This commit is contained in:
parent
2346f221e1
commit
5028423a0a
|
@ -308,7 +308,20 @@ int CNetConnection::Feed(CNetPacketConstruct *pPacket, NETADDR *pAddr, SECURITY_
|
|||
|
||||
if(CtrlMsg == NET_CTRLMSG_CLOSE)
|
||||
{
|
||||
if(net_addr_comp(&m_PeerAddr, pAddr) == 0)
|
||||
bool IsPeer;
|
||||
if(m_State != NET_CONNSTATE_CONNECT)
|
||||
{
|
||||
IsPeer = m_PeerAddr == *pAddr;
|
||||
}
|
||||
else
|
||||
{
|
||||
IsPeer = false;
|
||||
for(int i = 0; i < m_NumConnectAddrs; i++)
|
||||
{
|
||||
IsPeer = IsPeer || m_aConnectAddrs[i] == *pAddr;
|
||||
}
|
||||
}
|
||||
if(IsPeer)
|
||||
{
|
||||
m_State = NET_CONNSTATE_ERROR;
|
||||
m_RemoteClosed = 1;
|
||||
|
|
Loading…
Reference in a new issue