[API] Update Check Framework

Started by Neurotoxin, August 07, 2014, 05:06:02 AM

Previous topic - Next topic

Neurotoxin

Started work today on a simple update checker.





All that's needed to plug in is an xml file.


<Your Mod>/Update/Data.xml
Path and file name are required.


Data.xml Example


<Data>
   <CurrentVersion>1.1.0</CurrentVersion>
   <UpdateURL>http://pastebin.com/raw.php?i=TTicD5DE</UpdateURL>
</Data>



Currently only working on HTTP protocol (not https)


I am posting now for people who may want to plug in, what would you like to see? Currently, as proof of concept, it compares version strings rather than values. I can easily add support for Major.Minor.Revision.Build for version checking thus only notifying of update if one of the values is greater than the current. Is there any other versioning system you want supported?


I intend for this to be a very simple way for mod makers to add an update checking functionality to their mods.


Are there any security concerns with parsing a version String that people are worried about? This mod sends no data besides obviously an IP to whatever server it's connecting to (in my example pastebin) relative to the user. It's no worse than browsing to the page yourself.


Does anyone want to help getting HTTPS to work? Let me know here or via PM. I'll get it eventually.


TODO before release:
Implement HTTPS (Specifically for github but also for any other necessary reason)
Implement actual version checking rather than if(!string1.Equals(String2)) - PoC method
Maintain Use simplicity.   
Gather all updated mods on thread close rather than logging to present all at once via GUI window (Might need help with GUI, I suck at those).

Source will be released with the mod itself.




Sorry for my broken train of thought here, kinda fried after a long day... think of this a my bullet points, in no specific order.


Anyway, I'll straighten this thread out tomorrow. Any thoughts, comments, suggestions?

RawCode

Valid implementation of this feature require some work from @Tynan - to be precise - each mod must be loaded with separate appdomain (classloader) this will allow to hotplug mod assemblies, load and unload them at runtime.

Neurotoxin

I don't intend to auto-update mods. I intend to alert users to available updates. I personally dislike automatic updating, specifically because I'm on limited bandwidth satellite internet but reading a version string doesn't require more than at most a couple KB. I Just want to draw a screen at the main menu (popup) to inform users there's an update available for x,y,z mod(s). If they have the mod they know where to get the update, same place they got it in the first place.