aboutsummaryrefslogtreecommitdiff
path: root/builtin/mainmenu/tab_multiplayer.lua
diff options
context:
space:
mode:
authorest31 <MTest31@outlook.com>2015-02-17 01:37:14 +0100
committerLoic Blot <loic.blot@unix-experience.fr>2015-02-18 16:17:03 +0100
commit82bfa2ee7b90f678b687fb42405ca775c517be13 (patch)
tree5f55ebb512aad9b995dda71f98195dd4473c3dfc /builtin/mainmenu/tab_multiplayer.lua
parent9ef2e5000f6df5a0c16e0343c6af59967150db42 (diff)
downloadminetest-82bfa2ee7b90f678b687fb42405ca775c517be13.tar.gz
minetest-82bfa2ee7b90f678b687fb42405ca775c517be13.tar.bz2
minetest-82bfa2ee7b90f678b687fb42405ca775c517be13.zip
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
Diffstat (limited to 'builtin/mainmenu/tab_multiplayer.lua')
-rw-r--r--builtin/mainmenu/tab_multiplayer.lua13
1 files changed, 11 insertions, 2 deletions
diff --git a/builtin/mainmenu/tab_multiplayer.lua b/builtin/mainmenu/tab_multiplayer.lua
index 734cb5d3e..f9ac78f17 100644
--- a/builtin/mainmenu/tab_multiplayer.lua
+++ b/builtin/mainmenu/tab_multiplayer.lua
@@ -62,6 +62,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]"
@@ -88,7 +89,6 @@ end
--------------------------------------------------------------------------------
local function main_button_handler(tabview, fields, name, tabdata)
-
if fields["te_name"] ~= nil then
gamedata.playername = fields["te_name"]
core.setting_set("name", fields["te_name"])
@@ -98,6 +98,10 @@ local function main_button_handler(tabview, fields, name, tabdata)
local event = core.explode_table_event(fields["favourites"])
if event.type == "DCL" then
if event.row <= #menudata.favorites then
+ if not is_server_protocol_compat_or_error(menudata.favorites[event.row].proto_min,
+ menudata.favorites[event.row].proto_max) then
+ return true
+ end
gamedata.address = menudata.favorites[event.row].address
gamedata.port = menudata.favorites[event.row].port
gamedata.playername = fields["te_name"]
@@ -189,7 +193,7 @@ local function main_button_handler(tabview, fields, name, tabdata)
local current_favourite = core.get_table_index("favourites")
if current_favourite == nil then return end
core.delete_favorite(current_favourite)
- menudata.favorites = core.get_favorites()
+ menudata.favorites = order_favorite_list(core.get_favorites())
tabdata.fav_selected = nil
core.setting_set("address","")
@@ -214,6 +218,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 = ""