diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-10 00:45:07 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-10 00:45:07 -0300 |
commit | c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe (patch) | |
tree | 742dd839971d2aab1f08fd0291af66e6439646ab /localserver | |
download | tools-c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe.tar.gz tools-c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe.tar.bz2 tools-c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe.tar.xz tools-c6095ad062eaa0f5576cfab1c4fe436b90c2fbfe.zip |
Add initial tools
Diffstat (limited to 'localserver')
-rw-r--r-- | localserver/.gitignore | 1 | ||||
-rw-r--r-- | localserver/README | 14 | ||||
-rwxr-xr-x | localserver/build.sh | 6 | ||||
-rwxr-xr-x | localserver/buildasan.sh | 5 | ||||
-rwxr-xr-x | localserver/checktime.sh | 9 | ||||
-rwxr-xr-x | localserver/clean.sh | 6 | ||||
-rw-r--r-- | localserver/conf/battle.conf | 32 | ||||
-rw-r--r-- | localserver/conf/char-server.conf | 31 | ||||
-rw-r--r-- | localserver/conf/constants.conf | 34 | ||||
-rw-r--r-- | localserver/conf/inter-server.conf | 32 | ||||
-rw-r--r-- | localserver/conf/login-server.conf | 32 | ||||
-rw-r--r-- | localserver/conf/logs.conf | 32 | ||||
-rw-r--r-- | localserver/conf/map-server.conf | 32 | ||||
-rw-r--r-- | localserver/conf/msg_conf.txt | 0 | ||||
-rw-r--r-- | localserver/conf/ports.conf | 8 | ||||
-rw-r--r-- | localserver/conf/script.conf | 32 | ||||
-rw-r--r-- | localserver/conf/socket.conf | 32 | ||||
-rw-r--r-- | localserver/conf/sql_connection.conf | 52 | ||||
-rwxr-xr-x | localserver/givegm.sh | 8 | ||||
-rwxr-xr-x | localserver/initdb.sh | 26 | ||||
-rwxr-xr-x | localserver/installconfigs.sh | 12 | ||||
-rw-r--r-- | localserver/npc/motd-debug-text.txt | 4 | ||||
-rwxr-xr-x | localserver/updateconfigs.sh | 36 | ||||
-rwxr-xr-x | localserver/updatedb.sh | 112 |
24 files changed, 588 insertions, 0 deletions
diff --git a/localserver/.gitignore b/localserver/.gitignore new file mode 100644 index 0000000..ff3de76 --- /dev/null +++ b/localserver/.gitignore @@ -0,0 +1 @@ +versions diff --git a/localserver/README b/localserver/README new file mode 100644 index 0000000..8d1e2a3 --- /dev/null +++ b/localserver/README @@ -0,0 +1,14 @@ +Here located for LOCAL server usage ONLY. +Can be unsecure to use this files in public or production server. + +build.sh - build server from sources with most compilers. +buildasan.sh - build server from sources with asan flags enabled. +clean.sh - remove all built and temp files. +givegm.sh - give gm rights to first account created on server. +initdb.sh - initialize mariadb database. +installconfigs.sh - install configurations into server data directory. +updatedb.sh - update if need sql database +updateconfigs.sh - update if need server data configuration + +See also http://wiki.evolonline.org/guidelines/installmariadb + http://wiki.evolonline.org/guidelines/localserver diff --git a/localserver/build.sh b/localserver/build.sh new file mode 100755 index 0000000..c19d10b --- /dev/null +++ b/localserver/build.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +export DIR=`pwd` +./checktime.sh +source ./clean.sh +./build.sh old > /dev/null diff --git a/localserver/buildasan.sh b/localserver/buildasan.sh new file mode 100755 index 0000000..5c6d9f7 --- /dev/null +++ b/localserver/buildasan.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +export DIR=`pwd` +source ./clean.sh +./build.sh diff --git a/localserver/checktime.sh b/localserver/checktime.sh new file mode 100755 index 0000000..9ca0c95 --- /dev/null +++ b/localserver/checktime.sh @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +year=$(date "+%Y") + +if [[ $year -lt 2017 ]]; then + date + echo "Error: Date time is wrong. Please fix time. See man date" + exit 1 +fi
\ No newline at end of file diff --git a/localserver/clean.sh b/localserver/clean.sh new file mode 100755 index 0000000..134f5cb --- /dev/null +++ b/localserver/clean.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +rm -rf ../../server-code/src/evol/build/ +mkdir ../../server-code/src/evol/build/ +cd ../../server-code/ +make clean diff --git a/localserver/conf/battle.conf b/localserver/conf/battle.conf new file mode 100644 index 0000000..ff05022 --- /dev/null +++ b/localserver/conf/battle.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Battle local configuration file. +//========================================================================= + +battle_configuration: { + // See conf/map/battle.conf for details +} diff --git a/localserver/conf/char-server.conf b/localserver/conf/char-server.conf new file mode 100644 index 0000000..448b8d1 --- /dev/null +++ b/localserver/conf/char-server.conf @@ -0,0 +1,31 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Character Server local configuration file. +//========================================================================= + +min_char_class: 0 +max_char_class: 6 diff --git a/localserver/conf/constants.conf b/localserver/conf/constants.conf new file mode 100644 index 0000000..d2f4046 --- /dev/null +++ b/localserver/conf/constants.conf @@ -0,0 +1,34 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2016 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Battle local configuration file. +//========================================================================= + +// set to 0 for production, 1 for development +debug: 0 + +// set to 1 if the server uses tmw-vault +SERVER_USES_VAULT: 0 diff --git a/localserver/conf/inter-server.conf b/localserver/conf/inter-server.conf new file mode 100644 index 0000000..9cd3932 --- /dev/null +++ b/localserver/conf/inter-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Inter Server local configuration file. +//========================================================================= + +inter_configuration: { + // See conf/common/inter-server.conf +} diff --git a/localserver/conf/login-server.conf b/localserver/conf/login-server.conf new file mode 100644 index 0000000..c8f1f85 --- /dev/null +++ b/localserver/conf/login-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Login Server local configuration file. +//========================================================================= + +login_configuration: { + // See conf/login/login-server.conf for details +} diff --git a/localserver/conf/logs.conf b/localserver/conf/logs.conf new file mode 100644 index 0000000..47e5a66 --- /dev/null +++ b/localserver/conf/logs.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Log local configuration file. +//========================================================================= + +map_log: { + // See conf/map/logs.conf for details +} diff --git a/localserver/conf/map-server.conf b/localserver/conf/map-server.conf new file mode 100644 index 0000000..11e4356 --- /dev/null +++ b/localserver/conf/map-server.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Map Server local configuration file. +//========================================================================= + +map_configuration: { + // See conf/map/map-server.conf for details +} diff --git a/localserver/conf/msg_conf.txt b/localserver/conf/msg_conf.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/localserver/conf/msg_conf.txt diff --git a/localserver/conf/ports.conf b/localserver/conf/ports.conf new file mode 100644 index 0000000..7d5481e --- /dev/null +++ b/localserver/conf/ports.conf @@ -0,0 +1,8 @@ +// Login server port +login_port: 6901 + +// Character server port +char_port: 6122 + +// Map server port +map_port: 5122 diff --git a/localserver/conf/script.conf b/localserver/conf/script.conf new file mode 100644 index 0000000..042644f --- /dev/null +++ b/localserver/conf/script.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Script local configuration file. +//========================================================================= + +script_configuration: { + // See conf/map/script.conf for details +} diff --git a/localserver/conf/socket.conf b/localserver/conf/socket.conf new file mode 100644 index 0000000..57806f2 --- /dev/null +++ b/localserver/conf/socket.conf @@ -0,0 +1,32 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= Hercules Sockets local configuration file +//========================================================================= + +socket_configuration: { + // See conf/common/socket.conf for details. +} diff --git a/localserver/conf/sql_connection.conf b/localserver/conf/sql_connection.conf new file mode 100644 index 0000000..00edfc0 --- /dev/null +++ b/localserver/conf/sql_connection.conf @@ -0,0 +1,52 @@ +//================= Hercules Configuration ================================ +//= _ _ _ +//= | | | | | | +//= | |_| | ___ _ __ ___ _ _| | ___ ___ +//= | _ |/ _ \ '__/ __| | | | |/ _ \/ __| +//= | | | | __/ | | (__| |_| | | __/\__ \ +//= \_| |_/\___|_| \___|\__,_|_|\___||___/ +//================= License =============================================== +//= This file is part of Hercules. +//= http://herc.ws - http://github.com/HerculesWS/Hercules +//= +//= Copyright (C) 2014-2019 Hercules Dev Team +//= +//= Hercules 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 3 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, see <http://www.gnu.org/licenses/>. +//========================================================================= +//= SQL connection configuration file. +//========================================================================= +// This file affects how ALL server sql connections work, unless explictly +// defined so in the server configuration file (See +// doc/global_configuration.txt for more information). +//========================================================================= + +sql_connection: { + // [INTER] You can specify the codepage to use in your mySQL tables here. + // (Note that this feature requires MySQL 4.1+) + //default_codepage: "" + + // [LOGIN] Is `userid` in account_db case sensitive? + //case_sensitive: false + + // For IPs, ideally under linux, you want to use localhost instead of 127.0.0.1. + // Under windows, you want to use 127.0.0.1. If you see a message like + // "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)" + // and you have localhost, switch it to 127.0.0.1 + db_hostname: "127.0.0.1" + db_port: 3306 + db_username: "evol" + db_password: "evol" + db_database: "evol" + //codepage:"" +} diff --git a/localserver/givegm.sh b/localserver/givegm.sh new file mode 100755 index 0000000..ac9d301 --- /dev/null +++ b/localserver/givegm.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +ID="$1" +if [[ -z "${ID}" ]]; then + mysql -u evol -pevol evol -e "update login set group_id=99 where account_id=2000000;" +else + mysql -u evol -pevol evol -e "update login set group_id=99 where account_id=${ID} or userid='${ID}';" +fi diff --git a/localserver/initdb.sh b/localserver/initdb.sh new file mode 100755 index 0000000..074f8c5 --- /dev/null +++ b/localserver/initdb.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +export DIR="$(pwd)" +export VER=$(cat versions/sqlver 2>/dev/null) + +cd ../../server-data/sql-files + +echo Creating db and user... +echo Enter mysql root password: +mysql --force -u root -p <./init.sql +result=$? +if [ "$result" != 0 ]; then + echo Password failed. Trying with sudo... + sudo mysql --force -u root <./init.sql +fi + +export CMD="mysql -u evol -pevol evol" + +echo Creating tables... +$CMD <main.sql +$CMD <logs.sql + +if [[ -z "${VER}" ]]; then + mkdir ${DIR}/versions + echo "20" >${DIR}/versions/sqlver +fi diff --git a/localserver/installconfigs.sh b/localserver/installconfigs.sh new file mode 100755 index 0000000..398c02a --- /dev/null +++ b/localserver/installconfigs.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +export SD="../../server-data" +export CONF="$SD/conf/import" +export NPC="$SD/npc" + +mkdir $CONF +cp conf/* $CONF +cp -f ${SD}/conf/channels.conf.base ${SD}/conf/channels.conf +cp -f npc/motd-* ${NPC}/commands/ +mkdir versions +echo "5" >versions/confver diff --git a/localserver/npc/motd-debug-text.txt b/localserver/npc/motd-debug-text.txt new file mode 100644 index 0000000..60537fb --- /dev/null +++ b/localserver/npc/motd-debug-text.txt @@ -0,0 +1,4 @@ +function script MOTD_debug_text { + setarray $@Debug_Messages$[0],""; + return; +} diff --git a/localserver/updateconfigs.sh b/localserver/updateconfigs.sh new file mode 100755 index 0000000..8c2688c --- /dev/null +++ b/localserver/updateconfigs.sh @@ -0,0 +1,36 @@ +#!/usr/bin/env bash + +export VER=$(cat versions/confver 2>/dev/null) +export CONFDIR="../../server-data/" + +if [[ -z "${VER}" ]]; then + export VER="0" + mkdir versions +fi + +if [ "${VER}" -lt "1" ]; then + cp -f ${CONFDIR}/conf/channels.conf ${CONFDIR}/conf/channels.conf.bak + cp -f ${CONFDIR}/conf/channels.conf.base ${CONFDIR}/conf/channels.conf +fi + +if [ "${VER}" -lt "2" ]; then + rm ${CONFDIR}/conf/import/*.txt + cp conf/* ${CONFDIR}/conf/import + echo "2" >versions/confver +fi + +if [ "${VER}" -lt "3" ]; then + cp conf/constants.conf ${CONFDIR}/conf/import/ + echo "3" >versions/confver +fi + +if [ "${VER}" -lt "4" ]; then + cp -f npc/motd-* ${CONFDIR}/npc/commands/ + echo "4" >versions/confver +fi + +if [ "${VER}" -lt "5" ]; then + cp -f ${CONFDIR}/conf/channels.conf ${CONFDIR}/conf/channels.conf.bak + cp -f ${CONFDIR}/conf/channels.conf.base ${CONFDIR}/conf/channels.conf + echo "5" >versions/confver +fi diff --git a/localserver/updatedb.sh b/localserver/updatedb.sh new file mode 100755 index 0000000..8278326 --- /dev/null +++ b/localserver/updatedb.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash + +export VER=$(cat versions/sqlver 2>/dev/null) +export SQLDIR="../../server-data/sql-files/upgrades" +export CMD="mysql -u evol -pevol evol" + +function run { + echo "Running $1" + $CMD <${SQLDIR}/$1 +} + +if [[ -z "${VER}" ]]; then + export VER="1" + mkdir versions +fi + +if [ "${VER}" -lt "2" ]; then + run "2015-07-08--13-08.sql" + run "2015-08-27--20-42.sql" +fi + +if [ "${VER}" -lt "3" ]; then + run "2015-12-16--12-57.sql" + run "2015-12-17--15-58.sql" +fi + +if [ "${VER}" -lt "4" ]; then + run "2016-03-10--22-18.sql" +fi + +if [ "${VER}" -lt "5" ]; then + run "2016-07-08--02-42.sql" + run "2016-07-08--02-51.sql" +fi + +if [ "${VER}" -lt "6" ]; then + run "2016-10-03--20-27.sql" +fi + +if [ "${VER}" -lt "7" ]; then + run "2016-10-26--10-29.sql" +fi + +if [ "${VER}" -lt "8" ]; then + run "2017-03-02--11-40.sql" + run "2017-03-05--08-09.sql" +fi + +if [ "${VER}" -lt "9" ]; then + run "2017-03-15--14-29.sql" +fi + +if [ "${VER}" -lt "10" ]; then + run "2017-11-04--10-39.sql" +fi + +if [ "${VER}" -lt "11" ]; then + run "2017-06-04--15-04.sql" + run "2017-06-04--15-05.sql" +fi + +if [ "${VER}" -lt "12" ]; then + run "2018-02-26--15-57.sql" +fi + +if [ "${VER}" -lt "13" ]; then + run "2018-03-10--04-06.sql" +fi + +if [ "${VER}" -lt "14" ]; then + run "2018-06-05--12-02.sql" +fi + +if [ "${VER}" -lt "15" ]; then + run "2018-07-24--03-23.sql" +fi + +if [ "${VER}" -lt "16" ]; then + run "2018-06-03--00-10.sql" + run "2018-06-03--17-16.sql" + run "2018-09-01--05-22.sql" +fi + +if [ "${VER}" -lt "17" ]; then + run "2018-12-14--01-02.sql" + run "2018-12-29--07-51.sql" +fi + +if [ "${VER}" -lt "18" ]; then + run "2019-04-08--21-52.sql" + run "2019-04-25--02-12.sql" +fi + +if [ "${VER}" -lt "19" ]; then + run "2019-05-09--18-07.sql" +fi + +if [ "${VER}" -lt "20" ]; then + run "2019-08-08--19-43.sql" + run "2019-10-05--19-01.sql" + run "2019-10-12--14-21.sql" + run "2019-11-22--23-58.sql" + run "2020-01-24--01-09.sql" + run "2020-03-22--01-56.sql" + run "2020-03-22--03-09.sql" + run "2020-05-01--04-44.sql" + run "2020-05-10--23-11.sql" +fi + +if [ "${VER}" -lt "20" ]; then + echo "20" >versions/sqlver +fi |