Fractal Softworks Forum
March 22, 2017, 07:20:27 PM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: New blog post: Building Better Worlds (2/21/17)
 
   Home   Help Search Login Register  
Pages: [1] 2 3 ... 5
  Print  
Author Topic: [0.7.2a] Version Checker v1.7 (released 2017-03-16)  (Read 39641 times)
LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« on: August 26, 2014, 05:54:54 PM »

Version Checker
Lets you know when your mods are out of date
Inspired by the AVC plugin for Kerbal Space Program
Download v1.7 (mirror)
View source code on Bitbucket





Instructions for modders who want their mod to support this:
You will need three things to make your mod support this: a uniquely-named .version file and an entry in data/config/version/version_files.csv pointing to it, as well as a master .version file online somewhere.

The CSV is required due to how Starsector handles file loading and is trivial to add. Just create the file data/config/version/version_files.csv in your mod folder, then open it in a text editor and paste the following (make sure to change the .version filename to whatever you're planning on using):
Code:
version file
insertmodnamehere.version

Then create said version file in the root of your mod directory. You can find an example version file with a description of the necessary fields here.

Once you've finished, upload this version file to the internet somewhere and change "masterVersionFile" in your local copy to point at its URL. The only part that is read from the master is the mod version data, so don't worry if the masterVersionFile URL in the online file doesn't point to itself. Whenever you update your mod, just re-upload your local .version file with the new version data and all users running Version Checker alongside your mod will be notified of the release when they first start Starsector.

That's it, you're done. Now all you have to do is remember to keep these files up to date. It helps to add a comment next to the "version" line in mod_info.json reminding you to change both files when you update. Smiley


FAQ
  • Is any data sent from my computer? - No, this mod is download only. It retrieves a master .version file and compares it against your local mod. Absolutely everything is done client-side; no information is sent to any server aside from the initial download request.
  • Does this work for all mods? - No, only those whose authors choose to support it. That's the downside of the .version file format, but the upside is that it isn't reliant on a single global maintainer, but on each individual mod author instead.
  • Will this slow down my game? - The update checks are done in separate threads and only when the game first loads, so there shouldn't be any noticeable performance impact.
  • Will supporting this make my mod require yours like with LazyLib and ShaderLib? - Nope. If Version Checker isn't tagged in the launcher the game will act as if it wasn't even installed. No .version files will be loaded, no scripts will be run, nothing.

Changelog:
Quote
Version 1.7 (March 16, 2017)
==============================
New features:
 - Added RecheckVersions command (only if Console Commands mod is installed)
 - Mods that don't support Version Checker are now shown in the notification
   dialog along with their current version and a link to the forum's Mod Index
   so you can manually check for updates
Bug fixes:
 - Fixed comparison of multi-digit patch/RC numbers to single digit ones
 - Fixed spam if an update check failed with an unchecked exception

 Version 1.6 (December 08, 2015)
=================================
No longer requires modifications to vmparams/bat/shell script to function
Only show remote version number if it differs from the local version

 Version 1.5 (November 19, 2015)
=================================
Updated to be compatible with Starsector 0.7a
Local versions that are newer than the latest known are shown in cyan
If an update check fails, the reason is now shown in the update dialog

 Version 1.4b (February 12, 2015)
==================================
Reordered dialog options to match text order
Changes to Starsector game update notifications:
 - Only warns about Starsector update if remote version is newer, not just
   a different version than the one installed (it still won't warn about
   Starsector updates until I update the repository after each patch)
 - Now notifies the player if the Starsector update check fails

 Version 1.4 (February 10, 2015)
=================================
Version Checker now also checks if you are running the latest Starsector release
Added "checkStarsectorVersion" to data/config/version/version_checker.json
Fixed broken menus in Starsector 0.65.2a
Fixed parsing of remote JSON files with multiple #'s in a single line
Minor text polish (proper verbs and pluralization)

 Version 1.3 (December 13, 2014)
=================================
Mod now warns the player if installed incorrectly instead of crashing the game
Added keyboard shortcuts to mod list in campaign pop-up
Display current page number when multiple pages of mods are present
Show local version info for failed update checks so you can check forum manually

 Version 1.2b (November 30, 2014)
==================================
Can launch directly to a forum thread from the mod list (removes an extra step)
Fixed a typo when listing mods that failed their update check

 Version 1.2 (October 21, 2014)
================================
Can summon a dialog in campaign to display update information (default key: V)
You can launch directly to a mod's forum thread from within this dialog
Update check uses a thread pool (much faster when checking many mods)
Added "maxUpdateThreads" option to version_checker.json
Added optional "modThreadId" field to .version file format
Removed unused "starsectorVersion" field from .version file format

 Version 1.1b (August 31, 2014)
================================
Fixed serialization crash when starting a new game before update check is done

 Version 1.1 (August 28, 2014)
===============================
Local master version files allowed when dev mode is enabled (prefix w/ file:/)
Patch field can now be a String (allowing v2.4b instead of v2.4.1)

 Version 1.0 (August 27, 2014)
===============================
Initial release
« Last Edit: March 16, 2017, 10:08:44 PM by LazyWizard » Logged

Hyph_K31
Admiral
*****
Posts: 1605


O' Hear My Name and Tremble! Ug Ug.


View Profile
« Reply #1 on: August 26, 2014, 06:48:56 PM »


Oh my. Oh my oh my!

Is this what I think it is? Because I seem to think that I think I think that it seems to be an update thing! (I've actually forgotten what it should be called.)

...

Is it, really? How on earth have you managed to get this to work if it is so? I can't even begin to imagine with my meagre understanding.

You appear to have broken ground.
Logged


"GEDUNE, stop venting in front of your classmates!"
LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #2 on: August 26, 2014, 07:08:02 PM »

Yep, it's a mod that checks if your other mods are up to date. This is all finished and working, I just need to write the documentation for it (installation is slightly more complicated than other mods).

It also won't work unless a mod maker supports it by putting a .version file in their mod folder and registering it in a CSV, so it won't be very useful until mods start releasing updates again.

Here's an example .version file for the curious:
Code:
{
    # Points toward the online master .version file. This mod works by comparing
    # the local and online version to check if there is a newer version available.
    "masterVersionFile":"https://dl.dropboxusercontent.com/u/32722116/Version%20Files/versionchecker.version",
    "modName":"Version Checker",
    "modVersion":
    {
        "major":0,
        "minor":1,
        "patch":2
    },
    "starsectorVersion":".6.2a" # Unused for now
}
Logged

Thaago
Admiral
*****
Posts: 2762

Quantum Mechanic


View Profile Email
« Reply #3 on: August 26, 2014, 07:12:41 PM »

Ah, cool! Are you hosting one shared csv, or should the mod creators have one themselves?

Excellent job Smiley
Logged
Hyph_K31
Admiral
*****
Posts: 1605


O' Hear My Name and Tremble! Ug Ug.


View Profile
« Reply #4 on: August 26, 2014, 07:15:55 PM »

I'm suddenly awfully glad that I use the Major Minor Patch versioning system already, neat.

Will this be fully able to download and install updates, or say if an update is available?
Logged


"GEDUNE, stop venting in front of your classmates!"
LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #5 on: August 26, 2014, 07:35:12 PM »

Ah, cool! Are you hosting one shared csv, or should the mod creators have one themselves?

Excellent job Smiley

The CSV is per-mod but merged, a la ship_data.csv.


I'm suddenly awfully glad that I use the Major Minor Patch versioning system already, neat.

Will this be fully able to download and install updates, or say if an update is available?

It just notifies the player that an update is available for now. It won't ever download updates (allowing mods to download arbitrary files is a bad idea Wink), but I suppose it could let you choose to open your browser directly to a mod thread on this forum. I'd have to think about it.

Regarding the patch number: it will exclude trailing zeros (2.4.0 it will show up as 2.4 in-game), so if your mod doesn't use that notation you can just ignore the patch field. I might add support for characters (2.4b) later. Smiley
Logged

LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #6 on: August 26, 2014, 10:13:32 PM »

Version 1.0 is out now, get it in the OP. The installation instructions are different from normal mods, so make sure you read them carefully!

No released mods support this yet, so there's little point in downloading it right now if you're not a mod author adding support for it.

Let me know if anything is confusing and I'll update the instructions to be more clear. Smiley
Logged

Foxer360
Admiral
*****
Posts: 635


Recursion; See Recursion (n)


View Profile Email
« Reply #7 on: August 26, 2014, 11:40:44 PM »

This is by far the most glorious pure utility mod yet. Well, maybe Combat Radar is up there, but it has a 10x awesomeness multiplier for modders!
Logged

kazi
Admiral
*****
Posts: 677


I'm a huge dork.


View Profile
« Reply #8 on: August 27, 2014, 01:00:33 AM »

Not that it's an especially huge deal to add in the .version files, but why not just load the mod version from the modinfo.json files? That almost seems like a simpler solution (and everyone is already using those).
Logged

Hyph_K31
Admiral
*****
Posts: 1605


O' Hear My Name and Tremble! Ug Ug.


View Profile
« Reply #9 on: August 27, 2014, 01:10:13 AM »

Well, adding support for this is definitely on the top of my to-do list!
Logged


"GEDUNE, stop venting in front of your classmates!"
LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #10 on: August 27, 2014, 01:15:02 AM »

Not that it's an especially huge deal to add in the .version files, but why not just load the mod version from the modinfo.json files? That almost seems like a simpler solution (and everyone is already using those).

Because there's no way to load each individual mod_info.json through the API. You'll just get the first one Starsector can grab. This is also why the .version file has to be uniquely named and registered in a csv.
Logged

kazi
Admiral
*****
Posts: 677


I'm a huge dork.


View Profile
« Reply #11 on: August 27, 2014, 02:07:57 AM »

Ah, that would make sense. Anyhow, added for my next version. Took all of 5 seconds to get working Smiley
Logged

LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #12 on: August 27, 2014, 01:49:02 PM »

I added platform-specific installation instructions to the OP. It'd be great if a Linux user could confirm that the instructions for that OS work. I have confirmation on Mac already.
Logged

Sundog
Captain
****
Posts: 427



View Profile
« Reply #13 on: August 27, 2014, 05:15:31 PM »

I'll be adding support for this to my faction before the next release. Thank you for yet another excellent mod-to-improve-all-mods  Smiley
Logged

LazyWizard
Global Moderator
Admiral
*****
Posts: 1127


Addicted to complexity


View Profile WWW
« Reply #14 on: August 28, 2014, 04:24:34 PM »

Version 1.1 is up, get it here (mirror).

I added support for the more common patch notation where minor updates are given a character (v2.4b instead of v2.4.1).

I also made it so a .version file can point to a local master when dev mode is enabled. This should make it easier for modders to test support for this mod since they can skip the upload step temporarily.

Changelog:
Quote
Version 1.1 (August 28, 2014)
===============================
Local master version files allowed when dev mode is enabled (prefix w/ file://)
Patch field can now be a String (allowing v2.4b instead of v2.4.1)
Logged

Pages: [1] 2 3 ... 5
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.20 | SMF © 2006-2011, Simple Machines
Simple Audio Video Embedder
Valid XHTML 1.0! Valid CSS!