summaryrefslogtreecommitdiff
path: root/localserver
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
commitc2ccb14ffff0e45398365e19dfd2874307ddb943 (patch)
tree976eaea586fb8f1ee0ab8cae67c69071aed8b952 /localserver
downloadtools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.gz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.bz2
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.xz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.zip
Initial commit
Diffstat (limited to 'localserver')
-rw-r--r--localserver/.gitignore1
-rw-r--r--localserver/README14
-rw-r--r--localserver/applicator.py45
-rwxr-xr-xlocalserver/build.sh8
-rwxr-xr-xlocalserver/buildasan.sh6
-rwxr-xr-xlocalserver/checktime.sh9
-rwxr-xr-xlocalserver/clean.sh6
-rw-r--r--localserver/conf/battle.conf32
-rw-r--r--localserver/conf/char-server.conf31
-rw-r--r--localserver/conf/constants.conf30
-rw-r--r--localserver/conf/inter-server.conf32
-rw-r--r--localserver/conf/login-server.conf32
-rw-r--r--localserver/conf/logs.conf32
-rw-r--r--localserver/conf/map-server.conf32
-rw-r--r--localserver/conf/msg_conf.txt0
-rw-r--r--localserver/conf/ports.conf8
-rw-r--r--localserver/conf/script.conf32
-rw-r--r--localserver/conf/socket.conf32
-rw-r--r--localserver/conf/sql_connection.conf52
-rwxr-xr-xlocalserver/givegm.sh8
-rwxr-xr-xlocalserver/initdb.sh26
-rwxr-xr-xlocalserver/installconfigs.sh20
-rw-r--r--localserver/npc/006-10_blackbox.txt12
-rw-r--r--localserver/npc/015-8_blackbox.txt27
-rw-r--r--localserver/npc/017-1_stranger_blackbox.txt40
-rw-r--r--localserver/npc/018-7-1_demure_blackbox.txt12
-rw-r--r--localserver/npc/023-4_blackbox.txt36
-rw-r--r--localserver/npc/025-2-4_aegis_blackbox.txt33
-rw-r--r--localserver/npc/botcheck_blackbox.txt35
-rw-r--r--localserver/npc/easteregg_blackbox.txt16
-rw-r--r--localserver/npc/magic_blackbox.txt13
-rw-r--r--localserver/reapply.patch35
-rw-r--r--localserver/reapply.patch447
-rwxr-xr-xlocalserver/rebuild.sh9
-rwxr-xr-xlocalserver/updateconfigs.sh30
-rwxr-xr-xlocalserver/updatedb.sh103
-rwxr-xr-xlocalserver/updater.sh44
37 files changed, 950 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/applicator.py b/localserver/applicator.py
new file mode 100644
index 0000000..beb99a6
--- /dev/null
+++ b/localserver/applicator.py
@@ -0,0 +1,45 @@
+import subprocess
+
+# Open reapply.patch3
+f=open("reapply.patch3", "r")
+subprocess.call("cd ../../server-code", shell=True)
+
+for line in f:
+ if line[0] == "#" or line[0] == "\r" or line[0] == "\n":
+ continue
+ print "Downloading patch "+line.replace("\n", "")
+ subprocess.call("cd ../../server-code ; wget https://gitlab.com/evol/hercules/commit/"+line.replace("\n", "")+".diff", shell=True)
+ print "Applying patch..."
+ #subprocess.call("cd ../../server-code ; ls", shell=True)
+ subprocess.call("cd ../../server-code ; git apply --ignore-whitespace --reject "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch applied"
+ subprocess.call("cd ../../server-code ; rm "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch deleted (success)"
+
+
+f.close()
+print "Evol porting finished"
+
+
+###############################################
+# Open reapply.patch4 (HerculesWS Upstream)
+f=open("reapply.patch4", "r")
+subprocess.call("cd ../../server-code", shell=True)
+
+for line in f:
+ if line[0] == "#" or line[0] == "\r" or line[0] == "\n":
+ continue
+ print "Downloading patch "+line.replace("\n", "")
+ subprocess.call("cd ../../server-code ; wget https://github.com/HerculesWS/Hercules/commit/"+line.replace("\n", "")+".diff", shell=True)
+ print "Applying patch..."
+ #subprocess.call("cd ../../server-code ; ls", shell=True)
+ subprocess.call("cd ../../server-code ; git apply --ignore-whitespace --exclude=doc/ --exclude=tools/ --exclude=db/ --exclude=npc/ --exclude=conf/ --reject "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch applied"
+ subprocess.call("cd ../../server-code ; rm "+line.replace("\n", "")+".diff", shell=True)
+ print "Patch deleted (success)"
+
+
+f.close()
+print "HercWS porting finished"
+subprocess.call("ls --recursive ../../server-code|grep rej", shell=True)
+
diff --git a/localserver/build.sh b/localserver/build.sh
new file mode 100755
index 0000000..e861d0e
--- /dev/null
+++ b/localserver/build.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/env bash
+
+export DIR=`pwd`
+
+./checktime.sh
+./updater.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..6ed4c05
--- /dev/null
+++ b/localserver/buildasan.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+export DIR=`pwd`
+./updater.sh
+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..4080eed
--- /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-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.
+//=========================================================================
+
+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..03b1900
--- /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-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/>.
+//=========================================================================
+//= Character Server local configuration file.
+//=========================================================================
+
+min_char_class: 0
+max_char_class: 2
diff --git a/localserver/conf/constants.conf b/localserver/conf/constants.conf
new file mode 100644
index 0000000..4562d0c
--- /dev/null
+++ b/localserver/conf/constants.conf
@@ -0,0 +1,30 @@
+//================= 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.
+//=========================================================================
+
+debug: 0
diff --git a/localserver/conf/inter-server.conf b/localserver/conf/inter-server.conf
new file mode 100644
index 0000000..243dda4
--- /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-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/>.
+//=========================================================================
+//= 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..feadef9
--- /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-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/>.
+//=========================================================================
+//= 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..99e666d
--- /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-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/>.
+//=========================================================================
+//= 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..2c9b165
--- /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-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/>.
+//=========================================================================
+//= 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..b354b2b
--- /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-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/>.
+//=========================================================================
+//= 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..04d0a40
--- /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-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/>.
+//=========================================================================
+//= 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..1f9f514
--- /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-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/>.
+//=========================================================================
+//= 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..5a5db2d
--- /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 ../../serverdata/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 "19" >${DIR}/versions/sqlver
+fi
diff --git a/localserver/installconfigs.sh b/localserver/installconfigs.sh
new file mode 100755
index 0000000..2a42c3c
--- /dev/null
+++ b/localserver/installconfigs.sh
@@ -0,0 +1,20 @@
+#!/usr/bin/env bash
+
+export SD="../../serverdata"
+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/006-10_* ${NPC}/006-10/
+cp -f npc/017-1_* ${NPC}/017-1/
+cp -f npc/015-8_* ${NPC}/015-8/
+cp -f npc/025-2-4_* ${NPC}/025-2-4/
+cp -f npc/018-7-1_* ${NPC}/018-7-1/
+cp -f npc/023-4_* ${NPC}/023-4/
+cp -f npc/botcheck_* ${NPC}/botcheck/
+cp -f npc/easteregg_* ${NPC}/config/
+cp -f npc/magic_* ${NPC}/magic/
+mkdir versions
+echo "4" >versions/confver
diff --git a/localserver/npc/006-10_blackbox.txt b/localserver/npc/006-10_blackbox.txt
new file mode 100644
index 0000000..924a45e
--- /dev/null
+++ b/localserver/npc/006-10_blackbox.txt
@@ -0,0 +1,12 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Runestaff Blackbox
+
+// Syntax:
+// 00610_Init_BlackBox( - )
+function script 00610_Init_BlackBox {
+ return;
+}
+
diff --git a/localserver/npc/015-8_blackbox.txt b/localserver/npc/015-8_blackbox.txt
new file mode 100644
index 0000000..7ae5c57
--- /dev/null
+++ b/localserver/npc/015-8_blackbox.txt
@@ -0,0 +1,27 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// This is the “015-8 mapfile” black box.
+// It contains the answers to all the riddles.
+// This file is kept outside the main tree for translation purposes.
+// You thought you could cheat the answers, eh?
+
+// Syntax:
+// 0158_Riddle_BlackBox( )
+// Returns true on success, false on failure.
+function script 0158_Riddle_BlackBox {
+ .@r$="secret";
+ .@l$=l("secret");
+
+ mesc l("When I was alive, I brought people to their destiny.");
+ mesc l("One day, I was provoked. Others came to my aid,");
+ mesc l("But all I could do was a bite.");
+ mesc l("To my murders, I gave them a full meal.");
+ mesc l("And in a hut, a lone woman mourned my death.");
+ mes "";
+ input .@ans$;
+
+ return riddlevalidation(.@ans$, .@r$[.@e], .@l$[.@e]);
+}
+
diff --git a/localserver/npc/017-1_stranger_blackbox.txt b/localserver/npc/017-1_stranger_blackbox.txt
new file mode 100644
index 0000000..bdd444d
--- /dev/null
+++ b/localserver/npc/017-1_stranger_blackbox.txt
@@ -0,0 +1,40 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// This is the “Stranger” black box.
+// It contains the answers to all the riddles.
+// This file is kept outside the main tree for translation purposes.
+// You thought you could cheat the answers, eh?
+
+// Syntax:
+// 0171_Stranger_BlackBox( difficulty )
+// Where difficulty can be EASY, MEDIUM or HARD.
+// Returns 1 on success, 0 on failure.
+function script 0171_Stranger_BlackBox {
+ switch (getarg(0)) {
+ case EASY:
+ setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
+ setarray .@r$, "no", "yes";
+ setarray .@l$, l("no"), l("yes");
+ break;
+ case MEDIUM:
+ setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
+ setarray .@r$, "no", "yes";
+ setarray .@l$, l("no"), l("yes");
+ break;
+ case HARD:
+ setarray .@q$, l("Are you cheating?"), l("Should we blame Saulc for bugs?");
+ setarray .@r$, "no", "yes";
+ setarray .@l$, l("no"), l("yes");
+ break;
+ default: return 0;
+ }
+
+ .@e=rand(getarraysize(.@q$)-1);
+ mesq .@q$[.@e];
+ input .@ans$;
+
+ return riddlevalidation(.@ans$, .@r$[.@e], .@l$[.@e]);
+}
+
diff --git a/localserver/npc/018-7-1_demure_blackbox.txt b/localserver/npc/018-7-1_demure_blackbox.txt
new file mode 100644
index 0000000..a5e7560
--- /dev/null
+++ b/localserver/npc/018-7-1_demure_blackbox.txt
@@ -0,0 +1,12 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Demure Axe Blackbox
+
+// Syntax:
+// 01871_Demure_BlackBox( - )
+function script 01871_Demure_BlackBox {
+ return;
+}
+
diff --git a/localserver/npc/023-4_blackbox.txt b/localserver/npc/023-4_blackbox.txt
new file mode 100644
index 0000000..a5687e5
--- /dev/null
+++ b/localserver/npc/023-4_blackbox.txt
@@ -0,0 +1,36 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// 023-4 Blackbox
+
+// Syntax:
+// 0234_Password_BlackBox( PASSWORD )
+// 0234_Init_BlackBox( - )
+function script 0234_Password_BlackBox {
+ .@message$=getarg(0, "");
+ // Only react if the message is what we want to hear
+ if (.@message$ == "PASSWORD") {
+ if (getq(FrostiaQuest_Homunculus) < 1)
+ end;
+
+ if (isat("023-3", 26, 219)) {
+ warp "023-4", 42, 69;
+ sleep2(15);
+ dispbottom l("The gates to Aethyr have opened themselves to you.");
+ }
+ }
+ return;
+}
+
+function script 0234_Init_BlackBox {
+ return;
+}
+
+- script #0234BlackBox NPC_HIDDEN,{
+ end;
+OnIter:
+ end;
+}
+
+
diff --git a/localserver/npc/025-2-4_aegis_blackbox.txt b/localserver/npc/025-2-4_aegis_blackbox.txt
new file mode 100644
index 0000000..524d704
--- /dev/null
+++ b/localserver/npc/025-2-4_aegis_blackbox.txt
@@ -0,0 +1,33 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Aegis Shield & Mana Tree Blackbox
+
+// Syntax:
+// 02524_Tree_BlackBox( target name, target GID )
+// 02524_Revenge_BlackBox( - )
+// 02524_Avenge_BlackBox( deadflag )
+function script 02524_Tree_BlackBox {
+ .@prayer$=getarg(0);
+ .@gid=getarg(1);
+ .@org=getcharid(3);
+ message .@prayer$, strcharinfo(0)+" is praying for you!";
+ if (!attachrid(.@gid)) return;
+ percentheal 100, 100;
+ @purifio=max(gettimetick(2), @purifio)+60;
+ attachrid(.@org);
+ getmapxy(.@m$, .@x, .@y, 0);
+ .@mob=monster(.@m$, .@x+any(-2,-3,2,3), .@y+any(-1,0,1), "Pinkie of Doom", PinkieSuseran, 1);
+ unitattack(.@mob, .@org);
+ return;
+}
+
+function script 02524_Revenge_BlackBox {
+ return;
+}
+
+function script 02524_Avenge_BlackBox {
+ return;
+}
+
diff --git a/localserver/npc/botcheck_blackbox.txt b/localserver/npc/botcheck_blackbox.txt
new file mode 100644
index 0000000..b11050e
--- /dev/null
+++ b/localserver/npc/botcheck_blackbox.txt
@@ -0,0 +1,35 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Bot check area configuration, measures, utilitaries,
+// and various configuration files to prevent bots.
+// You must fill this file manually, or don't file it at all.
+
+botcheck,37,41,0 script Bot Master NPC_ELMO,{
+ if (!is_staff())
+ end;
+ mesc l("This file must be requested due not being public."), 1;
+ mesc l("Too many evil bots out there %%e They can't learn this!"), 1;
+ close;
+
+OnCall:
+ if (getmap() ~= "botcheck") {
+ if (@bck_map$ != "")
+ warp @bck_map$, @bck_x, @bck_y;
+ else
+ warp "Save", 0, 0;
+ dispbottom l("You passed the botcheck. Thanks for playing the game %%G");
+ end;
+ }
+ getmapxy(@bck_map$, @bck_x, @bck_y, 0);
+ warp "botcheck", 38, 40;
+ dispbottom l("BOTCHECK: You are on botcheck area. DO NOT attack or collect items until given the order.");
+ end;
+
+OnInit:
+ bindatcmd "botcheck", "Bot Master::OnCall", 60, 60, 1;
+ end;
+
+}
+
diff --git a/localserver/npc/easteregg_blackbox.txt b/localserver/npc/easteregg_blackbox.txt
new file mode 100644
index 0000000..0335eeb
--- /dev/null
+++ b/localserver/npc/easteregg_blackbox.txt
@@ -0,0 +1,16 @@
+// TMW2 Script
+//
+// Contains Easter Egg data and triggers (some excluded)
+
+// Author: Saulc
+005-2-1,41,33,0 script Note#saxsocave NPC_PAPER_NOTE,{
+ mesc l("I leave this basement that start to be too dangerous!");
+
+ RegEasterEgg(EE_SAXSO, 5);
+ close;
+
+OnInit:
+ .distance = 2;
+ end;
+}
+
diff --git a/localserver/npc/magic_blackbox.txt b/localserver/npc/magic_blackbox.txt
new file mode 100644
index 0000000..63d5001
--- /dev/null
+++ b/localserver/npc/magic_blackbox.txt
@@ -0,0 +1,13 @@
+// TMW2 Script
+// Author:
+// Jesusalva
+// Description:
+// Magic Blackbox
+// Contains the internals for Scripture skill.
+
+// Syntax:
+// SK_Scripture( {@chat$} )
+function script SK_Scripture {
+ return;
+}
+
diff --git a/localserver/reapply.patch3 b/localserver/reapply.patch3
new file mode 100644
index 0000000..7d7ddaf
--- /dev/null
+++ b/localserver/reapply.patch3
@@ -0,0 +1,5 @@
+############
+## First postponed update
+
+## <Commit Short Summary>
+# <full commit ID>
diff --git a/localserver/reapply.patch4 b/localserver/reapply.patch4
new file mode 100644
index 0000000..bc0f612
--- /dev/null
+++ b/localserver/reapply.patch4
@@ -0,0 +1,47 @@
+############
+# HOWTO:
+# git log v2019.08.25.. --pretty=short
+
+# TODO: Instructions on how to update our hercules repo
+# git diff v2019.09.22 v2019.10.20 > ../tmw2/server-code/x.diff
+# git apply --ignore-whitespace --exclude=doc/ --exclude=tools/ --exclude=db/ --exclude=npc/ --exclude=conf/ --reject x.diff ; git checkout -- .gitlab-ci.yml
+
+############
+## v2019.10.20
+
+############
+## v2019.11.17+1
+
+############
+## v2019.12.15
+
+############
+## v2020.01.12
+
+############
+## v2020.02.09
+
+############
+## v2020.03.08+2
+
+############
+## v2020.04.05+1
+
+############
+## v2020.05.03
+
+############
+## v2020.05.31+1
+
+############
+## v2020.06.28
+
+## Changed logic of skill_get_index
+#1042e9919f18d4aac21583a675d28758ba233e03
+
+## Added ifdef on mmo.h to allow change it with CPPFLAGS
+#8a4667a265227587dcc288f75dfe948f5df46034
+
+############
+## v2020.07.26
+
diff --git a/localserver/rebuild.sh b/localserver/rebuild.sh
new file mode 100755
index 0000000..3ec97ed
--- /dev/null
+++ b/localserver/rebuild.sh
@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+export DIR=`pwd`
+
+# Skip patches applications
+
+./checktime.sh
+source ./clean.sh
+CC="gcc-9" ./build.sh old > /dev/null
diff --git a/localserver/updateconfigs.sh b/localserver/updateconfigs.sh
new file mode 100755
index 0000000..4caf378
--- /dev/null
+++ b/localserver/updateconfigs.sh
@@ -0,0 +1,30 @@
+#!/usr/bin/env bash
+
+export VER=$(cat versions/confver 2>/dev/null)
+export CONFDIR="../../serverdata/"
+
+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
diff --git a/localserver/updatedb.sh b/localserver/updatedb.sh
new file mode 100755
index 0000000..6e777ae
--- /dev/null
+++ b/localserver/updatedb.sh
@@ -0,0 +1,103 @@
+#!/usr/bin/env bash
+
+export VER=$(cat versions/sqlver 2>/dev/null)
+export SQLDIR="../../serverdata/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"
+ run "2018-08-03--11-37.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"
+ run "2020-08-01--00-00.sql"
+fi
+
+if [ "${VER}" -lt "19" ]; then
+ echo "19" >versions/sqlver
+fi
+
diff --git a/localserver/updater.sh b/localserver/updater.sh
new file mode 100755
index 0000000..461afa5
--- /dev/null
+++ b/localserver/updater.sh
@@ -0,0 +1,44 @@
+#!/usr/bin/env bash
+
+# Apply beta.patch if it exists to serverdata
+# It will only exist on BETA SERVERS, though
+if [ -e "./beta.patch" ]
+ then
+ echo "Apply beta.patch ........"
+ cd ../../serverdata
+ git apply ../tools/localserver/beta.patch
+ cd $DIR
+ mv beta.patch .~beta.patch
+ ls
+ echo "........ Done."
+fi
+
+# Apply beta.patch2 if it exists to server-code
+# It will only exist on BETA SERVERS, though
+if [ -e "./beta.patch2" ]
+ then
+ echo "Apply server updates ........"
+ sleep 1
+ cd ../../server-code
+ git checkout -- src
+ echo "Rolling server back to correct version"
+ #git diff master ce2dbb6acdc559ec256d1f9f9a779b8283064708 > x.diff
+ #ls
+ #head -n 25 x.diff
+ #tail -n 40 x.diff
+ #git apply --reject --whitespace=nowarn x.diff
+ git status
+ ls --recursive|grep ".rej"
+ cd ../tools/localserver
+ echo "Server code clean ........"
+ sleep 1
+ python applicator.py
+ echo "Apply beta.patch2 ........"
+ cd ../../server-code
+ git apply ../tools/localserver/beta.patch2
+ cd $DIR
+ #mv beta.patch2 .~beta.patch2
+ ls
+ echo "........ Done."
+fi
+