setHome挪到group连接
parent
3e70cdd0ca
commit
2b596d4dba
|
|
@ -86,6 +86,11 @@ end
|
||||||
|
|
||||||
----------------------请求------------------------------------
|
----------------------请求------------------------------------
|
||||||
function M:connect(host, groupId, callback)
|
function M:connect(host, groupId, callback)
|
||||||
|
|
||||||
|
if self.connecting then
|
||||||
|
self:disconnect()
|
||||||
|
end
|
||||||
|
|
||||||
self.host = host
|
self.host = host
|
||||||
self.groupId = groupId
|
self.groupId = groupId
|
||||||
self.connecting = true
|
self.connecting = true
|
||||||
|
|
@ -100,6 +105,7 @@ function M:connect(host, groupId, callback)
|
||||||
_mgr_client.onconnect:Add(function(code)
|
_mgr_client.onconnect:Add(function(code)
|
||||||
self.code = code
|
self.code = code
|
||||||
if (code == SocketCode.Connect) then
|
if (code == SocketCode.Connect) then
|
||||||
|
print("GroupMgrController已连接", code)
|
||||||
local _data = {}
|
local _data = {}
|
||||||
_data.session = ControllerManager.WebClient:getSession()
|
_data.session = ControllerManager.WebClient:getSession()
|
||||||
if _data.session == nil then
|
if _data.session == nil then
|
||||||
|
|
@ -109,11 +115,8 @@ function M:connect(host, groupId, callback)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
_data.groupId = self.groupId
|
_data.groupId = self.groupId
|
||||||
--printlog(debug.traceback())
|
|
||||||
--printlog("session===1111111111>>>", _data.session)
|
|
||||||
--pt(_data)
|
|
||||||
_mgr_client:send(Protocol.FGMGR_ENTER_GROUP, _data, function(res)
|
_mgr_client:send(Protocol.FGMGR_ENTER_GROUP, _data, function(res)
|
||||||
self.connecting = false
|
--self.connecting = false
|
||||||
if res.ReturnCode == 0 then
|
if res.ReturnCode == 0 then
|
||||||
-- printlog("2222222222222222222222222222222")
|
-- printlog("2222222222222222222222222222222")
|
||||||
-- pt(res)
|
-- pt(res)
|
||||||
|
|
@ -177,6 +180,7 @@ function M:connect(host, groupId, callback)
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:disconnect()
|
function M:disconnect()
|
||||||
|
print("GroupMgrController disconnect")
|
||||||
self.connecting = false
|
self.connecting = false
|
||||||
if self._mgr_client then
|
if self._mgr_client then
|
||||||
self._mgr_client:destroy()
|
self._mgr_client:destroy()
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,6 @@ local function SortMembers(Members)
|
||||||
local offline = {}
|
local offline = {}
|
||||||
|
|
||||||
for _, player in pairs(Members) do
|
for _, player in pairs(Members) do
|
||||||
|
|
||||||
-- 在线 绿色状态
|
-- 在线 绿色状态
|
||||||
if player.online == 1 and player.playing == "stopPlaying" then
|
if player.online == 1 and player.playing == "stopPlaying" then
|
||||||
online[#online + 1] = player
|
online[#online + 1] = player
|
||||||
|
|
@ -75,6 +74,8 @@ local function SortMembers(Members)
|
||||||
end
|
end
|
||||||
|
|
||||||
function FamilyView.new()
|
function FamilyView.new()
|
||||||
|
--print("刘海屏Rect x:%s, y:%s, height:%s, width:%s", Screen.safeArea.x, Screen.safeArea.y, Screen.safeArea.height,Screen.safeArea.width)
|
||||||
|
|
||||||
UIPackage.AddPackage("base/Family/ui/Family")
|
UIPackage.AddPackage("base/Family/ui/Family")
|
||||||
|
|
||||||
setmetatable(M, { __index = BaseView })
|
setmetatable(M, { __index = BaseView })
|
||||||
|
|
@ -195,6 +196,7 @@ function M:InitCloseClick()
|
||||||
FamilyOffline(self._group.id, self)
|
FamilyOffline(self._group.id, self)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
self._mgr_ctr:disconnect()
|
||||||
ControllerManager.ChangeController(LoddyController)
|
ControllerManager.ChangeController(LoddyController)
|
||||||
ViewManager.ChangeView(ViewManager.View_Lobby)
|
ViewManager.ChangeView(ViewManager.View_Lobby)
|
||||||
else
|
else
|
||||||
|
|
@ -394,7 +396,6 @@ function M:BanDeskmate()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ReflashMember()
|
function M:ReflashMember()
|
||||||
|
|
||||||
self.members = SortMembers(self._group.members)
|
self.members = SortMembers(self._group.members)
|
||||||
|
|
||||||
local list_familyNumber = self._view:GetChild('list_familyNumber')
|
local list_familyNumber = self._view:GetChild('list_familyNumber')
|
||||||
|
|
@ -1042,7 +1043,6 @@ function M:RefalshMoreBtn()
|
||||||
end
|
end
|
||||||
|
|
||||||
function M:ReflashChatRoomRedPoint()
|
function M:ReflashChatRoomRedPoint()
|
||||||
|
|
||||||
self.cChatRoomRedPoint.selectedIndex = 0
|
self.cChatRoomRedPoint.selectedIndex = 0
|
||||||
|
|
||||||
if self._group.messageCount > 0 then
|
if self._group.messageCount > 0 then
|
||||||
|
|
|
||||||
|
|
@ -302,7 +302,7 @@ function OnApplicationPause()
|
||||||
ViewManager.OnApplicationPause()
|
ViewManager.OnApplicationPause()
|
||||||
|
|
||||||
local gMgr = ControllerManager.GetController(GroupMgrController)
|
local gMgr = ControllerManager.GetController(GroupMgrController)
|
||||||
if gMgr then
|
if gMgr and gMgr.connecting then
|
||||||
gMgr:FG_Set_Home("out")
|
gMgr:FG_Set_Home("out")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
@ -312,7 +312,7 @@ function OnApplicationActive()
|
||||||
ViewManager.OnApplicationActive()
|
ViewManager.OnApplicationActive()
|
||||||
|
|
||||||
local gMgr = ControllerManager.GetController(GroupMgrController)
|
local gMgr = ControllerManager.GetController(GroupMgrController)
|
||||||
if gMgr then
|
if gMgr and gMgr.connecting then
|
||||||
gMgr:FG_Set_Home("enter")
|
gMgr:FG_Set_Home("enter")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue