1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Server: announce MIN/MAX protocol version supported to serverlist. Client: check serverlist

Client now informs about incompatible servers from the list, this permits to prevent the protocol movements.
Server announces its supported protocol versions to master server
This commit is contained in:
est31 2015-02-17 01:37:14 +01:00 committed by Loic Blot
parent 9ef2e5000f
commit 82bfa2ee7b
8 changed files with 129 additions and 12 deletions

View file

@ -45,6 +45,7 @@ local function get_formspec(tabview, name, tabdata)
image_column(fgettext("Creative mode"), "creative") .. ",padding=1;" ..
image_column(fgettext("Damage enabled"), "damage") .. ",padding=0.25;" ..
image_column(fgettext("PvP enabled"), "pvp") .. ",padding=0.25;" ..
"color,span=1;" ..
"text,padding=1]" -- name
else
retval = retval .. "tablecolumns[text]"
@ -87,7 +88,6 @@ local function get_formspec(tabview, name, tabdata)
end
--------------------------------------------------------------------------------
local function main_button_handler(tabview, fields, name, tabdata)
if fields["btn_start_singleplayer"] then
@ -159,6 +159,11 @@ local function main_button_handler(tabview, fields, name, tabdata)
gamedata.servername = menudata.favorites[fav_idx].name
gamedata.serverdescription = menudata.favorites[fav_idx].description
if not is_server_protocol_compat_or_error(menudata.favorites[fav_idx].proto_min,
menudata.favorites[fav_idx].proto_max) then
return true
end
else
gamedata.servername = ""
gamedata.serverdescription = ""