[ENet-discuss] Differentiating multiple peer clients from sameremote machines

Daniel Aquino mr.danielaquino at gmail.com
Tue May 19 15:19:52 PDT 2009


Can't you just use the peer.sessionID ?

On Tue, May 19, 2009 at 5:19 AM, Ruud van Gaal <ruud at racer.nl> wrote:
>> -----Oorspronkelijk bericht-----
>> Van: enet-discuss-bounces at cubik.org
>> [mailto:enet-discuss-bounces at cubik.org] Namens David Lethe
>> Verzonden: Tuesday, May 19, 2009 07:45
>> Aan: enet-discuss at cubik.org
>> Onderwerp: [ENet-discuss] Differentiating multiple peer
>> clients from sameremote machines
>>
> ...
>
>> So, how do I properly identify the individual peers running
>> on the remote systems when I get an ENET_EVENT_TYPE_CONNECT,
>> and use the The host is bound to ENET_HOST_ANY, at UDP port #4079.
>
> I use the following to uniquely identify client ID's in my QNClient
> abstraction class:
>
>    if(event.type==ENET_EVENT_TYPE_CONNECT)
>    {
>      if(peer)
>      {
>        // Already connected
>        qinfo("QNClient: connect event but peer already connected, so drop
> this one");
>        enet_peer_disconnect(event.peer,0);
>        enet_host_flush(host);
>      } else
>      {
>        // No one connected yet; accept this one
>        SetConnected(true);
>        peer=event.peer;
>        // Get a client ID from ENet internals - note the server is always
> BASE_ID, so start one beyond that
>        id=event.peer->outgoingPeerID;
>        qinfo("QNClient: connected to server (our clientID=%d)",id);
>      }
>
> Hope that helps,
> Ruud
>
> _______________________________________________
> ENet-discuss mailing list
> ENet-discuss at cubik.org
> http://lists.cubik.org/mailman/listinfo/enet-discuss
>


More information about the ENet-discuss mailing list