Listen 443
@@ -316,10 +332,184 @@ mkdir -p $RYZOM_PATH/server/save_shard/rrd_graphs
#
# Serveur Patch
-# TODO - need add other step to initialize patch server
# Account use : gameserver
-su -c "mkdir -p /home/gameserver/patch_service/" gameserver || exit 2
-su -c "cd /home/gameserver/patch_service; patch_gen createNewProduct patch_game/ryzom.xml" gameserver || exit 2
+
+# 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
+
+# TODO : Pourquoi récupère ton des données de khanat-ressources pour les langues ?
+# Search le nombre de langue
+listlang=$(ls $RYDATA/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 $RYZOM_PATH/common/data_common/database.xml $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
+cp $RYZOM_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 $RYZOM_PATH/common/data_common/visual_slot.tab $PATCH_CLIENT_SYSTEM/kh_server/ || exit 2
+cp $RYDATA/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
+
+# TODO : Pourquoi récupère ton des données de khanat-ressources pour les langues ?
+for lang in $listlang
+do
+ cp $RYDATA/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
+
+#cat << EOF > $PATCH_HOME/patch_service/patch_game/ryzom.xml
+#
+# <_Categories>
+# <_Category>
+# <_Name type="STRING" value="khanat_lirria"/>
+# <_IsOptional type="SINT32" value="0"/>
+# <_UnpackTo type="STRING" value="./user/"/>
+# <_IsIncremental type="SINT32" value="1"/>
+# <_Files type="STRING" value="patch_lirria.bnp"/>
+#
+#
+# <_IndexFileName type="STRING" value="ryzom.hist"/>
+# <_PatchDirectory type="STRING" value="patch_game/patch/"/>
+# <_BnpDirectory type="STRING" value="patch_game/bnp/"/>
+# <_RefDirectory type="STRING" value="patch_game/ref/"/>
+# <_NextVersionFile type="STRING" value="patch_game/Lirria.version"/>
+# <_ClientIndexFileName type="STRING" value="ryzom"/>
+#
+#EOF
+
+# 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
+
+
+
+
+
+ New test data - Release $KHANAT_CLIENT_VERSION
+ 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!!
+
+
+EOF
+chown gameserver:www-data $PATCH_HOME/patch_service/patch_game/patch/index.php
+
+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
+
+ Options FollowSymLinks
+ DirectoryIndex index.php
+
+ Require all granted
+
+
+
+ AddType application/x-httpd-php .php
+
+
+ SetHandler application/x-httpd-php
+
+
+
+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
diff --git a/dist/docker/server/debian/jessie/x86_64/Dockerfile b/dist/docker/server/debian/jessie/x86_64/Dockerfile
index 71a2b3cdb..ca1cffc5a 100644
--- a/dist/docker/server/debian/jessie/x86_64/Dockerfile
+++ b/dist/docker/server/debian/jessie/x86_64/Dockerfile
@@ -19,9 +19,9 @@ RUN apt-get install -y openssh-server sudo net-tools
RUN apt-get install -y lzma xdelta
# adding account compil, password compil
-RUN useradd -G sudo,www-data -c /home -d /home/gameserver -c "Khanat account GAME" -m -p '$6$4a/ofDWe$Bh16Bi.fWHF2dkerY6f0fKLspYKfjsaZvvQ3Hqycoye0JV1KLS4SAm/FEtIx1MzwqkgQnnPgNFZRZwPIebnL01' -s /bin/bash -U gameserver
+RUN useradd -G sudo,www-data -c /home -d /home/gameserver -c "Khanat account GAME" -m -p '$6$nxHX/3u.$azS0.eldpfKqxqOLDjgZj8.hPOLC64arXDTUVX0fs7RZvRBX/pNqPzDR89ccP5XkEE/daOyaD3wVtDGDUND5b/' -s /bin/bash -U gameserver
-RUN useradd -G sudo,www-data -c /home -d /home/compil -c "Khanat account" -m -p '$6$cQrN51jJ$eP/whHzKesStKm8KgQwZMb.kYdPzJm2RtG7FcESQtrrioyOiDslE4jxnuz4WieMIvW8saPdnj3vOy1s/cnfVy.' -s /bin/bash -U compil
+RUN useradd -G sudo,www-data -c /home -d /home/compil -c "Khanat account" -m -p '$6$nxHX/3u.$azS0.eldpfKqxqOLDjgZj8.hPOLC64arXDTUVX0fs7RZvRBX/pNqPzDR89ccP5XkEE/daOyaD3wVtDGDUND5b/' -s /bin/bash -U compil
COPY dist/docker/server/debian/init-basic.sh /opt/
diff --git a/dist/docker/server/debian/jessie/x86_64/Dockerfile.khanat b/dist/docker/server/debian/jessie/x86_64/Dockerfile.khanat
index 432ba73d3..96024fea3 100644
--- a/dist/docker/server/debian/jessie/x86_64/Dockerfile.khanat
+++ b/dist/docker/server/debian/jessie/x86_64/Dockerfile.khanat
@@ -16,6 +16,7 @@ COPY dist/docker/server/debian/init-khanat.sh /opt/
COPY ryzomcore.tar.gz /opt/
COPY ryzom-ressources.tar.gz /opt/
COPY khanat-ressources.tar.gz /opt/
+COPY khanat-data-client.tar.gz /opt/
RUN /opt/init-khanat.sh
diff --git a/dist/docker/server/debian/jessie/x86_64/server.sh b/dist/docker/server/debian/jessie/x86_64/server.sh
index fe974322a..3c5a8cc4b 100755
--- a/dist/docker/server/debian/jessie/x86_64/server.sh
+++ b/dist/docker/server/debian/jessie/x86_64/server.sh
@@ -11,6 +11,7 @@ declare -i IMAGE=1
declare -i BASICSERVER=0
declare -i KHANATSERVER=0
declare -i KHANATRESSOURCES=0
+declare -i KHANATDATACLIENT=0
declare -i RYZOMRESSOURCES=0
declare -i LAUNCHKHANAT=1
declare -i DEBUG=0
@@ -18,7 +19,7 @@ declare -i AUTODETEC=1
declare -i STOPKHANAT=0
declare -i CLEANCONTAINERKHANAT=0
declare -i CONNECTSSHKHANAT=0
-declare -i KHANAT_CLIENT_VERSION=0
+declare -i KHANAT_CLIENT_VERSION=1
declare IMAGEGENERICSERVER="server_generic_debian_jessie_x86_64"
declare IMAGEKHANATSERVER="server_khanat_debian_jessie_x86_64"
@@ -42,6 +43,7 @@ options:
-d, --debug : Show debug message
-b, --force-basic : Force create/recreate image basic server
-t, --force-tar-ressources : Generate TAR.GZ for khanat-ressources (look directory ../khanat-ressources)
+ -q, --force-tar-data-client : Generate TAR.GZ for khanat-data-client (look directory ../khanat-data-client)
-z, --force-tar-ryzom-ressources : Generate TAR.GZ in data khanat-code
-k, --force-khanat : Force create/recreate image khanat server
-n, --no-launch-khanat : Doesn't launch khanat server
@@ -84,6 +86,7 @@ calldir="$(dirname $0)"
basedir=$(cd $calldir; pwd)
rootdir="$(dirname $(dirname $(dirname $(dirname $(dirname $(dirname ${basedir}))))))"
ressourcedir="$(dirname ${rootdir})/khanat-ressources"
+dataclientdir="$(dirname ${rootdir})/khanat-data-client"
while test $# -gt 0
do
@@ -120,6 +123,10 @@ do
KHANATRESSOURCES=1
shift
;;
+ -q|--force-tar-data-client)
+ KHANATDATACLIENT=1
+ shift
+ ;;
-z|--force-tar-ryzom-ressources)
RYZOMRESSOURCES=1
shift
@@ -190,10 +197,14 @@ then
then
BASICSERVER=1
fi
- if [[ ! -d ${ressourcedir} ]]
+ if [[ ! -f ${rootdir}/khanat-ressources.tar.gz ]]
then
KHANATRESSOURCES=1
fi
+ if [[ ! -f ${rootdir}/khanat-data-client.tar.gz ]]
+ then
+ KHANATDATACLIENT=1
+ fi
if [[ ! -f ${rootdir}/ryzom-ressources.tar.gz ]]
then
RYZOMRESSOURCES=1
@@ -222,6 +233,7 @@ msg_debug "rootdir: $rootdir"
msg_debug "ressourcedir: $ressourcedir"
msg_debug "generate basic image: $BASICSERVER"
msg_debug "generate tar khanat ressources: $KHANATRESSOURCES"
+msg_debug "generate tar khanat data client: $KHANATDATACLIENT"
msg_debug "generate tar ryzom ressources: $RYZOMRESSOURCES"
msg_debug "generate khanat image: $KHANATSERVER"
msg_debug "launch khanat: $LAUNCHKHANAT"
@@ -238,6 +250,17 @@ then
(cd $ressourcedir; tar --exclude='.git' -czf ${rootdir}/khanat-ressources.tar.gz .) || exit 2
fi
+if [[ $KHANATDATACLIENT -ne 0 ]]
+then
+ msg_info "$(date "+%Y/%m/%d %H:%M:%S") CREATE TAR with KHANAT DATA CLIENT"
+ if [[ ! -d ${dataclientdir} ]]
+ then
+ msg_error "Missing khanat-data-client directory ($dataclientdir)"
+ exit 2
+ fi
+ (cd $dataclientdir; tar --exclude='.git' -czf ${rootdir}/khanat-data-client.tar.gz .) || exit 2
+fi
+
if [[ $RYZOMRESSOURCES -ne 0 ]]
then
msg_info "CREATE TAR with RYZOM Ressources"