summaryrefslogtreecommitdiffhomepage
path: root/protocol.c
diff options
context:
space:
mode:
authoreihrul <eihrul>2005-06-08 01:13:28 +0000
committereihrul <eihrul>2005-06-08 01:13:28 +0000
commitfd57f842d5e45fe8642cc0dd4ba73de359e0db37 (patch)
tree4d56250344590f7326663d5e2acd0788b787f847 /protocol.c
parent59d5c26e3811e0ebfa4878e29886d8f4aadbdd6f (diff)
downloadenet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.tar.gz
enet-fd57f842d5e45fe8642cc0dd4ba73de359e0db37.zip
added broadcasting
Diffstat (limited to 'protocol.c')
-rw-r--r--protocol.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/protocol.c b/protocol.c
index d0014f0..ef8935b 100644
--- a/protocol.c
+++ b/protocol.c
@@ -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)