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 # This module holds textual connection screen definitions. All global
# string variables (only) in this module are read by Evennia and # 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 # The names of the string variables doesn't matter (except they
# shouldn't start with _), but each should hold a string defining a # 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. # 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 = \ # from src.utils import utils
"""{b=============================================================={n #
Welcome to {gEvennia{n, version %s! # CUSTOM_SCREEN = \
# """{b=============================================================={n
If you have an existing account, connect to it by typing: # Welcome to {gEvennia{n, version %s!
{wconnect <email> <password>{n #
If you need to create an account, type (without the <>'s): # If you have an existing account, connect to it by typing:
{wcreate \"<username>\" <email> <password>{n # {wconnect <email> <password>{n
# If you need to create an account, type (without the <>'s):
Enter {whelp{n for more info. {wlook{n will re-load this screen. # {wcreate \"<username>\" <email> <password>{n
{b=============================================================={n""" % utils.get_evennia_version() #
# 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. 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("site_name", settings.SERVERNAME)
ServerConfig.objects.conf("idle_timeout", settings.IDLE_TIMEOUT) ServerConfig.objects.conf("idle_timeout", settings.IDLE_TIMEOUT)
@ -189,14 +189,14 @@ def handle_setup(last_step):
create_objects, create_objects,
create_channels, create_channels,
create_system_scripts, create_system_scripts,
import_MUX_help_files,
start_game_time, start_game_time,
create_admin_media_links] create_admin_media_links,
import_MUX_help_files]
if not settings.IMPORT_MUX_HELP: if not settings.IMPORT_MUX_HELP:
# skip importing of the MUX helpfiles, they are # skip importing of the MUX helpfiles, they are
# not interesting except for developers. # not interesting except for developers.
del setup_queue[4] del setup_queue[-1]
#print " Initial setup: %s steps." % (len(setup_queue)) #print " Initial setup: %s steps." % (len(setup_queue))

View file

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