mirror of
https://github.com/evennia/evennia.git
synced 2026-04-04 23:17:17 +02:00
Added ban-check also before unloggedin player/character creation. Resolves #536.
This commit is contained in:
parent
4ae65c98fb
commit
52eef63a84
1 changed files with 12 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue