diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 15:39:11 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-02 15:43:36 -0600 |
commit | eaa8288a73872cb8d8b3d0b3455d79ce2579f438 (patch) | |
tree | a08c2e3f4180065d2c19f704dfe220484804e95c /src/net/connectionhandler.cpp | |
parent | b176a462662c719cca6d9d444ff1c5892c7c77d3 (diff) | |
download | manaserv-eaa8288a73872cb8d8b3d0b3455d79ce2579f438.tar.gz manaserv-eaa8288a73872cb8d8b3d0b3455d79ce2579f438.tar.bz2 manaserv-eaa8288a73872cb8d8b3d0b3455d79ce2579f438.tar.xz manaserv-eaa8288a73872cb8d8b3d0b3455d79ce2579f438.zip |
Add support for enet 1.3
Reviewed-by: Yohann Ferreira
Diffstat (limited to 'src/net/connectionhandler.cpp')
-rw-r--r-- | src/net/connectionhandler.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp index 61e373ef..6aa58569 100644 --- a/src/net/connectionhandler.cpp +++ b/src/net/connectionhandler.cpp @@ -40,11 +40,22 @@ bool ConnectionHandler::startListen(enet_uint16 port, enet_address_set_host(&address, listenHost.c_str()); LOG_INFO("Listening on port " << port << "..."); +#if ENET_VERSION_MAJOR != 1 +#error Unsuported enet version! +#elif ENET_VERSION_MINOR < 3 host = enet_host_create( &address /* the address to bind the server host to */, Configuration::getValue("net_maxClients", 1000) /* allowed connections */, 0 /* assume any amount of incoming bandwidth */, 0 /* assume any amount of outgoing bandwidth */); +#else + host = enet_host_create( + &address /* the address to bind the server host to */, + Configuration::getValue("net_maxClients", 1000) /* allowed connections */, + 0 /* unlimited channel count */, + 0 /* assume any amount of incoming bandwidth */, + 0 /* assume any amount of outgoing bandwidth */); +#endif return host != 0; } |