Skip to content

Commit

Permalink
优化GM管理
Browse files Browse the repository at this point in the history
  • Loading branch information
xiyoo0812 committed May 14, 2024
1 parent 4ca8043 commit a109e58
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions server/center/gm_mgr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -168,12 +168,11 @@ end
--参数分发预处理
function GM_Mgr:dispatch_pre_command(fmtargs)
local result = event_mgr:notify_listener("on_center_command", fmtargs.name, fmtargs.args)
local _, status_ok, args = tunpack(result)
local status_ok, args = tunpack(result)
--无额外处理
if not status_ok then
return self:dispatch_command(fmtargs.args, fmtargs.type, fmtargs.service)
end

return self:dispatch_command(args, fmtargs.type, fmtargs.service)
end

Expand Down Expand Up @@ -253,9 +252,9 @@ end

--local command
function GM_Mgr:exec_local_cmd(service_id, cmd_name, ...)
local ok, code, res = tunpack(event_mgr:notify_listener(cmd_name, ...))
local ok, res = tunpack(event_mgr:notify_listener(cmd_name, ...))
if not ok then
return { code = code, msg = "fail" }
return { code = 1, msg = res }
end
return { code = 0, msg = res }
end
Expand All @@ -280,4 +279,4 @@ end

quanta.gm_mgr = GM_Mgr()

return GM_Mgr
return GM_Mgr

0 comments on commit a109e58

Please sign in to comment.