Skip to content

Commit

Permalink
Fix list sorting behaviour with missing geoip
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Oct 17, 2022
1 parent 862419c commit 23e9f5d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builtin/mainmenu/serverlistmgr.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ local function order_server_list(list)
-- second: estimated latency
local ping = (fav.ping or 0) * 1000
if ping < 400 then
-- If ping is over 400ms, assume the server has latency issues
-- anyway and don't estimate
ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or ping
-- If ping is under 400ms replace it with our own estimate,
-- we assume the server has latency issues anyway otherwise
ping = estimate_continent_latency(serverlistmgr.my_continent, fav) or 0
end
s2:push(fav, -ping)
end
Expand Down Expand Up @@ -148,6 +148,9 @@ function serverlistmgr.sync()
nil,
function(result)
geoip_downloading = false
if not result then
return
end
serverlistmgr.my_continent = result
core.set_once("continent", result)
-- reorder list if we already have it
Expand Down

0 comments on commit 23e9f5d

Please sign in to comment.