From 59c3cb96595e9fcea636610ae4a5c3f84c64af9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=AE=B6=E7=82=9C?= <2029049582@qq.com> Date: Thu, 22 May 2025 15:57:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/Controller/NewGroupController.lua | 10 ++++++++++ lua_probject/base_project/Game/Protocol.lua | 2 ++ lua_probject/base_project/Game/View/FamilyView.lua | 13 ++++++++++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/lua_probject/base_project/Game/Controller/NewGroupController.lua b/lua_probject/base_project/Game/Controller/NewGroupController.lua index 9a4087e4..aee4e55c 100644 --- a/lua_probject/base_project/Game/Controller/NewGroupController.lua +++ b/lua_probject/base_project/Game/Controller/NewGroupController.lua @@ -1516,3 +1516,13 @@ function M:FG_SetFamilyDiamond(group_id, playerId, diamo, callback) callback(res) end) end + +function M:FG_SetFamilyHeartbeat(group_id, playerId, callback) + local _client = ControllerManager.GroupClient + local _data = {} + _data.id = group_id + _data.playerId = playerId + _client:send(Protocol.WEB_FG_SET_Family_Heartbeat, _data, function(res) + callback(res) + end) +end diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index d6073958..ac36db27 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -263,6 +263,8 @@ Protocol = { WEB_FG_SET_JOIN_SCORE = "group/update_join_score", -- 亲友圈重置房卡 WEB_FG_SET_Family_Diamond = "group/add_group_diamo", + -- 亲友圈发送伪心跳 + WEB_FG_SET_Family_Heartbeat = "group/set_group_heartbeat", -------------- group-log--------------------- -- 获取奖励日志 WEB_FG_GET_REWARDS_LOG = "group/log/get_reward_log", diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 01a7aa5d..310f7dae 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -74,8 +74,8 @@ function M:ShareWx() fgCtr:FG_GroupMembers12( self._group.id, 0, - 100, - 1, + 6, + 2, 2, function(res) ViewUtil.CloseModalWait() @@ -327,9 +327,10 @@ function M:ConnetFamily(index, groups, isCreate) end function M:OnUpdate() + local fgCtr = ControllerManager.GetController(NewGroupController) + local heatTime = os.time() -- --12001事件 if self._group.update_room then - local fgCtr = ControllerManager.GetController(NewGroupController) -- if self._roomNum == self._group.room_num then -- for i = 1, self._group.room_num do -- if self._group.rooms[i] and #self._group.rooms[i].plist == 0 then @@ -358,6 +359,12 @@ function M:OnUpdate() -- -- print("====================================UpdateFamilyRoom", fgCtr, self._group.id) self:UpdateFamilyRoom(fgCtr, self._group.id) end + if not self.lastType or self.lastType - heatTime > 30 then + fgCtr:FG_SetFamilyHeartbeat(self._group.id, DataManager.SelfUser.account_id, function(res) + pt(res) + end) + self.lastType = heatTime + end end local IDENTITY_LIST = {