The Daily Click ::. Forums ::. Klik Coding Help ::. Game Updater?
 

Post Reply  Post Oekaki 
 

Posted By Message

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
25th May, 2011 at 14:41:47 -

Hey guys
I'm making an online game which will be frequently patched called MedWar (beta soon available in the Downloads section)
I however feel a Game Updater would help the players alot, instead of me linking new versions to everyone when a character has been nerfed or a bug has been fixed. I read an article here about it, but it was not very in-depth and required the Download Object which I can't find.
So I'm basically wondering how to make an updater? What extensions do I need and so on.
Thanks!

 
...Atleast thats what Batman told me!

Jon Lambert

Administrator
Vaporware Master

Registered
  19/12/2004
Points
  8235

VIP MemberWii OwnerTDC Chat Super UserI am an April FoolSSBB 3265-4741-0937ACCF 3051-1173-8012360 Owner
25th May, 2011 at 17:05:43 -

The Download object should be included with MMF2 or one of the bonus packs.


Making a Game Updater
You will need:
- Get object
- String Parser
- Download object


1. Either load your updated file into the String Parser or any other client with MD5 hashing abilities. Set any string or other text object to mdFive$("String Parser") and record this information.

2. Create a .txt file or HTML/PHP file with this information:
Latest_version_number,Oldest_allowable_version_number,Update_url,Update_MD5
Note that each field is separated by a comma. Oldest_allowable_version_number is optional, so you only include it if you're going to allow users to not immediately update. The first two are version numbers, the third is an actual url, and the fourth is the MD5 hash you generated in step 1.

3. On boot or otherwise, your game should use the Get object to retrieve the .txt file you made in step 2. It then takes that information and puts it into String Parser, with a comma set as the delimiter. Take the first field and compare it to your current version. If it's higher than your current version, check the second field and compare. If it is higher than your current version, go to step 4a, else, go to step 4b.

4a. Your game is both not the latest available, nor is it new enough to be allowed to play. At this point, the game opens a separate updater application that uses the Download object to download the file specified in the Get request. Once the download is complete, it checks the MD5 hash of the downloaded file and if it matches the one in the Get request, it deletes the old game and opens the new one. The updater should know what file to delete based on the same MD5 strategy but I haven't really thought that one out so yeah. If you're wondering why you don't just download the new file on top of the old one, it's for security, make sure that it isn't being tricked into deleting anything besides the old version in favor of something that might not be the actual update.

4b. This step is pretty much 4a except you ask the user if they want to download first.





 
Sandwich Time!Whoo!

JoyCheck & KeyCheck Widgets
For easy implementation of customizable joystick and keyboard controls.
http://www.create-games.com/download.asp?id=8364

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
25th May, 2011 at 17:25:15 -

Thanks for the response.
I however don't seem to find the Get Object... And you were right, I hade the Download Object all along
I found a "Let Get Object", but I don't think it's for MMF2.

Edit:
Alright, I went back to the article about this subject (http://www.create-games.com/article.asp?id=2029). I kind of understand how it works, but the strings are all blank. It seems like the Ini doesn't load from any file, or the strings don't load from the ini.
I have the "game" in a folder with the "New" and "Current" .ini files, and the ini object set to load them through Appdir$+"Current" and Appdir$+"New"... Don't really know what I'm doing wrong

Edited by Callebo

 
...Atleast thats what Batman told me!

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
25th May, 2011 at 20:28:46 -

Alright, I got it to work with the way the article I first looked on.
I had to add [] in the beginning of the "Current" and "New" files, and = instead of : after the New Dwnld URL.
All I need now is a URL with a downlad to the "New" file. I always use Mediafire for my uploading, but I can't do it now since it would change the URL everytime I uploaded the "New" file.
So now my problem is me not having a link which will keep it's URL even if you change it's downloadable content. Help?

 
...Atleast thats what Batman told me!

Chris Burrows



Registered
  14/09/2002
Points
  2396

GOTW WINNER OCT. 2011
26th May, 2011 at 09:31:35 -

Well, by the sounds of what Jon Lambert was saying, using the Get Object Extension you can tell your game to retrieve a text file. A text file containing: "Latest_version_number,Oldest_allowable_version_number,Update_url,Update_MD5". So just change the url each time. Oh but now I think about it you have to have that text file stored somewhere and that is your original problem. Never mind!

 
n/a

Callebo

Possibly Insane

Registered
  10/08/2008
Points
  3988

VIP MemberPS3 OwnerGOTM AUGUST - 2009 - 3RD PLACE!GOTM OCTOBER- 2009 - 2ND PLACE
26th May, 2011 at 11:04:16 -

I could store the text file using Google Docs, so the updater is working now Thanks for the help guys.

 
...Atleast thats what Batman told me!
   

Post Reply



 



Advertisement

Worth A Click