Results 1 to 7 of 7

Thread: Game autoupdate

  1. #1
    Join Date
    Apr 2010
    Posts
    9
    Thanks
    1

    Default Game autoupdate

    I have read about general algorithm of updating on this forum, but I would like some advice about things that should be in an xml file.
    Do I need any version number in xml file on server and somewhere on client side? If yes, then where should it be? Hardcoded in source code of 2 binary files (Client.exe, Server.exe), in separate file?

    My first idea for now is:
    <update>
    <files sytem="Windows">
    <file path="Client.exe" hash="8bf15...." />
    <file path="Server.exe" hash="7a2z3...." />
    </files>
    <files sytem="Linux">
    <file path="Client" hash="8bf15...." />
    <file path="Server" hash="7a2z3...." />
    </files>
    </update>

    where hash is md5 for example.

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Game autoupdate

    What do you want to update? Game rules that are plain text files? Binary programm code? Scripts? In any case you will need an information what is the current version and what is the version that is available for update. You also need a compare to decide whether the version on the server is newer than the local one to decide to download the new version.
    It's nice to be important but it's more important to be nice.

  3. #3
    Join Date
    Apr 2010
    Posts
    9
    Thanks
    1

    Default Re: Game autoupdate

    I did working version 2 weeks ago. The xml file looks like this:
    <app name="iFootball">
    <files os="Windows" version="0.0.1">
    <file path="Client.exe" hash="6a82c37ea0a5be5d0a08aa987d540b96" />
    <file path="libgcc_s_dw2-1.dll" hash="c4b4409f186da70fcf2bcc60d5f05489" />
    <file path="mingwm10.dll" hash="dbda60d92e774b4acb3b1cd71f909426" />
    <file path="QtCore4.dll" hash="8bea92d1bad9eb2ef89e2b259bb404d0" />
    <file path="QtGui4.dll" hash="0903b26fa0e27904e91ad0f9db30f4ca" />
    <file path="QtNetwork4.dll" hash="8569fbdda6a657128e56a79aeac7bbf9" />
    <file path="QtXml4.dll" hash="10f12a0751780c687321f3ee4f6d6169" />
    <file path="Server.exe" hash="0d8b2c12510d5a8d630a7b53a1519099" />
    </files>
    </app>

    I have written Updater.exe which generates md5 sums of all local files mentioned in this xml file and compares them with these in the file. If any file differ there is a message that new version is available and after you click Download button it only downloads files which have different md5 sums. When there are no updates it just quits.

    It works ok, but I want this Updater.exe to check for updates every time I run Client.exe or Server.exe. I was trying to use QProcess and start it detached at the beginning of for example Client.exe but I have no idea how to check if there are any updates in this detached proceses and close Client.exe then. I want the same behaviour for Server.exe.

    I also haven't made any use of "version" attribute yet because I don't know where to store it.

  4. #4
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Game autoupdate

    This way, the client will download the version on the server even if there is an older version on the server. The only check is that the server version is different from the local version. You can just use a #define in your library to store the version.
    It's nice to be important but it's more important to be nice.

  5. #5
    Join Date
    Apr 2010
    Posts
    9
    Thanks
    1

    Default Re: Game autoupdate

    On server there will be the latest version and the only they should use.
    What do you mean by "use a #define in your library to store the version"? I have to write my own library?

  6. #6
    Join Date
    Jan 2006
    Location
    Frankfurt
    Posts
    500
    Thanks
    1
    Thanked 52 Times in 52 Posts
    Platforms
    MacOS X Unix/X11

    Default Re: Game autoupdate

    Well somehow you have to store the version number inside your appilcation/library to compare it with the one in the xml.
    It's nice to be important but it's more important to be nice.

  7. #7
    Join Date
    Apr 2010
    Posts
    9
    Thanks
    1

    Default Re: Game autoupdate

    I have never written my own library so haven't even considered it.
    And what about my other problem:
    "It works ok, but I want this Updater.exe to check for updates every time I run Client.exe or Server.exe. I was trying to use QProcess and start it detached at the beginning of for example Client.exe but I have no idea how to check if there are any updates in this detached proceses and close Client.exe then. I want the same behaviour for Server.exe."

Similar Threads

  1. Replies: 1
    Last Post: 22nd May 2010, 08:38
  2. Autoupdate QTableView
    By cyupa in forum Qt Programming
    Replies: 1
    Last Post: 1st February 2010, 08:33
  3. IQ Game
    By qtgears in forum Qt-based Software
    Replies: 0
    Last Post: 6th October 2009, 09:24
  4. Just for fun game
    By vermarajeev in forum Qt-based Software
    Replies: 6
    Last Post: 13th December 2007, 22:52
  5. Filter Proxy Model to Autoupdate View
    By Big Duck in forum Qt Programming
    Replies: 1
    Last Post: 1st June 2006, 21:32

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.