summaryrefslogtreecommitdiff
path: root/update
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
committerJesusaves <cpntb1@ymail.com>2022-10-23 23:45:19 -0300
commitc2ccb14ffff0e45398365e19dfd2874307ddb943 (patch)
tree976eaea586fb8f1ee0ab8cae67c69071aed8b952 /update
downloadtools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.gz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.bz2
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.tar.xz
tools-c2ccb14ffff0e45398365e19dfd2874307ddb943.zip
Initial commit
Diffstat (limited to 'update')
-rw-r--r--update/TMW2org.zipbin0 -> 42988466 bytes
-rwxr-xr-xupdate/addmods.sh35
-rw-r--r--update/adler32.c79
-rw-r--r--update/commit.txt1
-rw-r--r--update/commit_old.txt1
-rwxr-xr-xupdate/create_music.sh31
-rwxr-xr-xupdate/createnew.sh40
-rwxr-xr-xupdate/deploy.sh7
-rw-r--r--update/musiccommit.txt1
-rw-r--r--update/musiccommit_old.txt1
-rw-r--r--update/news.txt40
-rwxr-xr-xupdate/pseudo_update.sh31
-rwxr-xr-xupdate/update.sh42
-rwxr-xr-xupdate/update_music.sh42
14 files changed, 351 insertions, 0 deletions
diff --git a/update/TMW2org.zip b/update/TMW2org.zip
new file mode 100644
index 0000000..5bed7a0
--- /dev/null
+++ b/update/TMW2org.zip
Binary files differ
diff --git a/update/addmods.sh b/update/addmods.sh
new file mode 100755
index 0000000..109a81b
--- /dev/null
+++ b/update/addmods.sh
@@ -0,0 +1,35 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2010-2012 TMW2 Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+mds='../../clientdata/mods'
+
+previous=`cat commit.txt`
+rm files/xml_mods.txt
+rm files/mod-*
+
+cd ../../clientdata/mods
+
+FILES=`ls`
+
+for file in $FILES; do
+ echo "Uploading $file mod...."
+ cd $file
+ find . -type f | xargs zip -9 -r ../../../tools/update/files/mod-$file.zip
+ cd $dir/files
+ sum=`adler32 mod-$file.zip | awk '{print $2}'`
+ echo " <mod type=\"data\" group=\"$file\" file=\"mod-$file.zip\" hash=\"${sum}\" />" >> xml_mods.txt
+ cp mod-$file.zip ../upload/
+ cd ../$mds
+done
+
+cd $dir/files
+cp xml_header.txt resources.xml
+cat xml_footer.txt >>resources.xml
+cat xml_mods.txt >>resources.xml
+echo '</updates>' >>resources.xml
+cp resources2.txt ../upload/
+cp resources.xml ../upload/
+
diff --git a/update/adler32.c b/update/adler32.c
new file mode 100644
index 0000000..606c739
--- /dev/null
+++ b/update/adler32.c
@@ -0,0 +1,79 @@
+/*
+ * adler32.c (c) 2006 Bjorn Lindeijer
+ * License: GPL, v2 or later
+ *
+ * Calculates Adler-32 checksums for all files passed as argument.
+ *
+ * Usage: adler32 [file]...
+ */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <zlib.h>
+
+/**
+ * Calculates the Adler-32 checksum for the given file.
+ */
+unsigned long fadler32(FILE *file)
+{
+ // Obtain file size
+ fseek(file, 0, SEEK_END);
+ long fileSize = ftell(file);
+ rewind(file);
+
+ // Calculate Adler-32 checksum
+ char *buffer = (char*) malloc(fileSize);
+ fread(buffer, 1, fileSize, file);
+ unsigned long adler = adler32(0L, Z_NULL, 0);
+ adler = adler32(adler, (Bytef*) buffer, fileSize);
+ free(buffer);
+
+ return adler;
+}
+
+/**
+ * Prints out usage and exists.
+ */
+void print_usage()
+{
+ printf("Usage: adler32 mode [file]...\n");
+ exit(0);
+}
+
+int main(int argc, char *argv[])
+{
+ int i; /**< Loops through arguments. */
+
+ if (argc < 2)
+ {
+ print_usage();
+ }
+
+ int mode = atoi(argv[1]);
+
+ for (i = 2; i < argc; ++i)
+ {
+ FILE *file = fopen(argv[i], "r");
+
+ if (!file)
+ {
+ printf("Error while opening '%s' for reading!\n", argv[i]);
+ exit(1);
+ }
+
+ unsigned long adler = fadler32(file);
+ switch (mode)
+ {
+ case 0:
+ default:
+ printf("%s %lx\n", argv[i], adler);
+ break;
+ case 1:
+ printf("%lx", adler);
+ break;
+ }
+ fclose(file);
+ }
+
+ return 0;
+}
diff --git a/update/commit.txt b/update/commit.txt
new file mode 100644
index 0000000..dc221c3
--- /dev/null
+++ b/update/commit.txt
@@ -0,0 +1 @@
+a0877f34f3f73c84629bf7781e7da0b2feaa0174
diff --git a/update/commit_old.txt b/update/commit_old.txt
new file mode 100644
index 0000000..652fd1b
--- /dev/null
+++ b/update/commit_old.txt
@@ -0,0 +1 @@
+2b90b8051698ab0e962dab6e338e6894e4a7cd21
diff --git a/update/create_music.sh b/update/create_music.sh
new file mode 100755
index 0000000..70720d9
--- /dev/null
+++ b/update/create_music.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2011-2012 Evol Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+rm adler32
+gcc -lz adler32.c -o adler32
+
+mkdir files
+mkdir upload
+
+rm files/music.zip
+cd ../../music
+find -iregex ".+[.]\(ogg\|mp3\)" -exec touch --date=2015-01-01 {} \;
+find -iregex ".+[.]\(ogg\|mp3\)" -printf "%P\n" | zip -X -@ ../tools/update/files/music.zip
+git log --pretty=oneline -n 1 | awk '{print $1}' >../tools/update/musiccommit.txt
+
+cd $dir/files
+sum=`adler32 music.zip | awk '{print $2}'`
+
+echo " <update type=\"music\" required=\"no\" file=\"music.zip\" hash=\"${sum}\" description=\"TMW-2 music\" />" >> xml_footer.txt
+
+cp xml_header.txt resources.xml
+cat xml_footer.txt >>resources.xml
+echo '</updates>' >>resources.xml
+
+cp music.zip ../upload/
+cp resources.xml ../upload/
+cp ../news.txt ../upload/
diff --git a/update/createnew.sh b/update/createnew.sh
new file mode 100755
index 0000000..5ab356f
--- /dev/null
+++ b/update/createnew.sh
@@ -0,0 +1,40 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2011-2012 TMW2 Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+rm adler32
+gcc -lz adler32.c -o adler32
+
+mkdir files
+mkdir upload
+
+rm files/TMW2.zip
+cd ../../clientdata
+find -iregex ".+[.]\(xml\|png\|jpg\|tmx\|ogg\|txt\|po\|tsx\)" -exec touch --date=2015-01-01 {} \;
+find -iregex ".+[.]\(xml\|png\|jpg\|tmx\|ogg\|txt\|po\|tsx\)" -printf "%P\n" | zip -X -@ ../tools/update/files/TMW2.zip
+git log --pretty=oneline -n 1 | awk '{print $1}' >../tools/update/commit.txt
+
+cd $dir/files
+sum=`adler32 TMW2.zip | awk '{print $2}'`
+echo "TMW2.zip ${sum}" >resources2.txt
+
+echo '<?xml version="1.0"?>
+<updates>' >xml_header.txt
+touch xml_footer.txt
+touch xml_mods.txt
+
+echo " <update type=\"data\" file=\"TMW2.zip\" hash=\"${sum}\" />" >> xml_header.txt
+cp xml_header.txt resources.xml
+cat xml_footer.txt >>resources.xml
+cat xml_mods.txt >>resources.xml
+echo '</updates>' >>resources.xml
+
+cp TMW2.zip ../upload/
+cp resources2.txt ../upload/
+cp resources.xml ../upload/
+cp ../news.txt ../upload/
+
+
diff --git a/update/deploy.sh b/update/deploy.sh
new file mode 100755
index 0000000..1ae1be7
--- /dev/null
+++ b/update/deploy.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+# Deploy script
+echo "Deploying Bugfix-TMW2.zip"
+scp -4 upload/Bugfix-TMW2.zip jesusalva@updates.tmw2.org:/home/jesusalva/http/updates/
+scp -4 upload/resources.xml jesusalva@updates.tmw2.org:/home/jesusalva/http/updates/
+
diff --git a/update/musiccommit.txt b/update/musiccommit.txt
new file mode 100644
index 0000000..58369c4
--- /dev/null
+++ b/update/musiccommit.txt
@@ -0,0 +1 @@
+39e9aec960bd515ba0c458e39117edcc2f0d3079
diff --git a/update/musiccommit_old.txt b/update/musiccommit_old.txt
new file mode 100644
index 0000000..ee52604
--- /dev/null
+++ b/update/musiccommit_old.txt
@@ -0,0 +1 @@
+e65188eb11f07b09c20cfbc6e97ddd2275893a48
diff --git a/update/news.txt b/update/news.txt
new file mode 100644
index 0000000..2559f5f
--- /dev/null
+++ b/update/news.txt
@@ -0,0 +1,40 @@
+##0 Actual Release: ##1 17.2 Interlude in Red
+##0 Welcome to ##BTMW-2: Moubootaur Legends##b!
+
+##0 By playing you agree and abide to the ##1##BTerms of Service##b##0, available at:
+##1 [@@https://tmw2.org/legal|https://tmw2.org/legal@@]
+##2 Last ToS update: 2021-09-15
+
+##0 A Night in Red got delayed, and this is an interlude! Laura was only slightly
+##0 tweaked thus far. This interlude has more hints and tips, and fix bugs on Aurora
+##0 as well as rewording several stuff. ##BRealm of Drops##b skill was added: Now
+##0 you'll get warranted drops as you kill monsters, reducing the effects of PRNG.
+##0 ##BKreist Daily Quest##b was entirely reworked, and defeating a boss now plays
+##0 out a fanfare (but only some boss!) Boss Raid and Dream Towers events were
+##0 tweaked. You need less intelligence to learn magic. ##BConnor##b is more
+##0 generous giving coal. More drops for mobs above level 100. Iced Bottle now
+##0 heals a tiny bit. These Quality of Life changes makes an ##BInterlude in Red##b.
+
+##0 Ready to become a Moubootaur Legend now?
+##0 TMW2 Team
+
+##7 We want to express our gratitude here to ##BWoody##b, ##BSharli##b and ##BPovo##b, for sponsoring this server.
+##7 We would also want to kindly thank ##Bjak1##b and the GermanTMW Team for
+##7 their sponsorship and help.
+##7 And by last, our gratitude to every developer and contributor who made this
+##7 possible!
+
+----
+
+##0 [@@https://transifex.com/arctic-games/moubootaur-legends|Translators@@] are always welcome.
+##1 Our Staff will never ask for your password. You are the sole responsible for
+##1 its safety! You can contact a GM with ##B@request##b or calling one at #world.
+##0 (If you want, it's possible to skip music download under Settings > Audio)
+
+##0 Enjoy gaming, and leave feedback!
+
+##9 -- Your TMW2 Team
+##9 October 2022
+
+##0 You can check out this page for older entries:
+##9 [@@https://tmw2.org/news|https://tmw2.org/news@@]
diff --git a/update/pseudo_update.sh b/update/pseudo_update.sh
new file mode 100755
index 0000000..38678bf
--- /dev/null
+++ b/update/pseudo_update.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2010-2012 TMW2 Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+previous=`cat commit.txt`
+rm upload/Bugfix-TMW2.zip
+
+cd ../../clientdata
+head=`git log --pretty=oneline -n 1 | awk '{print $1}'`
+u1=`echo ${previous} | cut -c 1-7`
+u2=`echo ${head} | cut -c 1-7`
+git diff --name-status ${previous} HEAD | awk '/^(A|M)\t/ {print $2}; /^(R...)\t/ {print $3}' | \
+grep -e "[.]\(xml\|png\|jpg\|tmx\|ogg\|txt\|po\|tsx\)" | sort | uniq | \
+xargs zip -X -9 -r ../tools/update/upload/Bugfix-TMW2.zip
+
+cd $dir/upload
+
+sum=`adler32 Bugfix-TMW2.zip | awk '{print $2}'`
+echo "Update ID: ${u1}..${u2}"
+echo "Checksum: ${sum}"
+
+echo "Bugfix-TMW2.zip ${sum}" >>resources2.txt
+cp ../files/xml_header.txt resources.xml
+echo " <update type=\"data\" file=\"Bugfix-TMW2.zip\" hash=\"${sum}\" />" >> resources.xml
+cat ../files/xml_footer.txt >>resources.xml
+cat ../files/xml_mods.txt >>resources.xml
+echo '</updates>' >>resources.xml
+
diff --git a/update/update.sh b/update/update.sh
new file mode 100755
index 0000000..5e02147
--- /dev/null
+++ b/update/update.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2010-2012 TMW2 Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+rm adler32
+gcc -lz adler32.c -o adler32
+
+mkdir files
+mkdir upload
+
+previous=`cat commit_old.txt`
+
+cd ../../clientdata
+head=`git log --pretty=oneline -n 1 | awk '{print $1}'`
+u1=`echo ${previous} | cut -c 1-7`
+u2=`echo ${head} | cut -c 1-7`
+git diff --name-status ${previous} HEAD | awk '/^(A|M)\t/ {print $2}; /^(R...)\t/ {print $3}' | \
+ grep -e "[.]\(xml\|png\|jpg\|tmx\|ogg\|txt\|po\|tsx\)" | sort | uniq | \
+ xargs zip -X -9 -r ../tools/update/files/TMW2-${u1}.zip
+
+cd $dir/files
+if [ -f TMW2-${u1}.zip ]; then
+ #mv ../commit.txt ../commit_old.txt
+ echo ${head} >../commit.txt
+ sum=`adler32 TMW2-${u1}.zip | awk '{print $2}'`
+ echo "TMW2-${u1}.zip ${sum}" >>resources2.txt
+ echo " <update type=\"data\" file=\"TMW2-${u1}.zip\" hash=\"${sum}\" />" >> xml_header.txt
+ cp xml_header.txt resources.xml
+ cat xml_footer.txt >>resources.xml
+ cat xml_mods.txt >>resources.xml
+ echo '</updates>' >>resources.xml
+
+ cp TMW2-${u1}.zip ../upload/
+ cp resources2.txt ../upload/
+ cp resources.xml ../upload/
+ cp ../news.txt ../upload
+
+ echo "Update ID: ${u1}..${u2}"
+fi
diff --git a/update/update_music.sh b/update/update_music.sh
new file mode 100755
index 0000000..a99f5c6
--- /dev/null
+++ b/update/update_music.sh
@@ -0,0 +1,42 @@
+#!/usr/bin/env bash
+
+# Copyright (C) 2010-2012 Evol Online
+# Author: Andrei Karas (4144)
+
+dir=`pwd`
+
+rm adler32
+gcc -lz adler32.c -o adler32
+
+mkdir files
+mkdir upload
+
+previous=`cat musiccommit.txt`
+
+cd ../../music
+head=`git log --pretty=oneline -n 1 | awk '{print $1}'`
+u1=`echo ${previous} | cut -c 1-7`
+u2=`echo ${head} | cut -c 1-7`
+git log --name-status ${previous}..${head} \
+| awk '/^(A|M)\t/ {print $2}'
+ grep -e "[.]\(ogg\|mp3\)" | sort | uniq | \
+ xargs zip -X -9 -r ../../tools/update/files/music-${u1}..${u2}.zip
+#exit
+
+cd $dir/files
+if [ -f music-${u1}..${u2}.zip ]; then
+ mv ../muciscommit.txt ../muciscommit_old.txt
+ echo ${head} >../muciscommit.txt
+ sum=`adler32 music-${u1}..${u2}.zip | awk '{print $2}'`
+
+ echo " <update type=\"music\" required=\"no\" file=\"music-${u1}..${u2}.zip\" hash=\"${sum}\" description=\"TMW2 extra music\" />" >> xml_footer.txt
+ cp xml_header.txt resources.xml
+ cat xml_footer.txt >>resources.xml
+ cat xml_mods.txt >>resources.xml
+ echo '</updates>' >>resources.xml
+
+ cp music-${u1}..${u2}.zip ../upload/
+ cp resources2.txt ../upload/
+ cp resources.xml ../upload/
+ cp ../news.txt ../upload
+fi