Added ban-check also before unloggedin player/character creation. Resolves #536.

This commit is contained in:
Griatch 2014-07-07 22:31:19 +02:00
parent 4ae65c98fb
commit 52eef63a84

View file

@ -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)