Personal Updates Server

Ask for help regarding any technical issue or report any bug or OS independent issues.
User avatar
Alel
Peon
Peon
Posts: 33
Joined: 06 Jan 2010, 15:27
Location: Pescara,Italy

Personal Updates Server

Post 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
Never lose sight of the eyes of someone you love. Life is there, inside.
User avatar
Crush
TMW Adviser
TMW Adviser
Posts: 8046
Joined: 25 Aug 2005, 16:08
Location: Germany

Re: Personal Updates Server

Post by Crush »

Moved to general support forum.
  • former Manasource Programmer
  • former TMW Pixel artist
  • NOT a game master

Please do not send me any inquiries regarding player accounts on TMW.


You might have heard a certain rumor about me. This rumor is completely false. You might also have heard the other rumor about me. This rumor is 100% accurate.
User avatar
Wombat
TMW Adviser
TMW Adviser
Posts: 1532
Joined: 08 Aug 2008, 16:31

Re: Personal Updates Server

Post 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.
Current character is "Abolish".
User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Personal Updates Server

Post 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.
Head of the TMW Illuminati
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Re: Personal Updates Server

Post by Rotonen »

Posting such howtos on the wiki and improving the current howtos there is encouraged.
This message used to be meaningful.
User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Personal Updates Server

Post 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.
Head of the TMW Illuminati
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Personal Updates Server

Post 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.
Image
User avatar
Alel
Peon
Peon
Posts: 33
Joined: 06 Jan 2010, 15:27
Location: Pescara,Italy

Re: Personal Updates Server

Post 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?
Never lose sight of the eyes of someone you love. Life is there, inside.
User avatar
AnonDuck
TMW Adviser
TMW Adviser
Posts: 645
Joined: 02 Jan 2009, 04:19
Location: Catland

Re: Personal Updates Server

Post by AnonDuck »

try adding -lz to the end of that line
Head of the TMW Illuminati
User avatar
Alel
Peon
Peon
Posts: 33
Joined: 06 Jan 2010, 15:27
Location: Pescara,Italy

Re: Personal Updates Server

Post 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
Never lose sight of the eyes of someone you love. Life is there, inside.
User avatar
Jaxad0127
Manasource
Manasource
Posts: 4209
Joined: 01 Nov 2007, 17:35
Location: Internet

Re: Personal Updates Server

Post by Jaxad0127 »

Did you put the adler32 tool in the same folder?
Image
User avatar
Rotonen
TMW Adviser
TMW Adviser
Posts: 3154
Joined: 08 Sep 2004, 19:48
Location: Bern, Switzerland

Re: Personal Updates Server

Post 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.
This message used to be meaningful.
User avatar
Alel
Peon
Peon
Posts: 33
Joined: 06 Jan 2010, 15:27
Location: Pescara,Italy

Re: Personal Updates Server

Post by Alel »

Thanks,It worked,I had to run it from the directory it was placed in.
Never lose sight of the eyes of someone you love. Life is there, inside.
User avatar
Davius
Peon
Peon
Posts: 46
Joined: 02 Aug 2010, 20:01

Re: Personal Updates Server

Post 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
Image
User avatar
Gotcha
Novice
Novice
Posts: 84
Joined: 29 Jul 2010, 15:16

Re: Personal Updates Server

Post 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.
Locked