[Mod] No More Guests! [no_guests]

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

[Mod] No More Guests! [no_guests]

by kaeza » Post

Hello folks!

Due to a new feature in Minetest, players can be disconnected by mods even before they actually join the game. This has several advantages over the traditional ban on join followed shortly by unban:
  • The player file does not actually get created, thus avoiding cluttering up the world's `players' directory.
  • The join/leave callbacks do not actually get called, thus saving some processing and/or memory (and avoids spamming the chat with join/leave messages).
  • Does not modify the ban list in any way. "Kick user"-type mods usually implement the "kick" as a ban followed shortly by an unban, but this had the problem that if the server crashes between those actions, the player will be banned permanently until manually unbanned.
Now I present you the true and only No More Guests®©™ mod!

All this mod does is simply disconnect all "Guest" accounts (players named "Guest" followed by a number, a feature that some (most?) server owners find annoying.

In addition to this, and thanks to VanessaE for the ideas, it also disallows all-numeric names, names containing enther "guest" or "admin" (case insensitive), and names containing excessive numbers.

Also, thanks to sfan5 for letting me steal^Wborrow his code to detect "junk names". This mod does not allow players with gibberish names.

If you want to support this mod, send your money here.

License:
WTFPL

Dependencies:
None

Screenshots:
High resolution screenshot here.

Downloads:
Attachments
no_guests-1337.0.2.zip
(996 Bytes) Downloaded 638 times
Last edited by kaeza on Sat Dec 14, 2013 19:35, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
Evergreen
Member
Posts: 2135
Joined: Sun Jan 06, 2013 01:22
GitHub: 4Evergreen4
IRC: EvergreenTree
In-game: Evergreen
Location: A forest in the midwest
Contact:

by Evergreen » Post

Did you just Duckroll me?! /me slaps kaeza </kidding>
Anyway, great idea. It's good not to have all those random useless player files cluttering up the world directory.
Back from the dead!

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

by addi » Post

dose it work with a latest daily server and the client a 0.4.8 too?
Last edited by addi on Sun Dec 15, 2013 10:01, edited 1 time in total.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

addi wrote:dose it work if the server is a latest dayli and the client a 0.4.8 too?
This mod requires a build not older than 2013-12-13, so yes, latest daily build should work.
Also, this only needs an updated server; clients continue to work as ever.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
addi
Member
Posts: 666
Joined: Thu Sep 20, 2012 03:16
GitHub: adrido
Location: Black-Forest, Germany

by addi » Post

very good :)

User avatar
BrandonReese
Member
Posts: 839
Joined: Wed Sep 12, 2012 00:44
GitHub: bremaweb
IRC: BrandonReese
In-game: BrandonReese
Location: USA

by BrandonReese » Post

I love it. Works perfectly.

Jordach
Member
Posts: 4534
Joined: Mon Oct 03, 2011 17:58
GitHub: Jordach
IRC: Jordach
In-game: Jordach
Location: Blender Scene

by Jordach » Post

BrandonReese wrote:I love it. Works perfectly.
Vanessa will love this, I simply don't know if she already uses it on her production server yet. Will need to forward her this mod.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Jordach wrote:Vanessa will love this, I simply don't know if she already uses it on her production server yet. Will need to forward her this mod.
She's already using it (actually, a modified version that also disallows all-numeric names). In fact, 7 out of the 8 servers connected to Inchra are using it (ShadowNinja didn't have time to install it yet).
Last edited by kaeza on Sun Dec 15, 2013 01:00, edited 1 time in total.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

Great idea!
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

Sokomine
Member
Posts: 4276
Joined: Sun Sep 09, 2012 17:31
GitHub: Sokomine
IRC: Sokomine
In-game: Sokomine

by Sokomine » Post

I'm a bit unhappy with the very name of the mod. It may sound to new players as if guests as such would not welcome - whereas it's only nameless/silly named guestnames that are undesired. Perhaps "no_silly_names" or something like that might sound friendlier :-)
A list of my mods can be found here.

User avatar
kaeza
Moderator
Posts: 2162
Joined: Thu Oct 18, 2012 05:00
GitHub: kaeza
IRC: kaeza diemartin blaaaaargh
In-game: kaeza
Location: Montevideo, Uruguay
Contact:

by kaeza » Post

Sokomine wrote:I'm a bit unhappy with the very name of the mod. It may sound to new players as if guests as such would not welcome - whereas it's only nameless/silly named guestnames that are undesired. Perhaps "no_silly_names" or something like that might sound friendlier :-)
Well, the name is unimportant as the mod description explains exactly what it does.

Nobody is forced to install this on their server, but in my experience, most of these guests do not bother to choose an appropriate name, and they bother less about everyone's hard work.

