More re-arranging to make things more closely resemble MUX/MUSH directory structure. Reason we're doing this is to begin the emergence of a separation of server code from game-specific stuff (called a driver by some codebases like LPMud).
Ideally game developers don't touch the server code, they just play within the game directory, which will contain all of their script parents and stuff. NOTE: I may have broken the Linux/Unix start script. I am not able to boot back into Linux at the moment due to some testing going on, so if anyone could take a moment to tell me one way or another, I'd appreciate it. NOTE: You'll need to move your evennia.db3 file into the game directory if you're using sqlite.
This commit is contained in:
parent
66a529ba84
commit
01db5700e8
11 changed files with 20 additions and 110 deletions
72
startup.sh
72
startup.sh
|
|
@ -1,72 +0,0 @@
|
|||
#!/bin/bash
|
||||
#############################################################################
|
||||
# LINUX/UNIX SERVER STARTUP SCRIPT
|
||||
# Sets the appropriate environmental variables and launches the server
|
||||
# process. Run without flags for daemon mode.
|
||||
# It can be used for stoping the server.
|
||||
#
|
||||
# FLAGS
|
||||
# -i Interactive mode
|
||||
# -d Daemon mode
|
||||
# -s Stop the running server
|
||||
# -h Show help display
|
||||
#############################################################################
|
||||
|
||||
init () {
|
||||
## Sets environmental variables and preps the logs.
|
||||
export DJANGO_SETTINGS_MODULE="settings"
|
||||
BASE_PATH=`python -c "import settings; print settings.BASE_PATH"`
|
||||
mv -f $BASE_PATH/logs/evennia.log $BASE_PATH/logs/evennia.logs.old
|
||||
}
|
||||
|
||||
startup_interactive() {
|
||||
## Starts the server in interactive mode.
|
||||
init
|
||||
echo "Starting in interactive mode..."
|
||||
twistd -n --logfile=logs/evennia.log --python=src/server.py
|
||||
}
|
||||
|
||||
startup_daemon() {
|
||||
## Starts the server in daemon mode.
|
||||
init
|
||||
twistd --logfile=logs/evennia.log --python=src/server.py
|
||||
}
|
||||
|
||||
stop_server() {
|
||||
## Stops the running server
|
||||
kill `cat twistd.pid`
|
||||
}
|
||||
|
||||
help_display() {
|
||||
echo "SERVER STARTUP SCRIPT"
|
||||
echo "Sets the appropriate environmental variables and launches the server"
|
||||
echo "process. Run without flags for daemon mode."
|
||||
echo ""
|
||||
echo "FLAGS"
|
||||
echo " -i Interactive mode"
|
||||
echo " -d Daemon mode"
|
||||
echo " -s Stop the running server"
|
||||
echo " -h Show help display"
|
||||
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
'-i')
|
||||
startup_interactive
|
||||
;;
|
||||
'-d')
|
||||
startup_daemon
|
||||
;;
|
||||
'-s')
|
||||
stop_server
|
||||
;;
|
||||
'--help')
|
||||
help_display
|
||||
;;
|
||||
'-h')
|
||||
help_display
|
||||
;;
|
||||
*)
|
||||
# If no argument is provided, start in daemon mode.
|
||||
startup_daemon
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue