临时提交,心跳
parent
e4b616bb5b
commit
5f4b6bd160
|
|
@ -80,6 +80,8 @@ function M:init(name)
|
|||
self._eventmap[Protocol.GAME_EVT_WITNESS_ROOM] = self.OnEvtEnterWitness
|
||||
self._eventmap[Protocol.GAME_EVT_Exit_WITNESS_ROOM] = self.OnEvtExieWitness
|
||||
|
||||
self._eventmap[Protocol.GAME_GANGFEN] = self.OnEvtGANGFEN
|
||||
|
||||
--self._eventmap[Protocol.GAME_AUTO_CARD] = self.OnEvtOpenGameHuTuoGtips
|
||||
end
|
||||
|
||||
|
|
@ -632,6 +634,14 @@ function M:OnEvtCloseTupGTips(msg)
|
|||
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, false, t)
|
||||
end
|
||||
|
||||
function M:OnEvtGANGFEN(msg)
|
||||
print("有人得分了")
|
||||
local detSeat = msg["detSeat"]
|
||||
local formSeat = msg["formSeat"]
|
||||
local score = msg["score"]
|
||||
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, false, t)
|
||||
end
|
||||
|
||||
function M:DispatchEventTuoGuan(p, isShow, t)
|
||||
DispatchEvent(self._dispatcher, GameEvent.TupGuanOpen, p, isShow, t)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -501,4 +501,7 @@ Protocol = {
|
|||
GAME_EVT_CANCEL_READY_ENTRUST = "22011", --关闭托管倒计时
|
||||
|
||||
GAME_AUTO_CARD = "1303", --开启游戏托管
|
||||
|
||||
--加分显示
|
||||
GAME_GANGFEN = "gangfen",
|
||||
}
|
||||
|
|
|
|||
|
|
@ -623,7 +623,7 @@ end
|
|||
|
||||
function M:OnUpdate()
|
||||
local fgCtr = ControllerManager.GetController(NewGroupController)
|
||||
local heatTime = os.time()
|
||||
local newTime = os.time()
|
||||
-- --12001事件
|
||||
local func = self._mgr_ctr:PopEvent()
|
||||
if (func ~= nil) then
|
||||
|
|
@ -669,13 +669,15 @@ function M:OnUpdate()
|
|||
-- -- print("====================================UpdateFamilyRoom", fgCtr, self._group.id)
|
||||
self:UpdateFamilyRoom(fgCtr, self._group.id)
|
||||
end
|
||||
if not self.lastTime or self.lastTime - heatTime > 30 then
|
||||
|
||||
local HeartbeatTime = 3
|
||||
if not self.lastTime or newTime - self.lastTime > HeartbeatTime then
|
||||
fgCtr:FG_SetFamilyHeartbeat(self._group.id, DataManager.SelfUser.account_id, function(res)
|
||||
self:ChangeNumber(fgCtr, self._group.id, 0, self._group.total_member_num, false,
|
||||
1)
|
||||
pt(res)
|
||||
end)
|
||||
self.lastTime = heatTime
|
||||
self.lastTime = newTime
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,19 @@ local function GetSeat(data, uId)
|
|||
end
|
||||
end
|
||||
|
||||
local function RefalshBtnClose(self)
|
||||
local btn_close = self._view:GetChild("btn_closeRoom")
|
||||
local btn_close_cSytle = btn_close:GetController("cStyle")
|
||||
local roomOwner = self._room.player_list[1].self_user.account_id
|
||||
|
||||
if roomOwner == DataManager.SelfUser.account_id then
|
||||
btn_close_cSytle.selectedIndex = 0
|
||||
else
|
||||
btn_close_cSytle.selectedIndex = 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
--lingmeng新全局标记
|
||||
lingmengxin = false
|
||||
|
||||
|
|
@ -502,7 +515,8 @@ function M:InitView(url, isHideIpAdds)
|
|||
self:ShowWitnessPlayer()
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
RefalshBtnClose(self)
|
||||
------------------------------------------------------------
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -152,14 +152,14 @@ function ViewManager.ChangeView(id, game_id, callback)
|
|||
end
|
||||
|
||||
function ViewManager.OnApplicationPause()
|
||||
-- print("game pause")
|
||||
print("game pause")
|
||||
if (_currenView ~= nil) then
|
||||
_currenView:OnApplicationPause()
|
||||
end
|
||||
end
|
||||
|
||||
function ViewManager.OnApplicationActive()
|
||||
-- print("game active")
|
||||
print("game active")
|
||||
if (_currenView ~= nil) then
|
||||
_currenView:OnApplicationActive()
|
||||
end
|
||||
|
|
|
|||
|
|
@ -416,15 +416,20 @@ function M:EventInit()
|
|||
he_list:Center()
|
||||
|
||||
coroutine.start(function()
|
||||
coroutine.wait(0.4)
|
||||
for i = 1, #win_list do
|
||||
local tem = win_list[i]
|
||||
if tem.type > 0 and tem.type < 32 then
|
||||
local com_name = "he" .. tem.type
|
||||
printlog("声音====>>>", com_name)
|
||||
ViewUtil.PlaySound("FuZhou_MJ",
|
||||
string.format("extend/majiang/fuhzou/sound/%s/%s.mp3", ViewUtil.Sex_Chat[player.self_user.sex],
|
||||
com_name))
|
||||
local item = he_list:GetChild("list"):AddItemFromPool("ui://Extend_MJ_FuZhou/" .. com_name)
|
||||
local sound_name = string.format("extend/majiang/fuzhou/sound/%s/%s.mp3",
|
||||
ViewUtil.Sex_Chat[player.self_user.sex],
|
||||
com_name)
|
||||
ViewUtil.PlaySound("FuZhou_MJ", sound_name)
|
||||
|
||||
local listObj = he_list:GetChild("list")
|
||||
local imgPath = "ui://Extend_MJ_FuZhou/" .. com_name
|
||||
listObj:AddItemFromPool(imgPath)
|
||||
coroutine.wait(0.3)
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -137,6 +137,7 @@ public class GameApplication : MonoBehaviour
|
|||
}
|
||||
else
|
||||
{
|
||||
Debug.Log("UNITY Pause");
|
||||
//NetManager.KillAllConnection();
|
||||
if (_luaClient != null)
|
||||
_luaClient.OnApplicationPause1();
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ GraphicsSettings:
|
|||
- {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0}
|
||||
- {fileID: 16003, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_PreloadedShaders: []
|
||||
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
|
||||
type: 0}
|
||||
|
|
|
|||
Loading…
Reference in New Issue