查看成员列表,有权限设置禁止进入房间后,同步所有显示

master
罗家炜 2025-08-04 22:23:37 +08:00
parent 82bf2e5950
commit 2411897efa
3 changed files with 28 additions and 7 deletions

View File

@ -22,6 +22,7 @@ GroupMgrEvent = {
OnFamilyReflash = "OnFamilyReflash", OnFamilyReflash = "OnFamilyReflash",
OnFamilyRoomReflash = "OnFamilyRoomReflash", OnFamilyRoomReflash = "OnFamilyRoomReflash",
OnFamilyMemberOut = "OnFamilyMemberOut", OnFamilyMemberOut = "OnFamilyMemberOut",
OnRefNumberBan = "OnRefNumberBan"
} }
GroupMgrController = { GroupMgrController = {
@ -65,6 +66,7 @@ function GroupMgrController.new()
self._eventmap[Protocol.WEB_FG_REFLASH] = self.FG_Data_Family_Reflash self._eventmap[Protocol.WEB_FG_REFLASH] = self.FG_Data_Family_Reflash
self._eventmap[Protocol.WEB_FG_MEMBER_OUT] = self.OnMemberOut self._eventmap[Protocol.WEB_FG_MEMBER_OUT] = self.OnMemberOut
self._eventmap[Protocol.WEB_FG_MEMBER_ONLINE] = self.OnMemberOnline self._eventmap[Protocol.WEB_FG_MEMBER_ONLINE] = self.OnMemberOnline
self._eventmap[Protocol.FGMGR_EVT_Ref_NumberBan] = self.OnRefNumberBan
-- self:connect(callback) -- self:connect(callback)
return self return self
end end
@ -86,7 +88,6 @@ end
----------------------请求------------------------------------ ----------------------请求------------------------------------
function M:connect(host, groupId, callback) function M:connect(host, groupId, callback)
if self.connecting then if self.connecting then
self:disconnect() self:disconnect()
end end
@ -494,7 +495,7 @@ function M:FG_Data_ChatRoom(evt_data)
if evt_data.getData then if evt_data.getData then
local group = DataManager.groups:get(evt_data.groupId) local group = DataManager.groups:get(evt_data.groupId)
for _,recode in pairs(evt_data.records) do for _, recode in pairs(evt_data.records) do
recode.players = json.decode(recode.totalScore) recode.players = json.decode(recode.totalScore)
recode.maxRound = json.decode(recode.hpData).maxRound recode.maxRound = json.decode(recode.hpData).maxRound
recode.pid = recode.groupPid recode.pid = recode.groupPid
@ -604,6 +605,16 @@ function M:OnMemberOnline(evt_data)
DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data) DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data)
end end
function M:OnRefNumberBan(evt_data)
local tem = {}
tem.uid = evt_data.tagId
tem.ban = evt_data.ban
local group = DataManager.groups:get(self.groupId)
group:addMember(tem)
DispatchEvent(self._dispatcher, GroupMgrEvent.OnRefNumberBan, evt_data)
end
function M:PopEvent() function M:PopEvent()
local _cacheEvent = self._cacheEvent local _cacheEvent = self._cacheEvent
if (_cacheEvent:Count() > 0) then if (_cacheEvent:Count() > 0) then

View File

@ -424,6 +424,8 @@ Protocol = {
FGMGR_EVT_Update_Assistant = "update_assistant", FGMGR_EVT_Update_Assistant = "update_assistant",
-- 助理刷新界面推送 -- 助理刷新界面推送
FGMGR_EVT_Push_Assistant = "push_assistant", FGMGR_EVT_Push_Assistant = "push_assistant",
-- 刷新成员列表
FGMGR_EVT_Ref_NumberBan = "13010",
--end::::::::::::::牌友圈协议:::::::::::::::::::: --end::::::::::::::牌友圈协议::::::::::::::::::::
-------------------Game ---------------------------- -------------------Game ----------------------------

View File

@ -8,7 +8,7 @@ function FamilyInviteFamilyView.new()
setmetatable(M, { __index = BaseView }) setmetatable(M, { __index = BaseView })
local self = setmetatable({}, { __index = M }) local self = setmetatable({}, { __index = M })
self.class = "com_numberList" self.class = "com_numberList"
BaseView.InitView(self ,"ui://Family/com_numberList") BaseView.InitView(self, "ui://Family/com_numberList")
self:initBtn() self:initBtn()
return self return self
end end
@ -36,7 +36,8 @@ end
function M:Show(group) function M:Show(group)
self:Reflash(group) self:Reflash(group)
local _mgr_ctr = ControllerManager.GetController(GroupMgrController)
_mgr_ctr:AddEventListener("OnRefNumberBan", handler(self, self.RefrenMemberCallback))
BaseView.Show(self) BaseView.Show(self)
end end
@ -111,6 +112,7 @@ function M:TickNumberCallback(res)
end end
function M:RefrenMemberCallback() function M:RefrenMemberCallback()
print("lingmeng OnRefNumberBan")
local numbers = self._group.members local numbers = self._group.members
local fgCtr = ControllerManager.GetController(NewGroupController) local fgCtr = ControllerManager.GetController(NewGroupController)
if #numbers == 0 then if #numbers == 0 then
@ -129,4 +131,10 @@ function M:RefrenMemberCallback()
end end
end end
function M:Destroy()
local _mgr_ctr = ControllerManager.GetController(GroupMgrController)
_mgr_ctr:RemoveListener("OnRefNumberBan")
BaseView.Destroy(self)
end
return M return M