From 8e1c52b110256094d6c0698b90572f43c189a12e Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 2 May 2022 16:23:51 -0700 Subject: [PATCH 1/6] Create license.txt --- license.txt | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 license.txt diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..8945f13 --- /dev/null +++ b/license.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 MT-CTF + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From c8d4b195af89de3a8194ddbd24447145608d5006 Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 2 May 2022 16:24:13 -0700 Subject: [PATCH 2/6] Remove WTFPL as license --- init.lua | 3 --- 1 file changed, 3 deletions(-) diff --git a/init.lua b/init.lua index 5bd2e2e..64179fa 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,3 @@ --- License: WTFPL - - rules = {} local S = minetest.get_translator(minetest.get_current_modname()) From 0e9f0808c0224c7f4e6698bf61a104438feecffd Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 2 May 2022 16:26:16 -0700 Subject: [PATCH 3/6] Update init.lua --- init.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/init.lua b/init.lua index 64179fa..2c62909 100644 --- a/init.lua +++ b/init.lua @@ -26,9 +26,9 @@ local items = { S("Failure to follow these rules may result in a kick or ban"), S(" (temp or permanent) depending on severity."), "", - S("Developed and hosted by rubenwardy"), + S("Hosted by LandarVargan"), S("Moderators")..": Thomas-S, IceAgeComing, Waterbug, DragonsVolcanoDance,", - " Shara, Calinou, Aurika, Lone_Wolf, Xenon, Jhalman, Kat", + " Shara, Calinou, Aurika, LandarVargan, Xenon, Jhalman, Kat", "", S("Though the server owner will not actively read private messages or disclose"), S("their content outside the mod team, random checks will be done to make sure"), From 62fad3d1e7152b460a5e32644662bdc44239c3dc Mon Sep 17 00:00:00 2001 From: LoneWolfHT Date: Mon, 2 May 2022 16:33:03 -0700 Subject: [PATCH 4/6] Update translations --- locale/rules.de.tr | 2 +- locale/rules.es.tr | 2 +- locale/rules.fr.tr | 2 +- locale/rules.it.tr | 2 +- locale/rules.nl.tr | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/locale/rules.de.tr b/locale/rules.de.tr index 9ede46f..4c66f35 100644 --- a/locale/rules.de.tr +++ b/locale/rules.de.tr @@ -19,7 +19,7 @@ depending on the situation.=ab nur zwei Kills bestraft werden. 10. Moderator decisions are final.=10. Entscheidungen der Moderatoren sind endgültig. Failure to follow these rules may result in a kick or ban=Solltest du diese Regeln brechen kann das durchaus zu einem Kick (Rauswurf) (temp or permanent) depending on severity.=oder Ban (Bann) führen, (temporär oder permanent) je nach Schweregrad des Verstoßes. -Developed and hosted by rubenwardy=Entwickelt und gehostet von rubenwardy +Hosted by LandarVargan=Gehostet von LandarVargan Moderators=Moderatoren Though the server owner will not actively read private messages or disclose=Auch wenn der Server Besitzer normalerweise nicht aktiv private Nachrichten lesen their content outside the mod team, random checks will be done to make sure=oder deren deren Inhalte außerhalb des Moderatoren Teams veröffentlichen diff --git a/locale/rules.es.tr b/locale/rules.es.tr index 8718347..76c29e8 100644 --- a/locale/rules.es.tr +++ b/locale/rules.es.tr @@ -19,7 +19,7 @@ depending on the situation.=dependiendo de la situación. 10. Moderator decisions are final.=10. Las desiciones de los moderadores son lo final. Failure to follow these rules may result in a kick or ban=El incumplimiento de estas reglas puede resultar en una expulsión o prohibición (temp or permanent) depending on severity.=(temporal o permanente) dependiendo de la severidad. -Developed and hosted by rubenwardy=Desarrollado y hospedado por rubenwardy +Hosted by LandarVargan=Hospedado por LandarVargan Moderators=Moderadores Though the server owner will not actively read private messages or disclose=Aunque el dueño del servidor no va a leer activamente los mensajes privados ni divulgará their content outside the mod team, random checks will be done to make sure=su contenido fuera del equipo de mods, se realizarán comprobaciones aleatorias para asegurarse diff --git a/locale/rules.fr.tr b/locale/rules.fr.tr index b9ac101..70caa20 100644 --- a/locale/rules.fr.tr +++ b/locale/rules.fr.tr @@ -19,7 +19,7 @@ depending on the situation.=être puni à partir de deux meurtres. 10. Moderator decisions are final.=10. Les décisions de moderateurs sont irrévocables. Failure to follow these rules may result in a kick or ban=Manquement aux règles peut se résulter d'un kick ou ban (temp or permanent) depending on severity.=(temporaire ou permanent) dépendant de la sévérité. -Developed and hosted by rubenwardy=Développé et hébergé par rubenwardy +Hosted by LandarVargan=Hébergé par LandarVargan Moderators=Moderateurs Though the server owner will not actively read private messages or disclose=Même si le propriétaire du serveur ne lira pas activement des messages their content outside the mod team, random checks will be done to make sure=privés ou révélera leur contenu à personne sauf aux moderateurs, diff --git a/locale/rules.it.tr b/locale/rules.it.tr index 9342695..88f3c47 100644 --- a/locale/rules.it.tr +++ b/locale/rules.it.tr @@ -19,7 +19,7 @@ depending on the situation.=dipendendo della situazione. 10. Moderator decisions are final.=10. Le decisioni dei moderatori sono definitive. Failure to follow these rules may result in a kick or ban=Mancato rispetto di queste regole può comportare una cacciata (kick) o un'esclusione completa (ban) dal gioco, (temp or permanent) depending on severity.=(temporaneamente o permanente) a seconda della gravità. -Developed and hosted by rubenwardy=Sviluppato e ospitato da rubenwardy +Hosted by LandarVargan=Ospitato da LandarVargan Moderators=Moderatori Though the server owner will not actively read private messages or disclose=Anche se il proprietario del server non leggerà attivamente i messaggi privati o divulgherà their content outside the mod team, random checks will be done to make sure=il loro contenuto fuori del team dei moderatori, verranno effettuati controlli casuali per assicurarsi diff --git a/locale/rules.nl.tr b/locale/rules.nl.tr index 488990e..af16817 100644 --- a/locale/rules.nl.tr +++ b/locale/rules.nl.tr @@ -19,7 +19,7 @@ depending on the situation.=worden, afhangende van de situatie, als er maar twee 10. Moderator decisions are final.=10. Beslissingen van moderators zijn onherroepelijk. Failure to follow these rules may result in a kick or ban=Het falen om deze regels te volgen kan resulteren in een kick of ban (temp or permanent) depending on severity.=(tijdelijk of permanent), afhangend van de ernstigheid. -Developed and hosted by rubenwardy=Ontworpen en gehost door rubenwardy +Hosted by LandarVargan=Gehost door LandarVargan Moderators=Moderators Though the server owner will not actively read private messages or disclose=Ook al zal de server eigenaar niet actief privéberichten lezen of their content outside the mod team, random checks will be done to make sure=hun inhoud onthullen buiten het mod team, toch zullen willekeurige From c8af94235da8f8bb0a7df48749553b1a89c4d214 Mon Sep 17 00:00:00 2001 From: savilli <78875209+savilli@users.noreply.github.com> Date: Mon, 9 May 2022 20:23:52 +0000 Subject: [PATCH 5/6] Show rules for players on join if they didn't accept them --- init.lua | 84 ++++++++++++-------------------------------------------- 1 file changed, 18 insertions(+), 66 deletions(-) diff --git a/init.lua b/init.lua index 2c62909..d0f5dbe 100644 --- a/init.lua +++ b/init.lua @@ -53,16 +53,9 @@ if minetest.global_exists("sfinv") then }) end -local function can_grant_interact(player) - local pname = player:get_player_name() +local function need_to_accept(pname) return not minetest.check_player_privs(pname, { interact = true }) and - not minetest.check_player_privs(pname, { fly = true }) -end - -local function has_password(pname) - local handler = minetest.get_auth_handler() - local auth = handler.get_auth(pname) - return auth and not minetest.check_password_entry(pname, auth.password, "") + not minetest.check_player_privs(pname, { shout = true }) end function rules.show(player) @@ -70,11 +63,7 @@ function rules.show(player) local fs = "size[8,8.6]bgcolor[#080808BB;true]" .. "textlist[0.1,0.1;7.8,7.9;msg;" .. rules.txt .. ";-1;true]" - if not has_password(pname) then - fs = fs .. "box[4,8.1;3.1,0.7;#900]" - fs = fs .. "label[4.2,8.2;Please set a password]" - fs = fs .. "button_exit[0.5,7.6;3.5,2;ok;Okay]" - elseif not can_grant_interact(player) then + if not need_to_accept(pname) then fs = fs .. "button_exit[0.5,7.6;7,2;ok;Okay]" else local yes = minetest.formspec_escape("Yes, let me play!") @@ -87,18 +76,6 @@ function rules.show(player) minetest.show_formspec(pname, "rules:rules", fs) end -function rules.show_pwd(pname, msg) - msg = msg or "You must set a password to be able to play" - - minetest.show_formspec(pname, "rules:pwd", [[ - size[8,3] - no_prepends[] - bgcolor[#600] - pwdfield[0.8,1.5;7,1;pwd;Password] - button[0.5,2;7,2;setpwd;Set] - label[0.2,0.2;]] .. minetest.formspec_escape(msg) .. "]") -end - minetest.register_chatcommand("rules", { func = function(pname, param) if param ~= "" and @@ -120,63 +97,38 @@ minetest.register_on_newplayer(function(player) local pname = player:get_player_name() local privs = minetest.get_player_privs(pname) - if privs.interact and privs.fly then - privs.interact = false - minetest.set_player_privs(pname, privs) - end + privs.shout = nil + privs.interact = nil + minetest.set_player_privs(pname, privs) - if not has_password(pname) then - privs.shout = false - privs.interact = false - privs.kick = false - privs.ban = false - minetest.set_player_privs(pname, privs) - rules.show_pwd(pname) - elseif can_grant_interact(player) then + rules.show(player) +end) + +minetest.register_on_joinplayer(function(player) + if need_to_accept(player:get_player_name()) then rules.show(player) end end) minetest.register_on_player_receive_fields(function(player, form, fields) - if form == "rules:pwd" then - local pname = player:get_player_name() - if fields.setpwd then - local handler = minetest.get_auth_handler() - if not fields.pwd or fields.pwd:trim() == "" then - rules.show_pwd(pname) - elseif #fields.pwd < 5 then - rules.show_pwd(pname, "Needs at least 5 characters") - else - handler.set_password(pname, - minetest.get_password_hash(pname, fields.pwd)) - rules.show(player) - end - else - minetest.kick_player(pname, - "You need to set a password to play on this server.") - end - - return true - end - - if form ~= "rules:rules" then - return - end + if form ~= "rules:rules" then return end local pname = player:get_player_name() - if not can_grant_interact(player) or not has_password(pname) then + if not need_to_accept(pname) then return true end - if fields.msg then - return true - elseif not fields.yes or fields.no then + if fields.no then minetest.kick_player(pname, "You need to agree to the rules to play on this server. " .. "Please rejoin and confirm another time.") return true end + if not fields.yes then + return true + end + local privs = minetest.get_player_privs(pname) privs.shout = true privs.interact = true From bc0e3862379733a19f7e9da901ee970f716d7efb Mon Sep 17 00:00:00 2001 From: savilli <78875209+savilli@users.noreply.github.com> Date: Mon, 9 May 2022 20:31:16 +0000 Subject: [PATCH 6/6] Add myself --- init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/init.lua b/init.lua index d0f5dbe..4904f1a 100644 --- a/init.lua +++ b/init.lua @@ -26,7 +26,7 @@ local items = { S("Failure to follow these rules may result in a kick or ban"), S(" (temp or permanent) depending on severity."), "", - S("Hosted by LandarVargan"), + S("Created by rubenwardy. Developed by ")..S("LandarVargan and savilli."), S("Moderators")..": Thomas-S, IceAgeComing, Waterbug, DragonsVolcanoDance,", " Shara, Calinou, Aurika, LandarVargan, Xenon, Jhalman, Kat", "",