Index: binaries/data/config/default.cfg =================================================================== --- binaries/data/config/default.cfg +++ binaries/data/config/default.cfg @@ -171,6 +171,10 @@ ;;;;;;;;;;;;;;;;;;;;;;;; +[acls] +showoption = false ; Whether to show the checkbox during Host Game that would enable ACLs (Access Control Lists) in order to control permissions for network users. Possible values: true, false. +server.enable = false ; Whether to enable ACLs. Possible values: true, false. + [adaptivefps] session = 60 ; Throttle FPS in running games (prevents 100% CPU workload). menu = 60 ; Throttle FPS in menus only. Index: binaries/data/mods/public/gui/common/network.js =================================================================== --- binaries/data/mods/public/gui/common/network.js +++ binaries/data/mods/public/gui/common/network.js @@ -79,6 +79,8 @@ case 13: return translate("Password is invalid."); case 14: return translate("Could not find an unused port for the enet STUN client."); case 15: return translate("Could not find the STUN endpoint."); + case 16: return translate("Invalid connection address."); + case 17: return translate("The hoster's Access Control List does not allow you to join this game. Ask the hoster what is necessary for you to change in order to be allowed to join the game."); default: warn("Unknown disconnect-reason ID received: " + id); return sprintf(translate("\\[Invalid value %(id)s]"), { "id": id }); Index: binaries/data/mods/public/gui/gamesetup/Controllers/LobbyGameRegistration.js =================================================================== --- binaries/data/mods/public/gui/gamesetup/Controllers/LobbyGameRegistration.js +++ binaries/data/mods/public/gui/gamesetup/Controllers/LobbyGameRegistration.js @@ -11,6 +11,7 @@ this.serverName = initData.serverName; this.hasPassword = initData.hasPassword; + this.hasACLs = initData.hasACLs; this.mods = JSON.stringify(Engine.GetEngineInfo().mods); this.timer = undefined; @@ -101,7 +102,8 @@ "maxnbp": g_GameSettings.playerCount.nbPlayers, "players": clients.list, "mods": this.mods, - "hasPassword": this.hasPassword || "" + "hasPassword": this.hasPassword || "", + "hasACLs": this.hasACLs || "" }; // Only send the stanza if one of these properties changed Index: binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js =================================================================== --- binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js +++ binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.js @@ -18,6 +18,11 @@ */ var g_ServerHasPassword = false; +/** + * Identifier if server is using ACLs + */ +var g_ServerHasACLs = false; + var g_ServerId; var g_IsRejoining = false; @@ -52,6 +57,7 @@ let hasXmppClient = Engine.HasXmppClient(); Engine.GetGUIObjectByName("hostSTUNWrapper").hidden = !hasXmppClient; Engine.GetGUIObjectByName("hostPasswordWrapper").hidden = !hasXmppClient; + Engine.GetGUIObjectByName("aclsWrapper").hidden = !(Engine.ConfigDB_GetValue("user", "acls.showoption") == "true"); if (hasXmppClient) { Engine.GetGUIObjectByName("hostPlayerName").caption = attribs.name; @@ -59,6 +65,7 @@ sprintf(translate("%(name)s's game"), { "name": attribs.name }); Engine.GetGUIObjectByName("useSTUN").checked = Engine.ConfigDB_GetValue("user", "lobby.stun.enabled") == "true"; + Engine.GetGUIObjectByName("useACLs").checked = Engine.ConfigDB_GetValue("user", "acls.server.enable") == "true"; } switchSetupPage("pageHost"); @@ -165,6 +172,7 @@ case "not_server": return translate("Server is not running."); case "invalid_password": return translate("Password is invalid."); case "banned": return translate("You have been banned."); + case "not_allowed": return translate("The hoster's Access Control List does not allow you to join this game. Ask the hoster what is necessary for you to change in order to be allowed to join the game."); case "local_ip_failed": return translate("Failed to get local IP of the server (it was assumed to be on the same network)."); default: warn("Unknown connection failure reason: " + reason); @@ -285,7 +293,8 @@ } Engine.SwitchGuiPage("page_gamesetup.xml", { "serverName": g_ServerName, - "hasPassword": g_ServerHasPassword + "hasPassword": g_ServerHasPassword, + "hasACLs": g_ServerHasACLs }); return; // don't process any more messages - leave them for the game GUI loop @@ -321,7 +330,7 @@ if (newPage == "pageJoin" || newPage == "pageHost") { let pageSize = multiplayerPages.size; - let halfHeight = newPage == "pageJoin" ? 145 : Engine.HasXmppClient() ? 140 : 125; + let halfHeight = newPage == "pageJoin" ? 145 : 140; pageSize.top = -halfHeight; pageSize.bottom = halfHeight; multiplayerPages.size = pageSize; @@ -364,6 +373,8 @@ let useSTUN = Engine.HasXmppClient() && Engine.GetGUIObjectByName("useSTUN").checked; + let useACLs = Engine.GetGUIObjectByName("useACLs").checked; + try { Engine.StartNetworkHost(playername + (g_UserRating ? " (" + g_UserRating + ")" : ""), port, useSTUN, password, true); @@ -381,6 +392,7 @@ g_ServerName = servername; g_ServerHasPassword = !!password; + g_ServerHasACLs = !!useACLs; if (Engine.HasXmppClient()) Engine.LobbySetPlayerPresence("playing"); Index: binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml =================================================================== --- binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml +++ binaries/data/mods/public/gui/gamesetup_mp/gamesetup_mp.xml @@ -8,7 +8,7 @@ - + onTick(); @@ -18,7 +18,7 @@ Multiplayer -