diff --git a/src/commands/default/unloggedin.py b/src/commands/default/unloggedin.py index a6cb7299ac..04711d6975 100644 --- a/src/commands/default/unloggedin.py +++ b/src/commands/default/unloggedin.py @@ -158,6 +158,18 @@ class CmdUnconnectedCreate(MuxCommand): session.msg(string) return + # Check IP and/or name bans + bans = ServerConfig.objects.conf("server_bans") + if bans and (any(tup[0]==playername.lower() for tup in bans) + or + any(tup[2].match(session.address) for tup in bans if tup[2])): + # this is a banned IP or name! + string = "{rYou have been banned and cannot continue from here." + string += "\nIf you feel this ban is in error, please email an admin.{x" + session.msg(string) + session.execute_cmd("quit") + return + # everything's ok. Create the new player account. try: default_home = ObjectDB.objects.get_id(settings.DEFAULT_HOME)