1
0
Fork 0

More reliable serverlist behaviour

-> remember the previously loaded serverlist, and use if new one failed
-> show a "loading" serverlist
mutilcraft-mt53
HybridDog 2015-05-30 16:18:09 +02:00 committed by est31
parent e481745433
commit 05f4e9ee08
1 changed files with 13 additions and 3 deletions

View File

@ -234,7 +234,13 @@ end
--------------------------------------------------------------------------------
function asyncOnlineFavourites()
menudata.favorites = {}
if not menudata.public_known then
menudata.public_known = {{
name = fgettext("Loading..."),
description = fgettext("Try reenabling public serverlist and check your internet connection.")
}}
end
menudata.favorites = menudata.public_known
core.handle_async(
function(param)
return core.get_favorites("online")
@ -242,7 +248,11 @@ function asyncOnlineFavourites()
nil,
function(result)
if core.setting_getbool("public_serverlist") then
menudata.favorites = order_favorite_list(result)
local favs = order_favorite_list(result)
if favs[1] then
menudata.public_known = favs
menudata.favorites = menudata.public_known
end
core.event_handler("Refresh")
end
end