diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index 32ecdf00..cc2440d0 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -18,6 +18,7 @@ GroupMgrEvent = { OnNewApply = "OnNewApply", OnNewRecord = "OnNewRecord", OnMemberState = "OnMemberState", + Onpush_assistant = "Onpush_assistant", } GroupMgrController = { @@ -57,6 +58,7 @@ function GroupMgrController.new() self._eventmap[Protocol.FGMGR_EVT_DATA_CHATROOM] = self.FG_Data_ChatRoom self._eventmap[Protocol.FGMGR_EVT_NEWCHAT] = self.FG_Data_NewChat self._eventmap[Protocol.FGMGR_EVT_Member_State] = self.FG_Data_Member_State + self._eventmap[Protocol.FGMGR_EVT_Push_Assistant] = self.OnEVT_Push_Assistant -- self:connect(callback) return self end @@ -389,6 +391,22 @@ function M:FG_ResponseInvited(evt_data) DispatchEvent(self._dispatcher, GroupMgrEvent.InviteResponse, invite_id, g_name, roomid, pid, groupid) end +-- 设置助理,来用给对面刷新界面 tagId=助理 +function M:FG_Update_Assistant(groupId, tagId, callback) + local _data = {} + _data.id = groupId + _data.tagId = tagId + self._mgr_client:send(Protocol.FGMGR_EVT_Update_Assistant, _data, function(res) + callback(res) + end) +end + +function M:OnEVT_Push_Assistant(evt_data) + print("收到助理刷新推送") + pt(evt_data) + DispatchEvent(self._dispatcher, GroupMgrEvent.Onpush_assistant, evt_data) +end + function M:FG_Isopen_ChatRoom(evt_data) print("收到是否开启聊天室推送") pt(evt_data) diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index 56d7c26b..5e2f3aab 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -403,6 +403,10 @@ Protocol = { WEB_FG_SET_CANWATCH = "group/set_group_guest", -- 家族成员在线状态推送 FGMGR_EVT_Member_State = "13007", + -- 设置助理,来用给对面刷新界面 + FGMGR_EVT_Update_Assistant = "update_assistant", + -- 助理刷新界面推送 + FGMGR_EVT_Push_Assistant = "push_assistant", --end::::::::::::::牌友圈协议:::::::::::::::::::: -------------------Game ---------------------------- diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index 0027b31b..c06c3922 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -25,6 +25,7 @@ function FamilyEventView.new(root) mgr_ctr:AddEventListener(GroupMgrEvent.ChatRoomData, handler(self, self._evtChatRoomData)) mgr_ctr:AddEventListener(GroupMgrEvent.OnNewApply, handler(self, self._evtOnNewApply)) mgr_ctr:AddEventListener(GroupMgrEvent.OnNewRecord, handler(self, self._evtOnNewRecord)) + mgr_ctr:AddEventListener(GroupMgrEvent.Onpush_assistant, handler(self, self._evtOnPush_assistant)) --mgr_ctr:AddEventListener(GroupMgrEvent.OnMemberState, handler(self, self._evtOnMemberState)) return self end @@ -193,4 +194,13 @@ function M:_evtOnMemberState(...) end end +function M:_evtOnPush_assistant(...) + local view = ViewManager.GetCurrenView() + if view.class ~= "FamilyMainView" then + return + end + + view:ChangeOther(tonumber(view._group.lev) + 1) +end + return M diff --git a/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua b/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua index 8fe608a3..c9b30702 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyInvitedMsgView.lua @@ -60,7 +60,12 @@ function M:FillData() local play = group:getPlay(self.pid) local player = group.memberMap[self.invite_id] - print("lingmeng FillData", self.groupid, self.pid, self.invite_id, type(self.invite_id),player) + if player == nil then + return + end + + --print("lingmeng FillData", self.groupid, self.pid, self.invite_id, type(self.invite_id), type(self.groupid),player) + --pt(group.memberMap) self._viewText_groupName.text = group.name self._viewText_gameName.text = play.game_name diff --git a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua index 91fec340..04e78e24 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyNumberDetail.lua @@ -116,6 +116,10 @@ function M:init(url, lev, res) flag_assistant = 1 - flag_assistant self._view:GetChild('btn_assistant'):GetController('isAssistant').selectedIndex = flag_assistant self._callback_refren() + + -- 让服务器推送 + local mgr_ctr = ControllerManager.GetController(GroupMgrController) + mgr_ctr:FG_Update_Assistant(self.groupId, info.uid, function() end) else ViewUtil.ShowOneChooose("设置助理失败") end diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index c7f277d2..fa46e182 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -677,7 +677,7 @@ function M:OnUpdate() self:UpdateFamilyRoom(fgCtr, self._group.id) end - local HeartbeatTime = 30 + local HeartbeatTime = 3 if newTime - self.lastTime > HeartbeatTime then fgCtr:FG_SetFamilyHeartbeat(self._group.id, DataManager.SelfUser.account_id, function(res) print(res)