equal
deleted
inserted
replaced
1 |
1 |
|
2 local listeners_dir = (CFG_SOURCEDIR or "").."/net/"; |
2 local server_add = require "net.server".add; |
3 local server_add = require "net.server".add; |
3 local log = require "util.logger".init("connlisteners"); |
4 local log = require "util.logger".init("connlisteners"); |
4 |
5 |
5 local dofile, pcall, error = |
6 local dofile, pcall, error = |
6 dofile, pcall, error |
7 dofile, pcall, error |
24 end |
25 end |
25 |
26 |
26 function get(name) |
27 function get(name) |
27 local h = listeners[name]; |
28 local h = listeners[name]; |
28 if not h then |
29 if not h then |
29 pcall(dofile, "net/"..name:gsub("[^%w%-]", "_").."_listener.lua"); |
30 pcall(dofile, listeners_dir..name:gsub("[^%w%-]", "_").."_listener.lua"); |
30 h = listeners[name]; |
31 h = listeners[name]; |
31 end |
32 end |
32 return h; |
33 return h; |
33 end |
34 end |
34 |
35 |