diff options
-rw-r--r-- | src/net/manaserv/connection.cpp | 6 | ||||
-rw-r--r-- | src/net/manaserv/network.cpp | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp index 98076c8a..063c364b 100644 --- a/src/net/manaserv/connection.cpp +++ b/src/net/manaserv/connection.cpp @@ -60,7 +60,13 @@ bool Connection::connect(const std::string &address, short port) enetAddress.port = port; // Initiate the connection, allocating channel 0. +#if ENET_VERSION_MAJOR != 1 +#error Unsuported enet version! +#elif ENET_VERSION_MINOR < 3 mConnection = enet_host_connect(mClient, &enetAddress, 1); +#else + mConnection = enet_host_connect(mClient, &enetAddress, 1, 0); +#endif if (!mConnection) { diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp index f97a54d2..7c9bb864 100644 --- a/src/net/manaserv/network.cpp +++ b/src/net/manaserv/network.cpp @@ -53,7 +53,13 @@ void initialize() logger->error("Failed to initialize ENet."); } +#if ENET_VERSION_MAJOR != 1 +#error Unsuported enet version! +#elif ENET_VERSION_MINOR < 3 client = enet_host_create(NULL, 3, 0, 0); +#else + client = enet_host_create(NULL, 3, 0, 0, 0); +#endif if (!client) { |