summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/net/manaserv/connection.cpp4
-rw-r--r--src/net/manaserv/network.cpp4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp
index 98076c8a..fbd2ed22 100644
--- a/src/net/manaserv/connection.cpp
+++ b/src/net/manaserv/connection.cpp
@@ -60,7 +60,11 @@ bool Connection::connect(const std::string &address, short port)
enetAddress.port = port;
// Initiate the connection, allocating channel 0.
+#ifdef ENET_VERSION_MAJOR
+ mConnection = enet_host_connect(mClient, &enetAddress, 1, 0);
+#else
mConnection = enet_host_connect(mClient, &enetAddress, 1);
+#endif
if (!mConnection)
{
diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp
index f97a54d2..4b9751d7 100644
--- a/src/net/manaserv/network.cpp
+++ b/src/net/manaserv/network.cpp
@@ -53,7 +53,11 @@ void initialize()
logger->error("Failed to initialize ENet.");
}
+#ifdef ENET_VERSION_MAJOR
+ client = enet_host_create(NULL, 3, 0, 0, 0);
+#else
client = enet_host_create(NULL, 3, 0, 0);
+#endif
if (!client)
{