mirror of
https://github.com/lsalzman/enet
synced 2024-11-21 14:29:05 -07:00
duplicated disconnect packet fixes
This commit is contained in:
parent
42242320e4
commit
08836d86b3
2 changed files with 4 additions and 0 deletions
1
peer.c
1
peer.c
|
@ -422,6 +422,7 @@ enet_peer_disconnect (ENetPeer * peer, enet_uint32 data)
|
|||
|
||||
if (peer -> state == ENET_PEER_STATE_DISCONNECTING ||
|
||||
peer -> state == ENET_PEER_STATE_DISCONNECTED ||
|
||||
peer -> state == ENET_PEER_STATE_ACKNOWLEDING_DISCONNECT ||
|
||||
peer -> state == ENET_PEER_STATE_ZOMBIE)
|
||||
return;
|
||||
|
||||
|
|
|
@ -629,6 +629,9 @@ enet_protocol_handle_throttle_configure (ENetHost * host, ENetPeer * peer, const
|
|||
static int
|
||||
enet_protocol_handle_disconnect (ENetHost * host, ENetPeer * peer, const ENetProtocol * command)
|
||||
{
|
||||
if (peer -> state == ENET_PEER_STATE_ZOMBIE || peer -> state == ENET_PEER_STATE_ACKNOWLEDGING_DISCONNECT)
|
||||
return 0;
|
||||
|
||||
enet_peer_reset_queues (peer);
|
||||
|
||||
if (peer -> state == ENET_PEER_STATE_CONNECTION_SUCCEEDED)
|
||||
|
|
Loading…
Reference in a new issue