mirror of
https://github.com/minetest/minetest.git
synced 2024-11-23 16:13:46 +01:00
Fix list sorting behaviour with missing geoip
This commit is contained in:
parent
862419c76f
commit
23e9f5db43
@ -81,9 +81,9 @@ local function order_server_list(list)
|
|||||||
-- second: estimated latency
|
-- second: estimated latency
|
||||||
local ping = (fav.ping or 0) * 1000
|
local ping = (fav.ping or 0) * 1000
|
||||||
if ping < 400 then
|
if ping < 400 then
|
||||||
-- If ping is over 400ms, assume the server has latency issues
|
-- If ping is under 400ms replace it with our own estimate,
|
||||||
-- anyway and don't estimate
|
-- we assume the server has latency issues anyway otherwise
|
||||||
ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or ping
|
ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or 0
|
||||||
end
|
end
|
||||||
s2:push(fav, -ping)
|
s2:push(fav, -ping)
|
||||||
end
|
end
|
||||||
@ -148,6 +148,9 @@ function serverlistmgr.sync()
|
|||||||
nil,
|
nil,
|
||||||
function(result)
|
function(result)
|
||||||
geoip_downloading = false
|
geoip_downloading = false
|
||||||
|
if not result then
|
||||||
|
return
|
||||||
|
end
|
||||||
serverlistmgr.my_continent = result
|
serverlistmgr.my_continent = result
|
||||||
core.set_once("continent", result)
|
core.set_once("continent", result)
|
||||||
-- reorder list if we already have it
|
-- reorder list if we already have it
|
||||||
|
Loading…
Reference in New Issue
Block a user