-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathOther.lua
More file actions
64 lines (51 loc) · 1.58 KB
/
Copy pathOther.lua
File metadata and controls
64 lines (51 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
local Other = {};
local Log = require("Log");
local MapSvr = require("MapSvr")
-- Other_dbg = {};
function Other:OnInit()
-- Other_dbg = require("emmy_core")
-- Other_dbg.tcpListen("127.0.0.1", 9966)
-- Other_dbg.waitIDE()
local log = "OnOtherInit";
Log:Error(log);
MapSvr.OnInit()
Other:OnReload();
end
function Other:OnStop()
local log = "OnOtherStop";
Log:Error(log);
MapSvr.OnStop()
end
function Other:OnTick()
MapSvr.OnTick()
end
-- kill -SIGUSR1 {avant PID}
function Other:OnReload()
Log:Error("luavm Other:OnReload");
local reloadList = {}
table.insert(reloadList, "MapSvr")
for i, name in ipairs(reloadList) do
package.loaded[name] = nil;
end
for i, name in ipairs(reloadList) do
local ok, module = pcall(require, name)
if ok then
Log:Error("%s.lua Reloaded", name);
else
Log:Error("%s.lua Reload Err %s ", tostring(module or ""));
end
end
MapSvr.OnReload()
end
---@param msg_type integer
---@param cmd integer
---@param message table
---@param uint64_param1_string string
---@param int64_param2_string string
---@param str_param3 string
function Other:OnLuaVMRecvMessage(msg_type, cmd, message, uint64_param1_string, int64_param2_string, str_param3)
--Log:Error("msg_type %d cmd %d uint64_param1_string %s int64_param2_string %s str_param3 %s", msg_type, cmd, uint64_param1_string,
-- int64_param2_string, str_param3);
MapSvr.OnLuaVMRecvMessage(msg_type, cmd, message, uint64_param1_string, int64_param2_string, str_param3)
end
return Other;