From a109e5869ba66709cedd890cf7404f04c571c541 Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Tue, 14 May 2024 10:31:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96GM=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/center/gm_mgr.lua | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/server/center/gm_mgr.lua b/server/center/gm_mgr.lua index 93197e58..9d9301a3 100644 --- a/server/center/gm_mgr.lua +++ b/server/center/gm_mgr.lua @@ -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 @@ -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 @@ -280,4 +279,4 @@ end quanta.gm_mgr = GM_Mgr() -return GM_Mgr \ No newline at end of file +return GM_Mgr