Add mods from server (#16)
This commit is contained in:
parent
5aa6fc3469
commit
01054d1ba7
21
.gitmodules
vendored
Normal file
21
.gitmodules
vendored
Normal file
@ -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
|
1
antispam
Submodule
1
antispam
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit f4958b3f9d67494c3470a311d4d526b433149e12
|
1
filter
Submodule
1
filter
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit b3d58cd83d4e52eeedf1bb730fdfb569a89b1257
|
1
hud_notify
Submodule
1
hud_notify
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 04161966be25aece7930eee5fe41b143ba830461
|
1
irc
Submodule
1
irc
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 7fbbfd6cdbb239a059e42fdaf101b760346d06b9
|
1
irc_commands
Submodule
1
irc_commands
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 83ad5f580a20138843c1e75acb71195baf0326c6
|
1
no_guests/depends.txt
Normal file
1
no_guests/depends.txt
Normal file
@ -0,0 +1 @@
|
||||
sban?
|
75
no_guests/init.lua
Normal file
75
no_guests/init.lua
Normal file
@ -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)
|
1
sauth
Submodule
1
sauth
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit d2e0aa834c7c0b6d6000af98eb22088b905441c3
|
1
sban
Submodule
1
sban
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 30c882337bf8edf4658198afd7139800341acd4e
|
Loading…
x
Reference in New Issue
Block a user