diff --git a/Source/Vendor/Enet/Source/host.c b/Source/Vendor/Enet/Source/host.c index fff946a3..15185b7f 100644 --- a/Source/Vendor/Enet/Source/host.c +++ b/Source/Vendor/Enet/Source/host.c @@ -287,6 +287,30 @@ enet_host_broadcast (ENetHost * host, enet_uint8 channelID, ENetPacket * packet) enet_packet_destroy (packet); } +/** Queues a packet to be sent to all peers associated with the host. +@param host host on which to broadcast the packet +@param channelID channel on which to broadcast +@param packet packet to broadcast +*/ +void +enet_host_broadcast_except(ENetHost* host, enet_uint8 channelID, ENetPacket* packet, ENetPeer* except) +{ + ENetPeer* currentPeer; + + for (currentPeer = host->peers; + currentPeer < &host->peers[host->peerCount]; + ++currentPeer) + { + if (currentPeer->state != ENET_PEER_STATE_CONNECTED || currentPeer == except) + continue; + + enet_peer_send(currentPeer, channelID, packet); + } + + if (packet->referenceCount == 0) + enet_packet_destroy(packet); +} + /** Sets the packet compressor the host should use to compress and decompress packets. @param host host to enable or disable compression for @param compressor callbacks for for the packet compressor; if NULL, then compression is disabled