diff options
author | eihrul <eihrul> | 2005-06-08 01:13:28 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2005-06-08 01:13:28 +0000 |
commit | fd57f842d5e45fe8642cc0dd4ba73de359e0db37 (patch) | |
tree | 4d56250344590f7326663d5e2acd0788b787f847 /protocol.c | |
parent | 59d5c26e3811e0ebfa4878e29886d8f4aadbdd6f (diff) | |
download | enet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.tar.gz enet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.zip |
added broadcasting
Diffstat (limited to 'protocol.c')
-rw-r--r-- | protocol.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -643,11 +643,15 @@ enet_protocol_handle_incoming_commands (ENetHost * host, ENetEvent * event) if (peer -> state == ENET_PEER_STATE_DISCONNECTED || peer -> state == ENET_PEER_STATE_ZOMBIE || - host -> receivedAddress.host != peer -> address.host || + (host -> receivedAddress.host != peer -> address.host && + peer -> address.host != ENET_HOST_BROADCAST) || header -> challenge != peer -> challenge) return 0; else - peer -> address.port = host -> receivedAddress.port; + { + peer -> address.host = host -> receivedAddress.host; + peer -> address.port = host -> receivedAddress.port; + } } if (peer != NULL) |