diff options
author | Jared Adams <jaxad0127@gmail.com> | 2010-08-09 18:53:40 -0600 |
---|---|---|
committer | Jared Adams <jaxad0127@gmail.com> | 2010-08-09 18:53:40 -0600 |
commit | b5c98b278ea09934700ca2e8f03650ea19be1fd1 (patch) | |
tree | 17eebf4edffc46dbf37ba62a8dd6a37d0e1811ee /src/net/connectionhandler.cpp | |
parent | ce8ad18e97aa47c34acad2d9ca7a785718e51740 (diff) | |
download | manaserv-b5c98b278ea09934700ca2e8f03650ea19be1fd1.tar.gz manaserv-b5c98b278ea09934700ca2e8f03650ea19be1fd1.tar.bz2 manaserv-b5c98b278ea09934700ca2e8f03650ea19be1fd1.tar.xz manaserv-b5c98b278ea09934700ca2e8f03650ea19be1fd1.zip |
Fix enet version check
Reviewed-by: Chuck Miller
Diffstat (limited to 'src/net/connectionhandler.cpp')
-rw-r--r-- | src/net/connectionhandler.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp index 986d9dec..314eb0f7 100644 --- a/src/net/connectionhandler.cpp +++ b/src/net/connectionhandler.cpp @@ -29,6 +29,12 @@ #include "net/netcomputer.hpp" #include "utils/logger.h" +#ifdef ENET_VERSION_CREATE +#define ENET_CUTOFF ENET_VERSION_CREATE(1,3,0) +#else +#define ENET_CUTOFF 0xFFFFFFFF +#endif + bool ConnectionHandler::startListen(enet_uint16 port, const std::string &listenHost) { @@ -40,7 +46,7 @@ bool ConnectionHandler::startListen(enet_uint16 port, enet_address_set_host(&address, listenHost.c_str()); LOG_INFO("Listening on port " << port << "..."); -#ifdef ENET_VERSION_MAJOR +#ifdef defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF host = enet_host_create( &address /* the address to bind the server host to */, Configuration::getValue("net_maxClients", 1000) /* allowed connections */, |