From 01054d1ba78301e42500b5aea164f0160db99a66 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Mon, 15 Feb 2021 21:08:35 +0000 Subject: [PATCH] Add mods from server (#16) --- .gitmodules | 21 ++++++++++++ antispam | 1 + filter | 1 + hud_notify | 1 + irc | 1 + irc_commands | 1 + no_guests/depends.txt | 1 + no_guests/init.lua | 75 +++++++++++++++++++++++++++++++++++++++++++ sauth | 1 + sban | 1 + 10 files changed, 104 insertions(+) create mode 100644 .gitmodules create mode 160000 antispam create mode 160000 filter create mode 160000 hud_notify create mode 160000 irc create mode 160000 irc_commands create mode 100644 no_guests/depends.txt create mode 100644 no_guests/init.lua create mode 160000 sauth create mode 160000 sban diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..98d7f11 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,21 @@ +[submodule "sban"] + path = sban + url = https://github.com/shivajiva101/sban +[submodule "sauth"] + path = sauth + url = https://github.com/shivajiva101/sauth/ +[submodule "irc"] + path = irc + url = https://github.com/minetest-mods/irc +[submodule "irc_commands"] + path = irc_commands + url = https://github.com/MT-CTF/irc_commands +[submodule "filter"] + path = filter + url = https://github.com/minetest-mods/filter +[submodule "hud_notify"] + path = hud_notify + url = https://github.com/ClobberXD/hud_notify +[submodule "antispam"] + path = antispam + url = https://github.com/appgurueu/antispam diff --git a/antispam b/antispam new file mode 160000 index 0000000..f4958b3 --- /dev/null +++ b/antispam @@ -0,0 +1 @@ +Subproject commit f4958b3f9d67494c3470a311d4d526b433149e12 diff --git a/filter b/filter new file mode 160000 index 0000000..b3d58cd --- /dev/null +++ b/filter @@ -0,0 +1 @@ +Subproject commit b3d58cd83d4e52eeedf1bb730fdfb569a89b1257 diff --git a/hud_notify b/hud_notify new file mode 160000 index 0000000..0416196 --- /dev/null +++ b/hud_notify @@ -0,0 +1 @@ +Subproject commit 04161966be25aece7930eee5fe41b143ba830461 diff --git a/irc b/irc new file mode 160000 index 0000000..7fbbfd6 --- /dev/null +++ b/irc @@ -0,0 +1 @@ +Subproject commit 7fbbfd6cdbb239a059e42fdaf101b760346d06b9 diff --git a/irc_commands b/irc_commands new file mode 160000 index 0000000..83ad5f5 --- /dev/null +++ b/irc_commands @@ -0,0 +1 @@ +Subproject commit 83ad5f580a20138843c1e75acb71195baf0326c6 diff --git a/no_guests/depends.txt b/no_guests/depends.txt new file mode 100644 index 0000000..2cfe1c7 --- /dev/null +++ b/no_guests/depends.txt @@ -0,0 +1 @@ +sban? diff --git a/no_guests/init.lua b/no_guests/init.lua new file mode 100644 index 0000000..13f902c --- /dev/null +++ b/no_guests/init.lua @@ -0,0 +1,75 @@ +-- No guests mod. +-- By VanessaE, sfan5, and kaeza. + +local disallowed = { + ["guest"] = "Guest accounts are disallowed on this server. ".. + "Please choose a proper username and try again.", + ["[4a]dm[1il]n"] = "That is a clearly false, misleading, or otherwise disallowed username. ".. + "Please choose a unique username and try again.", + ["^[0-9]+$"] = "All-numeric usernames are disallowed on this server. ".. + "Please choose a proper username and try again.", + ["[0-9].-[0-9].-[0-9].-[0-9].-[0-9]"] = "Too many numbers in your username. ".. + "Please try again with less than five digits in your username.", + ["^[A-Za-z]+[0-9][0-9][0-9]+$"] = "Please choice your own username. Usernames with letters then 3 or more digits are not allowed" +} + +-- Original implementation (in Python) by sfan5 +local function judge(msg) + local numspeakable = 0 + local numnotspeakable = 0 + local cn = 0 + local lastc = '____' + for c in msg:gmatch(".") do + c = c:lower() + if c:find("[aeiou0-9_-]") then + if cn > 2 and not c:find("[0-9]") then + numnotspeakable = numnotspeakable + 1 + elseif not c:find("[0-9]") then + numspeakable = numspeakable + 1 + end + cn = 0 + else + if (cn == 1) and (lastc == c) and (lastc ~= 's') then + numnotspeakable = numnotspeakable + 1 + cn = 0 + end + if cn > 2 then + numnotspeakable = numnotspeakable + 1 + cn = 0 + end + if lastc:find("[aeiou]") then + numspeakable = numspeakable + 1 + cn = 0 + end + if not ((lastc:find("[aipfom]") and c == "r") or (lastc == "c" and c == "h")) then + cn = cn + 1 + end + end + lastc = c + end + if cn > 0 then + numnotspeakable = numnotspeakable + 1 + end + return (numspeakable >= numnotspeakable) +end + +minetest.register_on_prejoinplayer(function(name, ip) + if not minetest.player_exists(name) then + local lname = name:lower() + for re, reason in pairs(disallowed) do + if lname:find(re) then + return reason + end + end + + if #name < 2 then + return "Too short of a username. ".. + "Please pick a name with at least two letters and try again." + end + + if not judge(name) and #name > 5 then + return "Your username just plain looks like gibberish. ".. + "Please pick something readable and try again." + end + end +end) diff --git a/sauth b/sauth new file mode 160000 index 0000000..d2e0aa8 --- /dev/null +++ b/sauth @@ -0,0 +1 @@ +Subproject commit d2e0aa834c7c0b6d6000af98eb22088b905441c3 diff --git a/sban b/sban new file mode 160000 index 0000000..30c8823 --- /dev/null +++ b/sban @@ -0,0 +1 @@ +Subproject commit 30c882337bf8edf4658198afd7139800341acd4e