# HG changeset patch # User Matthew Wild # Date 1259094918 0 # Node ID 339a96689dcb4ab53f6082621f3017dea5b69650 # Parent 8d33f94dc3a1c3ffe0752a69ef24fb670cc2ba64# Parent 22b6b1899a5537b862c392e1e6b3eafad3d2bf6b Merge with trunk diff -r 8d33f94dc3a1 -r 339a96689dcb net/server.lua --- a/net/server.lua Tue Nov 24 20:34:22 2009 +0000 +++ b/net/server.lua Tue Nov 24 20:35:18 2009 +0000 @@ -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