diff --git a/lua_probject/base_project/Game/Controller/GameController.lua b/lua_probject/base_project/Game/Controller/GameController.lua index b079bfa4..5f07d563 100644 --- a/lua_probject/base_project/Game/Controller/GameController.lua +++ b/lua_probject/base_project/Game/Controller/GameController.lua @@ -183,7 +183,9 @@ function M:SendInteraction(playid, type, parm, callback) _data['parm'] = parm _data['gid'] = 1 _client:send(Protocol.GAME_INTERACTION, _data, function(res) - callback(res) + if callback then + callback(res) + end end) end diff --git a/lua_probject/base_project/Game/Controller/GroupMgrController.lua b/lua_probject/base_project/Game/Controller/GroupMgrController.lua index f070ccb6..5f3eeafe 100644 --- a/lua_probject/base_project/Game/Controller/GroupMgrController.lua +++ b/lua_probject/base_project/Game/Controller/GroupMgrController.lua @@ -66,6 +66,7 @@ function GroupMgrController.new() 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._eventmap[Protocol.WEB_FG_MEMBER_GAME_STATE] = self.OnMemberGameState self._eventmap[Protocol.FGMGR_EVT_Ref_NumberBan] = self.OnRefNumberBan -- self:connect(callback) return self @@ -590,7 +591,7 @@ function M:OnMemberOut(evt_data) end function M:OnMemberOnline(evt_data) - + --[[ print("收到在线成员推送") pt(evt_data) @@ -608,6 +609,26 @@ function M:OnMemberOnline(evt_data) end end + DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data) + Broadcast.Send(BroadcastEvent.OnMemberChange) + ]] +end + +function M:OnMemberGameState(evt_data) + print("收到成员游戏状态推送") + pt(evt_data) + + local uid = tonumber(evt_data.uid) + local state = evt_data.playing + + local group = DataManager.groups:get(self.groupId) + + for _, player in pairs(group.members) do + if player.uid == uid then + player.playing = state + end + end + DispatchEvent(self._dispatcher, GroupMgrEvent.OnMemberState, evt_data) Broadcast.Send(BroadcastEvent.OnMemberChange) end diff --git a/lua_probject/base_project/Game/Protocol.lua b/lua_probject/base_project/Game/Protocol.lua index d9f26b1f..d6ea1c36 100644 --- a/lua_probject/base_project/Game/Protocol.lua +++ b/lua_probject/base_project/Game/Protocol.lua @@ -290,6 +290,9 @@ Protocol = { -- 在线成员推送 WEB_FG_MEMBER_ONLINE = "13009", + -- 游戏状态成员 + WEB_FG_MEMBER_GAME_STATE = "push_game_state", + -- 获得申请列表的数量 WEB_FG_APPLYCOUNT = "group/request_apply_count", diff --git a/lua_probject/base_project/Game/View/playerDetailView.lua b/lua_probject/base_project/Game/View/playerDetailView.lua index 8b298027..d6a5d26a 100644 --- a/lua_probject/base_project/Game/View/playerDetailView.lua +++ b/lua_probject/base_project/Game/View/playerDetailView.lua @@ -7,7 +7,13 @@ local function Send(self, Missile) _data.targetSeat = self.player.seat _data.Missile = Missile local _gamectr = ControllerManager.GetController(GameController) - _gamectr:SendInteraction(DataManager.SelfUser.account_id, _type, _data) + _gamectr:SendInteraction(DataManager.SelfUser.account_id, _type, _data, function(res) + print("收到1006协议返回") + pt(res) + if res.ReturnCode ~= 0 then + ViewUtil.ErrorTip(res.ReturnCode) + end + end) end function playerDetailView.New() diff --git a/lua_probject/base_project/table/Table_Error_code.lua b/lua_probject/base_project/table/Table_Error_code.lua index f136c44f..03c81588 100644 --- a/lua_probject/base_project/table/Table_Error_code.lua +++ b/lua_probject/base_project/table/Table_Error_code.lua @@ -94,6 +94,7 @@ Table_Error_code_Map = { [1041]={id=1041,note="不能退出大联盟"}, [1047]={id=1047,note="携带值超越上线, 请保存到保险箱里"}, [1048]={id=1048,note="玩家携带值值超越上线, 请提醒保险箱里"}, + [1049]={id=1049,note="本房间禁止扔表情"}, [10000]={id=10000,note="微信登录失败,请重新登录"}, [10001]={id=10001,note="Error: capacity is full."}, [10002]={id=10002,note="Error: The Queue is empty."}