From 4d94132c54a93e0be5f90aaf9189fd54fa9679b4 Mon Sep 17 00:00:00 2001 From: Greg Taylor Date: Sat, 27 Oct 2007 03:25:42 +0000 Subject: [PATCH] Moved the connect screen to the connect_screen config directive. Made the conf_value field on the configvalue model a TextField so we're not getting truncated at 255 as with a CharField. This means you'll need to delete your config tables and re-sync. --- apps/config/models.py | 2 +- apps/config/sql/configvalue.sql | 10 ++++++++++ session.py | 12 ++++-------- startup.sh | 4 ++-- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/apps/config/models.py b/apps/config/models.py index 8eae47cfc..76bfb0b4b 100755 --- a/apps/config/models.py +++ b/apps/config/models.py @@ -20,7 +20,7 @@ class ConfigValue(models.Model): Experimental new config model. """ conf_key = models.CharField(maxlength=100) - conf_value = models.CharField(maxlength=255 ) + conf_value = models.TextField() class Admin: list_display = ('conf_key', 'conf_value',) diff --git a/apps/config/sql/configvalue.sql b/apps/config/sql/configvalue.sql index e32dc3b85..391511fe3 100644 --- a/apps/config/sql/configvalue.sql +++ b/apps/config/sql/configvalue.sql @@ -5,3 +5,13 @@ INSERT INTO config_configvalue VALUES(4,'money_name_singular','Credit'); INSERT INTO config_configvalue VALUES(5,'game_firstrun','1'); INSERT INTO config_configvalue VALUES(6,'idle_timeout','1800'); INSERT INTO config_configvalue VALUES(7,'default_home','2'); +INSERT INTO config_configvalue VALUES(8,'connect_screen',' +%%ch%%cb==================================================================%%cn + Welcome to Evennia! Please type one of the following to begin: + + If you have an existing account, connect to it by typing: + %%chconnect %%cn + If you need to create an account, type (without the <>''s): + %%chcreate "" %%cn +%%ch%%cb==================================================================%%cn +'); diff --git a/session.py b/session.py index eb052157b..47dee705e 100755 --- a/session.py +++ b/session.py @@ -10,6 +10,8 @@ from django.contrib.auth.models import User import functions_db import functions_general import session_mgr +import ansi +import gameconf class SessionProtocol(StatefulTelnetProtocol): """ @@ -117,15 +119,9 @@ class SessionProtocol(StatefulTelnetProtocol): def game_connect_screen(self): """ - Show the banner screen. + Show the banner screen. Grab from the 'connect_screen' config directive. """ - buffer = '-'*50 - buffer += ' \n\rWelcome to Evennia!\n\r' - buffer += '-'*50 + '\n\r' - buffer += """Please type one of the following to begin:\n\r - connect \n\r - create \"\" \n\r""" - buffer += '-'*50 + buffer = ansi.parse_ansi(gameconf.get_configvalue('connect_screen')) self.msg(buffer) def is_loggedin(self): diff --git a/startup.sh b/startup.sh index 9b9b88612..d77cd954a 100755 --- a/startup.sh +++ b/startup.sh @@ -11,6 +11,6 @@ mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old ## mode instead of having to uncomment crap. ## Interactive mode. Good for development and debugging. -#twistd -noy twistd -ny server.py +twistd -noy twistd -ny server.py ## Stand-alone mode. Good for running games. -twistd -y server.py +#twistd -y server.py