diff options
-rw-r--r-- | athena-start | 148 | ||||
-rw-r--r-- | char-server.sh | 32 | ||||
-rw-r--r-- | charserv-sql.bat | 16 | ||||
-rw-r--r-- | charserv.bat | 16 | ||||
-rw-r--r-- | configure | 512 | ||||
-rw-r--r-- | login-server.sh | 32 | ||||
-rw-r--r-- | logserv-sql.bat | 16 | ||||
-rw-r--r-- | logserv.bat | 16 | ||||
-rw-r--r-- | map-server.sh | 32 | ||||
-rw-r--r-- | mapserv-sql.bat | 16 | ||||
-rw-r--r-- | mapserv.bat | 16 | ||||
-rw-r--r-- | object_del.bat | 31 | ||||
-rw-r--r-- | runserver-sql.bat | 16 | ||||
-rw-r--r-- | runserver.bat | 150 | ||||
-rw-r--r-- | start | 70 |
15 files changed, 544 insertions, 575 deletions
diff --git a/athena-start b/athena-start index e9d3865f1..742145604 100644 --- a/athena-start +++ b/athena-start @@ -1,74 +1,74 @@ -#!/bin/sh
-# athena starting script by rowla
-# modified by shazeya@syafi.com (NL101541)
-
-PATH=./:$PATH
-
-L_SRV=login-server_sql
-C_SRV=char-server_sql
-M_SRV=map-server_sql
-
-print_start() {
-# more << EOF
-echo "Athena Starting..."
-echo " (c) 2003 Athena Project"
-echo " modified by shazeya@syafi.com"
-echo ""
-#echo "Debug informations will appear,"
-#echo "since this is a test release."
-#echo ""
-echo "checking..."
-#EOF
-}
-
-#check_account() {
-# if [ ! -f ./save/account.txt ]; then
-# echo "0 s1 p1 - S 0" > save/account.txt
-# echo "1 s2 p2 - S 0" >>save/account.txt
-# echo "2 s3 p3 - S 0" >>save/account.txt
-# echo "3 s4 p4 - S 0" >>save/account.txt
-# echo "4 s5 p5 - S 0" >>save/account.txt
-# fi
-#}
-
-check_files() {
-
- for i in ${L_SRV} ${C_SRV} ${M_SRV}
- do
- if [ ! -f ./$i ]; then
- echo "$i does not exist, or can't run."
- echo "Stop. Check your compile."
- exit 1;
- fi
- done
-
-# more << EOF
-echo "Check complete."
-echo "Looks good, a nice Athena!"
-#EOF
-}
-
-
-case $1 in
- 'start')
- print_start
-# check_account
- check_files
-
- exec ./${L_SRV}&
- exec ./${C_SRV}&
- exec ./${M_SRV}&
-
- echo "Now Started Athena."
-;;
- 'stop')
- ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9
-;;
- 'restart')
- $0 stop
- $0 start
-;;
- *)
- echo "Usage: athena-start { start | stop | restart }"
-;;
-esac
+#!/bin/sh +# athena starting script by rowla +# modified by shazeya@syafi.com (NL101541) + +PATH=./:$PATH + +L_SRV=login-server_sql +C_SRV=char-server_sql +M_SRV=map-server_sql + +print_start() { +# more << EOF +echo "Athena Starting..." +echo " (c) 2003 Athena Project" +echo " modified by shazeya@syafi.com" +echo "" +#echo "Debug informations will appear," +#echo "since this is a test release." +#echo "" +echo "checking..." +#EOF +} + +#check_account() { +# if [ ! -f ./save/account.txt ]; then +# echo "0 s1 p1 - S 0" > save/account.txt +# echo "1 s2 p2 - S 0" >>save/account.txt +# echo "2 s3 p3 - S 0" >>save/account.txt +# echo "3 s4 p4 - S 0" >>save/account.txt +# echo "4 s5 p5 - S 0" >>save/account.txt +# fi +#} + +check_files() { + + for i in ${L_SRV} ${C_SRV} ${M_SRV} + do + if [ ! -f ./$i ]; then + echo "$i does not exist, or can't run." + echo "Stop. Check your compile." + exit 1; + fi + done + +# more << EOF +echo "Check complete." +echo "Looks good, a nice Athena!" +#EOF +} + + +case $1 in + 'start') + print_start +# check_account + check_files + + exec ./${L_SRV}& + exec ./${C_SRV}& + exec ./${M_SRV}& + + echo "Now Started Athena." +;; + 'stop') + ps ax | grep -E "${L_SRV}|${C_SRV}|${M_SRV}" | awk '{print $1}' | xargs kill -9 +;; + 'restart') + $0 stop + $0 start +;; + *) + echo "Usage: athena-start { start | stop | restart }" +;; +esac diff --git a/char-server.sh b/char-server.sh index 39c1882ad..6cddf373c 100644 --- a/char-server.sh +++ b/char-server.sh @@ -1,16 +1,16 @@ -#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 3 ] ; do
-if [ -f .stopserver3 ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./char-server
-fi
-
-sleep 5
-
-done
+#/bin/sh +#Hi my naem is Kirt and I liek anime + +ulimit -Sc unlimited + +while [ 3 ] ; do +if [ -f .stopserver3 ] ; then +echo server marked down >> servlog.txt +else +echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt +./char-server +fi + +sleep 5 + +done diff --git a/charserv-sql.bat b/charserv-sql.bat index 894db5dc5..90b58b205 100644 --- a/charserv-sql.bat +++ b/charserv-sql.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-char-server_sql.exe
-echo .
-echo .
-echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +char-server_sql.exe +echo . +echo . +echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file diff --git a/charserv.bat b/charserv.bat index 29d03a3a4..cda0f4eb4 100644 --- a/charserv.bat +++ b/charserv.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-char-server.exe
-echo .
-echo .
-echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +char-server.exe +echo . +echo . +echo Char server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file @@ -1,256 +1,256 @@ -#!/bin/bash
-## NOTE:
-## I know this is not a clean way to check for some stuff
-## and edit the Makefile, but hey, it does work!
-
-# Configure script for eAthena
-# Copyright (C) 2005 dontBR
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-# Default variables
-status_mmx="No"
-status_sse="No"
-status_sse2="No"
-status_sse3="No"
-status_pcre="No"
-prefix='/opt/eathena/'
-
-# Functions
-function check_sed {
- echo -n "Checking for sed... "
- if [ -f $(which sed) ]; then
- echo "yes"
- else
- echo "Error: sed not found in $PATH"
- exit 1
- fi
-}
-
-function check_gcc {
- echo -n "Checking for gcc... "
- if [ -f $(which gcc) ]; then
- echo "yes"
- else
- echo "Error: GCC not found in $PATH"
- exit 1
- fi
-}
-
-function check_make {
- echo -n "Checking for (g)make... "
- if [ -f $(which make) ]; then
- maker=make
- echo "yes"
- else if [ -f $(which gmake) ]; then
- maker=gmake
- echo "yes"
- else
- echo "Error: (g)make not found in $PATH"
- exit 1
- fi
- fi
-}
-
-function check_sockets {
- echo -n "Checking for sockets... "
- echo "#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-int main(){
-}" > test_sockets.c
- if $(gcc test_sockets.c -o test_sockets); then
- echo "yes"
- rm -f test_sockets.c test_sockets
- else
- echo "Error: Unix sockets not found/working."
- exit 1
- rm -f test_sockets.c
- fi
-}
-
-function check_mysql_headers {
- echo -n "Checking for MySQL headers... "
- if [ -d /usr/local/lib/mysql ]; then # Default
- echo "yes"
- mysql_headers_path='/usr/local/lib/mysql'
- else
- if [ -d /usr/include/mysql ]; then # Gentoo/Debian/?
- echo "yes"
- mysql_headers_path='/usr/include/mysql'
- else
- echo "Error: MySQL headers not found."
- mysql_headers_path='Not found.'
- fi
- fi
-}
-
-function optimize {
- case $@ in
- mmx ) status_mmx="Yes" ;;
- sse ) status_sse="Yes" ;;
- sse2 ) status_sse2="Yes" ;;
- sse3 ) status_sse3="Yes" ;;
- all ) status_mmx="Yes"
- status_sse="Yes"
- status_sse2="Yes"
- status_sse3="Yes" ;;
- esac
-}
-
-function make_changes {
- if [ "$maker" != "make" ]; then
- sed -e 's,MAKE = make,MAKE = '$maker',g' Makefile -i
- fi
- if [ "$status_mmx" = "Yes" ]; then
- sed -e 's,# OPT += -mmmx,OPT += -mmmx,g' Makefile -i
- fi
- if [ "$status_sse" = "Yes" ]; then
- sed -e 's,# OPT += -msse,OPT += -msse,g' Makefile -i
- fi
- if [ "$status_sse2" = "Yes" ]; then
- sed -e 's,# OPT += -msse2,OPT += -msse2,g' Makefile -i
- fi
- if [ "$status_sse3" = "Yes" ]; then
- sed -e 's,# OPT += -msse3,OPT += -msse3,g' Makefile -i
- fi
- if [ "$status_pcre" = "Yes" ]; then
- sed -e 's,# OPT += -DPCRE_SUPPORT,OPT += -DPCRE_SUPPORT,g' Makefile -i
- fi
- if [ "$mysql_headers_path" != "/usr/local/lib/mysql" ] && [ "$mysql_headers_path" != "Not found." ]; then
- sed -e 's,LIBS += -L/usr/local/lib/mysql -lmysqlclient,LIBS += -L'$mysql_headers_path' -lmysqlclient,g' Makefile -i
- fi
-}
-
-function opt_check_pcre {
- echo -n "Checking for PCRE... "
- if [ -f /usr/local/lib/pcre.h ]; then
- echo "yes"
- status_pcre="Yes"
- else
- echo "Error: PCRE not found."
- status_pcre="No"
- fi
-}
-
-function make_report {
- echo "Configuration report:"
- echo eAthena
-
- echo
- echo Enable PCRE support..... : $status_pcre
- echo
- echo Enable MMX optimization. : $status_mmx
- echo Enable SSE optimization. : $status_sse
- echo Enable SSE2 optimization : $status_sse2
- echo Enable SSE3 optimization : $status_sse3
- echo
- echo MySQL headers path...... : $mysql_headers_path
- echo
- echo eAthena will be installed in $prefix
- echo Please type \'make txt\' or \'make sql\' now to compile eAthena.
-}
-
-function helptext {
- echo "eAthena Configure Script version 0.1"
- echo
- echo "Options:"
- echo
- echo " -h Display this help message and exit."
- echo " -d Enter debug mode."
- echo " -o Turn on optimization flags."
- echo " Supported:"
- echo " mmx"
- echo " sse"
- echo " sse2"
- echo " sse3"
- echo " all"
- echo " -e Enable PCRE support."
- echo " -p Root directory where eA is going to be installed."
- echo " DON'T FORGET THE LAST SLASH!"
- echo " For example:"
- echo " ./configure -p /usr/local/"
- echo " This will create /usr/local/bin/login-server,"
- echo " /usr/local/etc/eathena/save/account.txt, etc"
- echo " Default is /opt/eathena/"
- echo
- echo "Report bugs (about the configure script) to dontBR at the eAthena Support Board."
-}
-
-function make_installable {
- echo -e '' >> Makefile
- echo -e 'install: conf/%.conf conf/%.txt' >> Makefile
- echo -e ' $(shell mkdir -p '$prefix'bin/)' >> Makefile
- echo -e ' $(shell mkdir -p '$prefix'etc/eathena/)' >> Makefile
- echo -e ' $(shell mkdir -p '$prefix'var/log/eathena/)' >> Makefile
- echo -e ' $(shell mv save '$prefix'etc/eathena/save)' >> Makefile
- echo -e ' $(shell mv db '$prefix'etc/eathena/db)' >> Makefile
- echo -e ' $(shell mv conf '$prefix'etc/eathena/conf)' >> Makefile
- echo -e ' $(shell mv npc '$prefix'etc/eathena/npc)' >> Makefile
- echo -e ' $(shell mv log/* '$prefix'var/log/eathena/)' >> Makefile
- echo -e ' $(shell cp *-server* '$prefix'bin/)' >> Makefile
- echo -e ' $(shell cp ladmin '$prefix'bin/)' >> Makefile
- echo -e ' $(shell ln -s '$prefix'etc/eathena/save/ '$prefix'bin/)' >> Makefile
- echo -e ' $(shell ln -s '$prefix'etc/eathena/db/ '$prefix'bin/)' >> Makefile
- echo -e ' $(shell ln -s '$prefix'etc/eathena/conf/ '$prefix'bin/)' >> Makefile
- echo -e ' $(shell ln -s '$prefix'etc/eathena/npc/ '$prefix'bin/)' >> Makefile
- echo -e ' $(shell ln -s '$prefix'var/log/eathena/ '$prefix'bin/log)' >> Makefile
- echo '' >> Makefile
- echo -e 'bin-clean:' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/login-server*)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/char-server*)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/map-server*)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/ladmin)' >> Makefile
- echo '' >> Makefile
- echo -e 'uninstall:' >> Makefile
- echo -e ' bin-clean' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/save)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/db)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/conf)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/npc)' >> Makefile
- echo -e ' $(shell rm '$prefix'bin/log)' >> Makefile
- echo -e ' $(shell rm -rf '$prefix'etc/eathena)' >> Makefile
- echo -e ' $(shell rm -rf '$prefix'var/log/eathena)' >> Makefile
-}
-
-
-# Arguments
-while getopts ":hdo:ep:" opt; do
- case $opt in
- h ) helptext ; exit ;;
- d ) set -x ;;
- o ) optimize ${OPTARG} ;;
- e ) opt_check_pcre ;;
- p ) prefix=${OPTARG} ; [ -d ${OPTARG} ] || echo "The directory $prefix does not exist. Creating...";;
- esac
-done
-
-
-# Execution
-echo "eAthena configure script"
-echo "Note: This is ALPHA software! Do NOT use it on a production server!"
-echo
-echo "Checking for dependencies.."
-check_sed
-check_gcc
-check_make
-check_sockets
-check_mysql_headers
-make_changes
-make_installable
-echo
-make_report
-exit
+#!/bin/bash +## NOTE: +## I know this is not a clean way to check for some stuff +## and edit the Makefile, but hey, it does work! + +# Configure script for eAthena +# Copyright (C) 2005 dontBR +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + + +# Default variables +status_mmx="No" +status_sse="No" +status_sse2="No" +status_sse3="No" +status_pcre="No" +prefix='/opt/eathena/' + +# Functions +function check_sed { + echo -n "Checking for sed... " + if [ -f $(which sed) ]; then + echo "yes" + else + echo "Error: sed not found in $PATH" + exit 1 + fi +} + +function check_gcc { + echo -n "Checking for gcc... " + if [ -f $(which gcc) ]; then + echo "yes" + else + echo "Error: GCC not found in $PATH" + exit 1 + fi +} + +function check_make { + echo -n "Checking for (g)make... " + if [ -f $(which make) ]; then + maker=make + echo "yes" + else if [ -f $(which gmake) ]; then + maker=gmake + echo "yes" + else + echo "Error: (g)make not found in $PATH" + exit 1 + fi + fi +} + +function check_sockets { + echo -n "Checking for sockets... " + echo "#include <sys/types.h> +#include <sys/socket.h> +#include <netinet/in.h> +int main(){ +}" > test_sockets.c + if $(gcc test_sockets.c -o test_sockets); then + echo "yes" + rm -f test_sockets.c test_sockets + else + echo "Error: Unix sockets not found/working." + exit 1 + rm -f test_sockets.c + fi +} + +function check_mysql_headers { + echo -n "Checking for MySQL headers... " + if [ -d /usr/local/lib/mysql ]; then # Default + echo "yes" + mysql_headers_path='/usr/local/lib/mysql' + else + if [ -d /usr/include/mysql ]; then # Gentoo/Debian/? + echo "yes" + mysql_headers_path='/usr/include/mysql' + else + echo "Error: MySQL headers not found." + mysql_headers_path='Not found.' + fi + fi +} + +function optimize { + case $@ in + mmx ) status_mmx="Yes" ;; + sse ) status_sse="Yes" ;; + sse2 ) status_sse2="Yes" ;; + sse3 ) status_sse3="Yes" ;; + all ) status_mmx="Yes" + status_sse="Yes" + status_sse2="Yes" + status_sse3="Yes" ;; + esac +} + +function make_changes { + if [ "$maker" != "make" ]; then + sed -e 's,MAKE = make,MAKE = '$maker',g' Makefile -i + fi + if [ "$status_mmx" = "Yes" ]; then + sed -e 's,# OPT += -mmmx,OPT += -mmmx,g' Makefile -i + fi + if [ "$status_sse" = "Yes" ]; then + sed -e 's,# OPT += -msse,OPT += -msse,g' Makefile -i + fi + if [ "$status_sse2" = "Yes" ]; then + sed -e 's,# OPT += -msse2,OPT += -msse2,g' Makefile -i + fi + if [ "$status_sse3" = "Yes" ]; then + sed -e 's,# OPT += -msse3,OPT += -msse3,g' Makefile -i + fi + if [ "$status_pcre" = "Yes" ]; then + sed -e 's,# OPT += -DPCRE_SUPPORT,OPT += -DPCRE_SUPPORT,g' Makefile -i + fi + if [ "$mysql_headers_path" != "/usr/local/lib/mysql" ] && [ "$mysql_headers_path" != "Not found." ]; then + sed -e 's,LIBS += -L/usr/local/lib/mysql -lmysqlclient,LIBS += -L'$mysql_headers_path' -lmysqlclient,g' Makefile -i + fi +} + +function opt_check_pcre { + echo -n "Checking for PCRE... " + if [ -f /usr/local/lib/pcre.h ]; then + echo "yes" + status_pcre="Yes" + else + echo "Error: PCRE not found." + status_pcre="No" + fi +} + +function make_report { + echo "Configuration report:" + echo eAthena + + echo + echo Enable PCRE support..... : $status_pcre + echo + echo Enable MMX optimization. : $status_mmx + echo Enable SSE optimization. : $status_sse + echo Enable SSE2 optimization : $status_sse2 + echo Enable SSE3 optimization : $status_sse3 + echo + echo MySQL headers path...... : $mysql_headers_path + echo + echo eAthena will be installed in $prefix + echo Please type \'make txt\' or \'make sql\' now to compile eAthena. +} + +function helptext { + echo "eAthena Configure Script version 0.1" + echo + echo "Options:" + echo + echo " -h Display this help message and exit." + echo " -d Enter debug mode." + echo " -o Turn on optimization flags." + echo " Supported:" + echo " mmx" + echo " sse" + echo " sse2" + echo " sse3" + echo " all" + echo " -e Enable PCRE support." + echo " -p Root directory where eA is going to be installed." + echo " DON'T FORGET THE LAST SLASH!" + echo " For example:" + echo " ./configure -p /usr/local/" + echo " This will create /usr/local/bin/login-server," + echo " /usr/local/etc/eathena/save/account.txt, etc" + echo " Default is /opt/eathena/" + echo + echo "Report bugs (about the configure script) to dontBR at the eAthena Support Board." +} + +function make_installable { + echo -e '' >> Makefile + echo -e 'install: conf/%.conf conf/%.txt' >> Makefile + echo -e ' $(shell mkdir -p '$prefix'bin/)' >> Makefile + echo -e ' $(shell mkdir -p '$prefix'etc/eathena/)' >> Makefile + echo -e ' $(shell mkdir -p '$prefix'var/log/eathena/)' >> Makefile + echo -e ' $(shell mv save '$prefix'etc/eathena/save)' >> Makefile + echo -e ' $(shell mv db '$prefix'etc/eathena/db)' >> Makefile + echo -e ' $(shell mv conf '$prefix'etc/eathena/conf)' >> Makefile + echo -e ' $(shell mv npc '$prefix'etc/eathena/npc)' >> Makefile + echo -e ' $(shell mv log/* '$prefix'var/log/eathena/)' >> Makefile + echo -e ' $(shell cp *-server* '$prefix'bin/)' >> Makefile + echo -e ' $(shell cp ladmin '$prefix'bin/)' >> Makefile + echo -e ' $(shell ln -s '$prefix'etc/eathena/save/ '$prefix'bin/)' >> Makefile + echo -e ' $(shell ln -s '$prefix'etc/eathena/db/ '$prefix'bin/)' >> Makefile + echo -e ' $(shell ln -s '$prefix'etc/eathena/conf/ '$prefix'bin/)' >> Makefile + echo -e ' $(shell ln -s '$prefix'etc/eathena/npc/ '$prefix'bin/)' >> Makefile + echo -e ' $(shell ln -s '$prefix'var/log/eathena/ '$prefix'bin/log)' >> Makefile + echo '' >> Makefile + echo -e 'bin-clean:' >> Makefile + echo -e ' $(shell rm '$prefix'bin/login-server*)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/char-server*)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/map-server*)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/ladmin)' >> Makefile + echo '' >> Makefile + echo -e 'uninstall:' >> Makefile + echo -e ' bin-clean' >> Makefile + echo -e ' $(shell rm '$prefix'bin/save)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/db)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/conf)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/npc)' >> Makefile + echo -e ' $(shell rm '$prefix'bin/log)' >> Makefile + echo -e ' $(shell rm -rf '$prefix'etc/eathena)' >> Makefile + echo -e ' $(shell rm -rf '$prefix'var/log/eathena)' >> Makefile +} + + +# Arguments +while getopts ":hdo:ep:" opt; do + case $opt in + h ) helptext ; exit ;; + d ) set -x ;; + o ) optimize ${OPTARG} ;; + e ) opt_check_pcre ;; + p ) prefix=${OPTARG} ; [ -d ${OPTARG} ] || echo "The directory $prefix does not exist. Creating...";; + esac +done + + +# Execution +echo "eAthena configure script" +echo "Note: This is ALPHA software! Do NOT use it on a production server!" +echo +echo "Checking for dependencies.." +check_sed +check_gcc +check_make +check_sockets +check_mysql_headers +make_changes +make_installable +echo +make_report +exit diff --git a/login-server.sh b/login-server.sh index e37645ed5..b658a3e35 100644 --- a/login-server.sh +++ b/login-server.sh @@ -1,16 +1,16 @@ -#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 2 ] ; do
-if [ -f .stopserver2 ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./login-server
-fi
-
-sleep 5
-
-done
+#/bin/sh +#Hi my naem is Kirt and I liek anime + +ulimit -Sc unlimited + +while [ 2 ] ; do +if [ -f .stopserver2 ] ; then +echo server marked down >> servlog.txt +else +echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt +./login-server +fi + +sleep 5 + +done diff --git a/logserv-sql.bat b/logserv-sql.bat index 15f57fb45..3280c4095 100644 --- a/logserv-sql.bat +++ b/logserv-sql.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-login-server_sql.exe
-echo .
-echo .
-echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +login-server_sql.exe +echo . +echo . +echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file diff --git a/logserv.bat b/logserv.bat index 945c59c36..9ea82e4c0 100644 --- a/logserv.bat +++ b/logserv.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-login-server.exe
-echo .
-echo .
-echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +login-server.exe +echo . +echo . +echo Login server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file diff --git a/map-server.sh b/map-server.sh index f66e9f1c5..04a635463 100644 --- a/map-server.sh +++ b/map-server.sh @@ -1,16 +1,16 @@ -#/bin/sh
-#Hi my naem is Kirt and I liek anime
-
-ulimit -Sc unlimited
-
-while [ 1 ] ; do
-if [ -f .stopserver ] ; then
-echo server marked down >> servlog.txt
-else
-echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt
-./map-server
-fi
-
-sleep 5
-
-done
+#/bin/sh +#Hi my naem is Kirt and I liek anime + +ulimit -Sc unlimited + +while [ 1 ] ; do +if [ -f .stopserver ] ; then +echo server marked down >> servlog.txt +else +echo restarting server at time at `date +"%m-%d-%H:%M-%S"`>> startlog.txt +./map-server +fi + +sleep 5 + +done diff --git a/mapserv-sql.bat b/mapserv-sql.bat index 78a9179c9..ae65d3be3 100644 --- a/mapserv-sql.bat +++ b/mapserv-sql.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-map-server_sql.exe
-echo .
-echo .
-echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +map-server_sql.exe +echo . +echo . +echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file diff --git a/mapserv.bat b/mapserv.bat index 813cbd110..d9eee9f6e 100644 --- a/mapserv.bat +++ b/mapserv.bat @@ -1,9 +1,9 @@ -@echo off
-rem Writen by Jbain
-:end
-map-server.exe
-echo .
-echo .
-echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart!
-PING -n 15 127.0.0.1 >nul
+@echo off +rem Writen by Jbain +:end +map-server.exe +echo . +echo . +echo Map server crashed! restarting in 15 seconds! press ctl+C to cancel restart! +PING -n 15 127.0.0.1 >nul goto end
\ No newline at end of file diff --git a/object_del.bat b/object_del.bat deleted file mode 100644 index b2c3c46ef..000000000 --- a/object_del.bat +++ /dev/null @@ -1,31 +0,0 @@ -@echo off
-echo Y | del src\char\*.o
-echo Y | del src\char\GNUmakefile
-echo Y | del src\char_sql\*.o
-echo Y | del src\char_sql\GNUmakefile
-echo Y | del src\common\obj\*.o
-echo Y | rmdir src\common\obj
-echo Y | del src\common\GNUmakefile
-echo Y | del src\ladmin\GNUmakefile
-echo Y | del src\login\*.o
-echo Y | del src\login\GNUmakefile
-echo Y | del src\login_sql\*.o
-echo Y | del src\login_sql\GNUmakefile
-echo Y | del src\map\txtobj\*.o
-echo Y | rmdir src\map\txtobj
-echo Y | del src\map\sqlobj\*.o
-echo Y | rmdir src\map\sqlobj
-echo Y | del src\map\GNUmakefile
-echo Y | del src\txt-converter\char\GNUmakefile
-echo Y | del src\txt-converter\char\*.o
-echo Y | del src\txt-converter\login\GNUmakefile
-echo Y | del src\txt-converter\login\*.o
-echo Y | del char-converter.exe
-echo Y | del char-server.exe
-echo Y | del char-server_sql.exe
-echo Y | del ladmin.exe
-echo Y | del login-converter.exe
-echo Y | del login-server.exe
-echo Y | del login-server_sql.exe
-echo Y | del map-server.exe
-echo Y | del map-server_sql.exe
\ No newline at end of file diff --git a/runserver-sql.bat b/runserver-sql.bat index 57d6fa1b8..f424a205a 100644 --- a/runserver-sql.bat +++ b/runserver-sql.bat @@ -1,8 +1,8 @@ -@echo off
-rem This is and auto-restart script for the eAthena Ragnarok Online Server Emulator.
-rem It will also keep the map server OPEN after it crashes to that errors may be
-rem more easily identified
-rem Writen by Jbain
-start cmd /k logserv-sql.bat
-start cmd /k charserv-sql.bat
-start cmd /k mapserv-sql.bat
+@echo off +rem This is and auto-restart script for the eAthena Ragnarok Online Server Emulator. +rem It will also keep the map server OPEN after it crashes to that errors may be +rem more easily identified +rem Writen by Jbain +start cmd /k logserv-sql.bat +start cmd /k charserv-sql.bat +start cmd /k mapserv-sql.bat diff --git a/runserver.bat b/runserver.bat index 4fc66edc9..553274013 100644 --- a/runserver.bat +++ b/runserver.bat @@ -1,75 +1,75 @@ -@echo off
-
-rem ----- Configuration -----
- rem Defines the server type (txt or sql).
- set SERVER_TYPE=txt
- rem Defines how long to wait before restarting (in seconds).
- set SLEEP_TIME=15
- rem Defines whether to run all servers in one window (yes or no).
- set SINGLE_WINDOW=no
-rem ----- ------------- -----
-
-:L_Init
- set this=%0
- if %SERVER_TYPE% == txt set suffix=
- if %SERVER_TYPE% == sql set suffix=_sql
- if %SINGLE_WINDOW% == yes set wndswitch=/B
-
-:L_Main
- set command=%1
- if "%command%" == "" goto L_DefaultAction
-
- if %command% == exec goto L_ExecServerExe
- if %command% == start goto L_StartServerExe
- if %command% == stop goto L_StopServerExe
- if %command% == restart echo "TODO"
- goto L_EOF
-
-:L_DefaultAction
-:L_StartServer
- call %this% start login-server%suffix%.exe
- call %this% start char-server%suffix%.exe
- call %this% start map-server%suffix%.exe
- goto L_EOF
-
-:L_StopServer
- call %this% stop login-server%suffix%.exe
- call %this% stop char-server%suffix%.exe
- call %this% stop map-server%suffix%.exe
- goto L_EOF
-
-:L_StartServerExe
- set filename=%2
- if "%filename%" == "" goto L_StartServer
- if exist %filename% goto L_HaveExe
- echo Cannot start '%filename%' because the file is missing!
- goto L_EOF
-
- :L_HaveExe
- echo Starting %filename%...
- start "%filename%" %wndswitch% %this% exec %filename%
- goto L_EOF
-
-:L_StopServerExe
- set filename=%2
- if "%filename%" == "" goto L_StopServer
- if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill
- echo The 'stop' command is not available on your system.
- exit
-
- :L_HaveTaskKill
- rem CAUTION! This will kill all processes called %filename%.
- echo Stopping '%filename%'...
- taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%"
- taskkill /F /IM "%filename%"
- goto L_EOF
-
-:L_ExecServerExe
- %filename%
- echo .
- echo .
- echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort!
- ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul
- goto L_ExecServerExe
-
-:L_EOF
+@echo off + +rem ----- Configuration ----- + rem Defines the server type (txt or sql). + set SERVER_TYPE=txt + rem Defines how long to wait before restarting (in seconds). + set SLEEP_TIME=15 + rem Defines whether to run all servers in one window (yes or no). + set SINGLE_WINDOW=no +rem ----- ------------- ----- + +:L_Init + set this=%0 + if %SERVER_TYPE% == txt set suffix= + if %SERVER_TYPE% == sql set suffix=_sql + if %SINGLE_WINDOW% == yes set wndswitch=/B + +:L_Main + set command=%1 + if "%command%" == "" goto L_DefaultAction + + if %command% == exec goto L_ExecServerExe + if %command% == start goto L_StartServerExe + if %command% == stop goto L_StopServerExe + if %command% == restart echo "TODO" + goto L_EOF + +:L_DefaultAction +:L_StartServer + call %this% start login-server%suffix%.exe + call %this% start char-server%suffix%.exe + call %this% start map-server%suffix%.exe + goto L_EOF + +:L_StopServer + call %this% stop login-server%suffix%.exe + call %this% stop char-server%suffix%.exe + call %this% stop map-server%suffix%.exe + goto L_EOF + +:L_StartServerExe + set filename=%2 + if "%filename%" == "" goto L_StartServer + if exist %filename% goto L_HaveExe + echo Cannot start '%filename%' because the file is missing! + goto L_EOF + + :L_HaveExe + echo Starting %filename%... + start "%filename%" %wndswitch% %this% exec %filename% + goto L_EOF + +:L_StopServerExe + set filename=%2 + if "%filename%" == "" goto L_StopServer + if exist %windir%\system32\taskkill.exe goto L_HaveTaskKill + echo The 'stop' command is not available on your system. + exit + + :L_HaveTaskKill + rem CAUTION! This will kill all processes called %filename%. + echo Stopping '%filename%'... + taskkill /F /FI "WINDOWTITLE eq %filename% - %this% exec %filename%" + taskkill /F /IM "%filename%" + goto L_EOF + +:L_ExecServerExe + %filename% + echo . + echo . + echo Server exited, restarting in %SLEEP_TIME% seconds! Press CTRL+C to abort! + ping.exe -n %SLEEP_TIME% 127.0.0.1 > nul + goto L_ExecServerExe + +:L_EOF @@ -1,35 +1,35 @@ -#!/bin/bash
-# modified by shazeya@syafi.com (NL130240)
-
-./athena-start start
-sleep 30
-
-while [ true ]; do
- if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
-# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
- [ " 0" = "$(ps | grep -e char | wc -l)" ] ||
- [ " 0" = "$(ps | grep -e map | wc -l)" ]; then
- printf "Error:"
- date
- sleep 10
- printf "Checking:"
- date
- if [ " 0" = "$(ps | grep -e log | wc -l)" ] ||
-# if [ " 0" = "$(ps | grep -e login | wc -l)" ] ||
- [ " 0" = "$(ps | grep -e char | wc -l)" ] ||
- [ " 0" = "$(ps | grep -e map | wc -l)" ]; then
- printf "Error Confirmation:"
- date
- printf "Restoration:"
- date
- ./athena-start start
- else
- printf "Check Miss Sorry:"
- date
- fi
-# else
-# printf "Check OK:"
-# date
- fi
- sleep 10
-done
+#!/bin/bash +# modified by shazeya@syafi.com (NL130240) + +./athena-start start +sleep 30 + +while [ true ]; do + if [ " 0" = "$(ps | grep -e log | wc -l)" ] || +# if [ " 0" = "$(ps | grep -e login | wc -l)" ] || + [ " 0" = "$(ps | grep -e char | wc -l)" ] || + [ " 0" = "$(ps | grep -e map | wc -l)" ]; then + printf "Error:" + date + sleep 10 + printf "Checking:" + date + if [ " 0" = "$(ps | grep -e log | wc -l)" ] || +# if [ " 0" = "$(ps | grep -e login | wc -l)" ] || + [ " 0" = "$(ps | grep -e char | wc -l)" ] || + [ " 0" = "$(ps | grep -e map | wc -l)" ]; then + printf "Error Confirmation:" + date + printf "Restoration:" + date + ./athena-start start + else + printf "Check Miss Sorry:" + date + fi +# else +# printf "Check OK:" +# date + fi + sleep 10 +done |