mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-12 16:58:39 +00:00
Basic Lan Implmentation
This commit is contained in:
parent
bc23a610d3
commit
f03922f218
26 changed files with 1414 additions and 2 deletions
|
@ -22,6 +22,24 @@ local function get_sorted_servers()
|
|||
incompatible = {}
|
||||
}
|
||||
|
||||
--Special thanks to proller <proller@gmail.com> for letting use use the get_lan_servers function.
|
||||
if minetest.settings:get_bool("serverlist_lan") then
|
||||
if core.get_lan_servers then
|
||||
servers.lan = core.get_lan_servers();
|
||||
|
||||
for _, server in ipairs(servers.lan) do
|
||||
server.is_compatible = is_server_protocol_compat(server.proto_min, server.proto_max)
|
||||
end
|
||||
else
|
||||
print("core.get_lan_servers isn't defined.")
|
||||
servers.lan = {}
|
||||
end
|
||||
else
|
||||
servers.lan = {}
|
||||
end
|
||||
|
||||
print(dump(servers.lan))
|
||||
|
||||
local favs = serverlistmgr.get_favorites()
|
||||
local taken_favs = {}
|
||||
local result = menudata.search_result or serverlistmgr.servers
|
||||
|
@ -154,11 +172,12 @@ local function get_formspec(tabview, name, tabdata)
|
|||
local servers = get_sorted_servers()
|
||||
|
||||
local dividers = {
|
||||
lan = "1,#00ff00," .. fgettext("Lan") .. ",,,0,0,,",
|
||||
fav = "5,#ffff00," .. fgettext("Favorites") .. ",,,0,0,,",
|
||||
public = "6,#4bdd42," .. fgettext("Public Servers") .. ",,,0,0,,",
|
||||
incompatible = "7,"..mt_color_grey.."," .. fgettext("Incompatible Servers") .. ",,,0,0,,"
|
||||
}
|
||||
local order = {"fav", "public", "incompatible"}
|
||||
local order = {"lan", "fav", "public", "incompatible"}
|
||||
|
||||
tabdata.lookup = {} -- maps row number to server
|
||||
local rows = {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue