Fractal Softworks Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Starsector 0.97a is out! (02/02/24); New blog post: Planet Search Overhaul (07/13/24)

Pages: [1] 2 3 ... 10

Author Topic: [0.9.1a] Version Checker v2.0b (released 2020-08-28)  (Read 396827 times)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
[0.9.1a] Version Checker v2.0b (released 2020-08-28)
« on: August 26, 2014, 05:54:54 PM »

Note: the recent error messages and failed update checks are not caused by a bug in this mod.

Bitbucket has made a change on their end that means that the version of Java that ships with Starsector can no longer connect to bitbucket.org. Mods using Bitbucket to host their version files will need to migrate to another site.

Since the update check does not work for affected mods, you'll need to check their threads for updates manually using the in-game menu. My apologies for the inconvenience.



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

Spoiler



[close]

Instructions for modders who want to add Version Checker support to their mod:
Spoiler
You will need three things to add Version Checker support to your mod: a uniquely-named .version file, an entry in data/config/version/version_files.csv pointing to it, and a master .version file somewhere online to check against.

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 next 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. :)
[close]


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.
  • I have a mod I made for personal use. Is there any way I can make Version Checker stop telling me it's unsupported? - Yes! Add the line "suppressVCUnsupported":true, to your mod's mod_info.json.

Changelog:
Spoiler
Quote
Version 2.0b (August 28, 2020)
================================
Moved version file hosting from Bitbucket to GitHub

 Version 2.0 (March 19, 2019)
==============================
Added "nexusModId" field to .version file format:
 - Optional field, adds support for nexusmods.com
 - ID is an integer, and should be the mod ID in the Nexus mod page's URL
   Ex: https://www.nexusmods.com/starsector/mods/3 has an ID of 3
Added "preferNexusLinks" to data/config/version/version_checker.json:
 - When true, will open a mod's Nexus page instead of its forum thread,
   provided it has one listed in its .version file
Added an option that opens threads for all updatable mods in one click
Fixed RecheckVersions command not updating the version info dialog
Fixed message spam when a user's connection drops during an update check

 Version 1.8b (December 1, 2018)
=================================
Fixed Bitbucket connection issue (enabled TLS v1.2)

 Version 1.8 (November 16, 2018)
=================================
Updated to be compatible with Starsector 0.9a
Added support for "suppressVCUnsupported" tag in a mod's mod_info.json
Fixed crash when clicking forum links on some Linux distros

 Version 1.7c (April 21, 2017)
===============================
Disabled Java URL caching (fixes a minor Bitbucket version file hosting issue)

 Version 1.7b (April 21, 2017)
===============================
Updated to be compatible with Starsector 0.8a

 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
[close]
« Last Edit: September 18, 2020, 06:39:27 AM by LazyWizard »
Logged

Hyph_K31

  • Admiral
  • *****
  • Posts: 1605
  • O' Hear My Name and Tremble! Ug Ug.
    • View Profile
Re: So I've been working on something new...
« 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: 1368
    • View Profile
    • GitHub Profile
Re: So I've been working on something new...
« 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

  • Global Moderator
  • Admiral
  • *****
  • Posts: 7531
  • Harpoon Affectionado
    • View Profile
Re: So I've been working on something new...
« 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 :)
Logged

Hyph_K31

  • Admiral
  • *****
  • Posts: 1605
  • O' Hear My Name and Tremble! Ug Ug.
    • View Profile
Re: So I've been working on something new...
« 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: 1368
    • View Profile
    • GitHub Profile
Re: So I've been working on something new...
« 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 :)

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 ;)), 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. :)
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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. :)
Logged

FasterThanSleepyfish

  • Admiral
  • *****
  • Posts: 730
  • Blub
    • View Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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: 714
    • View Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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: 1368
    • View Profile
    • GitHub Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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: 714
    • View Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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 :)
Logged

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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

  • Admiral
  • *****
  • Posts: 1771
    • View Profile
Re: [0.6.2a] Version Checker v1.0 (released 2014-08-27)
« 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  :)

LazyWizard

  • Global Moderator
  • Admiral
  • *****
  • Posts: 1368
    • View Profile
    • GitHub Profile
Re: [0.6.2a] Version Checker v1.1 (released 2014-08-28)
« 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 ... 10