Commit eaa8288a73872cb8d8b3d0b3455d79ce2579f438

Add support for enet 1.3

Reviewed-by: Yohann Ferreira
  
3636 enet_address_set_host(&enetAddress, address.c_str());
3737 enetAddress.port = port;
3838
39#if ENET_VERSION_MAJOR != 1
40#error Unsuported enet version!
41#elif ENET_VERSION_MINOR < 3
3942 mLocal = enet_host_create(NULL /* create a client host */,
4043 1 /* allow one outgoing connection */,
4144 0 /* assume any amount of incoming bandwidth */,
4245 0 /* assume any amount of outgoing bandwidth */);
46#else
47 mLocal = enet_host_create(NULL /* create a client host */,
48 1 /* allow one outgoing connection */,
49 0 /* unlimited channel count */,
50 0 /* assume any amount of incoming bandwidth */,
51 0 /* assume any amount of outgoing bandwidth */);
52#endif
4353
4454 if (!mLocal)
4555 return false;
4656
4757 // Initiate the connection, allocating channel 0.
58#if ENET_VERSION_MAJOR != 1
59#error Unsuported enet version!
60#elif ENET_VERSION_MINOR < 3
4861 mRemote = enet_host_connect(mLocal, &enetAddress, 1);
62#else
63 mRemote = enet_host_connect(mLocal, &enetAddress, 1, 0);
64#endif
4965
5066 ENetEvent event;
5167 if (enet_host_service(mLocal, &event, 10000) <= 0 ||
  
4040 enet_address_set_host(&address, listenHost.c_str());
4141
4242 LOG_INFO("Listening on port " << port << "...");
43#if ENET_VERSION_MAJOR != 1
44#error Unsuported enet version!
45#elif ENET_VERSION_MINOR < 3
4346 host = enet_host_create(
4447 &address /* the address to bind the server host to */,
4548 Configuration::getValue("net_maxClients", 1000) /* allowed connections */,
4649 0 /* assume any amount of incoming bandwidth */,
4750 0 /* assume any amount of outgoing bandwidth */);
51#else
52 host = enet_host_create(
53 &address /* the address to bind the server host to */,
54 Configuration::getValue("net_maxClients", 1000) /* allowed connections */,
55 0 /* unlimited channel count */,
56 0 /* assume any amount of incoming bandwidth */,
57 0 /* assume any amount of outgoing bandwidth */);
58#endif
4859
4960 return host != 0;
5061}