How exactly would I make a game file updater?

BlitzPlus Forums/BlitzPlus Programming/How exactly would I make a game file updater?

Xzider(Posted 2005) [#1]
check to see if files have been changed/if theres new files.. how would i do that?

so far i just made it check the version of client(using 1 variable) And see if its same as Server,if its not, go to updates folder,send all files in folder..(Testing reasons)

should I use FTP (i have my own webspace)?

Thanks in advance

EDIT
(I want to make my own,please do not direct me to already coded updates,Thanks!)


-=Darkheart=-(Posted 2005) [#2]
I would talk to Ozak who has just written something like this.

http://www.blitzbasic.co.nz/Account/showuser.php?id=8596

Darkheart


ozak(Posted 2005) [#3]
What I basically do is to calc CRC-32 for all the files and download a list of server files and their CRC-32 value to check for modified/missing files. Then I use HTTP to download them. HTTP is great, since you can place the file on a regular Web server instead of a custom server. FTP can be bad, as people can deduct your login/password from scanning your executable.


MagicalTux(Posted 2005) [#4]
I do something a bit different :)

I have a file where I store an "update cookie". When the game is started, I pass the update cookie to a PHP script with an HTTP request. It returns me the list of files I need to download, the type of file (archive, game data, or the updater itself).

I download the files and do whatever I need with them (I use bzip2.dll for compression, which provide best compression ever; if anyone want the decls and the dll, just ask). If I need to update the updater itself I generate a batch-file for that (or use my "rerun.exe" binary, a little code in C which does the work).

Each time I've installed an update, I save the current "update cookie" so if I get interrupted I can start from where I stopped.

The problem with CRC is simple. When, like me, you have 800MB of data, it may take a while to check it all :)

Also if you want to use FTP, you can, but make sure you use an anonymous FTP (most likely you'll need a dedicated server).

I wrote a simple http_download function, with resume support, which does a great job. :)