Page 1 of 2

Personal Updates Server

Posted: 07 Aug 2010, 13:06
by Alel
Hello Guys,I opened my server and wanted to have my own updates server,but i dont know how to do it.Someone Knows how to?I don't know if this is the right section if not move it.Thanks

Re: Personal Updates Server

Posted: 07 Aug 2010, 13:22
by Crush
Moved to general support forum.

Re: Personal Updates Server

Posted: 08 Aug 2010, 16:57
by Wombat
How to play around with TMW resource files.

Click and read the above link for your answer. If you run into any problems, ask on this thread. This link is just for localhosting, not sure about setting up a server host.

Re: Personal Updates Server

Posted: 09 Aug 2010, 05:28
by AnonDuck
I initially had trouble with this myself. Here's a mini-howto, if it works for you I'll see about putting it in the wiki

First you need web space somewhere you can upload files to. It's possible to run a webserver on your personal connection but this is not recommended due to the large size of the data files and the usually low speed of home connections. You need to be able to host .zip files somewhere via http. I'm sure you can find a free solution for this with enough googling :)

Check out tmwdata and Mana from git:

Code: Select all

git clone git://gitorious.org/tmwdata/mainline.git
git clone git://gitorious.org/mana/mana.git
In order to make updates you need to use the adler32 tool from tools/ in the mana source tree:

Code: Select all

gcc -o adler32 mana/src/tools/adler32.c
Make a zip file of tmwdata, Then use adler32 to generate resources2.txt

Code: Select all

cd tmwdata
zip -r ../data.zip *
cd ..
./adler32 data.zip >resources2.txt
Copy data.zip and resources2.txt to your web root. Edit login_local.conf to point to your web root and you should be good to go. You may also want to put a news.txt in your webroot for the sign-on news.

Next step: Making updates. I'll try to post this soon.

Re: Personal Updates Server

Posted: 09 Aug 2010, 11:04
by Rotonen
Posting such howtos on the wiki and improving the current howtos there is encouraged.

Re: Personal Updates Server

Posted: 11 Aug 2010, 17:46
by AnonDuck
I'll put it in the wiki once I get some sort of feedback - I feel incorrect instructions can be worse than none at at times.

To make updates, one must make a zip file of only the files you have changed, put it in the webroot, and add it's adler32 checksum to resources2.txt. This can be done manually but I suggest tracking your changes in a git repository so it can be fully automated.

The manual method is pretty easy, but you have to keep track of what files you have changed on your own. Lets say you have edited maps/022-1.tmx and added a file named graphics/sprites/crazy.png

Code: Select all

cd tmwdata
zip -r update-crazy.zip maps/022-1.tmx graphics/sprites/crazy.png
./adler32 update-crazy.zip >>resources2.txt
Then upload the .zip and new resources2.txt to your webroot.
Just a warning: You probably do not ever want to delete lines in your resources2.txt, this can cause weirdness if you're not sure what you are doing. Just append lines.

In releasing an update for TAW I use a tool that generates zip files based upon git revisions. If you are comfortable using git, this is the way to go.
Get the script and chmod +x it

Code: Select all

cd tmwdata
wget http://server.thealternateworld.org/junk/makeupdatezip.sh
chmod +x makeupdatezip.sh
Once the tool is set, pick the starting revision in your git log you would like to generate an update from and run the tool. The tool will generate an update zip file containing updates from the revision you specify all the way to current.

Code: Select all

git log
./makeupdatezip.sh 3db8bcdc615f5ca953a52ac79070859c84041add
It will generate a file with a name like update-70859-41add.zip. Do the adler32 thing as in the manual method and put the files in your webroot.

Perhaps the TMW admins would have some tips to help flesh out these instructions on handling duplicate data and inefficient updates. I haven't gotten to that part yet myself.

Re: Personal Updates Server

Posted: 11 Aug 2010, 17:58
by Jaxad0127
MadCamel wrote:Perhaps the TMW admins would have some tips to help flesh out these instructions on handling duplicate data and inefficient updates. I haven't gotten to that part yet myself.
In the client repository is a PHP script (the upalyzer) that checks the updates for such things. Using that, you can see how much of each zip is actually used, and remove them (possibly with a new zip to hold the few files it still provides) from the resources file (just remove the line). Sample output: http://updates.themanaworld.org/analyze.php.
MadCamel wrote:In releasing an update for TAW I use a tool that generates zip files based upon git revisions. If you are comfortable using git, this is the way to go.
Get the script and chmod +x it

Code: Select all

cd tmwdata
wget http://server.thealternateworld.org/junk/makeupdatezip.sh
chmod +x makeupdatezip.sh
Once the tool is set, pick the starting revision in your git log you would like to generate an update from and run the tool. The tool will generate an update zip file containing updates from the revision you specify all the way to current.

Code: Select all

git log
./makeupdatezip.sh 3db8bcdc615f5ca953a52ac79070859c84041add
It will generate a file with a name like update-70859-41add.zip. Do the adler32 thing as in the manual method and put the files in your webroot.
An automated mode where it also calls git pull and gets the starting revision automatically would be nice.

Re: Personal Updates Server

Posted: 15 Aug 2010, 19:16
by Alel
When i do

Code: Select all

gcc -o adler32 mana/src/tools/adler32.c
I get this

Code: Select all

adler32.c:(.text+0x81): undefined reference to `adler32'
adler32.c:(.text+0x9d): undefined reference to `adler32'
collect2: ld returned 1 exit status
Any ideas?

Re: Personal Updates Server

Posted: 16 Aug 2010, 00:28
by AnonDuck
try adding -lz to the end of that line

Re: Personal Updates Server

Posted: 16 Aug 2010, 10:41
by Alel
Added -lz and command worked but when i give

Code: Select all

./adler32 data.zip >resources2.txt
I get this

Code: Select all

bash:./adler32: No file or directory

Re: Personal Updates Server

Posted: 16 Aug 2010, 14:49
by Jaxad0127
Did you put the adler32 tool in the same folder?

Re: Personal Updates Server

Posted: 17 Aug 2010, 06:06
by Rotonen
./ means "here". So ./adler32 would mean "adler32, which is here". Where you ran ./adler32 from was obviously not where adler32 is. That is also what your shell told you. I hope this helps you understand better what your computer is trying to tell you.

Re: Personal Updates Server

Posted: 22 Aug 2010, 12:35
by Alel
Thanks,It worked,I had to run it from the directory it was placed in.

Re: Personal Updates Server

Posted: 05 Oct 2010, 13:15
by Davius
Ok, I made it through everything perfectly, and all went well until I got to the manual zip update part. I tried to do the zip -r etc... thing, but when I do I get this:

Code: Select all

bash: zip: command not found
Do I have to install another cygwin package for this to work? If so, what one?

Anyway thanks for a great tutorial!
Oh, one other thing...the link to the makeupdatezip.sh thing is broken. I was wondering if you could fix that also. :D

Re: Personal Updates Server

Posted: 05 Oct 2010, 13:23
by Gotcha
hi!

are you sure zip is installed on that server?
you could try unzipping something with unzip something.zip to see if it works.