【优化】服务器列表排序
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
|
for i = 1, #data.serverList do
|
||||||
this.serverList[i] = data.serverList[i]
|
this.serverList[i] = data.serverList[i]
|
||||||
end
|
end
|
||||||
table.sort(this.serverList, function(a, b)
|
--取消serverId排序,改用后端原数据,手动把isnew的数据插入到第一个
|
||||||
if a.isnew == b.isnew then
|
local tempList = {}
|
||||||
return a.server_id < b.server_id
|
for i = 1, #this.serverList do
|
||||||
else
|
if this.serverList[i].isnew > 0 then
|
||||||
return a.isnew > b.isnew
|
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)
|
end
|
||||||
this.myServerList = {}
|
this.myServerList = {}
|
||||||
for i = 1, #data.myServerList do
|
for i = 1, #data.myServerList do
|
||||||
this.myServerList[i] = data.myServerList[i]
|
this.myServerList[i] = data.myServerList[i]
|
||||||
|
|
Loading…
Reference in New Issue