【服务器】服务器选择界面每次打开时都重新获取一遍服务器列表数据
parent
c4c57893ea
commit
8e43418825
|
@ -145,6 +145,17 @@ function this:BindEvent()
|
||||||
|
|
||||||
---SelectServer
|
---SelectServer
|
||||||
Util.AddClick(this.changeServerBtn, function()
|
Util.AddClick(this.changeServerBtn, function()
|
||||||
|
local function reServerCallback(str)
|
||||||
|
if str == nil then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
if str ~= nil and str ~= "" then
|
||||||
|
MyPCall(function()
|
||||||
|
local json = require 'cjson'
|
||||||
|
local data = json.decode(str)
|
||||||
|
-- selectServerPart
|
||||||
|
this.SetServerList(data)
|
||||||
|
-- 打开服务器选择界面
|
||||||
UIManager.OpenPanel(UIName.ServerListSelectPanel, {
|
UIManager.OpenPanel(UIName.ServerListSelectPanel, {
|
||||||
serverList = this.serverList,
|
serverList = this.serverList,
|
||||||
myServerList = this.myServerList,
|
myServerList = this.myServerList,
|
||||||
|
@ -162,6 +173,16 @@ function this:BindEvent()
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
-- 判断获取服务器的id
|
||||||
|
if IsSDKLogin then
|
||||||
|
this.RequestServerList(AppConst.OpenId, reServerCallback)
|
||||||
|
else
|
||||||
|
local userId = PlayerPrefs.GetString(openIdkey, defaultOpenIdkey)
|
||||||
|
this.RequestServerList(userId, reServerCallback)
|
||||||
|
end
|
||||||
|
end)
|
||||||
|
|
||||||
|
|
||||||
--SDK 登录
|
--SDK 登录
|
||||||
|
|
Loading…
Reference in New Issue