Excellent. Thanks for sharing your solution :)

On Sat, Oct 2, 2010 at 10:11 AM, Benoit Germain <[email protected]> wrote:

>  Enet 1.3 won’t filter on the incoming connect reason out of the box, you
> have to change the code. Changes are as follows:
>
>
>
> Enet.h: Add  in structure _ENetHost:
>
>    enet_uint32          sessionPassword;
>
>
>
> host.c:  Add initialization in enet_host_create();
>
>     host -> sessionPassword = 0;
>
>
>
> protocol.c: add password filtering at the beginning of
> enet_protocol_handle_connect:
>
>
>
>     switch (host -> sessionPassword)
>
>     {
>
>         case 0: // session is opened, proceed
>
>         break;
>
>
>
>         case 0xffffffff: // session is locked, ignore all requests
>
>         return NULL;
>
>
>
>         default: // session is password-protected, proceed only if incoming
> request data matches password
>
>         if (ENET_NET_TO_HOST_32 (command -> connect.data) != host ->
> sessionPassword)
>
>             return NULL;
>
>     }
>
>
>
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss

Reply via email to