From 69b98608e5fb48160947807256ea53f5574dae37 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Sat, 11 May 2013 21:53:55 +0300 Subject: track the number of connected peers to make throttling a bit cheaper --- include/enet/enet.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'include') diff --git a/include/enet/enet.h b/include/enet/enet.h index 7bd10da..07ed9d2 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -383,6 +383,8 @@ typedef struct _ENetHost enet_uint32 totalReceivedData; /**< total data received, user should reset to 0 as needed to prevent overflow */ enet_uint32 totalReceivedPackets; /**< total UDP packets received, user should reset to 0 as needed to prevent overflow */ ENetInterceptCallback intercept; /**< callback the user can set to intercept received raw UDP packets */ + size_t connectedPeers; + size_t bandwidthLimitedPeers; } ENetHost; /** @@ -566,6 +568,8 @@ extern ENetIncomingCommand * enet_peer_queue_incoming_command (ENetPeer *, const extern ENetAcknowledgement * enet_peer_queue_acknowledgement (ENetPeer *, const ENetProtocol *, enet_uint16); extern void enet_peer_dispatch_incoming_unreliable_commands (ENetPeer *, ENetChannel *); extern void enet_peer_dispatch_incoming_reliable_commands (ENetPeer *, ENetChannel *); +extern void enet_peer_on_connect (ENetPeer *); +extern void enet_peer_on_disconnect (ENetPeer *); ENET_API void * enet_range_coder_create (void); ENET_API void enet_range_coder_destroy (void *); -- cgit v1.2.3