在线成员协议
parent
04a307bee2
commit
3f97a0db14
|
|
@ -64,6 +64,7 @@ function GroupMgrController.new()
|
|||
self._eventmap[Protocol.FGMGR_EVT_Push_Assistant] = self.OnEVT_Push_Assistant
|
||||
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_ONLINE] = self.OnMemberOnline
|
||||
-- self:connect(callback)
|
||||
return self
|
||||
end
|
||||
|
|
@ -532,6 +533,24 @@ function M:OnMemberOut(evt_data)
|
|||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnFamilyMemberOut, evt_data)
|
||||
end
|
||||
|
||||
function M:OnMemberOnline(evt_data)
|
||||
print("收到在线成员推送")
|
||||
pt(evt_data)
|
||||
|
||||
local group = DataManager.groups:get(self.groupId)
|
||||
|
||||
for _, player in pairs(group.members) do
|
||||
player.online = 0
|
||||
end
|
||||
|
||||
for _, uid in pairs(evt_data.onlineUserId) do
|
||||
local player = group.memberMap[uid]
|
||||
player.online = 1
|
||||
end
|
||||
|
||||
DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data)
|
||||
end
|
||||
|
||||
function M:PopEvent()
|
||||
local _cacheEvent = self._cacheEvent
|
||||
if (_cacheEvent:Count() > 0) then
|
||||
|
|
|
|||
|
|
@ -287,6 +287,9 @@ Protocol = {
|
|||
-- 成员退出
|
||||
WEB_FG_MEMBER_OUT = "13008",
|
||||
|
||||
-- 在线成员推送
|
||||
WEB_FG_MEMBER_ONLINE = "13009",
|
||||
|
||||
-- 获得申请列表的数量
|
||||
WEB_FG_APPLYCOUNT = "group/request_apply_count",
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue