aboutsummaryrefslogtreecommitdiffstats
path: root/net/server.lua
diff options
context:
space:
mode:
Diffstat (limited to 'net/server.lua')
-rw-r--r--net/server.lua11
1 files changed, 9 insertions, 2 deletions
diff --git a/net/server.lua b/net/server.lua
index a2325735..f77b216d 100644
--- a/net/server.lua
+++ b/net/server.lua
@@ -1,9 +1,16 @@
-local have_luaevent = pcall(require, "luaevent.core");
+
local use_luaevent = require "core.configmanager".get("*", "core", "use_libevent");
+if use_luaevent then
+ use_luaevent = pcall(require, "luaevent.core");
+ if not use_luaevent then
+ log("error", "libevent not found, falling back to select()");
+ end
+end
+
local server;
-if have_luaevent and use_luaevent == true then
+if use_luaevent then
server = require "net.server_event";
-- util.timer requires "net.server", so instead of having
-- Lua look for, and load us again (causing a loop) - set this here