I've seen some guests come back, and even become regular users of my server, so this is not a problem for legitimate players.
Your signature is not the place for a blog post. Please keep it as concise as possible. Thank you!

Check out my stuff! | Donations greatly appreciated! PayPal

User avatar
LazyJ
Member
Posts: 687
Joined: Wed Sep 12, 2012 12:29
Location: Podunk, Nowhere, USA

by LazyJ » Post

It's been my experience that server operators and admins are more likely to pay attention to the mod's name than the young and impatient players. ;)

For me, if the mod's name became an issue, I would change the name and leave a credit-line with the author's name, the mod's original name, and perhaps an url to the place to download it, commented-out in the code.

Along that same thought, server operators can change the mod's message to better suit their servers, perhaps even re-write the message in the server's locale language.

Thanks to kaeza and VanessaE for another good and quite useful mod. ;)
Last edited by LazyJ on Sun Dec 15, 2013 09:07, edited 1 time in total.

specopsbarton
Member
Posts: 12
Joined: Thu Jul 18, 2013 17:38
Location: Poland
Contact:

by specopsbarton » Post

Nice mod, it works very good for me - NO MORE GUESTS!
Last edited by specopsbarton on Mon Jan 20, 2014 13:05, edited 1 time in total.
True Christian don't fight with evil, but transforms it to good on Cross, only on Cross.

User avatar
crazyginger72
Member
Posts: 69
Joined: Wed Jan 01, 2014 07:57
GitHub: crazyginger72
IRC: cg72
In-game: crazyginger72
Location: gone to lunch

by crazyginger72 » Post

I am releasing my fork of this mod now!!!

It not only filters "guest" names but i have added a through "profanity name" filter to the mod and renamed it to be more inviting :)

download here >>>> https://github.com/crazyginger72/blocked_usernames
Last edited by crazyginger72 on Thu Feb 27, 2014 04:18, edited 1 time in total.

User avatar
Pitriss
Member
Posts: 254
Joined: Mon Aug 05, 2013 17:09
GitHub: Pitriss
IRC: pitriss
In-game: pitriss
Location: Czech republic, Bohumin

by Pitriss » Post

["[c]+[r]+[4a]+[z]+[y]+[g]+[i1l]+[g]+[3e]+[r]+"] = "that is too close to the server owners name".. //line 51, you probably forgot [n]+
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.

User avatar
Krock
Developer
Posts: 4649
Joined: Thu Oct 03, 2013 07:48
GitHub: SmallJoker
Location: Switzerland
Contact:

by Krock » Post

https://github.com/crazyginger72/blocked_usernames/blob/master/init.lua#L51 wrote:

Code: Select all

["[c]+[r]+[4a]+[z]+[y]+[g]+[i1l]+[g]+[3e]+[r]+"] = "that is too close to the server owners name"..
                               "pick a new name",
I would suggest:

Code: Select all

 ["cr[4a]zyg[i1l]ng[3e]r"] = "that is too close to the server owners name"..
                               "pick a new name",
Like the admin preg_match filter is.
EDIT: added missing 'n' :)
Last edited by Krock on Thu Feb 27, 2014 16:36, edited 1 time in total.
Look, I programmed a bug for you. >> Mod Search Engine << - Mods by Krock - DuckDuckGo mod search bang: !mtmod <keyword here>

User avatar
BrunoMine
Member
Posts: 1082
Joined: Thu Apr 25, 2013 17:29
GitHub: BrunoMine
Location: SP-Brasil
Contact:

by BrunoMine » Post

The guests will be expelled?
it is possible to warn the prohibition?
Image
Last edited by BrunoMine on Thu Feb 27, 2014 19:45, edited 1 time in total.
My small square universe under construction ... Minemacro
Comunidade Minetest Brasil
www.minetestbrasil.com

User avatar
CraigyDavi
Member
Posts: 582
Joined: Sat Aug 10, 2013 13:08
GitHub: davisonio
IRC: davisonio
In-game: CraigyDavi
Location: Hampshire, UK
Contact:

by CraigyDavi » Post

brunob.santos wrote:The guests will be expelled?
it is possible to warn the prohibition?
When a guest joins they will get a message telling them that guest accounts are not allowed on here:
Guest accounts are disallowed on this server. Please choose a proper username and try again.

User avatar
Pitriss
Member
Posts: 254
Joined: Mon Aug 05, 2013 17:09
GitHub: Pitriss
IRC: pitriss
In-game: pitriss
Location: Czech republic, Bohumin

by Pitriss » Post

Krock wrote:
https://github.com/crazyginger72/blocked_usernames/blob/master/init.lua#L51 wrote:

