summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2023-04-17 22:46:36 -0300
committerJesusaves <cpntb1@ymail.com>2023-04-17 22:46:36 -0300
commitdf347e86fbc9fb62f3d02c79d3763c1d3b87da19 (patch)
treedad30b5f8494f473f7c1fcb91c31bf194fa5c44a
parent7b7921324db38e60fc8e6d24859af7ff4c919bed (diff)
downloadtools-df347e86fbc9fb62f3d02c79d3763c1d3b87da19.tar.gz
tools-df347e86fbc9fb62f3d02c79d3763c1d3b87da19.tar.bz2
tools-df347e86fbc9fb62f3d02c79d3763c1d3b87da19.tar.xz
tools-df347e86fbc9fb62f3d02c79d3763c1d3b87da19.zip
This seems to be the necessary changes for deploying mods
-rwxr-xr-xclient/make-updates.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/client/make-updates.sh b/client/make-updates.sh
index 04fb934..53bad74 100755
--- a/client/make-updates.sh
+++ b/client/make-updates.sh
@@ -48,11 +48,13 @@ echo -e "\e[96m>> Creating directory tree...\e[0m"
mkdir -pv files
mkdir -pv $UPDATE_DIR
mkdir -pv $cdata/music
+mkdir -pv $cdata/mods
echo -e "\e[96m>> Removing leftovers...\e[0m"
rm -rv files/* 2>/dev/null || :
rm -v $UPDATE_DIR/TMW.zip 2>/dev/null || :
rm -v $UPDATE_DIR/TMW-music.zip 2>/dev/null || :
+rm -v $UPDATE_DIR/TMW-mods.zip 2>/dev/null || :
rm -v $UPDATE_DIR/resources.xml 2>/dev/null || :
rm -v $UPDATE_DIR/resources2.txt 2>/dev/null || : # Legacy: used by mana client
@@ -65,30 +67,37 @@ if [ "$UPDATE_HTTP" == "none" ] ; then
fi
echo -e "\e[96m>> Compressing files...\e[0m"
-find -path ./music -prune -o -iregex ".+[.]\(xml\|png\|tmx\|ogg\|txt\|po\|tsx\)" -printf "%P\n" | zip -X -@ $dir/files/TMW.zip
-find -path ./sfx -prune -o -iregex ".+[.]\(ogg\)" -printf "%P\n" | zip -X -@ $dir/files/TMW-music.zip
+find -path ./music -prune -path ./mods -prune -o -iregex ".+[.]\(xml\|png\|tmx\|ogg\|txt\|po\|tsx\)" -printf "%P\n" | zip -X -@ $dir/files/TMW.zip
+find -path ./sfx -prune -path ./mods -prune -o -iregex ".+[.]\(ogg\)" -printf "%P\n" | zip -X -@ $dir/files/TMW-music.zip
+#find ./mods -printf "%P\n" | zip -X -@ $dir/files/TMW-mods.zip
+find ./mods -type f | xargs zip -9 -r $dir/files/TMW-mods.zip
touch $dir/files/TMW-music.zip
+touch $dir/files/TMW-mods.zip
echo -e "\e[96m>> Calculating adler32 checksum...\e[0m"
pushd $dir/files &>/dev/null
sum=`../adler32 1 TMW.zip`
musicsum=`../adler32 1 TMW-music.zip`
+modsum=`../adler32 1 TMW-mods.zip`
echo -e "\e[96m>> Generating xml file...\e[0m"
echo "<?xml version=\"1.0\"?><updates>" >resources.xml
echo "<update type=\"data\" file=\"TMW.zip\" hash=\"${sum}\"/>" >>resources.xml
echo "<update type=\"music\" required=\"no\" file=\"TMW-music.zip\" hash=\"${musicsum}\" description=\"TMW music\"/>" >>resources.xml
+echo "<update type=\"data\" required=\"no\" file=\"TMW-mods.zip\" hash=\"${modsum}\" description=\"TMW mods\"/>" >>resources.xml
echo "</updates>" >>resources.xml
echo -e "\e[96m>> Moving stuff around...\e[0m"
cp -v TMW.zip $UPDATE_DIR/
cp -v TMW-music.zip $UPDATE_DIR/
+cp -v TMW-mods.zip $UPDATE_DIR/
cp -v resources.xml $UPDATE_DIR/
echo -e "\e[96m>> Giving read permissions...\e[0m"
pushd $UPDATE_DIR &>/dev/null
chmod a+r TMW.zip
chmod a+r TMW-music.zip
+chmod a+r TMW-mods.zip
chmod a+r resources.xml
if [ "$UPDATE_HTTP" != "none" ] ; then
@@ -96,6 +105,7 @@ if [ "$UPDATE_HTTP" != "none" ] ; then
echo -e "\e[96m>> Checking updates...\e[0m"
check_update "$UPDATE_HTTP/TMW.zip"
check_update "$UPDATE_HTTP/TMW-music.zip"
+ check_update "$UPDATE_HTTP/TMW-mods.zip"
check_update "$UPDATE_HTTP/resources.xml"
check_update "$UPDATE_HTTP/news.php"
fi