From 1c5f949aebd9dc85d79f8a94caa3c025e59c2415 Mon Sep 17 00:00:00 2001 From: "DESKTOP-7R8JEQQ\\k" <1076390229@qq.com> Date: Mon, 21 Jul 2025 15:57:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8D=E7=9F=A5=E9=81=93=E4=B8=BA=E4=BB=80?= =?UTF-8?q?=E4=B9=88=E5=8F=AB=E6=88=91=E6=94=B9=E5=88=AB=E4=BA=BA=E7=9A=84?= =?UTF-8?q?=E4=B8=9C=E8=A5=BF=EF=BC=8C=E4=B8=8A=E4=BC=A0=E4=B8=8A=E5=8E=BB?= =?UTF-8?q?=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Game/Controller/GroupMgrController.lua | 2 +- .../Game/View/Common/BaseView.lua | 1 + .../Game/View/Family/FamilyEventView.lua | 19 +++++++++++++++++++ .../base_project/Game/View/FamilyView.lua | 5 +++++ .../base_project/Game/View/LobbyView.lua | 1 + 5 files changed, 27 insertions(+), 1 deletion(-) diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index 515effa9..e9c28569 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -338,7 +338,7 @@ end -- 邀请在线玩家 function M:FG_InvitePlayer(group_id, tag, player_id, roomid, pid, game_name, callback) local _data = {} - _data.id = group_id + _data.groupId = group_id _data.tagId = tag _data.player_id = player_id _data.roomid = roomid diff --git a/lua_probject/base_project/Game/View/Common/BaseView.lua b/lua_probject/base_project/Game/View/Common/BaseView.lua index 324cfe18..98dfd18e 100644 --- a/lua_probject/base_project/Game/View/Common/BaseView.lua +++ b/lua_probject/base_project/Game/View/Common/BaseView.lua @@ -85,6 +85,7 @@ end --@function [parent=#BaseView] Destroy --@param self function M:Destroy() + self:Close() self._is_destroy = true self._root_view:Dispose() _views[self.class] = nil diff --git a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua index b6cf12d4..0027b31b 100644 --- a/lua_probject/base_project/Game/View/Family/FamilyEventView.lua +++ b/lua_probject/base_project/Game/View/Family/FamilyEventView.lua @@ -29,6 +29,25 @@ function FamilyEventView.new(root) return self end +function M:RemoveAll() + local mgr_ctr = self._mgr_ctr + mgr_ctr:RemoveEventListener(GroupMgrEvent.AddPlay, handler(self, self._evtAddPlay)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.DelPlay, handler(self, self._evtDelPlay)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.UpdatePlay, handler(self, self._evtUpdatePlay)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.AddRoom, handler(self, self._evtAddRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.DelRoom, handler(self, self._evtDelRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.UpdateRoom, handler(self, self._evtUpdateRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.UpdatePlayerInfo, handler(self, self._evtUpdatePlayerInfo)) + --mgr_ctr:RemoveEventListener(GroupMgrEvent.BeInvited, handler(self, self._evtInvited)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.UpdateGroup, handler(self, self._evtUpdateGroup)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.NewMailTip, handler(self, self._evtNewMailTip)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.InviteResponse, handler(self, self._evtInviteResponse)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.IsOpenChatRoom, handler(self, self._evtIsOpenChatRoom)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.ChatRoomData, handler(self, self._evtChatRoomData)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.OnNewApply, handler(self, self._evtOnNewApply)) + mgr_ctr:RemoveEventListener(GroupMgrEvent.OnNewRecord, handler(self, self._evtOnNewRecord)) +end + function M:_evtAddPlay(...) local arg = { ... } print("family event _evtAddPlay") diff --git a/lua_probject/base_project/Game/View/FamilyView.lua b/lua_probject/base_project/Game/View/FamilyView.lua index 6f9c9733..c7f277d2 100644 --- a/lua_probject/base_project/Game/View/FamilyView.lua +++ b/lua_probject/base_project/Game/View/FamilyView.lua @@ -881,4 +881,9 @@ function M:RefalshMoreBtn() self:ChangeMore() end +function M:Close() + self._familyEventView:RemoveAll() + BaseView.Close(self) +end + return M diff --git a/lua_probject/base_project/Game/View/LobbyView.lua b/lua_probject/base_project/Game/View/LobbyView.lua index 555b6723..164d8034 100644 --- a/lua_probject/base_project/Game/View/LobbyView.lua +++ b/lua_probject/base_project/Game/View/LobbyView.lua @@ -97,6 +97,7 @@ function M:InitView(url) local user = DataManager.SelfUser if user.group_id ~= 0 then self:ReconnectRoom(user.group_id) + return end ControllerManager.ChangeController(NewGroupController) ViewManager.ChangeView(ViewManager.View_Family)