diff --git a/README b/README index d7040ff22d..d4f815e8ea 100755 --- a/README +++ b/README @@ -29,6 +29,14 @@ many features free, such as: abstraction of sessions and cookies, and access to whatever game data you desire are all attractive. +Requirements +------------ +* Python 2.5 strongly recommended, although may work just fine. +* PySqlite2 +* Django (Latest trunk from Subversion recommended) +* Optional: Apache2 or equivalent webserver with a Python interpreter + module. Required for web interface. + Installation ------------ At this point in time, the codebase is changing so rapidly that writing @@ -37,14 +45,15 @@ in development, we'll make sure to update this. But for the really determined (or stubborn), here's a rough outline: * Install Django. -* Copy the Evennia source somewhere. -* Set up your apache2.conf to point mod-python to the settings.py file if you - want the web features. +* Get a copy of the Evennia source. +* Optional: Set up your apache2.conf to point mod-python to the settings.py + file if you want the web features. * Copy settings.py.dist to settings.py. * Edit settings.py with your database info. * Run 'python manage.py syncdb' -* Run prepenv.sh. This will start the MU* server on port 4000 by default. You +* Run startup.sh. This will start the MU* server on port 4000 by default. You may change this via the web interface or by editing the config table in SQL. +* Login with the email address and password you provided to the syncdb script. Support and Development ----------------------- @@ -52,8 +61,11 @@ Since we're so early in development, we really can't hope to offer much support. However, if you'd like to report bugs, make suggestions, or help with the code work, visit either or both of the following links: +* Evennia Webpage + http://evennia.com + * Evennia Code Page - http://code.google.com/p/evennia/ - -* Evennia Google Group - http://groups-beta.google.com/group/evennia?hl=en + http://code.evennia.com + +* Evennia Test Game + evennia.com port 4000 diff --git a/apps/config/sql/configvalue.sql b/apps/config/sql/configvalue.sql index 449cf7808a..d721aa18b2 100644 --- a/apps/config/sql/configvalue.sql +++ b/apps/config/sql/configvalue.sql @@ -2,4 +2,5 @@ INSERT INTO "config_configvalue" VALUES(0,'site_name','Evennia Test Site'); INSERT INTO "config_configvalue" VALUES(1,'site_port','4000'); INSERT INTO "config_configvalue" VALUES(2,'player_dbnum_start','2'); INSERT INTO "config_configvalue" VALUES(3,'money_name_plural','Credits'); -INSERT INTO "config_configvalue" VALUES(4,'money_name_singular','Credit'); \ No newline at end of file +INSERT INTO "config_configvalue" VALUES(4,'money_name_singular','Credit'); +INSERT INTO "config_configvalue" VALUES(5,'game_firstrun','1'); \ No newline at end of file diff --git a/evennia.sql b/evennia.sql deleted file mode 100755 index 05cc0ab8e6..0000000000 Binary files a/evennia.sql and /dev/null differ diff --git a/gameconf.py b/gameconf.py index b21627be6c..7ba47ab6f1 100644 --- a/gameconf.py +++ b/gameconf.py @@ -8,3 +8,11 @@ def get_configvalue(configname): Retrieve a configuration value. """ return ConfigValue.objects.get(conf_key=configname).conf_value + +def set_configvalue(configname, newvalue): + """ + Sets a configuration value with the specified name. + """ + conf = ConfigValue.objects.get(conf_key=configname) + conf.conf_value = newvalue + conf.save() \ No newline at end of file diff --git a/initial_setup.py b/initial_setup.py new file mode 100644 index 0000000000..8d515c6986 --- /dev/null +++ b/initial_setup.py @@ -0,0 +1,20 @@ +from django.contrib.auth.models import User, Group +from apps.objects.models import Object +import functions_db +import functions_general +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') \ No newline at end of file diff --git a/server.py b/server.py index 7ec6e60211..95551b6e0a 100755 --- a/server.py +++ b/server.py @@ -10,6 +10,7 @@ import functions_general import session_mgr import gameconf import settings +import initial_setup class Server(dispatcher): """ @@ -31,7 +32,11 @@ class Server(dispatcher): # Load command aliases into memory for easy/quick access. self.load_cmd_aliases() self.port = gameconf.get_configvalue('site_port') - + + if gameconf.get_configvalue('game_firstrun') == '1': + print ' Game started for the first time, setting defaults.' + initial_setup.handle_setup() + # Start accepting connections. dispatcher.__init__(self) self.create_socket(socket.AF_INET, socket.SOCK_STREAM)