Changeset 7330 for code/branches/ipv6/src/external/enet/protocol.c
- Timestamp:
- Sep 3, 2010, 12:28:21 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ipv6/src/external/enet/protocol.c
r7328 r7330 9 9 #include "enet/time.h" 10 10 #include "enet/enet.h" 11 12 const ENetHostAddress ENET_HOST_ANY = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }; 13 const ENetHostAddress ENET_HOST_BROADCAST = { { 0,0,0,0,0,0,0,0,0,0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } }; 11 14 12 15 static size_t commandSizes [ENET_PROTOCOL_COMMAND_COUNT] = … … 263 266 { 264 267 if (currentPeer -> state != ENET_PEER_STATE_DISCONNECTED && 265 currentPeer -> address.host == host -> receivedAddress.host &&266 268 currentPeer -> address.port == host -> receivedAddress.port && 267 currentPeer -> connectID == command -> connect.connectID) 269 currentPeer -> connectID == command -> connect.connectID && 270 !memcmp(& currentPeer -> address.host, & host -> receivedAddress.host, sizeof (ENetHostAddress))) 268 271 return NULL; 269 272 } … … 849 852 if (peer -> state == ENET_PEER_STATE_DISCONNECTED || 850 853 peer -> state == ENET_PEER_STATE_ZOMBIE || 851 (host -> receivedAddress.host != peer -> address.host &&852 peer -> address.host != ENET_HOST_BROADCAST) ||853 854 (peer -> outgoingPeerID < ENET_PROTOCOL_MAXIMUM_PEER_ID && 854 sessionID != peer -> incomingSessionID)) 855 sessionID != peer -> incomingSessionID) || 856 ( memcmp(& peer -> address.host, & host -> receivedAddress.host, sizeof (ENetHostAddress)) && 857 memcmp(& peer -> address.host, & ENET_HOST_BROADCAST, sizeof (ENetHostAddress)) && 858 peer -> address.host.addr[0] != 0xff ) ) 855 859 return 0; 856 860 } … … 892 896 if (peer != NULL) 893 897 { 894 peer -> address.host = host -> receivedAddress.host; 895 peer -> address.port = host -> receivedAddress.port; 898 peer -> address = host -> receivedAddress; 896 899 peer -> incomingDataTotal += host -> receivedDataLength; 897 900 }
Note: See TracChangeset
for help on using the changeset viewer.