Fixed a bug in serverconfig. Tweaked how the default connection screen is stored, to allow for server updates.

This commit is contained in:
Griatch 2011-04-12 22:22:04 +00:00
parent 7f9f21f45e
commit 88626842b7
4 changed files with 42 additions and 19 deletions

View file

@ -1,7 +1,8 @@
#
# This module holds textual connection screen definitions. All global
# string variables (only) in this module are read by Evennia and
# assumed to define a Connection screen.
# assumed to define a Connection screen. You can change which module is
# used with settings.CONNECTION_SCREEN_MODULE.
#
# The names of the string variables doesn't matter (except they
# shouldn't start with _), but each should hold a string defining a
@ -13,16 +14,18 @@
# either reboot or reload the server to make them available.
#
from src.utils import utils
from src.commands.connection_screen import DEFAULT_SCREEN
DEFAULT_SCREEN = \
"""{b=============================================================={n
Welcome to {gEvennia{n, version %s!
If you have an existing account, connect to it by typing:
{wconnect <email> <password>{n
If you need to create an account, type (without the <>'s):
{wcreate \"<username>\" <email> <password>{n
Enter {whelp{n for more info. {wlook{n will re-load this screen.
{b=============================================================={n""" % utils.get_evennia_version()
# from src.utils import utils
#
# CUSTOM_SCREEN = \
# """{b=============================================================={n
# Welcome to {gEvennia{n, version %s!
#
# If you have an existing account, connect to it by typing:
# {wconnect <email> <password>{n
# If you need to create an account, type (without the <>'s):
# {wcreate \"<username>\" <email> <password>{n
#
# Enter {whelp{n for more info. {wlook{n will re-load this screen.
#{b=============================================================={n""" % utils.get_evennia_version()

View file

@ -0,0 +1,18 @@
#
# This is Evennia's default connection screen. It is imported
# and run from game/gamesrc/world/connection_screens.py.
#
from src.utils import utils
DEFAULT_SCREEN = \
"""{b=============================================================={n
Welcome to {gEvennia{n, version %s!
If you have an existing account, connect to it by typing:
{wconnect <email> <password>{n
If you need to create an account, type (without the <>'s):
{wcreate \"<username>\" <email> <password>{n
Enter {whelp{n for more info. {wlook{n will re-load this screen.
{b=============================================================={n""" % utils.get_evennia_version()

View file

@ -17,7 +17,7 @@ def create_config_values():
"""
Creates the initial config values.
"""
ServerConfig.objects.conf("default_home", "2")
ServerConfig.objects.conf("default_home", '2')
ServerConfig.objects.conf("site_name", settings.SERVERNAME)
ServerConfig.objects.conf("idle_timeout", settings.IDLE_TIMEOUT)
@ -189,14 +189,14 @@ def handle_setup(last_step):
create_objects,
create_channels,
create_system_scripts,
import_MUX_help_files,
start_game_time,
create_admin_media_links]
create_admin_media_links,
import_MUX_help_files]
if not settings.IMPORT_MUX_HELP:
# skip importing of the MUX helpfiles, they are
# not interesting except for developers.
del setup_queue[4]
del setup_queue[-1]
#print " Initial setup: %s steps." % (len(setup_queue))

View file

@ -21,8 +21,10 @@ class ServerConfigManager(models.Manager):
conf.delete()
elif value != None:
conf = self.filter(db_key=key)
if not conf:
conf = self.model(db_key=key)
if conf:
conf = conf[0]
else:
conf = self.model(db_key=key)
conf.value = value # this will pickle
else:
conf = self.filter(db_key=key)