The following script sets up the directories for building and running your server. It also creates scripts to get files from the subversion servers.
It is based on the Debian guide in the wiki, but could be used on any system that has bash.
Hope this helps...
Code:
#!/bin/bash
#Set this variable to where you want eqemu to go
EMUDIR=eqemuserver
if [ -e $EMUDIR ]; then
echo
echo $EMUDIR already exists - exiting to avoid potential confusion
echo you might want to edit this script and set the EMUDIR to somewhere else
exit
fi
if [ $EUID -eq 0 ]; then
echo
echo you are running this script as root, possibly via su or sudo
echo EqEmu does not need superuser to install or run, except possibly
echo when you are setting up the database
echo
echo Either install this script as yourself, or create a dedicated
echo account to install and run EqEmu.
echo #!/bin/bash
#Set this variable to where you want eqemu to go
EMUDIR=eqemuserver
if [ -e $EMUDIR ]; then
echo
echo $EMUDIR already exists - exiting to avoid potential confusion
echo you might want to edit this script and set the EMUDIR to somewhere else
exit
fi
if [ $EUID -eq 0 ]; then
echo
echo you are running this script as root, possibly via su or sudo
echo EqEmu does not need superuser to install or run, except possibly
echo when you are setting up the database
echo
echo Either install this script as yourself, or create a dedicated
echo account to install and run EqEmu.
echo
echo Exiting
exit
fi
mkdir $EMUDIR
cd $EMUDIR
cat > getEqemu << EOD1
#!/bin/bash
svn checkout http://projecteqemu.googlecode.com/svn/trunk/ projecteqemu-read-only
EOD1
cat > getEQmaps << EOD2
#!/bin/bash
svn checkout http://eqemumaps.googlecode.com/svn/trunk/ eqemumaps-read-only
EOD2
cat > getPEQdb << EOD3
#!/bin/bash
svn checkout http://projecteqdb.googlecode.com/svn/trunk/ projecteqdb-current-only
EOD3
cat > getQuest << EOD4
#!/bin/bash
svn checkout http://projecteqquests.googlecode.com/svn/trunk/ projecteqquests-read-only
EOD4
mkdir server
for s in getEQmaps getPEQdb getQuest getEqemu ; do chmod +x $s ; done
cd server
ln -s ../projecteqemu-read-only/EQEmuServer/ source
targets="source/chatserver/chatserver source/utils/cleanipc source/utils/defaults/eqemu_config.xml.full source/eqlaunch/eqlaunch source/EMuShareMem/libEMuShareMem.so source/utils/defaults/log.ini source/utils/mail_opcodes.conf source/mailserver/mailserver ../eqemumaps-read-only/Maps source/utils/defaults/mime.types source/utils/opcodes.conf source/utils/patch_6.2.conf source/utils/patch_Anniversary.conf source/utils/patch_Live.conf source/utils/patch_SoF.conf source/utils/patch_Titanium.conf source/utils/defaults/plugin.pl ../projecteqquests-read-only/quests/plugins ../projecteqquests-read-only/quests source/utils/defaults/templates source/world/world source/utils/defaults/worldui source/utils/defaults/worldui.pl source/zone/zone"
for foo in $targets ; do
ln -s $foo `basename $foo `
done
echo
echo the start and stop scripts are setup for the Privatelogin server
echo you will want to edit these scripts if you use minilogin or the official
echo login servers
echo
cat > start << EOD5
#!/bin/sh
#ulimit -c 99999999
rm -f .zone_shutdown
rm -f .world_shutdown
set -x
LNAME="zone" #launcher name
if [ "$1" = "test" ]; then
LNAME="test"
fi
# The following are for my setup of the PrivateLogin server
# Those who use minilogin or the new private login server will need
# to modify this to suit -- Kobaz
#cd ../LS
#wine PrivateLogin.exe > logs/PrivateLogin.log &
#cd ../server
P=`pwd`
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
#make sure we have a place to log
mkdir -p logs 2>&1 > /dev/null
#clear out old logs, if both are stopped
if [ ! -e .lock-zones -a ! -e .lock-world ] ; then
for f in logs/eqemu_*.log
do
if [ "$f" = "logs/eqemu_commands_zone.log" ]; then
continue;
fi
rm -f $f
done
fi
#boot up world
if [ ! -e .lock-world ] ; then
touch .lock-world
# ./world 2>&1 > logs/world &
./persist_world 2>&1 > logs/world &
# wait for shared memory to load
sleep 15
fi
#start up the official launcher
if [ ! -e .lock-launcher ]; then
touch .lock-launcher
./eqlaunch $LNAME 2>&1 > logs/launcher &
fi
./mailserver &
./chatserver &
EOD5
cat > stop << EOD6
#!/bin/sh
touch .zone_shutdown
touch .world_shutdown
#Users of the official private login server or minilogin
#will need to do something different here -- Kobaz
killall wine PrivateLogin.exe world eqlaunch zone mailserver chatserver
killall -9 PrivateLogin.exe
sleep 3
if ps ax|grep -e 'w[o]rld' -e 'z[o]ne' -e 'eq[l]aunch' -e 'mails[e]rver' -e 'cha[t]server' >/dev/null; then
killall -9 world eqlaunch zone mailserver chatserver
sleep 2
fi
./cleanipc
rm -f .lock-zones .lock-world .lock-login .lock-launcher
EOD6
cat > persist_world << EOD7
#!/bin/sh
#ulimit -c 99999999
while true
do
./world "$@"
if [ -r ".world_shutdown" ]; then
exit 0
fi
echo `date` "World crashed." >>crashlog
sleep 2
done
EOD7
for a in persist_world start stop ; do chmod +x $a ; done
mkdir logs
cat << EOD | more
Things you still have to do:
- create/edit your eqemu_config.xml
- copy your spells_en.txt and spells_us.txt to the server folder
- Run the 4 "get" scripts in the eqemu directory.
This can take a long time, especially the maps...
- Build the server
- Source the database
- edit the start and stop scripts to reflect which login server you use
Once all thats done, change to the ${EMUDIR}/server and run
start
to start the server and
stop
to stop it. Check your logfiles in ${EMUDIR}/server/logs.
EOD
echo Exiting
exit
fi
mkdir $EMUDIR
cd $EMUDIR
cat > getEqemu << EOD1
#!/bin/bash
svn checkout http://projecteqemu.googlecode.com/svn/trunk/ projecteqemu-read-only
EOD1
cat > getEQmaps << EOD2
#!/bin/bash
svn checkout http://eqemumaps.googlecode.com/svn/trunk/ eqemumaps-read-only
EOD2
cat > getPEQdb << EOD3
#!/bin/bash
svn checkout http://projecteqdb.googlecode.com/svn/trunk/ projecteqdb-current-only
EOD3
cat > getQuest << EOD4
#!/bin/bash
svn checkout http://projecteqquests.googlecode.com/svn/trunk/ projecteqquests-read-only
EOD4
mkdir server
for s in getEQmaps getPEQdb getQuest getEqemu ; do chmod +x $s ; done
cd server
ln -s ../projecteqemu-read-only/EQEmuServer/ source
targets="source/chatserver/chatserver source/utils/cleanipc source/utils/defaults/eqemu_config.xml.full source/eqlaunch/eqlaunch \
source/EMuShareMem/libEMuShareMem.so source/utils/defaults/log.ini source/utils/mail_opcodes.conf source/mailserver/mailserver \
../eqemumaps-read-only/Maps source/utils/defaults/mime.types source/utils/opcodes.conf source/utils/patch_6.2.conf source/utils \
/patch_Anniversary.conf source/utils/patch_Live.conf source/utils/patch_SoF.conf source/utils/patch_Titanium.conf \
source/utils/defaults/plugin.pl ../projecteqquests-read-only/quests/plugins ../projecteqquests-read-only/quests \
source/utils/defaults/templates source/world/world source/utils/defaults/worldui source/utils/defaults/worldui.pl source/zone/zone"
for foo in $targets ; do
ln -s $foo `basename $foo `
done
echo
echo the start and stop scripts are setup for the Privatelogin server
echo you will want to edit these scripts if you use minilogin or the official
echo login servers
echo
cat > start << EOD5
#!/bin/sh
#ulimit -c 99999999
rm -f .zone_shutdown
rm -f .world_shutdown
set -x
LNAME="zone" #launcher name
if [ "$1" = "test" ]; then
LNAME="test"
fi
# The following are for my setup of the PrivateLogin server
# Those who use minilogin or the new private login server will need
# to modify this to suit -- Kobaz
#cd ../LS
#wine PrivateLogin.exe > logs/PrivateLogin.log &
#cd ../server
P=`pwd`
export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$P"
#make sure we have a place to log
mkdir -p logs 2>&1 > /dev/null
#clear out old logs, if both are stopped
if [ ! -e .lock-zones -a ! -e .lock-world ] ; then
for f in logs/eqemu_*.log
do
if [ "$f" = "logs/eqemu_commands_zone.log" ]; then
continue;
fi
rm -f $f
done
fi
#boot up world
if [ ! -e .lock-world ] ; then
touch .lock-world
# ./world 2>&1 > logs/world &
./persist_world 2>&1 > logs/world &
# wait for shared memory to load
sleep 15
fi
#start up the official launcher
if [ ! -e .lock-launcher ]; then
touch .lock-launcher
./eqlaunch $LNAME 2>&1 > logs/launcher &
fi
./mailserver &
./chatserver &
EOD5
cat > stop << EOD6
#!/bin/sh
touch .zone_shutdown
touch .world_shutdown
#Users of the official private login server or minilogin
#will need to do something different here -- Kobaz
killall wine PrivateLogin.exe world eqlaunch zone mailserver chatserver
killall -9 PrivateLogin.exe
sleep 3
if ps ax|grep -e 'w[o]rld' -e 'z[o]ne' -e 'eq[l]aunch' -e 'mails[e]rver' -e 'cha[t]server' >/dev/null; then
killall -9 world eqlaunch zone mailserver chatserver
sleep 2
fi
./cleanipc
rm -f .lock-zones .lock-world .lock-login .lock-launcher
EOD6
cat > persist_world << EOD7
#!/bin/sh
#ulimit -c 99999999
while true
do
./world "$@"
if [ -r ".world_shutdown" ]; then
exit 0
fi
echo `date` "World crashed." >>crashlog
sleep 2
done
EOD7
for a in persist_world start stop ; do chmod +x $a ; done
mkdir logs
cat << EOD | more
Things you still have to do:
- create/edit your eqemu_config.xml
- copy your spells_en.txt and spells_us.txt to the server folder
- Run the 4 "get" scripts in the eqemu directory.
This can take a long time, especially the maps...
- Build the server
- Source the database
- edit the start and stop scripts to reflect which login server you use
Once all thats done, change to the ${EMUDIR}/server and run
start
to start the server and
stop
to stop it. Check your logfiles in ${EMUDIR}/server/logs.
EOD