【优化】服务器列表排序
parent
4ff2e1dc8d
commit
853933b0ea
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 9e51bffc03022dd4a811ab704bbec993
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -603,13 +603,18 @@ function this.CacheLoginData(data)
|
|||
for i = 1, #data.serverList do
|
||||
this.serverList[i] = data.serverList[i]
|
||||
end
|
||||
table.sort(this.serverList, function(a, b)
|
||||
if a.isnew == b.isnew then
|
||||
return a.server_id < b.server_id
|
||||
else
|
||||
return a.isnew > b.isnew
|
||||
--取消serverId排序,改用后端原数据,手动把isnew的数据插入到第一个
|
||||
local tempList = {}
|
||||
for i = 1, #this.serverList do
|
||||
if this.serverList[i].isnew > 0 then
|
||||
local tempData = this.serverList[i]
|
||||
for j = i, 2, -1 do
|
||||
this.serverList[j] = this.serverList[j-1]
|
||||
end
|
||||
this.serverList[1] = tempData
|
||||
break
|
||||
end
|
||||
end)
|
||||
end
|
||||
this.myServerList = {}
|
||||
for i = 1, #data.myServerList do
|
||||
this.myServerList[i] = data.myServerList[i]
|
||||
|
|
Loading…
Reference in New Issue