From 7c23a687f36a903bb02441bc3ad8675a141178f3 Mon Sep 17 00:00:00 2001 From: huahua132 <958677003@qq.com> Date: Mon, 13 Jan 2025 20:58:18 +0800 Subject: [PATCH] =?UTF-8?q?room=5Fgame=5Flogin=20=E5=8F=91=E9=80=81?= =?UTF-8?q?=E5=88=B0=E7=8E=A9=E5=AE=B6=E6=89=80=E5=9C=A8=E6=9C=8D=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E8=B0=83=E6=95=B4=EF=BC=8C=E7=8E=A9=E5=AE=B6=E4=B8=8D?= =?UTF-8?q?=E5=9C=A8=E7=BA=BF=E5=B0=B1=E5=8F=91=E5=88=B0=E6=9C=80=E6=96=B0?= =?UTF-8?q?hall=E6=9C=8D=E5=8A=A1=E4=B8=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/room_game_login.lua | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/service/room_game_login.lua b/service/room_game_login.lua index 8f51aafe..630516e8 100644 --- a/service/room_game_login.lua +++ b/service/room_game_login.lua @@ -523,11 +523,14 @@ end --发送到玩家所在大厅服 function CMD.send_player_hall(player_id, ...) local agent = g_player_map[player_id] - if not agent then - log.warn("send_player_hall agent not exists ", player_id, ...) - return + + --玩家在线就发到所在服 + if agent then + agent.queue(send_player_hall, agent, ...) + else + --不在线就发到最新的hall服务上 + contriner_client:instance("room_game_hall_m"):set_mod_num(player_id):mod_send(...) end - agent.queue(send_player_hall, agent, ...) end local function call_player_hall(agent, ...) @@ -538,11 +541,13 @@ end --发送到玩家所在大厅服 function CMD.call_player_hall(player_id, ...) local agent = g_player_map[player_id] - if not agent then - log.warn("call_player_hall agent not exists ", player_id, ...) - return + --玩家在线就发到所在服 + if agent then + return agent.queue(call_player_hall, agent, ...) + else + --不在线就发到最新的hall服务上 + return contriner_client:instance("room_game_hall_m"):set_mod_num(player_id):mod_call(...) end - return agent.queue(call_player_hall, agent, ...) end skynet.start(function()