Author Topic: Ver / MD5 check for registry  (Read 1393 times)

Kirk

  • Traveller
  • *
  • Posts: 23
    • View Profile
Ver / MD5 check for registry
« on: December 07, 2005, 12:00:12 am »
I\'m new around here so sorry if I irritate someone out of ignorance.

Why not have the updater check to see if the current registry on disk is the same as the one on the server?  It seems that the updater downloads the registry zip regardless and the file appears to be just over 600 KB.

You could read in the \"information version\" tag or just do a MD5 on the zip itself.

I would think this would reduce the load on the update servers considerably although I\'m not sure how many hits they are getting a day.

Cha0s

  • Veteran
  • *
  • Posts: 1860
    • View Profile
(No subject)
« Reply #1 on: December 07, 2005, 12:30:02 am »
Interesting idea. It would be something to consider... the only issue is that to save disk space, the repository is not currently stored on the local machine. A hashcode could be stored after a completed update, however, and compared to a server hash before the next update, I suppose. The only issue would be that people who overwrote files or deleted files by mistake wouldn\'t be able to get an update without deleting the hashcode for the repository, a process that might confuse them... I don\'t know if it\'s worth it or not; it depends on the load on the update servers.
Cha0s
Mac OS X Forum Moderator
In-Game Roleplay Forum Moderator
Please search and skim existing threads before posting!

Kirk

  • Traveller
  • *
  • Posts: 23
    • View Profile
(No subject)
« Reply #2 on: December 07, 2005, 12:43:35 am »
Hmm.  Here\'s where I am coming from.  In my game folder I have a folder called updatertemp.  In this folder the updater places a repos.zip which contains a repository.xml file.  The repos.zip is about 600 KB and the repository.xml file is about 2731 KB.  The repository.xml file has as its first tag and then the (long) document contains MD5 values for every file.

Is this the repository that is / isn\'t stored on the local machine?

See I was thinking it was on the local machine.  In that case, the server sends an md5 of the zip, local machine md5s its zip, if they match the local machine continues on with extracting the repository and doing the checks for each file that composes the game.

If this is valid then you wouldn\'t have the issues about users changing / deleting files.  The only change in the process is that the local machine only downloads if the repository is different from the one on the server.

By the way, I\'m a windows xp user so I don\'t know if that makes a difference.
« Last Edit: December 07, 2005, 12:45:57 am by Kirk »

Cha0s

  • Veteran
  • *
  • Posts: 1860
    • View Profile
(No subject)
« Reply #3 on: December 07, 2005, 01:52:28 am »
Ah, interesting, I didn\'t know that the updater did that now... it didn\'t used to, if I recall correctly. Well, anyway, yes it could work, but there are still the problems I mentioned before...
Cha0s
Mac OS X Forum Moderator
In-Game Roleplay Forum Moderator
Please search and skim existing threads before posting!

Kirk

  • Traveller
  • *
  • Posts: 23
    • View Profile
(No subject)
« Reply #4 on: December 07, 2005, 03:16:14 am »
I\'m not sure what problems you are referring to.

All I\'m proposing is to not download the repository file if the exact same repository file exists.  Nothing would change in regards to how the updater checks the game files against the repository.

Cha0s

  • Veteran
  • *
  • Posts: 1860
    • View Profile
(No subject)
« Reply #5 on: December 07, 2005, 03:42:36 am »
Ah, I see what you\'re saying. In that case, I don\'t think it actually saves that much traffic. The repository isn\'t really all that big, and the servers have a lot of bandwidth. I can easily get upwards of 200 kb/s from mirrors 2 and 3.
Cha0s
Mac OS X Forum Moderator
In-Game Roleplay Forum Moderator
Please search and skim existing threads before posting!

stfrn

  • Hydlaa Citizen
  • *
  • Posts: 324
  • the beaver ex-dev :B
    • View Profile
(No subject)
« Reply #6 on: December 07, 2005, 03:49:34 am »
Yes, but it can take a m,inute or so to download the 600kb file, just to see that everything is up to date :) and if people are constantly downloading that needlessly, then the update servers are wasting bandwtih. Seems like a good step to add.

Furthermore, if this new check was very fast, it would be simple to add it to the main client. Then as you are loading it would tell you that there are new downloads ready, and in theory files could be downloaded in the background, if that was supported. But one step at a time :)
player -> gm -> dev -> bum

Cha0s

  • Veteran
  • *
  • Posts: 1860
    • View Profile
(No subject)
« Reply #7 on: December 07, 2005, 04:00:02 am »
Good point... that extra minute is a bit annoying.

Oh, and now that I think about it, a hash would probably not be necessary. It would be much easier to just compare sizes.
Cha0s
Mac OS X Forum Moderator
In-Game Roleplay Forum Moderator
Please search and skim existing threads before posting!

DaveG

  • Forum Addict
  • *
  • Posts: 2058
    • View Profile
(No subject)
« Reply #8 on: December 07, 2005, 05:08:18 am »
I feel the need to point out the irony of checking if the update repository is new with a hash, when the update repository contains all the hashes used to check if everything else is up-to-date...  :P  Hash the hashes!...

::  PlaneShift Team Programmer  ::

Cha0s

  • Veteran
  • *
  • Posts: 1860
    • View Profile
(No subject)
« Reply #9 on: December 07, 2005, 05:11:29 am »
Yes, quite ironic, but unnecessary, anyway. :P

P.S. Get on IRC pretty please. There should be a law that DaveG must be on IRC 24/7. :D
Cha0s
Mac OS X Forum Moderator
In-Game Roleplay Forum Moderator
Please search and skim existing threads before posting!

Kirk

  • Traveller
  • *
  • Posts: 23
    • View Profile
(No subject)
« Reply #10 on: December 07, 2005, 05:16:21 am »
Ehh, you can always just read the \"information version\" field if you don\'t like hashes.  Of course you won\'t be checking for file integrity.

hash the planet!