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;
}
That's all.
De : [email protected] [mailto:[email protected]] De
la part de Jay Sprenkle
Envoyé : samedi 2 octobre 2010 16:45
À : Discussion of the ENet library
Objet : Re: [ENet-discuss] gracefully exiting
Thanks. I hadn't gotten the new version.
_______________________________________________
ENet-discuss mailing list
[email protected]
http://lists.cubik.org/mailman/listinfo/enet-discuss