Skip to content

Commit

Permalink
room_game_login 发送到玩家所在服方法调整,玩家不在线就发到最新hall服务上
Browse files Browse the repository at this point in the history
  • Loading branch information
huahua132 committed Jan 13, 2025
1 parent 2e6b184 commit 7c23a68
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions service/room_game_login.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)
Expand All @@ -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()
Expand Down

0 comments on commit 7c23a68

Please sign in to comment.