evennia/initial_setup.py
loki77 3fe644ef17 Indentation change 3-4 spaces.
Possible files that need to be cleanedup;
commands/info.py:cmd_list
commands/general.py:cmd_who
commands/comsys.py:cmd_who

cmdtable.py
ansi.py
2008-06-13 19:52:29 +00:00

18 lines
626 B
Python

from django.contrib.auth.models import User, Group
from apps.objects.models import Object
import gameconf
def handle_setup():
# Set the initial user's username on the #1 object.
god_user = User.objects.filter(id=1)[0]
god_user_obj = Object.objects.filter(id=1)[0]
god_user_obj.set_name(god_user.username)
groups = ("Immortals", "Wizards", "Builders", "Player Helpers")
for group in groups:
newgroup = Group()
newgroup.name = group
newgroup.save()
# We don't want to do initial setup tasks every startup, only the first.
gameconf.set_configvalue('game_firstrun', '0')