From 17c3e4513c15fd0e59e8cf5c1a56e63034916df0 Mon Sep 17 00:00:00 2001 From: Jerome Sagnole Date: Sun, 27 Aug 2017 18:38:14 +0200 Subject: [PATCH] update patch server, remove root.bnp and adding ".ref" files --- dist/docker/server/debian/init-khanat.sh | 29 +++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/dist/docker/server/debian/init-khanat.sh b/dist/docker/server/debian/init-khanat.sh index 0846ca20d..c7899ceff 100755 --- a/dist/docker/server/debian/init-khanat.sh +++ b/dist/docker/server/debian/init-khanat.sh @@ -401,7 +401,7 @@ do done for file in $PATCH_HOME/patch_service/dataserver/client/*.bnp do - mv "$file" "${file%.bnp}.ref" || exit 2 + mv "$file" "${file%.bnp}_.ref" || exit 2 done @@ -445,6 +445,33 @@ su -c "cd $PATCH_HOME/patch_service;touch patch_game/Lirria.version" gameserver 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 +#echo $ADDREF + +# 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 == "") { + found = 2; + print "'"$ADDREF"'"; + print $0; + } else if(found == 2 && $1 == "") { + found = 3; + } + if ( found != 2 ) { + print $0 + } +}' patch_game/ryzom.xml.ref > patch_game/ryzom.xml || exit 2 + #cat << EOF > $PATCH_HOME/patch_service/patch_game/ryzom.xml # # <_Categories>