master
parent
32e9da5b74
commit
d72cae3131
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
@ -1487,6 +1629,7 @@ function M:__joinRoom(room_id)
|
|||
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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
)
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component size="1009,619">
|
||||
<controller name="mengzhu" pages="0,,1," selected="0"/>
|
||||
<controller name="mengzhu" pages="0,,1," selected="1"/>
|
||||
<displayList>
|
||||
<graph id="n16_isix" name="win_ws" xy="-496,-245" size="2019,1147" type="rect" lineSize="0" fillColor="#bf000000">
|
||||
<relation target="" sidePair="width-width,height-height"/>
|
||||
|
|
@ -24,7 +24,7 @@
|
|||
<image id="n15_jjon" name="n15" src="eeqmcgm" fileName="font/images/win/zz.png" pkg="27vd145b" xy="45,104" size="917,295" visible="false">
|
||||
<relation target="" sidePair="width-width,height-height"/>
|
||||
</image>
|
||||
<list id="n5_e5q7" name="lst_player" xy="364,402" size="597,115" layout="flow_hz" overflow="scroll" lineGap="5" colGap="39" lineItemCount="2" defaultItem="ui://m7iejg46e5q7hu9" align="center" vAlign="middle" autoClearItems="true">
|
||||
<list id="n5_e5q7" name="lst_player" xy="225,404" size="597,115" layout="flow_hz" overflow="scroll" lineGap="5" colGap="39" lineItemCount="2" defaultItem="ui://m7iejg46e5q7hu9" align="center" vAlign="middle" autoClearItems="true">
|
||||
<gearXY controller="mengzhu" pages="1" values="225,404" default="364,402"/>
|
||||
<relation target="" sidePair="center-center"/>
|
||||
<item/>
|
||||
|
|
@ -38,15 +38,15 @@
|
|||
<item/>
|
||||
<item/>
|
||||
</list>
|
||||
<component id="n3_e5q7" name="btn_enter" src="eeqmcgp" fileName="buttons/Btn_Common.xml" pkg="27vd145b" xy="325,516" size="304,82" group="n18_lsw5">
|
||||
<component id="n3_e5q7" name="btn_enter" src="eeqmcgp" fileName="buttons/Btn_Common.xml" pkg="27vd145b" xy="352,525" size="304,82" group="n18_lsw5">
|
||||
<gearXY controller="mengzhu" pages="0,1" values="347,521|352,525"/>
|
||||
<Button title=" " icon="ui://m7iejg46e5q7hu5"/>
|
||||
</component>
|
||||
<component id="n4_e5q7" name="btn_del" src="eeqmcgp" fileName="buttons/Btn_Common.xml" pkg="27vd145b" xy="671,516" size="304,82" group="n18_lsw5">
|
||||
<component id="n4_e5q7" name="btn_del" src="eeqmcgp" fileName="buttons/Btn_Common.xml" pkg="27vd145b" xy="670,521" size="304,82" group="n18_lsw5">
|
||||
<gearDisplay controller="mengzhu" pages="0"/>
|
||||
<Button title=" " icon="ui://m7iejg46e5q7hu6"/>
|
||||
</component>
|
||||
<group id="n18_lsw5" name="n18" xy="325,516" size="650,82" advanced="true">
|
||||
<gearXY controller="mengzhu" pages="1" values="208,516" default="325,516"/>
|
||||
</group>
|
||||
<group id="n18_lsw5" name="n18" xy="352,521" size="622,86" advanced="true"/>
|
||||
<text id="n26_a81d" name="wafashuoming" xy="43,121" size="919,253" font="Microsoft YaHei" fontSize="30" color="#aa3300" align="center" autoSize="none" text=""/>
|
||||
<text id="n21_a81d" name="n21" xy="40,402" size="255,64" group="n27_a81d" font="Microsoft YaHei" fontSize="22" color="#aa3300" autoSize="none" text="盟主专用解散房间
输入房间号解散"/>
|
||||
<image id="n23_a81d" name="n23" src="a81d7ii6" fileName="component/Lst_info/inputbg.png" xy="36,468" size="241,63" group="n24_a81d"/>
|
||||
|
|
|
|||
Loading…
Reference in New Issue