diff --git a/lua_probject/base_project/Game/Controller/LoginController.lua b/lua_probject/base_project/Game/Controller/LoginController.lua index 201fdf2f..bbe0f6be 100644 --- a/lua_probject/base_project/Game/Controller/LoginController.lua +++ b/lua_probject/base_project/Game/Controller/LoginController.lua @@ -33,9 +33,6 @@ end local function __Login(cmd, _data, callBack) local _client = ControllerManager.WebClient _client:send(cmd, _data, function(res) - printlog("1111111111111111222222222222222222222222") - --pt(cmd) - --pt(res) if (res.ReturnCode == 0) then local data = res.Data local account = data["account"] @@ -62,8 +59,7 @@ local function __Login(cmd, _data, callBack) end _client:setSession(data["session_id"] .. "," .. data["token"]) - print("11111111111111111111111111111111") - pt(data) + ControllerManager.GroupClient = NetClient.new(data.groupWeb, "web_group", ConnectionProtocol.Web) ControllerManager.GroupClient:setSession((data["session_id"] .. "," .. data["token"])) end diff --git a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua index 45e5465d..477035d4 100644 --- a/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua +++ b/lua_probject/base_project/Game/View/NewGroup/GroupInfoView.lua @@ -285,7 +285,7 @@ local function __fillRoomItem(self, index, item, room) if room.default or isHidden == 1 then self:__startGame(room.id, room.pid, false, isHidden) else - self:__joinRoom(roomid) + self:__joinRoom(roomid,room) end else if self.roominfo.view and not self.roominfo.view.isDisposed then @@ -352,7 +352,7 @@ local function __fillRoomItem(self, index, item, room) if room.default or isHidden == 1 then self:__startGame(room.id, room.pid, false, isHidden) else - self:__joinRoom(roomid) + self:__joinRoom(roomid,room) end end ) @@ -1430,7 +1430,149 @@ function M:__onUpdate() end end -function M:__joinRoom(room_id) +function M:__joinRoom(room_id,room) + + + if self.roominfo.view and not self.roominfo.view.isDisposed then + self.roominfo.view:Dispose() + end + local riv = UIPackage.CreateObjectFromURL('ui://NewGroup/Win_roomInfo') + self.roominfo.view = riv + self.roominfo.room = room + + riv:GetChild('tex_room_id').text = room.id and '房间号:' .. room.id or '' + local play = self.curGroup:getPlay(room.pid) + local isHidden = 0 + if play then + if play.isHidden and play.isHidden == 1 then + isHidden = 1 + elseif play.config then + local config = json.decode(play.config) + if config.isHidden and config.isHidden == 1 then + isHidden = 1 + end + end + play.isHidden = isHidden + end + riv:GetChild('tex_room_name').text = play.game_name + riv:GetController("mengzhu").selectedIndex = 1 + printlog("tex_room_name:") + riv:GetController("mengzhu").selectedIndex = 1 + local exconfig = ExtendManager.GetExtendConfig(play.gameId) + local data = json.decode(play.config) + local r = {} + exconfig:FillRoomConfig(r, data) + local gameStr = "" + gameStr = "[" .. play.name .. "]" .. string.gsub(r.room_config:GetDes(), "\r", "") + riv:GetChild("wafashuoming").text = gameStr + + self:InitRoomInfoView() + + local roomCtr = ControllerManager.GetController(RoomController) + local _gameCtrl = ControllerManager.GetController(GameController) + local _currentCtrl = ControllerManager.GetCurrenController() + + riv:GetChild('btn_enter').onClick:Set( + function() + riv:Dispose() + if room.default or isHidden == 1 then + self:__startGame(room.id, room.pid, false, isHidden) + else + -- self:__joinRoom(room_id,room) + printlog("join_room") + + if _gameCtrl == _currentCtrl then + + if _gameCtrl.tmpRoomID ~= room_id then + _gameCtrl:LevelRoom( + function(res) + roomCtr:PublicJoinRoom( + Protocol.WEB_FG_JOIN_ROOM, + room_id, + false, + function(response) + if (response.ReturnCode == -1) then + ViewUtil.CloseModalWait('join_room') + RestartGame() + return + end + + if response.ReturnCode == -2 then + self:__joinRoom(room_id,room) + return + elseif response.ReturnCode ~= 0 then + ViewUtil.CloseModalWait('join_room') + ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败') + return + end + self.__join_room = true + self._view.visible = false + ImageLoad.Clear(self.class) + ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) + ViewUtil.CloseModalWait('join_room') + timer = 0 + end, + self.curGroup.id + ) + end + ) + return + + end + + + end + + roomCtr:PublicJoinRoom( + Protocol.WEB_FG_JOIN_ROOM, + room_id, + false, + function(response) + printlog("进入房间返回事件==========》》》") + pt(response) + if (response.ReturnCode == -1) then + ViewUtil.CloseModalWait('join_room') + RestartGame() + return + end + + + if response.ReturnCode == -2 then + self:__joinRoom(room_id,room) + return + elseif response.ReturnCode ~= 0 then + ViewUtil.CloseModalWait('join_room') + ViewUtil.ErrorMsg(self._root_view, response.ReturnCode, '进入房间失败') + return + end + self.__join_room = true + -- local mgr_ctr = ControllerManager.GetController(GroupMgrController) + -- mgr_ctr:disconnect() + self._view.visible = false + ImageLoad.Clear(self.class) + ViewManager.ChangeView(ViewManager.View_Main, DataManager.CurrenRoom.game_id) + ViewUtil.CloseModalWait('join_room') + timer = 0 + end, + self.curGroup.id + ) + + + + + + end + end + ) + + riv:GetChild('btn_close').onClick:Set( + function() + riv:Dispose() + end + ) + self._view:AddChild(riv) + riv:Center() + --[[ ViewUtil.ShowModalWait(self._root_view, '正在加入游戏...', 'join_room') local roomCtr = ControllerManager.GetController(RoomController) local _gameCtrl = ControllerManager.GetController(GameController) @@ -1486,7 +1628,8 @@ function M:__joinRoom(room_id) RestartGame() return end - + + if response.ReturnCode == -2 then self:__joinRoom(room_id) return @@ -1506,6 +1649,7 @@ function M:__joinRoom(room_id) end, self.curGroup.id ) + ]] end function M:__joinRoom_match(roomid, pid, is_null, isHidden, callback) @@ -1685,7 +1829,7 @@ function M:_evtInvited(...) self._root_view, self.curGroup.id, function(roomid) - self:__joinRoom(roomid) + self:__joinRoom(roomid,self.roominfo.room) end ) imv:FillData(data) @@ -2121,8 +2265,9 @@ function M:Show() BaseView.Show(self) local user = DataManager.SelfUser local roomid = user.room_id + if user.group_id == self.curGroup.id and string.len(roomid) > 1 then - self:__joinRoom(roomid) + self:__joinRoom(roomid,self.roominfo.room) user.group_id = 0 end end diff --git a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua index fdd001da..0af0a993 100644 --- a/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua +++ b/lua_probject/extend_project/extend/zipai/fanpaofa/EXMainView.lua @@ -1058,7 +1058,7 @@ function M:OnFangziAction(...) function() coroutine.wait(1.0) info:PlayingOutCardAnima() - self:PlaySound(player.self_user.sex, 'F_GuoSao') + self:PlaySound(player.self_user.sex, 'F_Sao') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei') effect.touchable = false effect.x, effect.y = -250, -200 @@ -1080,7 +1080,7 @@ function M:OnFangziAction(...) function() coroutine.wait(1.2) info:PlayingOutCardAnima() - self:PlaySound(player.self_user.sex, 'F_GuoSao') + self:PlaySound(player.self_user.sex, 'F_Sao') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'wei') effect.touchable = false effect.x, effect.y = -250, -200 @@ -1099,7 +1099,7 @@ function M:OnFangziAction(...) self:PlaySound(player.self_user.sex, 'F_KaiDuo') effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'pao') elseif fz.type == RB_FZType.Ti then - self:PlaySound(player.self_user.sex, 'F_' .. fz.card) + -- self:PlaySound(player.self_user.sex, 'F_' .. fz.card) info:UpdateOutCardList(fz.card, true, true, fz.from_seat) effect:GetChild('icon1').icon = UIPackage.GetItemURL('Main_RunBeard', 'ti') effect.touchable = false @@ -1115,7 +1115,7 @@ function M:OnFangziAction(...) coroutine.start( function() - coroutine.wait(1.7) + coroutine.wait(2) effect:Dispose() end ) diff --git a/wb_new_ui/.objs/workspace.json b/wb_new_ui/.objs/workspace.json index ead7b2b2..9fbd8bf6 100644 --- a/wb_new_ui/.objs/workspace.json +++ b/wb_new_ui/.objs/workspace.json @@ -1,5 +1,5 @@ { - "libview.firstColumnWidth": 522, + "libview.firstColumnWidth": 297, "expanded_nodes": [ "27vd145b", "/", @@ -10,34 +10,25 @@ "doc.openedDocs": [ "ui://v6yvqp7wyfzf1h4", "ui://v6yvqp7wcyprwq", + "ui://m7iejg46e5q7hu2", "ui://v6yvqp7wlvh412c" ], "test.device": "720p Phone", "canvasColor": 10066329, "auxline2": true, - "doc.activeDoc": "ui://v6yvqp7wcyprwq", + "doc.activeDoc": "ui://m7iejg46e5q7hu2", "libview.twoColumn": false, "libview.expandedNodes": [ - "v6yvqp7w", + "m7iejg46", "/", - "v6yvqp7w", + "m7iejg46", "/component/", - "v6yvqp7w", - "/component/cards/", - "v6yvqp7w", - "/component/option/", - "v6yvqp7w", - "/component/option/component/", - "v6yvqp7w", - "/component/option/component/card/", - "v6yvqp7w", - "/image/", - "v6yvqp7w", - "/images/", - "v6yvqp7w", - "/images/cards6/", - "v6yvqp7w", - "/images/cards8/" + "m7iejg46", + "/component/Lst_info/", + "m7iejg46", + "/mgr/", + "m7iejg46", + "/mgr/component/" ], "auxline1": true, "snapToGrid": true, diff --git a/wb_new_ui/assets/NewGroup/component/Lst_info/Win_roomInfo.xml b/wb_new_ui/assets/NewGroup/component/Lst_info/Win_roomInfo.xml index 03460746..cd7af9a8 100644 --- a/wb_new_ui/assets/NewGroup/component/Lst_info/Win_roomInfo.xml +++ b/wb_new_ui/assets/NewGroup/component/Lst_info/Win_roomInfo.xml @@ -1,6 +1,6 @@ - + @@ -24,7 +24,7 @@ - + @@ -38,15 +38,15 @@ - + +