1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-09-30 19:22:14 +00:00

Mainmenu: Still support favorites if send_pre_v25_init is disabled

@SmallJoker has noted a bug that servers from the (local) main menu
favorites list can't be opened.

This commit fixes the bug by disabling any main menu based protocol
checks for servers from the favorite list.

Also, it fixes a second bug that happens when a server from the
public serverlist doesn't send its supported protocol versions,
most likely because its running a minetest older than commit [1].
Then we have shown an error msg that the server has enforced
one specific protocol version. This was most likely not the case.

Of course, we can't do anything better than do an assumption on
the protocol versions if they are not known. That assumption
should however be closest to the most often occuring case as
possible.

Also, some little cleanups.

[1]: 5a0ed780f5 "Server: announce MIN/MAX protocol version supported to serverlist. Client: check serverlist"
This commit is contained in:
est31 2016-04-15 04:13:53 +02:00
parent d82c5da0dc
commit bc4dc80c01
3 changed files with 32 additions and 20 deletions

View file

@ -246,6 +246,7 @@ function asyncOnlineFavourites()
}}
end
menudata.favorites = menudata.public_known
menudata.favorites_is_public = true
core.handle_async(
function(param)
return core.get_favorites("online")
@ -257,6 +258,7 @@ function asyncOnlineFavourites()
if favs[1] then
menudata.public_known = favs
menudata.favorites = menudata.public_known
menudata.favorites_is_public = true
end
core.event_handler("Refresh")
end
@ -297,12 +299,14 @@ function is_server_protocol_compat_or_error(server_proto_min, server_proto_max)
if not is_server_protocol_compat(server_proto_min, server_proto_max) then
local server_prot_ver_info
local client_prot_ver_info
if server_proto_min ~= server_proto_max then
local s_p_min = server_proto_min or 13
local s_p_max = server_proto_max or 24
if s_p_min ~= s_p_max then
server_prot_ver_info = fgettext_ne("Server supports protocol versions between $1 and $2. ",
server_proto_min or 13, server_proto_max or 24)
s_p_min, s_p_max)
else
server_prot_ver_info = fgettext_ne("Server enforces protocol version $1. ",
server_proto_min or 13)
s_p_min)
end
if min_supp_proto ~= max_supp_proto then
client_prot_ver_info= fgettext_ne("We support protocol versions between version $1 and $2.",