mirror of
https://port.numenaute.org/aleajactaest/khanat-code-old.git
synced 2024-11-22 06:46:14 +00:00
update header (adding licence GPL v3), split script to intialize khanat server, ading option to clean old images docker
This commit is contained in:
parent
42efd2ea70
commit
e18fa4bbef
11 changed files with 851 additions and 507 deletions
21
dist/docker/server/debian/common/autostart.sh
vendored
21
dist/docker/server/debian/common/autostart.sh
vendored
|
@ -1,4 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Scritp to launch server khanat
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
declare METHOD_START=$1
|
declare METHOD_START=$1
|
||||||
|
|
||||||
|
@ -11,6 +28,8 @@ tmp=$(hostname -I)
|
||||||
export addressip=${tmp//[[:blank:]]/}
|
export addressip=${tmp//[[:blank:]]/}
|
||||||
sed -i -r 's/(FSListenHost)(.*)(=)(.*)(;)/FSListenHost = "'"$addressip"'";/g' $KHANAT_PATH/server/frontend_service.cfg || exit 2
|
sed -i -r 's/(FSListenHost)(.*)(=)(.*)(;)/FSListenHost = "'"$addressip"'";/g' $KHANAT_PATH/server/frontend_service.cfg || exit 2
|
||||||
|
|
||||||
|
/opt/prepare_start_server.sh || exit 2
|
||||||
|
|
||||||
if [[ $METHOD_START -eq 1 ]]
|
if [[ $METHOD_START -eq 1 ]]
|
||||||
then
|
then
|
||||||
export RYZOM_PATH=$KHANAT_PATH
|
export RYZOM_PATH=$KHANAT_PATH
|
||||||
|
@ -19,7 +38,7 @@ elif [[ $METHOD_START -eq 2 ]]
|
||||||
then
|
then
|
||||||
bash /opt/launch_services.sh
|
bash /opt/launch_services.sh
|
||||||
sleep 10
|
sleep 10
|
||||||
tail -f /home/gameserver/khanat/server/log/log.log
|
tail -n+0 -f /home/gameserver/khanat/server/log/log.log
|
||||||
else
|
else
|
||||||
bash /opt/launch_services.sh
|
bash /opt/launch_services.sh
|
||||||
sleep 10
|
sleep 10
|
||||||
|
|
134
dist/docker/server/debian/common/configure_apache.sh
vendored
Executable file
134
dist/docker/server/debian/common/configure_apache.sh
vendored
Executable file
|
@ -0,0 +1,134 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Configure apache
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
echo "CONFIGURE APACHE"
|
||||||
|
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# load environment
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# Create directory use for patch server
|
||||||
|
#mkdir -p $KHANAT_PATH/khanatweb/public_php/
|
||||||
|
mkdir -p $PATCH_CLIENT_SYSTEM/patch_game/patch
|
||||||
|
|
||||||
|
# configure apache
|
||||||
|
cat << EOF > /etc/apache2/sites-available/000-default.conf
|
||||||
|
# Default
|
||||||
|
<VirtualHost *:80>
|
||||||
|
<Directory "$KHANAT_PATH/khanatweb/">
|
||||||
|
Options Indexes FollowSymLinks
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
DirectoryIndex index.php
|
||||||
|
AddType text/html .php .phps
|
||||||
|
AddHandler application/x-httpd-php .php
|
||||||
|
AddHandler application/x-httpd-php-source .phps
|
||||||
|
</Directory>
|
||||||
|
ServerName lirria.khaganat.net
|
||||||
|
|
||||||
|
ServerAdmin webmaster@localhost
|
||||||
|
DocumentRoot $KHANAT_PATH/khanatweb/public_php/
|
||||||
|
|
||||||
|
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||||
|
</VirtualHost>
|
||||||
|
|
||||||
|
# Khanat Server Web
|
||||||
|
<VirtualHost *:40916>
|
||||||
|
<Directory "$KHANAT_PATH/khanatweb/">
|
||||||
|
Options Indexes FollowSymLinks
|
||||||
|
AllowOverride None
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
ServerName lirria.khaganat.net
|
||||||
|
|
||||||
|
ServerAdmin admin@localhost
|
||||||
|
DocumentRoot $KHANAT_PATH/khanatweb/public_php
|
||||||
|
|
||||||
|
ErrorLog \${APACHE_LOG_DIR}/error.log
|
||||||
|
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
||||||
|
</VirtualHost>
|
||||||
|
|
||||||
|
# Patch Server
|
||||||
|
<VirtualHost *:43435>
|
||||||
|
ServerName lirria.khaganat.net
|
||||||
|
DocumentRoot $PATCH_HOME/patch_service/patch_game/patch/
|
||||||
|
|
||||||
|
<Directory "$PATCH_HOME/patch_service/patch_game/patch">
|
||||||
|
Options -Indexes
|
||||||
|
AllowOverride All
|
||||||
|
Require all granted
|
||||||
|
</Directory>
|
||||||
|
</VirtualHost>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Open port use by apache
|
||||||
|
cat << EOF > /etc/apache2/ports.conf
|
||||||
|
# If you just change the port or add more ports here, you will likely also
|
||||||
|
# have to change the VirtualHost statement in
|
||||||
|
# /etc/apache2/sites-enabled/000-default.conf
|
||||||
|
|
||||||
|
Listen 80
|
||||||
|
Listen 40916
|
||||||
|
Listen 43435
|
||||||
|
|
||||||
|
<IfModule ssl_module>
|
||||||
|
Listen 443
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
<IfModule mod_gnutls.c>
|
||||||
|
Listen 443
|
||||||
|
</IfModule>
|
||||||
|
|
||||||
|
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
# Activate php - strange beacause we have only index.php (without php code !)
|
||||||
|
cat << EOF > /etc/apache2/conf-available/patch_service.conf
|
||||||
|
Alias /patch /home/gameserver/patch_service/patch_game/patch
|
||||||
|
<Directory /home/gameserver/patch_service/patch_game/patch>
|
||||||
|
Options FollowSymLinks
|
||||||
|
DirectoryIndex index.php
|
||||||
|
|
||||||
|
Require all granted
|
||||||
|
|
||||||
|
<IfModule mod_php5.c>
|
||||||
|
<IfModule mod_mime.c>
|
||||||
|
AddType application/x-httpd-php .php
|
||||||
|
</IfModule>
|
||||||
|
<FilesMatch ".+\.php$">
|
||||||
|
SetHandler application/x-httpd-php
|
||||||
|
</FilesMatch>
|
||||||
|
</IfModule>
|
||||||
|
</Directory>
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Activate & deploy new configuration
|
||||||
|
a2enconf patch_service.conf
|
||||||
|
|
||||||
|
|
||||||
|
# Restart apache
|
||||||
|
service apache2 restart || exit 2
|
||||||
|
|
134
dist/docker/server/debian/common/configure_database.sh
vendored
Executable file
134
dist/docker/server/debian/common/configure_database.sh
vendored
Executable file
|
@ -0,0 +1,134 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Configure database
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
echo "CONFIGURE DATABASE"
|
||||||
|
|
||||||
|
export KHANAT_CLIENT_VERSION=1
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# load environment
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# start/restart service mysql & apache
|
||||||
|
service mysql restart || exit 2
|
||||||
|
|
||||||
|
# Create account shard on MySQL
|
||||||
|
mysql -u root -e "CREATE USER 'shard'@'localhost' IDENTIFIED BY '';" || exit 2
|
||||||
|
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'shard'@'localhost' WITH GRANT OPTION;" || exit 2
|
||||||
|
|
||||||
|
# launch web configuration for khanat
|
||||||
|
curl 'http://localhost:40916/setup/install.php' \
|
||||||
|
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
|
||||||
|
-H 'Accept-Language: en-US' \
|
||||||
|
-H 'Connection: keep-alive' \
|
||||||
|
-H 'Cookie: PHPSESSID=9jr1ssig58929bp777nrj2fa92' \
|
||||||
|
-H 'DNT: 1' \
|
||||||
|
-H 'Host: localhost:40916' \
|
||||||
|
-H 'Referer: http://localhost:40916/setup/install.php' \
|
||||||
|
-H 'Upgrade-Insecure-Requests: 1' \
|
||||||
|
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
--data 'roleService=on'\
|
||||||
|
'&roleSupport=on'\
|
||||||
|
'&roleDomain=on'\
|
||||||
|
'&privatePhpDirectory=..%2Fprivate_php%2F'\
|
||||||
|
'&nelSetupPassword=admin'\
|
||||||
|
'&nelSqlHostname=localhost'\
|
||||||
|
'&nelSqlUsername=root'\
|
||||||
|
'&nelSqlPassword='\
|
||||||
|
'&nelDatabase=nel'\
|
||||||
|
'&toolDatabase=nel_tool'\
|
||||||
|
'&toolsAdminUsername=admin'\
|
||||||
|
'&toolsAdminPassword=admin'\
|
||||||
|
'&amsSqlHostname=localhost'\
|
||||||
|
'&amsSqlUsername=root'\
|
||||||
|
'&amsSqlPassword='\
|
||||||
|
'&amsDatabase=nel_ams'\
|
||||||
|
'&amsLibDatabase=nel_ams_lib'\
|
||||||
|
'&amsAdminUsername=admin'\
|
||||||
|
'&amsAdminPassword=admin'\
|
||||||
|
'&nelDomainName=Lirria'\
|
||||||
|
'&domainDatabase=ring_mini01'\
|
||||||
|
'&submit=Configure' \
|
||||||
|
-o /opt/setup.log || exit 2
|
||||||
|
|
||||||
|
# Check account is create
|
||||||
|
grep "Domain role successfully installed" /opt/setup.log >/dev/null || exit 2
|
||||||
|
|
||||||
|
# Get IP ADDRESS
|
||||||
|
tmp=$(hostname -I)
|
||||||
|
export addressip=${tmp//[[:blank:]]/}
|
||||||
|
|
||||||
|
## Configure Domain
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel.domain (domain_id, domain_name, status, patch_version, backup_patch_url, patch_urls, login_address, session_manager_address, ring_db_name, web_host, web_host_php, description) VALUES ('12', 'Lirria', 'ds_open', '$KHANAT_CLIENT_VERSION', '$addressip:23001', '$addressip/patch', '$addressip:49998', '$addressip:49999', 'ring_mini01', '$addressip:30000', '$addressip:40916', NULL);" || exit 2
|
||||||
|
|
||||||
|
# Configure nel.shard
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel.shard (ShardId, domain_id, WsAddr, NbPlayers, Name, Online, Version, FixedSessionId, State, MOTD) VALUES ('302', '12', '$addressip:', '0', 'Lirria shard', '0', '', '0', 'ds_open', '');" || exit 2
|
||||||
|
|
||||||
|
# Configure nel_tool.neltool_domains
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel_tool.neltool_domains (domain_id, domain_name, domain_as_host, domain_as_port, domain_rrd_path, domain_las_admin_path, domain_las_local_path, domain_application, domain_sql_string, domain_hd_check, domain_mfs_web, domain_cs_sql_string) VALUES ('12', 'Lirria', '$addressip', '46700', '/home/gameserver/khanat/server/save_shard/rrd_graphs', '', '', 'ryzom_open', '', '0', NULL, NULL);" || exit 2
|
||||||
|
|
||||||
|
# configure nel_tool.neltool_shards
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel_tool.neltool_shards (shard_id, shard_name, shard_as_id, shard_domain_id, shard_lang, shard_restart) VALUES ('302', 'open', 'open', '12', 'fr', '0');" || exit 2
|
||||||
|
|
||||||
|
# configure nel_tool.neltool_user_domains
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel_tool.neltool_user_domains (user_domain_id, user_domain_user_id, user_domain_domain_id) VALUES ('1', '1', '12');" || exit 2
|
||||||
|
|
||||||
|
# configure nel_tool.neltool_user_shards
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
INSERT INTO nel_tool.neltool_user_shards (user_shard_id, user_shard_user_id, user_shard_shard_id, user_shard_domain_id) VALUES ('1', '1', '302', '12');" || exit 2
|
||||||
|
|
||||||
|
# configure ring_mini01.sessions
|
||||||
|
mysql -u root -e "use ring_mini01;
|
||||||
|
INSERT INTO ring_mini01.sessions (session_id, session_type, title, owner, plan_date, start_date, description, orientation, level, rule_type, access_type, state, host_shard_id, subscription_slots, reserved_slots, free_slots, estimated_duration, final_duration, folder_id, lang, icone, anim_mode, race_filter, religion_filter, guild_filter, shard_filter, level_filter, subscription_closed, newcomer) VALUES ('302', 'st_mainland', '', '0', '2005-09-21 12:41:33.000000', '2005-08-31 00:00:00.000000', '', 'so_other', 'sl_a', 'rt_strict', 'at_private', 'ss_planned', '0', '0', '0', '0', 'et_short', '0', '0', '', '', 'am_dm', '', '', 'gf_only_my_guild', 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', '0', '0');" || exit 2
|
||||||
|
|
||||||
|
|
||||||
|
## Create one user 'tester' (password : tester)
|
||||||
|
declare accountuser="tester"
|
||||||
|
declare passworduser="tester"
|
||||||
|
curl 'http://localhost:40916/ams/index.php' \
|
||||||
|
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
|
||||||
|
-H 'Accept-Language: en-US' \
|
||||||
|
-H 'Connection: keep-alive' \
|
||||||
|
-H 'Cookie: PHPSESSID=lsoumn9f0ljgm3vo3hgjdead03' \
|
||||||
|
-H 'DNT: 1' \
|
||||||
|
-H 'Host: localhost:40916' \
|
||||||
|
-H 'Referer: http://localhost:40916/ams/index.php?page=register' \
|
||||||
|
-H 'Upgrade-Insecure-Requests: 1' \
|
||||||
|
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0' \
|
||||||
|
-H 'Content-Type: application/x-www-form-urlencoded' \
|
||||||
|
--data 'Username='"$accountuser"'&Password='"$passworduser"'&ConfirmPass=tester&Email=tester%40get2mail.fr&TaC=on&function=add_user' \
|
||||||
|
-o /opt/account_tester.log || exit 2
|
||||||
|
|
||||||
|
# configure nel.permission
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
UPDATE nel.permission SET AccessPrivilege = 'OPEN,DEV,RESTRICTED';
|
||||||
|
" || exit 2
|
||||||
|
|
||||||
|
|
50
dist/docker/server/debian/common/configure_environment.sh
vendored
Executable file
50
dist/docker/server/debian/common/configure_environment.sh
vendored
Executable file
|
@ -0,0 +1,50 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Configure environment
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
echo "CONFIGURE ENVIRONMENT"
|
||||||
|
|
||||||
|
# configure environment
|
||||||
|
cat << EOF > /opt/shard.sh
|
||||||
|
export KHANAT_HOME=/home/gameserver
|
||||||
|
export KHANAT_PATH=/home/gameserver/khanat
|
||||||
|
export PATH=\$PATH:/usr/local/bin:/usr/local/sbin:\$KHANAT_PATH/tools/scripts/linux
|
||||||
|
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
||||||
|
export PATCH_HOME=/home/gameserver
|
||||||
|
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# configure environment
|
||||||
|
cat << EOF > /home/gameserver/.bashrc
|
||||||
|
export KHANAT_HOME=/home/gameserver
|
||||||
|
export KHANAT_PATH=/home/gameserver/khanat
|
||||||
|
export PATH=\$PATH:/usr/local/bin:\$KHANAT_PATH/tools/scripts/linux
|
||||||
|
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
||||||
|
export PATCH_HOME=/home/gameserver
|
||||||
|
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# load environment
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# Initialize ssh
|
||||||
|
/etc/init.d/ssh restart
|
||||||
|
|
||||||
|
|
||||||
|
|
17
dist/docker/server/debian/common/init-basic.sh
vendored
17
dist/docker/server/debian/common/init-basic.sh
vendored
|
@ -1,7 +1,20 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
####################################
|
# Install all package we need to prepare and install khanat server
|
||||||
#
|
#
|
||||||
####################################
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
echo "Start Basic"
|
echo "Start Basic"
|
||||||
|
|
||||||
|
|
527
dist/docker/server/debian/common/init-khanat.sh
vendored
527
dist/docker/server/debian/common/init-khanat.sh
vendored
|
@ -1,509 +1,29 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
# Script to initialize khanat server
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
# /opt/dist/docker/server/init-khanat.sh
|
# /opt/dist/docker/server/init-khanat.sh
|
||||||
|
|
||||||
# install new package
|
/opt/configure_environment.sh || exit 2
|
||||||
cd /; tar xzf /opt/ryzomcore.tar.gz --strip 1 || exit 2
|
/opt/install_package.sh || exit 2
|
||||||
cd /opt; tar xzf ryzom-ressources.tar.gz || exit 2
|
/opt/configure_apache.sh || exit 2
|
||||||
|
/opt/configure_database.sh || exit 2
|
||||||
|
/opt/initialize_khanat_server.sh || exit 2
|
||||||
# configure environment
|
/opt/initialize_patch_server.sh || exit 2
|
||||||
cat << EOF > /opt/shard.sh
|
|
||||||
export KHANAT_HOME=/home/gameserver
|
|
||||||
export KHANAT_PATH=/home/gameserver/khanat
|
|
||||||
export PATH=\$PATH:/usr/local/bin:/usr/local/sbin:\$KHANAT_PATH/tools/scripts/linux
|
|
||||||
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
|
||||||
export PATCH_HOME=/home/gameserver
|
|
||||||
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# configure environment
|
|
||||||
cat << EOF > /home/gameserver/.bashrc
|
|
||||||
export KHANAT_HOME=/home/gameserver
|
|
||||||
export KHANAT_PATH=/home/gameserver/khanat
|
|
||||||
export PATH=\$PATH:/usr/local/bin:\$KHANAT_PATH/tools/scripts/linux
|
|
||||||
export KHANAT_DATA=/home/gameserver/khanat-ressources
|
|
||||||
export PATCH_HOME=/home/gameserver
|
|
||||||
export PATCH_CLIENT_SYSTEM=\$PATCH_HOME/patch_service
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# load environment
|
|
||||||
source /opt/shard.sh
|
|
||||||
|
|
||||||
if [[ -f /opt/khanat_config.sh ]]
|
|
||||||
then
|
|
||||||
echo "Configuration loaded"
|
|
||||||
source /opt/khanat_config.sh
|
|
||||||
echo "KHANAT_CLIENT_VERSION:$KHANAT_CLIENT_VERSION"
|
|
||||||
fi
|
|
||||||
|
|
||||||
mkdir -p $KHANAT_HOME $KHANAT_PATH $PATH || exit 2
|
|
||||||
|
|
||||||
mkdir -p $KHANAT_DATA/ressources
|
|
||||||
(cd $KHANAT_DATA; tar xzf /opt/khanat-ressources.tar.gz) || exit 2
|
|
||||||
#cp -r /opt/ressources $KHANAT_DATA || exit 2
|
|
||||||
|
|
||||||
mkdir -p $KHANAT_PATH/tools/scripts/linux
|
|
||||||
cp -r /opt/code/ryzom/tools/scripts/linux/* $KHANAT_PATH/tools/scripts/linux || exit 2
|
|
||||||
|
|
||||||
# configure ryzom
|
|
||||||
mkdir -p $KHANAT_PATH/server || exit 2
|
|
||||||
cp -r /opt/code/ryzom/common/ $KHANAT_PATH/common || exit 2
|
|
||||||
cp -r /opt/code/ryzom/client/ $KHANAT_PATH/client || exit 2
|
|
||||||
cp /opt/code/ryzom/server/*.cfg $KHANAT_PATH/server/. || exit 2
|
|
||||||
sed -i -r 's/(FSListenHost)(.*)(=)(.*)(;)/FSListenHost = "localhost";/g' $KHANAT_PATH/server/frontend_service.cfg || exit 2
|
|
||||||
sed -i -r 's/(DBHost)(.*)(=)(.*)(;)/DBHost = "localhost";/g' $KHANAT_PATH/server/sql.cfg || exit 2
|
|
||||||
sed -i -r 's/(DBRingName)(.*)(=)(.*)(;)/ DBRingName = "ring_mini01";/g' $KHANAT_PATH/server/sql.cfg || exit 2
|
|
||||||
|
|
||||||
# install web ryzom
|
|
||||||
cp -r /opt/code/web $KHANAT_PATH/khanatweb || exit 2
|
|
||||||
|
|
||||||
chmod -R a+w $KHANAT_PATH/khanatweb || exit 2
|
|
||||||
chown -R www-data:www-data $KHANAT_PATH/khanatweb || exit 2
|
|
||||||
|
|
||||||
# configure apache
|
|
||||||
cat << EOF > /etc/apache2/sites-available/000-default.conf
|
|
||||||
<VirtualHost *:80>
|
|
||||||
<Directory "$KHANAT_PATH/khanatweb/">
|
|
||||||
Options Indexes FollowSymLinks
|
|
||||||
AllowOverride None
|
|
||||||
Require all granted
|
|
||||||
DirectoryIndex index.php
|
|
||||||
AddType text/html .php .phps
|
|
||||||
AddHandler application/x-httpd-php .php
|
|
||||||
AddHandler application/x-httpd-php-source .phps
|
|
||||||
</Directory>
|
|
||||||
ServerName lirria.khaganat.net
|
|
||||||
|
|
||||||
ServerAdmin webmaster@localhost
|
|
||||||
DocumentRoot $KHANAT_PATH/khanatweb/public_php/
|
|
||||||
|
|
||||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
<VirtualHost *:40916>
|
|
||||||
<Directory "$KHANAT_PATH/khanatweb/">
|
|
||||||
Options Indexes FollowSymLinks
|
|
||||||
AllowOverride None
|
|
||||||
Require all granted
|
|
||||||
</Directory>
|
|
||||||
ServerName lirria.khaganat.net
|
|
||||||
|
|
||||||
ServerAdmin admin@localhost
|
|
||||||
DocumentRoot $KHANAT_PATH/khanatweb/public_php
|
|
||||||
|
|
||||||
ErrorLog \${APACHE_LOG_DIR}/error.log
|
|
||||||
CustomLog \${APACHE_LOG_DIR}/access.log combined
|
|
||||||
</VirtualHost>
|
|
||||||
|
|
||||||
<VirtualHost *:43435>
|
|
||||||
ServerName lirria.khaganat.net
|
|
||||||
DocumentRoot $PATCH_HOME/patch_service/patch_game/patch/
|
|
||||||
|
|
||||||
<Directory "/$PATCH_HOME/patch_service/patch_game/patch">
|
|
||||||
Options -Indexes
|
|
||||||
AllowOverride All
|
|
||||||
Require all granted
|
|
||||||
</Directory>
|
|
||||||
</VirtualHost>
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cat << EOF > /etc/apache2/ports.conf
|
|
||||||
# If you just change the port or add more ports here, you will likely also
|
|
||||||
# have to change the VirtualHost statement in
|
|
||||||
# /etc/apache2/sites-enabled/000-default.conf
|
|
||||||
|
|
||||||
Listen 80
|
|
||||||
Listen 40916
|
|
||||||
Listen 43435
|
|
||||||
|
|
||||||
<IfModule ssl_module>
|
|
||||||
Listen 443
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
<IfModule mod_gnutls.c>
|
|
||||||
Listen 443
|
|
||||||
</IfModule>
|
|
||||||
|
|
||||||
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
|
|
||||||
EOF
|
|
||||||
|
|
||||||
# start/restart service mysql & apache
|
|
||||||
service mysql restart || exit 2
|
|
||||||
service apache2 restart || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "CREATE USER 'shard'@'localhost' IDENTIFIED BY '';" || exit 2
|
|
||||||
mysql -u root -e "GRANT ALL PRIVILEGES ON *.* TO 'shard'@'localhost' WITH GRANT OPTION;" || exit 2
|
|
||||||
|
|
||||||
## DATABASE
|
|
||||||
|
|
||||||
# launch web configuration for khanat
|
|
||||||
# -H 'Accept-Encoding: gzip, deflate'
|
|
||||||
curl 'http://localhost:40916/setup/install.php' \
|
|
||||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
|
|
||||||
-H 'Accept-Language: en-US' \
|
|
||||||
-H 'Connection: keep-alive' \
|
|
||||||
-H 'Cookie: PHPSESSID=9jr1ssig58929bp777nrj2fa92' \
|
|
||||||
-H 'DNT: 1' \
|
|
||||||
-H 'Host: localhost:40916' \
|
|
||||||
-H 'Referer: http://localhost:40916/setup/install.php' \
|
|
||||||
-H 'Upgrade-Insecure-Requests: 1' \
|
|
||||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0' \
|
|
||||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
|
||||||
--data 'roleService=on'\
|
|
||||||
'&roleSupport=on'\
|
|
||||||
'&roleDomain=on'\
|
|
||||||
'&privatePhpDirectory=..%2Fprivate_php%2F'\
|
|
||||||
'&nelSetupPassword=admin'\
|
|
||||||
'&nelSqlHostname=localhost'\
|
|
||||||
'&nelSqlUsername=root'\
|
|
||||||
'&nelSqlPassword='\
|
|
||||||
'&nelDatabase=nel'\
|
|
||||||
'&toolDatabase=nel_tool'\
|
|
||||||
'&toolsAdminUsername=admin'\
|
|
||||||
'&toolsAdminPassword=admin'\
|
|
||||||
'&amsSqlHostname=localhost'\
|
|
||||||
'&amsSqlUsername=root'\
|
|
||||||
'&amsSqlPassword='\
|
|
||||||
'&amsDatabase=nel_ams'\
|
|
||||||
'&amsLibDatabase=nel_ams_lib'\
|
|
||||||
'&amsAdminUsername=admin'\
|
|
||||||
'&amsAdminPassword=admin'\
|
|
||||||
'&nelDomainName=Lirria'\
|
|
||||||
'&domainDatabase=ring_mini01'\
|
|
||||||
'&submit=Configure' \
|
|
||||||
-o /opt/setup.log || exit 2
|
|
||||||
|
|
||||||
grep "Domain role successfully installed" /opt/setup.log >/dev/null || exit 2
|
|
||||||
|
|
||||||
# configure domain
|
|
||||||
tmp=$(hostname -I)
|
|
||||||
export addressip=${tmp//[[:blank:]]/}
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel.domain (domain_id, domain_name, status, patch_version, backup_patch_url, patch_urls, login_address, session_manager_address, ring_db_name, web_host, web_host_php, description) VALUES ('12', 'Lirria', 'ds_open', '$KHANAT_CLIENT_VERSION', '$addressip:23001', '$addressip/patch', '$addressip:49998', '$addressip:49999', 'ring_mini01', '$addressip:30000', '$addressip:40916', NULL);" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel.shard (ShardId, domain_id, WsAddr, NbPlayers, Name, Online, Version, FixedSessionId, State, MOTD) VALUES ('302', '12', '$addressip:', '0', 'Lirria shard', '0', '', '0', 'ds_open', '');" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel_tool.neltool_domains (domain_id, domain_name, domain_as_host, domain_as_port, domain_rrd_path, domain_las_admin_path, domain_las_local_path, domain_application, domain_sql_string, domain_hd_check, domain_mfs_web, domain_cs_sql_string) VALUES ('12', 'Lirria', '$addressip', '46700', '/home/gameserver/khanat/server/save_shard/rrd_graphs', '', '', 'ryzom_open', '', '0', NULL, NULL);" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel_tool.neltool_shards (shard_id, shard_name, shard_as_id, shard_domain_id, shard_lang, shard_restart) VALUES ('302', 'open', 'open', '12', 'fr', '0');" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel_tool.neltool_user_domains (user_domain_id, user_domain_user_id, user_domain_domain_id) VALUES ('1', '1', '12');" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
INSERT INTO nel_tool.neltool_user_shards (user_shard_id, user_shard_user_id, user_shard_shard_id, user_shard_domain_id) VALUES ('1', '1', '302', '12');" || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use ring_mini01;
|
|
||||||
INSERT INTO ring_mini01.sessions (session_id, session_type, title, owner, plan_date, start_date, description, orientation, level, rule_type, access_type, state, host_shard_id, subscription_slots, reserved_slots, free_slots, estimated_duration, final_duration, folder_id, lang, icone, anim_mode, race_filter, religion_filter, guild_filter, shard_filter, level_filter, subscription_closed, newcomer) VALUES ('302', 'st_mainland', '', '0', '2005-09-21 12:41:33.000000', '2005-08-31 00:00:00.000000', '', 'so_other', 'sl_a', 'rt_strict', 'at_private', 'ss_planned', '0', '0', '0', '0', 'et_short', '0', '0', '', '', 'am_dm', '', '', 'gf_only_my_guild', 'sf_shard00,sf_shard01,sf_shard02,sf_shard03,sf_shard04,sf_shard05,sf_shard06,sf_shard07,sf_shard08,sf_shard09,sf_shard10,sf_shard11,sf_shard12,sf_shard13,sf_shard14,sf_shard15,sf_shard16,sf_shard17,sf_shard18,sf_shard19,sf_shard20,sf_shard21,sf_shard22,sf_shard23,sf_shard24,sf_shard25,sf_shard26,sf_shard27,sf_shard28,sf_shard29,sf_shard30', 'lf_a,lf_b,lf_c,lf_d,lf_e,lf_f', '0', '0');" || exit 2
|
|
||||||
|
|
||||||
## Create an user
|
|
||||||
# tester / tester
|
|
||||||
curl 'http://localhost:40916/ams/index.php' \
|
|
||||||
-H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8' \
|
|
||||||
-H 'Accept-Language: en-US' \
|
|
||||||
-H 'Connection: keep-alive' \
|
|
||||||
-H 'Cookie: PHPSESSID=lsoumn9f0ljgm3vo3hgjdead03' \
|
|
||||||
-H 'DNT: 1' \
|
|
||||||
-H 'Host: localhost:40916' \
|
|
||||||
-H 'Referer: http://localhost:40916/ams/index.php?page=register' \
|
|
||||||
-H 'Upgrade-Insecure-Requests: 1' \
|
|
||||||
-H 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:6.0) Gecko/20100101 Firefox/6.0' \
|
|
||||||
-H 'Content-Type: application/x-www-form-urlencoded' \
|
|
||||||
--data 'Username=tester&Password=tester&ConfirmPass=tester&Email=tester%40get2mail.fr&TaC=on&function=add_user' \
|
|
||||||
-o /opt/account_tester.log || exit 2
|
|
||||||
|
|
||||||
mysql -u root -e "use nel;
|
|
||||||
UPDATE nel.permission SET AccessPrivilege = 'OPEN,DEV,RESTRICTED';
|
|
||||||
" || exit 2
|
|
||||||
|
|
||||||
###
|
|
||||||
|
|
||||||
# create link resource
|
|
||||||
# Les dossiers :
|
|
||||||
ln -s $KHANAT_DATA/collisions $KHANAT_PATH/server/
|
|
||||||
ln -s $KHANAT_DATA/leveldesign $KHANAT_PATH/server/
|
|
||||||
ln -s $KHANAT_DATA/primitives $KHANAT_PATH/server/
|
|
||||||
ln -s $KHANAT_DATA/translation $KHANAT_PATH/server/
|
|
||||||
ln -s $KHANAT_DATA/continents $KHANAT_PATH/server/
|
|
||||||
ln -s $KHANAT_DATA/common $KHANAT_PATH/server/
|
|
||||||
|
|
||||||
# Les fichiers :
|
|
||||||
mkdir -p $KHANAT_PATH/server/data_shard
|
|
||||||
cp -r /opt/code/ryzom/server/data_shard/* $KHANAT_PATH/server/data_shard/.
|
|
||||||
ln -s $KHANAT_DATA/shard/su/dev_gm_names.xml $KHANAT_PATH/server/data_shard/dev_gm_names.xml
|
|
||||||
ln -s $KHANAT_DATA/shard/su/invalid_entity_names.txt $KHANAT_PATH/server/data_shard/invalid_entity_names.txt
|
|
||||||
ln -s $KHANAT_DATA/shard/su/reserved_names.xml $KHANAT_PATH/server/data_shard/reserved_names.xml
|
|
||||||
ln -s $KHANAT_DATA/shard/egs/game_event.txt $KHANAT_PATH/server/data_shard/game_event.txt
|
|
||||||
ln -s $KHANAT_DATA/shard/egs/mission_queues.txt $KHANAT_PATH/server/data_shard/mission_queues.txt
|
|
||||||
ln -s $KHANAT_DATA/shard/egs/named_items.txt $KHANAT_PATH/server/data_shard/named_items.txt
|
|
||||||
|
|
||||||
mkdir -p $KHANAT_DATA/mirror_sheets
|
|
||||||
cp -r /opt/code/ryzom/server/data_shard/mirror_sheets/* $KHANAT_DATA/mirror_sheets
|
|
||||||
|
|
||||||
# Generate data
|
|
||||||
cd /usr/local; /usr/local/bin/make_sheet_id \
|
|
||||||
-o$KHANAT_DATA/leveldesign/game_elem/sheet_id.bin \
|
|
||||||
$KHANAT_DATA/leveldesign/game_elem \
|
|
||||||
$KHANAT_DATA/leveldesign/game_element \
|
|
||||||
$KHANAT_DATA/leveldesign/world \
|
|
||||||
$KHANAT_DATA/leveldesign/ecosystems \
|
|
||||||
$KHANAT_DATA/sound \
|
|
||||||
$KHANAT_DATA/mirror_sheets || exit 2
|
|
||||||
|
|
||||||
rm -rf /opt/sheets_packer/*
|
|
||||||
mkdir -p /opt/sheets_packer/common /opt/sheets_packer/khanat-ressources /opt/sheets_packer/client
|
|
||||||
cat << EOF > /opt/sheets_packer/sheets_packer.cfg
|
|
||||||
/////////////////////////////////
|
|
||||||
/////////////////////////////////
|
|
||||||
/// SHEETS PACKER CONFIG FILE ///
|
|
||||||
/////////////////////////////////
|
|
||||||
/////////////////////////////////
|
|
||||||
DataPath = { "/opt/sheets_packer/common/data_leveldesign",
|
|
||||||
"/opt/sheets_packer/common/data_common",
|
|
||||||
"/opt/sheets_packer/client/data",
|
|
||||||
"/opt/sheets_packer/khanat-ressources/common",
|
|
||||||
"/opt/sheets_packer/khanat-ressources/leveldesign",
|
|
||||||
"/opt/sheets_packer/khanat-ressources/primitives" };
|
|
||||||
WorldSheet = "ryzom.world";
|
|
||||||
PrimitivesPath = "/opt/sheets_packer/khanat-ressources/primitives";
|
|
||||||
OutputDataPath = "/opt/sheets_packer/client/data";
|
|
||||||
LigoPrimitiveClass = "world_editor_classes.xml";
|
|
||||||
DumpVisualSlotsIndex = 1;
|
|
||||||
EOF
|
|
||||||
|
|
||||||
cp -r /opt/code/ryzom/common/* /opt/sheets_packer/common || exit 2
|
|
||||||
cp -r $KHANAT_DATA/* /opt/sheets_packer/khanat-ressources || exit 2
|
|
||||||
cp -r /opt/code/ryzom/client/* /opt/sheets_packer/client || exit 2
|
|
||||||
cd /opt/sheets_packer; sheets_packer || exit 2
|
|
||||||
cp /opt/sheets_packer/visual_slot.tab $KHANAT_PATH/common/data_common/visual_slot.tab || exit 2
|
|
||||||
cp /opt/sheets_packer/visual_slot.tab $KHANAT_PATH/client/data/visual_slot.tab || exit 2
|
|
||||||
|
|
||||||
|
|
||||||
for var in $KHANAT_DATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_de}; done
|
|
||||||
for var in $KHANAT_DATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_es}; done
|
|
||||||
for var in $KHANAT_DATA/translation/translated/*_wk.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_wk/_ru}; done
|
|
||||||
|
|
||||||
# Copy default screen configuration
|
|
||||||
cp /opt/code/ryzom/server/shard.screen.rc $KHANAT_PATH/server/shard.screen.rc
|
|
||||||
sed -i -r 's/\$RYZOM_PATH\/\.\.\/build\/bin\///g' $KHANAT_PATH/server/shard.screen.rc
|
|
||||||
|
|
||||||
ln -s /usr/local /home/gameserver/build
|
|
||||||
|
|
||||||
## Initialize ssh
|
|
||||||
/etc/init.d/ssh restart
|
|
||||||
|
|
||||||
# create default directory for rrd data
|
|
||||||
mkdir -p $KHANAT_PATH/server/save_shard/rrd_graphs
|
|
||||||
|
|
||||||
|
|
||||||
## See on https://ryzomcore.atlassian.net/wiki/display/RC/Configure+Linux+Web+Services
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/admin/graphs_output
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/admin/templates/default_c
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/www/login/logs
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/ryzom_ams/www/
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/ryzom_ams/www/html/cache
|
|
||||||
#mkdir -p $KHANAT_PATH/tools/server/ryzom_ams/www/html/templates_c
|
|
||||||
#shard
|
|
||||||
|
|
||||||
#
|
|
||||||
# Serveur Patch
|
|
||||||
# Account use : gameserver
|
|
||||||
|
|
||||||
# Generate data to client
|
|
||||||
echo "PATCH - CREATE DIRECTORY"
|
|
||||||
echo "PATCH_HOME:$PATCH_HOME"
|
|
||||||
echo "PATCH_CLIENT_SYSTEM:$PATCH_CLIENT_SYSTEM"
|
|
||||||
mkdir -p $PATCH_HOME/patch_service/dataserver || exit 2
|
|
||||||
|
|
||||||
# Search le nombre de langue
|
|
||||||
listlang=$(ls $KHANAT_DATA/translation/translated | cut -f 1 -d '.' | sed 's/^.*\(.\{2\}\)$/\1/' | sort | uniq)
|
|
||||||
echo "LIST LANG : $listlang"
|
|
||||||
|
|
||||||
for lang in $listlang
|
|
||||||
do
|
|
||||||
echo "create dir : $PATCH_HOME/patch_service/dataserver/kh_translate_$lang"
|
|
||||||
mkdir -p $PATCH_HOME/patch_service/dataserver/kh_translate_$lang || exit 2
|
|
||||||
done
|
|
||||||
mkdir -p $PATCH_HOME/patch_service/kh_server || exit 2
|
|
||||||
mkdir -p $PATCH_HOME/patch_service/dataserver || exit 2
|
|
||||||
mkdir -p $PATCH_CLIENT_SYSTEM/patch_game/bnp/
|
|
||||||
|
|
||||||
echo "COPY DATA TO GENERATE PATCH"
|
|
||||||
cp $KHANAT_PATH/common/data_common/database.xml $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
cp $KHANAT_PATH/common/data_common/msg.xml $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
cp /opt/sheets_packer/client/data/*.packed_sheets $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
cp /opt/sheets_packer/client/data/*.packed $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
cp $KHANAT_PATH/common/data_common/visual_slot.tab $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
cp $KHANAT_DATA/leveldesign/game_elem/sheet_id.bin $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
|
||||||
|
|
||||||
|
|
||||||
cd $PATCH_HOME/patch_service/dataserver; tar xzf /opt/khanat-data-client.tar.gz || exit 2
|
|
||||||
|
|
||||||
# language : copy to client (to generate client patch)
|
|
||||||
for lang in $listlang
|
|
||||||
do
|
|
||||||
cp $KHANAT_DATA/translation/translated/*$lang.* $PATCH_CLIENT_SYSTEM/dataserver/kh_translate_$lang/ || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
echo "GENERATE PATCH"
|
|
||||||
for lang in $listlang
|
|
||||||
do
|
|
||||||
cd $PATCH_CLIENT_SYSTEM/dataserver/; bnp_make -p kh_translate_$lang || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
# tous les bnp de khanat-data-client
|
|
||||||
cd $PATCH_HOME/patch_service/dataserver/data/; bnp_make -p fonts || exit 2
|
|
||||||
for dir in $PATCH_HOME/patch_service/dataserver/data/kh/*
|
|
||||||
do
|
|
||||||
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
#for dir in $PATCH_HOME/patch_service/dataserver/data/kh_shard/*
|
|
||||||
#do
|
|
||||||
# cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
|
||||||
#done
|
|
||||||
|
|
||||||
for dir in $PATCH_HOME/patch_service/dataserver/data/ryz/*
|
|
||||||
do
|
|
||||||
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
## TODO - check how generate '.ref' files
|
|
||||||
for dir in $PATCH_HOME/patch_service/dataserver/client/*
|
|
||||||
do
|
|
||||||
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
|
||||||
done
|
|
||||||
for file in $PATCH_HOME/patch_service/dataserver/client/*.bnp
|
|
||||||
do
|
|
||||||
mv "$file" "${file%.bnp}_.ref" || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
|
|
||||||
# kh_server
|
|
||||||
cd $PATCH_CLIENT_SYSTEM/; bnp_make -p kh_server || exit 2
|
|
||||||
|
|
||||||
echo "MOVE PATCH"
|
|
||||||
|
|
||||||
for file in $PATCH_HOME/patch_service/dataserver/client/*.ref
|
|
||||||
do
|
|
||||||
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
for file in $PATCH_HOME/patch_service/dataserver/data/kh/*.bnp
|
|
||||||
do
|
|
||||||
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
#for file in $PATCH_HOME/patch_service/dataserver/data/kh_shard/*.bnp
|
|
||||||
#do
|
|
||||||
# mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
#done
|
|
||||||
|
|
||||||
for file in $PATCH_HOME/patch_service/dataserver/data/ryz/*.bnp
|
|
||||||
do
|
|
||||||
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
done
|
|
||||||
|
|
||||||
for lang in $listlang
|
|
||||||
do
|
|
||||||
mv $PATCH_CLIENT_SYSTEM/dataserver/kh_translate_$lang.bnp $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
done
|
|
||||||
mv kh_server.bnp $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
|
||||||
|
|
||||||
chown -R gameserver:www-data $PATCH_HOME/patch_service || exit 2
|
|
||||||
|
|
||||||
echo "PREPARE PATCH"
|
|
||||||
#
|
|
||||||
su -c "cd $PATCH_HOME/patch_service; patch_gen createNewProduct patch_game/ryzom.xml" gameserver || exit 2
|
|
||||||
su -c "cd $PATCH_HOME/patch_service;touch patch_game/Lirria.version" gameserver || exit 2
|
|
||||||
sed -i -r 's/value="main"/value="khanat_lirria"/g' patch_game/ryzom.xml || exit 2
|
|
||||||
sed -i -r 's/_NextVersionFile type="STRING" value=""/_NextVersionFile type="STRING" value="patch_game\/Lirria.version"/g' patch_game/ryzom.xml || exit 2
|
|
||||||
|
|
||||||
# Edit RYZOM file
|
|
||||||
|
|
||||||
# search all ref files
|
|
||||||
ADDREF=""
|
|
||||||
#for file in /home/gameserver/patch_service/patch_game/bnp/*.ref
|
|
||||||
#do
|
|
||||||
# ADDREF="$ADDREF"'<_Files type=\"STRING\" value=\"'$(basename $file)'\"/>'
|
|
||||||
#done
|
|
||||||
|
|
||||||
# Remove other _Category (keep 1st) and add ref file
|
|
||||||
cp patch_game/ryzom.xml patch_game/ryzom.xml.ref || exit 2
|
|
||||||
awk 'BEGIN{found=0}{
|
|
||||||
if(found==0 && $1 == "<_Category>") {
|
|
||||||
found = 1;
|
|
||||||
} else if(found == 1 && $1 == "</_Category>") {
|
|
||||||
found = 2;
|
|
||||||
print "'"$ADDREF"'";
|
|
||||||
print $0;
|
|
||||||
} else if(found == 2 && $1 == "</_Categories>") {
|
|
||||||
found = 3;
|
|
||||||
}
|
|
||||||
if ( found != 2 ) {
|
|
||||||
print $0
|
|
||||||
}
|
|
||||||
}' patch_game/ryzom.xml.ref > patch_game/ryzom.xml || exit 2
|
|
||||||
|
|
||||||
# Force version release
|
|
||||||
if [[ $KHANAT_CLIENT_VERSION -gt 1 ]]
|
|
||||||
then
|
|
||||||
# rm $PATCH_HOME/patch_service/patch_game/ryzom.hist
|
|
||||||
# rm $PATCH_HOME/patch_service/patch_game/ref/*
|
|
||||||
echo -n "$KHANAT_CLIENT_VERSION" > $PATCH_HOME/patch_service/patch_game/Lirria.version
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Generate patch
|
|
||||||
su -c "cd $PATCH_HOME/patch_service; patch_gen updateProduct patch_game/ryzom.xml" gameserver || exit 2
|
|
||||||
# Edit release note
|
|
||||||
cat << EOF > $PATCH_HOME/patch_service/patch_game/patch/index.php
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<h1>New test data - Release $KHANAT_CLIENT_VERSION</h1>
|
|
||||||
<p>An update will now be performed to your client(the /user directory to be exact).
|
|
||||||
Please help us test the deployment of our free MMORPG server!!
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
EOF
|
|
||||||
chown gameserver:www-data $PATCH_HOME/patch_service/patch_game/patch/index.php
|
|
||||||
|
|
||||||
# TODO - Strange, we need update patch - to be check
|
|
||||||
cat << EOF > $PATCH_HOME/patch_service/patch_game/patch/Lirria.version
|
|
||||||
$KHANAT_CLIENT_VERSION $KHANAT_CLIENT_VERSION
|
|
||||||
EOF
|
|
||||||
|
|
||||||
echo "CONFIGURE APACHE"
|
|
||||||
cat << EOF > /etc/apache2/conf-available/patch_service.conf
|
|
||||||
Alias /patch /home/gameserver/patch_service/patch_game/patch
|
|
||||||
<Directory /home/gameserver/patch_service/patch_game/patch>
|
|
||||||
Options FollowSymLinks
|
|
||||||
DirectoryIndex index.php
|
|
||||||
|
|
||||||
Require all granted
|
|
||||||
|
|
||||||
<IfModule mod_php5.c>
|
|
||||||
<IfModule mod_mime.c>
|
|
||||||
AddType application/x-httpd-php .php
|
|
||||||
</IfModule>
|
|
||||||
<FilesMatch ".+\.php$">
|
|
||||||
SetHandler application/x-httpd-php
|
|
||||||
</FilesMatch>
|
|
||||||
</IfModule>
|
|
||||||
</Directory>
|
|
||||||
EOF
|
|
||||||
# Activate & deploy new configuration
|
|
||||||
a2enconf patch_service.conf
|
|
||||||
|
|
||||||
chown -R gameserver:www-data $PATCH_HOME/patch_service
|
|
||||||
chmod g+w -R $PATCH_HOME/patch_service
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Stop All
|
# Stop All
|
||||||
|
@ -512,3 +32,6 @@ chmod g+w -R $PATCH_HOME/patch_service
|
||||||
service ssh stop || exit 2
|
service ssh stop || exit 2
|
||||||
service apache2 stop|| exit 2
|
service apache2 stop|| exit 2
|
||||||
service mysql stop || exit 2
|
service mysql stop || exit 2
|
||||||
|
|
||||||
|
exit 0
|
||||||
|
|
||||||
|
|
104
dist/docker/server/debian/common/initialize_khanat_server.sh
vendored
Executable file
104
dist/docker/server/debian/common/initialize_khanat_server.sh
vendored
Executable file
|
@ -0,0 +1,104 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Configure server Khanat
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
echo "INITIALIZE KHANAT SERVER"
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# GET PARAM ENVIRONMENT
|
||||||
|
#######################
|
||||||
|
export KHANAT_CLIENT_VERSION=1
|
||||||
|
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# load environment
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# Load
|
||||||
|
if [[ -f /opt/khanat_config.sh ]]
|
||||||
|
then
|
||||||
|
echo "Configuration loaded"
|
||||||
|
source /opt/khanat_config.sh
|
||||||
|
echo "KHANAT_CLIENT_VERSION:$KHANAT_CLIENT_VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# configure khanat server
|
||||||
|
sed -i -r 's/(FSListenHost)(.*)(=)(.*)(;)/FSListenHost = "localhost";/g' $KHANAT_PATH/server/frontend_service.cfg || exit 2
|
||||||
|
sed -i -r 's/(DBHost)(.*)(=)(.*)(;)/DBHost = "localhost";/g' $KHANAT_PATH/server/sql.cfg || exit 2
|
||||||
|
sed -i -r 's/(DBRingName)(.*)(=)(.*)(;)/ DBRingName = "ring_mini01";/g' $KHANAT_PATH/server/sql.cfg || exit 2
|
||||||
|
|
||||||
|
# Generate data
|
||||||
|
cd /usr/local; /usr/local/bin/make_sheet_id \
|
||||||
|
-o$KHANAT_DATA/leveldesign/game_elem/sheet_id.bin \
|
||||||
|
$KHANAT_DATA/leveldesign/game_elem \
|
||||||
|
$KHANAT_DATA/leveldesign/game_element \
|
||||||
|
$KHANAT_DATA/leveldesign/world \
|
||||||
|
$KHANAT_DATA/leveldesign/ecosystems \
|
||||||
|
$KHANAT_DATA/sound \
|
||||||
|
$KHANAT_DATA/mirror_sheets || exit 2
|
||||||
|
|
||||||
|
# configure sheets_packer.cfg
|
||||||
|
rm -rf /opt/sheets_packer/*
|
||||||
|
mkdir -p /opt/sheets_packer/common /opt/sheets_packer/khanat-ressources /opt/sheets_packer/client
|
||||||
|
cat << EOF > /opt/sheets_packer/sheets_packer.cfg
|
||||||
|
/////////////////////////////////
|
||||||
|
/////////////////////////////////
|
||||||
|
/// SHEETS PACKER CONFIG FILE ///
|
||||||
|
/////////////////////////////////
|
||||||
|
/////////////////////////////////
|
||||||
|
DataPath = { "/opt/sheets_packer/common/data_leveldesign",
|
||||||
|
"/opt/sheets_packer/common/data_common",
|
||||||
|
"/opt/sheets_packer/client/data",
|
||||||
|
"/opt/sheets_packer/khanat-ressources/common",
|
||||||
|
"/opt/sheets_packer/khanat-ressources/leveldesign",
|
||||||
|
"/opt/sheets_packer/khanat-ressources/primitives" };
|
||||||
|
WorldSheet = "ryzom.world";
|
||||||
|
PrimitivesPath = "/opt/sheets_packer/khanat-ressources/primitives";
|
||||||
|
OutputDataPath = "/opt/sheets_packer/client/data";
|
||||||
|
LigoPrimitiveClass = "world_editor_classes.xml";
|
||||||
|
DumpVisualSlotsIndex = 1;
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# copy data to target
|
||||||
|
cp -r /opt/code/ryzom/common/* /opt/sheets_packer/common || exit 2
|
||||||
|
cp -r $KHANAT_DATA/* /opt/sheets_packer/khanat-ressources || exit 2
|
||||||
|
cp -r /opt/code/ryzom/client/* /opt/sheets_packer/client || exit 2
|
||||||
|
cd /opt/sheets_packer; sheets_packer || exit 2
|
||||||
|
cp /opt/sheets_packer/visual_slot.tab $KHANAT_PATH/common/data_common/visual_slot.tab || exit 2
|
||||||
|
cp /opt/sheets_packer/visual_slot.tab $KHANAT_PATH/client/data/visual_slot.tab || exit 2
|
||||||
|
|
||||||
|
# link translation
|
||||||
|
for var in $KHANAT_DATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_de}; done
|
||||||
|
for var in $KHANAT_DATA/translation/translated/*_en.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_en/_es}; done
|
||||||
|
for var in $KHANAT_DATA/translation/translated/*_wk.txt; do nomfic=${var##*/}; ln -s $nomfic ${var%/*}/${nomfic/_wk/_ru}; done
|
||||||
|
|
||||||
|
# Copy default screen configuration
|
||||||
|
cp /opt/code/ryzom/server/shard.screen.rc $KHANAT_PATH/server/shard.screen.rc
|
||||||
|
sed -i -r 's/\$RYZOM_PATH\/\.\.\/build\/bin\///g' $KHANAT_PATH/server/shard.screen.rc
|
||||||
|
|
||||||
|
ln -s /usr/local /home/gameserver/build
|
||||||
|
|
||||||
|
# create default directory for rrd data
|
||||||
|
mkdir -p $KHANAT_PATH/server/save_shard/rrd_graphs
|
||||||
|
|
||||||
|
|
218
dist/docker/server/debian/common/initialize_patch_server.sh
vendored
Executable file
218
dist/docker/server/debian/common/initialize_patch_server.sh
vendored
Executable file
|
@ -0,0 +1,218 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# install / compile data / configure patch server
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
echo "INITIALIZE PATCH SERVER"
|
||||||
|
|
||||||
|
#######################
|
||||||
|
# GET PARAM ENVIRONMENT
|
||||||
|
#######################
|
||||||
|
export KHANAT_CLIENT_VERSION=1
|
||||||
|
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
# load environment
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# Load
|
||||||
|
if [[ -f /opt/khanat_config.sh ]]
|
||||||
|
then
|
||||||
|
echo "Configuration loaded"
|
||||||
|
source /opt/khanat_config.sh
|
||||||
|
echo "KHANAT_CLIENT_VERSION:$KHANAT_CLIENT_VERSION"
|
||||||
|
fi
|
||||||
|
|
||||||
|
#
|
||||||
|
# Serveur Patch
|
||||||
|
# Account use : gameserver
|
||||||
|
|
||||||
|
# Generate data to client
|
||||||
|
echo "PATCH - CREATE DIRECTORY"
|
||||||
|
echo "PATCH_HOME:$PATCH_HOME"
|
||||||
|
echo "PATCH_CLIENT_SYSTEM:$PATCH_CLIENT_SYSTEM"
|
||||||
|
mkdir -p $PATCH_HOME/patch_service/dataserver || exit 2
|
||||||
|
|
||||||
|
# Search le nombre de langue
|
||||||
|
listlang=$(ls $KHANAT_DATA/translation/translated | cut -f 1 -d '.' | sed 's/^.*\(.\{2\}\)$/\1/' | sort | uniq)
|
||||||
|
echo "LIST LANG : $listlang"
|
||||||
|
|
||||||
|
for lang in $listlang
|
||||||
|
do
|
||||||
|
echo "create dir : $PATCH_HOME/patch_service/dataserver/kh_translate_$lang"
|
||||||
|
mkdir -p $PATCH_HOME/patch_service/dataserver/kh_translate_$lang || exit 2
|
||||||
|
done
|
||||||
|
mkdir -p $PATCH_HOME/patch_service/kh_server || exit 2
|
||||||
|
mkdir -p $PATCH_HOME/patch_service/dataserver || exit 2
|
||||||
|
mkdir -p $PATCH_CLIENT_SYSTEM/patch_game/bnp/
|
||||||
|
|
||||||
|
echo "COPY DATA TO GENERATE PATCH"
|
||||||
|
cp $KHANAT_PATH/common/data_common/database.xml $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
cp $KHANAT_PATH/common/data_common/msg.xml $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
cp /opt/sheets_packer/client/data/*.packed_sheets $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
cp /opt/sheets_packer/client/data/*.packed $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
cp $KHANAT_PATH/common/data_common/visual_slot.tab $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
cp $KHANAT_DATA/leveldesign/game_elem/sheet_id.bin $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
|
||||||
|
|
||||||
|
|
||||||
|
cd $PATCH_HOME/patch_service/dataserver; tar xzf /opt/khanat-data-client.tar.gz || exit 2
|
||||||
|
|
||||||
|
# language : copy to client (to generate client patch)
|
||||||
|
for lang in $listlang
|
||||||
|
do
|
||||||
|
cp $KHANAT_DATA/translation/translated/*$lang.* $PATCH_CLIENT_SYSTEM/dataserver/kh_translate_$lang/ || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "GENERATE PATCH"
|
||||||
|
for lang in $listlang
|
||||||
|
do
|
||||||
|
cd $PATCH_CLIENT_SYSTEM/dataserver/; bnp_make -p kh_translate_$lang || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
# tous les bnp de khanat-data-client
|
||||||
|
cd $PATCH_HOME/patch_service/dataserver/data/; bnp_make -p fonts || exit 2
|
||||||
|
for dir in $PATCH_HOME/patch_service/dataserver/data/kh/*
|
||||||
|
do
|
||||||
|
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
#for dir in $PATCH_HOME/patch_service/dataserver/data/kh_shard/*
|
||||||
|
#do
|
||||||
|
# cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
||||||
|
#done
|
||||||
|
|
||||||
|
for dir in $PATCH_HOME/patch_service/dataserver/data/ryz/*
|
||||||
|
do
|
||||||
|
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
## TODO - check how generate '.ref' files
|
||||||
|
for dir in $PATCH_HOME/patch_service/dataserver/client/*
|
||||||
|
do
|
||||||
|
cd $dir/..; bnp_make -p $(basename $dir) || exit 2
|
||||||
|
done
|
||||||
|
for file in $PATCH_HOME/patch_service/dataserver/client/*.bnp
|
||||||
|
do
|
||||||
|
mv "$file" "${file%.bnp}_.ref" || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
# kh_server
|
||||||
|
cd $PATCH_CLIENT_SYSTEM/; bnp_make -p kh_server || exit 2
|
||||||
|
|
||||||
|
echo "MOVE PATCH"
|
||||||
|
|
||||||
|
for file in $PATCH_HOME/patch_service/dataserver/client/*.ref
|
||||||
|
do
|
||||||
|
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
for file in $PATCH_HOME/patch_service/dataserver/data/kh/*.bnp
|
||||||
|
do
|
||||||
|
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
#for file in $PATCH_HOME/patch_service/dataserver/data/kh_shard/*.bnp
|
||||||
|
#do
|
||||||
|
# mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
#done
|
||||||
|
|
||||||
|
for file in $PATCH_HOME/patch_service/dataserver/data/ryz/*.bnp
|
||||||
|
do
|
||||||
|
mv "$file" $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
done
|
||||||
|
|
||||||
|
for lang in $listlang
|
||||||
|
do
|
||||||
|
mv $PATCH_CLIENT_SYSTEM/dataserver/kh_translate_$lang.bnp $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
done
|
||||||
|
mv kh_server.bnp $PATCH_CLIENT_SYSTEM/patch_game/bnp/ || exit 2
|
||||||
|
|
||||||
|
chown -R gameserver:www-data $PATCH_HOME/patch_service || exit 2
|
||||||
|
|
||||||
|
echo "PREPARE PATCH"
|
||||||
|
#
|
||||||
|
su -c "cd $PATCH_HOME/patch_service; patch_gen createNewProduct patch_game/ryzom.xml" gameserver || exit 2
|
||||||
|
su -c "cd $PATCH_HOME/patch_service;touch patch_game/Lirria.version" gameserver || exit 2
|
||||||
|
sed -i -r 's/value="main"/value="khanat_lirria"/g' patch_game/ryzom.xml || exit 2
|
||||||
|
sed -i -r 's/_NextVersionFile type="STRING" value=""/_NextVersionFile type="STRING" value="patch_game\/Lirria.version"/g' patch_game/ryzom.xml || exit 2
|
||||||
|
|
||||||
|
# Edit RYZOM file
|
||||||
|
|
||||||
|
# search all ref files
|
||||||
|
ADDREF=""
|
||||||
|
#for file in /home/gameserver/patch_service/patch_game/bnp/*.ref
|
||||||
|
#do
|
||||||
|
# ADDREF="$ADDREF"'<_Files type=\"STRING\" value=\"'$(basename $file)'\"/>'
|
||||||
|
#done
|
||||||
|
|
||||||
|
# Remove other _Category (keep 1st) and add ref file
|
||||||
|
cp patch_game/ryzom.xml patch_game/ryzom.xml.ref || exit 2
|
||||||
|
awk 'BEGIN{found=0}{
|
||||||
|
if(found==0 && $1 == "<_Category>") {
|
||||||
|
found = 1;
|
||||||
|
} else if(found == 1 && $1 == "</_Category>") {
|
||||||
|
found = 2;
|
||||||
|
print "'"$ADDREF"'";
|
||||||
|
print $0;
|
||||||
|
} else if(found == 2 && $1 == "</_Categories>") {
|
||||||
|
found = 3;
|
||||||
|
}
|
||||||
|
if ( found != 2 ) {
|
||||||
|
print $0
|
||||||
|
}
|
||||||
|
}' patch_game/ryzom.xml.ref > patch_game/ryzom.xml || exit 2
|
||||||
|
|
||||||
|
# Force version release
|
||||||
|
if [[ $KHANAT_CLIENT_VERSION -gt 1 ]]
|
||||||
|
then
|
||||||
|
# rm $PATCH_HOME/patch_service/patch_game/ryzom.hist
|
||||||
|
# rm $PATCH_HOME/patch_service/patch_game/ref/*
|
||||||
|
echo -n "$KHANAT_CLIENT_VERSION" > $PATCH_HOME/patch_service/patch_game/Lirria.version
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Generate patch
|
||||||
|
su -c "cd $PATCH_HOME/patch_service; patch_gen updateProduct patch_game/ryzom.xml" gameserver || exit 2
|
||||||
|
|
||||||
|
# Edit release note
|
||||||
|
cat << EOF > $PATCH_HOME/patch_service/patch_game/patch/index.php
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>New test data - Release $KHANAT_CLIENT_VERSION</h1>
|
||||||
|
<p>An update will now be performed to your client(the /user directory to be exact).
|
||||||
|
Please help us test the deployment of our free MMORPG server!!
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
EOF
|
||||||
|
chown gameserver:www-data $PATCH_HOME/patch_service/patch_game/patch/index.php
|
||||||
|
|
||||||
|
# TODO - Strange, we need update patch - to be check
|
||||||
|
cat << EOF > $PATCH_HOME/patch_service/patch_game/patch/Lirria.version
|
||||||
|
$KHANAT_CLIENT_VERSION $KHANAT_CLIENT_VERSION
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# configure right (apache can read files)
|
||||||
|
chown -R gameserver:www-data $PATCH_HOME/patch_service
|
||||||
|
chmod g+w -R $PATCH_HOME/patch_service
|
||||||
|
|
79
dist/docker/server/debian/common/install_package.sh
vendored
Executable file
79
dist/docker/server/debian/common/install_package.sh
vendored
Executable file
|
@ -0,0 +1,79 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Install binary and data
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
|
||||||
|
echo "INSTALL PACKAGE"
|
||||||
|
|
||||||
|
# Load Environment
|
||||||
|
export KHANAT_CLIENT_VERSION=1
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# install new package
|
||||||
|
cd /; tar xzf /opt/ryzomcore.tar.gz --strip 1 || exit 2
|
||||||
|
cd /opt; tar xzf ryzom-ressources.tar.gz || exit 2
|
||||||
|
|
||||||
|
# Create Home directory (if not exist)
|
||||||
|
mkdir -p $KHANAT_PATH || exit 2
|
||||||
|
|
||||||
|
# install web khanat
|
||||||
|
cp -r /opt/code/web $KHANAT_PATH/khanatweb || exit 2
|
||||||
|
chmod -R a+w $KHANAT_PATH/khanatweb || exit 2
|
||||||
|
chown -R www-data:www-data $KHANAT_PATH/khanatweb || exit 2
|
||||||
|
|
||||||
|
# Get Ressource
|
||||||
|
mkdir -p $KHANAT_DATA/ressources
|
||||||
|
(cd $KHANAT_DATA; tar xzf /opt/khanat-ressources.tar.gz) || exit 2
|
||||||
|
|
||||||
|
# Copy script ryzom
|
||||||
|
mkdir -p $KHANAT_PATH/tools/scripts/linux
|
||||||
|
cp -r /opt/code/ryzom/tools/scripts/linux/* $KHANAT_PATH/tools/scripts/linux || exit 2
|
||||||
|
|
||||||
|
# Copy data for server
|
||||||
|
mkdir -p $KHANAT_PATH/server || exit 2
|
||||||
|
cp -r /opt/code/ryzom/common/ $KHANAT_PATH/common || exit 2
|
||||||
|
cp -r /opt/code/ryzom/client/ $KHANAT_PATH/client || exit 2
|
||||||
|
cp /opt/code/ryzom/server/*.cfg $KHANAT_PATH/server/. || exit 2
|
||||||
|
|
||||||
|
# create link resource
|
||||||
|
## Directories
|
||||||
|
ln -s $KHANAT_DATA/collisions $KHANAT_PATH/server/
|
||||||
|
ln -s $KHANAT_DATA/leveldesign $KHANAT_PATH/server/
|
||||||
|
ln -s $KHANAT_DATA/primitives $KHANAT_PATH/server/
|
||||||
|
ln -s $KHANAT_DATA/translation $KHANAT_PATH/server/
|
||||||
|
ln -s $KHANAT_DATA/continents $KHANAT_PATH/server/
|
||||||
|
ln -s $KHANAT_DATA/common $KHANAT_PATH/server/
|
||||||
|
## Files
|
||||||
|
mkdir -p $KHANAT_PATH/server/data_shard
|
||||||
|
cp -r /opt/code/ryzom/server/data_shard/* $KHANAT_PATH/server/data_shard/.
|
||||||
|
ln -s $KHANAT_DATA/shard/su/dev_gm_names.xml $KHANAT_PATH/server/data_shard/dev_gm_names.xml
|
||||||
|
ln -s $KHANAT_DATA/shard/su/invalid_entity_names.txt $KHANAT_PATH/server/data_shard/invalid_entity_names.txt
|
||||||
|
ln -s $KHANAT_DATA/shard/su/reserved_names.xml $KHANAT_PATH/server/data_shard/reserved_names.xml
|
||||||
|
ln -s $KHANAT_DATA/shard/egs/game_event.txt $KHANAT_PATH/server/data_shard/game_event.txt
|
||||||
|
ln -s $KHANAT_DATA/shard/egs/mission_queues.txt $KHANAT_PATH/server/data_shard/mission_queues.txt
|
||||||
|
ln -s $KHANAT_DATA/shard/egs/named_items.txt $KHANAT_PATH/server/data_shard/named_items.txt
|
||||||
|
|
||||||
|
# copy data from khanat-code
|
||||||
|
mkdir -p $KHANAT_DATA/mirror_sheets
|
||||||
|
cp -r /opt/code/ryzom/server/data_shard/mirror_sheets/* $KHANAT_DATA/mirror_sheets
|
||||||
|
|
|
@ -1,9 +1,22 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# Script to launch automatically khaganat
|
# Script to launch khaganat
|
||||||
|
# (see shard.screen.rc)
|
||||||
#
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
#
|
#
|
||||||
# ref : shard.screen.rc
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
mkdir -p /home/gameserver/khanat/server/log
|
mkdir -p /home/gameserver/khanat/server/log
|
||||||
cd /home/gameserver/khanat/server/log
|
cd /home/gameserver/khanat/server/log
|
||||||
|
|
57
dist/docker/server/debian/common/prepare_start_server.sh
vendored
Normal file
57
dist/docker/server/debian/common/prepare_start_server.sh
vendored
Normal file
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# Script to update khanat configuration (change ip address)
|
||||||
|
#
|
||||||
|
# Copyright (C) 2017 AleaJactaEst
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 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/>.
|
||||||
|
|
||||||
|
echo "PREPARE ENVIRONMENT"
|
||||||
|
|
||||||
|
# Load Environment
|
||||||
|
export KHANAT_CLIENT_VERSION=1
|
||||||
|
if [[ ! -f /home/gameserver/.bashrc ]]
|
||||||
|
then
|
||||||
|
echo "ERROR - missing /home/gameserver/.bashrc"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
source /home/gameserver/.bashrc
|
||||||
|
|
||||||
|
# Get IP ADDRESS
|
||||||
|
tmp=$(hostname -I)
|
||||||
|
export addressip=${tmp//[[:blank:]]/}
|
||||||
|
|
||||||
|
## Configure Domain
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
UPDATE nel.domain
|
||||||
|
SET backup_patch_url = '$addressip:23001'
|
||||||
|
, patch_urls = '$addressip/patch'
|
||||||
|
, login_address = '$addressip:49998'
|
||||||
|
, session_manager_address = '$addressip:49999'
|
||||||
|
, web_host = '$addressip:30000'
|
||||||
|
, web_host_php = '$addressip:40916'
|
||||||
|
WHERE domain_id = 12;" || exit 2
|
||||||
|
|
||||||
|
# Configure nel.shard
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
UPDATE nel.shard
|
||||||
|
SET WsAddr = '$addressip:'
|
||||||
|
WHERE ShardId = 302;" || exit 2
|
||||||
|
|
||||||
|
# Configure nel_tool.neltool_domains
|
||||||
|
mysql -u root -e "use nel;
|
||||||
|
UPDATE nel_tool.neltool_domains
|
||||||
|
SET domain_as_host = '$addressip'
|
||||||
|
WHERE domain_id = 12;" || exit 2
|
||||||
|
|
Loading…
Reference in a new issue