Code: Select all

["[c]+[r]+[4a]+[z]+[y]+[g]+[i1l]+[g]+[3e]+[r]+"] = "that is too close to the server owners name"..
                               "pick a new name",
I would suggest:

Code: Select all

 ["cr[4a]zyg[i1l]ng[3e]r"] = "that is too close to the server owners name"..
                               "pick a new name",
Like the admin preg_match filter is.
EDIT: added missing 'n' :)
Original solution matches also wit cccccraaaa4a4azzzzyginger AFAIK:)
I reject your reality and substitute my own. (A. Savage, Mythbusters)
I'm not modding and/or playing minetest anymore. All my mods were released under WTFPL. You can fix/modify them yourself. Don't ask me for support. Thanks.

User avatar
crazyginger72
Member
Posts: 69
Joined: Wed Jan 01, 2014 07:57
GitHub: crazyginger72
IRC: cg72
In-game: crazyginger72
Location: gone to lunch

by crazyginger72 » Post

thanks i didnt see that typo guys :)
fixed and updated!
Last edited by crazyginger72 on Thu Feb 27, 2014 21:30, edited 1 time in total.

User avatar
rubenwardy
Moderator
Posts: 6972
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy
Location: Bristol, United Kingdom
Contact:

Re: [Mod] No More Guests! [no_guests]

by rubenwardy » Post

Version which doesn't stop already registered accounts, and also works with newer guest names:

Code: Select all

-- 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)
Renewed Tab (my browser add-on) | Donate | Mods | Minetest Modding Book

Hello profile reader

User avatar
scottwolff
Member
Posts: 129
Joined: Sat Apr 30, 2016 06:15
In-game: scottwolff or some variant of iasiney
Location: Central Illinois

Re: [Mod] No More Guests! [no_guests]

by scottwolff » Post

I'm beginning to think that the hackers that try to get into my server don't like this mod either. I do. If I remember correctly, it bans names like 123456 or abcdefg?

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [Mod] No More Guests! [no_guests]

by Festus1965 » Post

First Thank you for this solution !

I started to think about, basically because of this "Xxxxx999" gamer,

Code: Select all

["^[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"
as this ones are also most responsible for
Warnings at Server like
* moved to fast, or
* tried to interact without interact ...
So I got rid of them most.

Now much less work to xban the less users getting in, "pressing" this Warnings sometimes some pages long. My poor Server ..., the rest I can still xban myself, but thinking also about a solution for those who try to cheat - and filling the server actions too fast.
Last edited by Festus1965 on Sat Jul 21, 2018 01:21, edited 1 time in total.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
Festus1965
Member
Posts: 4181
Joined: Sun Jan 03, 2016 11:58
GitHub: Festus1965
In-game: Festus1965 Thomas Thailand Explorer
Location: Thailand ChiangMai
Contact:

Re: [Mod] No More Guests! [no_guests]

by Festus1965 » Post

so after the new ? App "3D Exploration" is flooding my server with Name12 Logins here again questions, as that coding I never got:

edited:
I think I got it:

Code: Select all

["^[A-Za-z]+[0-9][0-9][0-9]+$"]
seamd only to block Name123, but not Name123abc
so I also added

Code: Select all

["^[A-Za-z]+[0-9][0-9][0-9]+$[A-Za-z]"]
and now I see Name123abc is also blocked, as a lot of them just added some letters
= most of I think Multicraft-Users are gone, and a lot of useless traffic saved

so I also added the shelter to 2 diggit users, as I think that are the "3D Exploration" or so names Gamers

Code: Select all

["^[A-Za-z]+[0-9][0-9]+$"]
["^[A-Za-z]+[0-9][0-9]+$[A-Za-z]"]
now still some only Capital letter names pass throught (I dont like that screaming view)... working on it ...

Code: Select all

["^[A-Z]+$[A-Z]"]
maybe ,,, testing



How to implementate exeptions:
* names with 2 digit end are stopped, but 2 of them I want to let pass

also the exeptions could work, as a Friend gave me a solution enlage the onjoin ..., later about it.
Last edited by Festus1965 on Sat Jul 21, 2018 01:21, edited 3 times in total.
Human has no future (climate change)
If urgend, you find me in Roblox (as CNXThomas)

User avatar
davidthecreator
Member
Posts: 452
Joined: Mon Aug 18, 2014 19:48
GitHub: daviddoesminetest
In-game: DavidDoesMinetest
Location: Lithuania

Re:

by davidthecreator » Post

CraigyDavi wrote: When a guest joins they will get a message telling them that guest accounts are not allowed on here:
Guest accounts are disallowed on this server. Please choose a proper username and try again.

Oof !

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 19 guests