OgrePatcher

From ISXOgre
Jump to: navigation, search

Ogre Patcher

A patcher created specifically to patch files from ISXOgre. This is a rough idea of various options available. Anything marked 'Server side' is specifically for Kannkor, and you can't have any effect on it. It's merely a place to document.

Overall: How it works

  • The server creates a hash of every file available for ISXOgre.
  • It passes this file to your client.
  • Your client creates a hash of all ISXOgre files on your computer.
  • If the file is marked as ignore, the file is skipped.
  • If the file is marked as 'Do not overwrite' and the file exists, the file is skipped.
  • If the hashes are different, it downloads the new file from the server.


Download: How it works

  • Lets use the file ISXOgre.dll as an example. The patcher downloads the file as: ISXOgre.dll.ogrepatcher.
  • Once the file is fully downloaded, it compares the hash of ISXOgre.dll.ogrepatcher to what it is suppose to be from the server. If they are different, it means the file wasn't downloaded properly, and the file is discarded.
    • The file is discarded because if the hashes are wrong, the file may be corrupt. In that case it's better to have the old file, than a corrupt new file.
  • If the hashes match, the "old" ISXOgre.dll file is renamed to "ISXOgre.dll.ogrepatcherold".
  • The new file (currently named ISXOgre.dll.ogrepatcher) is renamed to "ISXOgre.dll".
  • The old file "ISXOgre.dll.ogrepatcherold" is then deleted.

Server side

  • Create a list of files, designating if the file should be always patch if the file has changed (default) or
  • <donotoverwrite>1</donotoverwrite>
    • Specifies to only patch the file if the file does not exist. This works great for config files, such as eq2chars.inc. This way it would never overwrite an existing file.

Client side

  • The user can create a list of files, designating options which override server side options.
  • File: ./innerspace/extensions/ISXOgrePatcherIgnoreList.xml
    • Format:
<?xml version="1.0" ?>
<Manifest>
   <FileInfo>
       <filename>Logs/placeholder.txt</filename>
     <ignore>1</ignore>
   </FileInfo>
 <FileInfo>
   <filename>Logs/placeholder2.txt</filename>
     <donotoverwrite>1</donotoverwrite>
 </FileInfo>
</Manifest>
  • In the first example above, the patcher will completely ignore Logs/placeholder.txt. Even if the file doesn't exist, the patcher will not download it.
  • In the second example above, the patcher will only patch Logs/placeholder2.txt if the file does not exist. This means you can safey modify the file without it being overwritten. Be warned, when a new version of this file is available, you will NOT download it because you have it set to not overwrite your existing file.
  • More examples to follow

Quirks

  • While it's in testing, there is a lot of spam in the console. This will be removed once it's confirmed working properly.
  • Because of the way it downloads, then tries to delete the file afterwards, it will always fail on isxogre.dll.ogrepatcherold because it's still in use. It is deleted on the reload. Still produces an error in the console that can be ignored.