同步测试时间消息队列

master
罗家炜 2025-06-10 16:20:42 +08:00
parent 6e7ebe64a6
commit 6a0fd7e4f3
2 changed files with 5 additions and 0 deletions

View File

@ -169,10 +169,12 @@ function M:OnEventSendCards(evt_data)
end end
function M:OnEventOutCard(evt_data) function M:OnEventOutCard(evt_data)
print("lingmeng OnEventOutCard")
local seat = evt_data["seat"] local seat = evt_data["seat"]
local card = evt_data["card"] local card = evt_data["card"]
local ting_list = nil local ting_list = nil
local p = self._room:GetPlayerBySeat(seat) local p = self._room:GetPlayerBySeat(seat)
print("lingmeng OnEventOutCard1", #self._cacheEvent)
self._cacheEvent:Enqueue(function() self._cacheEvent:Enqueue(function()
local _room = self._room local _room = self._room
_room.last_outcard_seat = seat _room.last_outcard_seat = seat
@ -187,9 +189,11 @@ function M:OnEventOutCard(evt_data)
p.hand_left_count = p.hand_left_count - 1 p.hand_left_count = p.hand_left_count - 1
if not p.outcard_list then p.outcard_list = {} end if not p.outcard_list then p.outcard_list = {} end
p.outcard_list[#p.outcard_list + 1] = card p.outcard_list[#p.outcard_list + 1] = card
print("lingmeng OnEventOutCard2")
DispatchEvent(self._dispatcher, TX_GameEvent.OutCard, p, card) DispatchEvent(self._dispatcher, TX_GameEvent.OutCard, p, card)
end end
end) end)
print("lingmeng OnEventOutCard1-2", #self._cacheEvent)
end end
function M:OnEventTakeCard(evt_data) function M:OnEventTakeCard(evt_data)

View File

@ -52,6 +52,7 @@ end
function M:EventInit() function M:EventInit()
-- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong") -- UIPackage.AddPackage("extend/majiang/hongzhong/ui/Extend_MJ_HongZhong")
print("lingmeng EventInit")
MainView.EventInit(self) MainView.EventInit(self)
local _room = self._room local _room = self._room
local _view = self._view local _view = self._view