summaryrefslogtreecommitdiff
path: root/.tools
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 21:44:22 -0300
commita7c45a192268da2601cef47a4cdba987ae2327ca (patch)
treec5fb5b97db109fe7106496dd96498c475881046b /.tools
downloadserverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.gz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.bz2
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.xz
serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.zip
Initial commit (Moubootaur Legends fork)
Diffstat (limited to '.tools')
-rw-r--r--.tools/applicator.py44
-rw-r--r--.tools/beta.patch21
-rw-r--r--.tools/conf/mariadb/battle.conf32
-rw-r--r--.tools/conf/mariadb/char-server.conf31
-rw-r--r--.tools/conf/mariadb/constants.conf30
-rw-r--r--.tools/conf/mariadb/inter-server.conf32
-rw-r--r--.tools/conf/mariadb/login-server.conf32
-rw-r--r--.tools/conf/mariadb/logs.conf32
-rw-r--r--.tools/conf/mariadb/map-server.conf32
-rw-r--r--.tools/conf/mariadb/msg_conf.txt0
-rw-r--r--.tools/conf/mariadb/ports.conf8
-rw-r--r--.tools/conf/mariadb/script.conf32
-rw-r--r--.tools/conf/mariadb/socket.conf32
-rw-r--r--.tools/conf/mariadb/sql_connection.conf52
-rw-r--r--.tools/conf/mysql/battle.conf32
-rw-r--r--.tools/conf/mysql/char-server.conf31
-rw-r--r--.tools/conf/mysql/constants.conf30
-rw-r--r--.tools/conf/mysql/inter-server.conf32
-rw-r--r--.tools/conf/mysql/login-server.conf32
-rw-r--r--.tools/conf/mysql/logs.conf32
-rw-r--r--.tools/conf/mysql/map-server.conf32
-rw-r--r--.tools/conf/mysql/msg_conf.txt0
-rw-r--r--.tools/conf/mysql/ports.conf8
-rw-r--r--.tools/conf/mysql/script.conf32
-rw-r--r--.tools/conf/mysql/socket.conf32
-rw-r--r--.tools/conf/mysql/sql_connection.conf52
-rwxr-xr-x.tools/jobs/build.sh15
-rwxr-xr-x.tools/jobs/cloneall.sh5
-rwxr-xr-x.tools/jobs/clonedata.sh5
-rwxr-xr-x.tools/jobs/initdb.sh23
-rwxr-xr-x.tools/jobs/install.sh10
-rwxr-xr-x.tools/jobs/licensecheck.sh41
-rwxr-xr-x.tools/jobs/newlines.sh10
-rwxr-xr-x.tools/jobs/runserver.sh38
-rwxr-xr-x.tools/jobs/runservervalgrind.sh37
-rwxr-xr-x.tools/jobs/spaces.sh11
-rw-r--r--.tools/npc/motd-debug-text.txt4
-rw-r--r--.tools/reapply.patch36
-rw-r--r--.tools/reapply.patch447
-rwxr-xr-x.tools/scripts/init.sh243
40 files changed, 1230 insertions, 0 deletions
diff --git a/.tools/applicator.py b/.tools/applicator.py
new file mode 100644
index 0000000..6fa8d6e
--- /dev/null
+++ b/.tools/applicator.py
@@ -0,0 +1,44 @@
+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"
+
diff --git a/.tools/beta.patch2 b/.tools/beta.patch2
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/.tools/beta.patch2
@@ -0,0 +1 @@
+
diff --git a/.tools/conf/mariadb/battle.conf b/.tools/conf/mariadb/battle.conf
new file mode 100644
index 0000000..4080eed
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/char-server.conf b/.tools/conf/mariadb/char-server.conf
new file mode 100644
index 0000000..f6431c5
--- /dev/null
+++ b/.tools/conf/mariadb/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: 6
diff --git a/.tools/conf/mariadb/constants.conf b/.tools/conf/mariadb/constants.conf
new file mode 100644
index 0000000..4562d0c
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/inter-server.conf b/.tools/conf/mariadb/inter-server.conf
new file mode 100644
index 0000000..243dda4
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/login-server.conf b/.tools/conf/mariadb/login-server.conf
new file mode 100644
index 0000000..feadef9
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/logs.conf b/.tools/conf/mariadb/logs.conf
new file mode 100644
index 0000000..99e666d
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/map-server.conf b/.tools/conf/mariadb/map-server.conf
new file mode 100644
index 0000000..2c9b165
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/msg_conf.txt b/.tools/conf/mariadb/msg_conf.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.tools/conf/mariadb/msg_conf.txt
diff --git a/.tools/conf/mariadb/ports.conf b/.tools/conf/mariadb/ports.conf
new file mode 100644
index 0000000..7d5481e
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/script.conf b/.tools/conf/mariadb/script.conf
new file mode 100644
index 0000000..b354b2b
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/socket.conf b/.tools/conf/mariadb/socket.conf
new file mode 100644
index 0000000..04d0a40
--- /dev/null
+++ b/.tools/conf/mariadb/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/.tools/conf/mariadb/sql_connection.conf b/.tools/conf/mariadb/sql_connection.conf
new file mode 100644
index 0000000..1e0e559
--- /dev/null
+++ b/.tools/conf/mariadb/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: "mariadb"
+ db_port: 3306
+ db_username: "evol"
+ db_password: "evol"
+ db_database: "evol"
+ //codepage:""
+}
diff --git a/.tools/conf/mysql/battle.conf b/.tools/conf/mysql/battle.conf
new file mode 100644
index 0000000..4080eed
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/char-server.conf b/.tools/conf/mysql/char-server.conf
new file mode 100644
index 0000000..f6431c5
--- /dev/null
+++ b/.tools/conf/mysql/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: 6
diff --git a/.tools/conf/mysql/constants.conf b/.tools/conf/mysql/constants.conf
new file mode 100644
index 0000000..4562d0c
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/inter-server.conf b/.tools/conf/mysql/inter-server.conf
new file mode 100644
index 0000000..243dda4
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/login-server.conf b/.tools/conf/mysql/login-server.conf
new file mode 100644
index 0000000..feadef9
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/logs.conf b/.tools/conf/mysql/logs.conf
new file mode 100644
index 0000000..99e666d
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/map-server.conf b/.tools/conf/mysql/map-server.conf
new file mode 100644
index 0000000..2c9b165
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/msg_conf.txt b/.tools/conf/mysql/msg_conf.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/.tools/conf/mysql/msg_conf.txt
diff --git a/.tools/conf/mysql/ports.conf b/.tools/conf/mysql/ports.conf
new file mode 100644
index 0000000..7d5481e
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/script.conf b/.tools/conf/mysql/script.conf
new file mode 100644
index 0000000..b354b2b
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/socket.conf b/.tools/conf/mysql/socket.conf
new file mode 100644
index 0000000..04d0a40
--- /dev/null
+++ b/.tools/conf/mysql/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/.tools/conf/mysql/sql_connection.conf b/.tools/conf/mysql/sql_connection.conf
new file mode 100644
index 0000000..b469dbf
--- /dev/null
+++ b/.tools/conf/mysql/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: "mysql"
+ db_port: 3306
+ db_username: "evol"
+ db_password: "evol"
+ db_database: "evol"
+ //codepage:""
+}
diff --git a/.tools/jobs/build.sh b/.tools/jobs/build.sh
new file mode 100755
index 0000000..8b57f71
--- /dev/null
+++ b/.tools/jobs/build.sh
@@ -0,0 +1,15 @@
+#!/bin/bash
+
+export LOGFILE=gcc6.log
+
+source ./.tools/scripts/init.sh
+
+pwd
+cd ..
+
+build_init
+
+cd server-code
+check_error $?
+
+make_server "$1" "$2"
diff --git a/.tools/jobs/cloneall.sh b/.tools/jobs/cloneall.sh
new file mode 100755
index 0000000..79bb8d0
--- /dev/null
+++ b/.tools/jobs/cloneall.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+do_init
diff --git a/.tools/jobs/clonedata.sh b/.tools/jobs/clonedata.sh
new file mode 100755
index 0000000..95fa77a
--- /dev/null
+++ b/.tools/jobs/clonedata.sh
@@ -0,0 +1,5 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+do_init_data
diff --git a/.tools/jobs/initdb.sh b/.tools/jobs/initdb.sh
new file mode 100755
index 0000000..d6c2480
--- /dev/null
+++ b/.tools/jobs/initdb.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+cd ../server-data
+
+export host=$1
+cd sql-files
+
+export CMD="mysql --force -u root -proot --host=${host}"
+check_error $?
+echo $CMD <./initremote.sql
+$CMD <./initremote.sql
+check_error $?
+
+export CMD="mysql -u evol -pevol --host=${host} evol"
+echo Creating tables...
+echo $CMD <main.sql
+$CMD <main.sql
+check_error $?
+echo $CMD <logs.sql
+$CMD <logs.sql
+check_error $?
diff --git a/.tools/jobs/install.sh b/.tools/jobs/install.sh
new file mode 100755
index 0000000..dd762e1
--- /dev/null
+++ b/.tools/jobs/install.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+update_repos
+aptget_update
+
+aptget_install $*
+
+do_init_data
diff --git a/.tools/jobs/licensecheck.sh b/.tools/jobs/licensecheck.sh
new file mode 100755
index 0000000..d57efc3
--- /dev/null
+++ b/.tools/jobs/licensecheck.sh
@@ -0,0 +1,41 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+aptget_update
+aptget_install git-core gcc ca-certificates grep python
+
+do_init_data
+
+ls
+
+do_init_tools
+
+cd tools/licensecheck
+#ls
+
+cp -r ../../TMW2/serverdata/npc npc
+
+#echo "ls .."
+#ls ..
+#echo "ls ../.."
+#ls ../..
+#echo "ls ../../TMW2"
+#ls ../../TMW2
+#echo "ls ../../TMW2/serverdata"
+#ls ../../TMW2/serverdata
+#echo "ls ../../TMW2/serverdata/npc"
+#ls ../../TMW2/serverdata/npc
+
+./serverdata.py npc/ # >license.log
+
+#export RES=$(cat license.log)
+#if [[ -n "${RES}" ]]; then
+# echo "Detected missing licenses."
+# cat license.log
+# echo "Estimated total missing licenses:"
+# wc -l license.log
+# exit 1
+#fi
+echo "Exiting with status zero because licensecheck errors are not considered critical"
+exit 0
diff --git a/.tools/jobs/newlines.sh b/.tools/jobs/newlines.sh
new file mode 100755
index 0000000..23309f7
--- /dev/null
+++ b/.tools/jobs/newlines.sh
@@ -0,0 +1,10 @@
+#!/bin/bash
+
+find -H . -type f -name "*.txt" -o -name "*.conf" -exec dos2unix {} \;
+
+export RES=$(git diff --name-only)
+if [[ -n "${RES}" ]]; then
+ echo "Wrong new lines detected in files:"
+ git diff --name-only
+ exit 1
+fi
diff --git a/.tools/jobs/runserver.sh b/.tools/jobs/runserver.sh
new file mode 100755
index 0000000..6bff48a
--- /dev/null
+++ b/.tools/jobs/runserver.sh
@@ -0,0 +1,38 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+function run_server {
+ echo "running: $1 --run-once $2"
+ $1 --run-once $2 2>runlog.txt
+ export errcode=$?
+ export teststr=$(cat runlog.txt)
+ if [[ -n "${teststr}" ]]; then
+ echo "Errors found in running server $1."
+ cat runlog.txt
+ echo "Errors found in running server $1."
+ exit 1
+ else
+ echo "No errors found for server $1."
+ fi
+ if [ ${errcode} -ne 0 ]; then
+ echo "server $1 terminated with exit code ${errcode}"
+ echo "Test failed"
+ exit 1
+ fi
+}
+
+do_init_tools
+init_configs $1
+
+cd server-data
+pwd
+ls -la
+
+run_server ./login-server
+run_server ./char-server
+
+ARGS="--load-script npc/dev/test.txt "
+ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt"
+
+run_server ./map-server "$ARGS"
diff --git a/.tools/jobs/runservervalgrind.sh b/.tools/jobs/runservervalgrind.sh
new file mode 100755
index 0000000..6442b09
--- /dev/null
+++ b/.tools/jobs/runservervalgrind.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+source ./.tools/scripts/init.sh
+
+function run_server {
+ echo "running: $1 --run-once $2"
+ valgrind -q --read-var-info=yes --track-origins=yes --malloc-fill=11 --free-fill=55 --show-reachable=yes --leak-check=full --leak-resolution=high --partial-loads-ok=yes --error-limit=no $1 --run-once $2 2>runlog.txt
+ export errcode=$?
+ export teststr=$(grep "invalid" runlog.txt)
+ cat runlog.txt
+ if [[ -n "${teststr}" ]]; then
+ echo "Errors found in running server $1."
+ exit 1
+ else
+ echo "No errors found for server $1."
+ fi
+ if [ ${errcode} -ne 0 ]; then
+ echo "server $1 terminated with exit code ${errcode}"
+ echo "Test failed"
+ exit 1
+ fi
+}
+
+do_init_tools
+init_configs $1
+
+cd server-data
+pwd
+ls -la
+
+run_server ./login-server
+run_server ./char-server
+
+ARGS="--load-script npc/dev/test.txt "
+ARGS="--load-plugin script_mapquit $ARGS --load-script npc/dev/ci_test.txt"
+
+run_server ./map-server "$ARGS"
diff --git a/.tools/jobs/spaces.sh b/.tools/jobs/spaces.sh
new file mode 100755
index 0000000..4460cfb
--- /dev/null
+++ b/.tools/jobs/spaces.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+find -H . -type f -name "*.txt" -exec sed -i 's/[[:blank:]]*$//' {} \;
+
+export RES=$(git diff --name-only)
+if [[ -n "${RES}" ]]; then
+ echo "Extra spaces before new lines detected in files:"
+ git diff --name-only
+ # I don't want this to be critical on TMW2
+ exit 1
+fi
diff --git a/.tools/npc/motd-debug-text.txt b/.tools/npc/motd-debug-text.txt
new file mode 100644
index 0000000..a57c9a2
--- /dev/null
+++ b/.tools/npc/motd-debug-text.txt
@@ -0,0 +1,4 @@
+function script MOTD_debug_text {
+ setarray $@Debug_Messages$[0], "";
+ return;
+}
diff --git a/.tools/reapply.patch3 b/.tools/reapply.patch3
new file mode 100644
index 0000000..35dfb79
--- /dev/null
+++ b/.tools/reapply.patch3
@@ -0,0 +1,6 @@
+############
+## First postponed update
+
+## <Commit Message>
+# <Full Commit ID>
+
diff --git a/.tools/reapply.patch4 b/.tools/reapply.patch4
new file mode 100644
index 0000000..bc0f612
--- /dev/null
+++ b/.tools/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/.tools/scripts/init.sh b/.tools/scripts/init.sh
new file mode 100755
index 0000000..3b800bb
--- /dev/null
+++ b/.tools/scripts/init.sh
@@ -0,0 +1,243 @@
+#!/bin/bash
+
+mkdir logs
+
+export dir=$(pwd)
+export ERRFILE=${dir}/logs/${LOGFILE}
+
+cat /etc/os-release
+
+rm ${ERRFILE}
+
+function check_error {
+ if [ "$1" != 0 ]; then
+ echo "Error $1"
+ exit $1
+ fi
+}
+
+function update_repos {
+ if [ "$CI_SERVER" == "" ];
+ then
+ return
+ fi
+
+ export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101")
+ if [ "$DATA" != "" ];
+ then
+ echo "Detected local runner"
+ sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list
+ else
+ echo "Detected non local runner"
+ fi
+}
+
+function gitclone1 {
+ echo git clone $2 $3
+ git clone $2 $3
+ if [ "$?" != 0 ]; then
+ echo git clone $1 $3
+ git clone $1 $3
+ return $?
+ fi
+ return $?
+}
+
+function gitclone {
+ export name1=$1/$2
+ export name2=${CI_BUILD_REPO##*@}
+ export name2=https://${name2%/*}/$2
+
+ gitclone1 "$name1" "$name2" $3
+ if [ "$?" != 0 ]; then
+ sleep 1s
+ gitclone1 "$name1" "$name2" $3
+ if [ "$?" != 0 ]; then
+ sleep 3s
+ gitclone1 "$name1" "$name2" $3
+ if [ "$?" != 0 ]; then
+ sleep 5s
+ gitclone1 "$name1" "$name2" $3
+ fi
+ fi
+ fi
+ check_error $?
+}
+
+function update_repos {
+ if [ "$CI_SERVER" == "" ];
+ then
+ return
+ fi
+
+ export DATA=$(cat /etc/resolv.conf|grep "nameserver 1.10.100.101")
+ if [ "$DATA" != "" ];
+ then
+ echo "Detected local runner"
+ sed -i 's!http://httpredir.debian.org/debian!http://1.10.100.103/debian!' /etc/apt/sources.list
+ else
+ echo "Detected non local runner"
+ fi
+}
+
+function aptget_update {
+ update_repos
+ apt-get update
+ if [ "$?" != 0 ]; then
+ sleep 1s
+ apt-get update
+ if [ "$?" != 0 ]; then
+ sleep 1s
+ apt-get update
+ fi
+ fi
+ check_error $?
+}
+
+function aptget_install {
+ apt-get -y -qq install $*
+ if [ "$?" != 0 ]; then
+ sleep 1s
+ apt-get -y -qq install $*
+ if [ "$?" != 0 ]; then
+ sleep 2s
+ apt-get -y -qq install $*
+ fi
+ fi
+ check_error $?
+}
+
+function make_server {
+ ls -la ../server-data
+ ls -la ../server-data/plugins
+ if [ -e "../server-data/.tools/beta.patch2" ]
+ then
+ echo "Download and install Python 2.7 Minimal ........"
+ aptget_install python2.7-minimal wget
+ echo "Download and apply reapply patch ........"
+ cd ../server-data/.tools; python2.7 applicator.py
+ echo "Apply beta.patch2 ........"
+ cd ../../server-code ; git apply ../server-data/.tools/beta.patch2
+ echo "........ Done."
+ fi
+ echo source src/evol/tools/vars.sh
+ source ./src/evol/tools/vars.sh
+ check_error $?
+ export CPPFLAGS="$CPPFLAGS -DI_AM_AWARE_OF_THE_RISK_AND_STILL_WANT_TO_RUN_HERCULES_AS_ROOT -UPYTHON_LOGS"
+ echo "autoreconf -i"
+ autoreconf -i
+ check_error $?
+ echo ./configure $1 CPPFLAGS=\"${CPPFLAGS}${HERCCPPFLAGS}\"
+ ./configure $1 CPPFLAGS="$CPPFLAGS$HERCCPPFLAGS"
+ export err="$?"
+ if [ "$err" != 0 ]; then
+ echo "Error $err"
+ echo cat config.log
+ cat config.log
+ exit $err
+ fi
+ echo "make -j2"
+ make -j2
+ check_error $?
+ echo "make -j2 plugin.script_mapquit"
+ make -j2 plugin.script_mapquit
+ check_error $?
+ make install
+ check_error $?
+
+ cd src/evol
+ echo "autoreconf -i"
+ mkdir m4
+ autoreconf -i
+ check_error $?
+ mkdir build
+ cd build
+ echo ../configure $2 CPPFLAGS=\"${VARS} -UPYTHON_LOGS\"
+ ../configure $2 CPPFLAGS="${VARS} -UPYTHON_LOGS"
+ check_error $?
+ echo "make -j2 V=0"
+ make -j2 V=0
+ check_error $?
+ cd ../../../..
+ ls -la server-data/plugins
+}
+
+function do_init_data {
+ mkdir shared
+ rm -rf ../server-data
+ cp -r . ../server-data
+ cd ..
+ ls -la server-data
+ check_error $?
+}
+
+function do_init_tools {
+ cd ..
+ rm -rf tools
+ gitclone https://git.themanaworld.org/ml tools.git tools
+}
+
+function do_init {
+ do_init_data
+ rm -rf server-code
+ gitclone https://git.themanaworld.org/ml hercules.git server-code
+ check_error $?
+ cd server-code/src ; git checkout tmw2
+ check_error $?
+ #: ' #Use this to force an old version. You need s20190422 for this.
+ echo "Rolling server back to correct version"
+ cd ..
+ # 10.0 and prior: Server s20190513
+ #git diff master 41b5d5e9b6f14fd26197958aec29a02858dff299 > x.diff
+ # Current version: Server s20190819
+ #git diff master ce2dbb6acdc559ec256d1f9f9a779b8283064708 > x.diff
+ #ls
+ #head -n 25 x.diff
+ #tail -n 40 x.diff
+ #git apply --reject --whitespace=nowarn x.diff
+ #echo "====================================== CHANGES APPLIED"
+ git status
+ ls --recursive|grep ".rej"
+ echo "====================================== Continuing..."
+ cd src
+ check_error $?
+ #'
+ gitclone https://git.themanaworld.org/ml evol-hercules.git evol ; cd evol ; git checkout tmw2 ; cd ..
+ check_error $?
+ cd ../..
+ check_error $?
+ mkdir -p server-data/plugins
+}
+
+function build_init {
+ if [ "$CI_SERVER" == "" ];
+ then
+ return
+ fi
+ mkdir -p /local/bin
+ echo "#!/bin/bash" > /local/bin/id
+ echo "echo 1000" >> /local/bin/id
+ export PATH="/local/bin:$PATH"
+ chmod +x /local/bin/id
+ echo "fake id check"
+ id
+
+ cd server-code/src/evol
+ source tools/vars.sh
+ check_error $?
+ cd ../../..
+ check_error $?
+ echo $CC --version
+ $CC --version
+ check_error $?
+}
+
+function init_configs {
+ cd tools/localserver
+ ./installconfigs.sh
+ cd ../..
+ cp server-data/.tools/conf/$1/* server-data/conf/import/
+ cp server-data/.tools/npc/motd-* server-data/npc/commands/
+ ls -la server-data/conf/import
+ cat server-data/conf/import/inter_conf.txt
+}