cybutek

[1.3 & 1.2] KSP-AVC Add-on Version Checker Plugin 1.1.6.2 - MiniAVC - KSP-AVC Online (2016-10-13)

Recommended Posts

Posted (edited)

I have an interesting problem.  I'm working on adopting another mod.

So, I created a .version file, and in my local system, I made the version # 0.1.3, while on the website it is 0.1.4

It sees both properly, but for some reason, it doesn't say that an update is available:

From the log file:

MiniAVC -> R:\KSP_1.3.0_dev\GameData\TokamakIndustries\TokamakIndustries.version
	NAME: TokamakIndustries
	URL: http://ksp-avc.cybutek.net/version.php?id=501
	DOWNLOAD: https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases
	GITHUB: NULL
	VERSION: 0.1.3
	KSP_VERSION: 1.1.3
	KSP_VERSION_MIN: 1.1.3
	KSP_VERSION_MAX: 1.3
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

MiniAVC -> http://ksp-avc.cybutek.net/version.php?id=501
	NAME: TokamakIndustries
	URL: http://ksp-avc.cybutek.net/version.php?id=501
	DOWNLOAD: https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases
	GITHUB: NULL
	VERSION: 0.1.4
	KSP_VERSION: 1.1.3
	KSP_VERSION_MIN: 1.1.3
	KSP_VERSION_MAX: 1.3
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
	UpdateAvailable: False

The .version file on my system:

{
	"NAME"			:	"TokamakIndustries",
"URL":"http://ksp-avc.cybutek.net/version.php?id=501"
	"DOWNLOAD"		:	"https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases",
	"CHANGE_LOG_URL":	"https://raw.githubusercontent.com/linuxgurugamer/Tokamak-Refurbished-Parts/master/GameData/TokamakIndustries/changelog.txt",
	"VERSION":
	{
		"MAJOR"	:	0,
		"MINOR"	:	1,
		"PATCH"	:	3,
		"BUILD"	:	0
	},
	"KSP_VERSION":
	{
		"MAJOR"	:	1,
		"MINOR"	:	1,
		"PATCH"	:	3
	},
	"KSP_VERSION_MIN":
	{
		"MAJOR"	:	1,
		"MINOR"	:	1,
		"PATCH"	:	3
	},
	"KSP_VERSION_MAX":
	{
		"MAJOR"	:	1,
		"MINOR"	:	3,
		"PATCH"	:	0
	}
}

 

I'm in a bit of a rush, so I don't have time to look at this more.

I hope to release this on Sunday, if possible.

Any help would be appreciated.

thanks

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites

 

2 hours ago, linuxgurugamer said:

I have an interesting problem.  I'm working on adopting another mod.

So, I created a .version file, and in my local system, I made the version # 0.1.3, while on the website it is 0.1.4

It sees both properly, but for some reason, it doesn't say that an update is available:

From the log file:


MiniAVC -> R:\KSP_1.3.0_dev\GameData\TokamakIndustries\TokamakIndustries.version
	NAME: TokamakIndustries
	URL: http://ksp-avc.cybutek.net/version.php?id=501
	DOWNLOAD: https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases
	GITHUB: NULL
	VERSION: 0.1.3
	KSP_VERSION: 1.1.3
	KSP_VERSION_MIN: 1.1.3
	KSP_VERSION_MAX: 1.3
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

MiniAVC -> http://ksp-avc.cybutek.net/version.php?id=501
	NAME: TokamakIndustries
	URL: http://ksp-avc.cybutek.net/version.php?id=501
	DOWNLOAD: https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases
	GITHUB: NULL
	VERSION: 0.1.4
	KSP_VERSION: 1.1.3
	KSP_VERSION_MIN: 1.1.3
	KSP_VERSION_MAX: 1.3
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
	UpdateAvailable: False

The .version file on my system:


{
	"NAME"			:	"TokamakIndustries",
"URL":"http://ksp-avc.cybutek.net/version.php?id=501"
	"DOWNLOAD"		:	"https://github.com/linuxgurugamer/Tokamak-Refurbished-Parts/releases",
	"CHANGE_LOG_URL":	"https://raw.githubusercontent.com/linuxgurugamer/Tokamak-Refurbished-Parts/master/GameData/TokamakIndustries/changelog.txt",
	"VERSION":
	{
		"MAJOR"	:	0,
		"MINOR"	:	1,
		"PATCH"	:	3,
		"BUILD"	:	0
	},
	"KSP_VERSION":
	{
		"MAJOR"	:	1,
		"MINOR"	:	1,
		"PATCH"	:	3
	},
	"KSP_VERSION_MIN":
	{
		"MAJOR"	:	1,
		"MINOR"	:	1,
		"PATCH"	:	3
	},
	"KSP_VERSION_MAX":
	{
		"MAJOR"	:	1,
		"MINOR"	:	3,
		"PATCH"	:	0
	}
}

 

I'm in a bit of a rush, so I don't have time to look at this more.

I hope to release this on Sunday, if possible.

Any help would be appreciated.

thanks

Seems to be related to a space I had in the file which wasn't online.  

Workig now

Share this post


Link to post
Share on other sites
Posted (edited)

Just saw two colours I've not seen before highlighting mods in the KSP AVC list on the upper left of the screen on KSP.  Magenta (Kronometer) and dark orange / brown (Kopernicus), but with green version numbers.

Spoiler

screenshot_2017-08-20--16-03-49a.png

I've only seen the all-green lines (current version) and all-yellow lines (not current version) before and was wondering what the other colours mean.

Edited by Jacke

Share this post


Link to post
Share on other sites
47 minutes ago, Jacke said:

I've only seen the all-green lines (current version) and all-yellow lines (not current version) before and was wondering what the other colours mean.

those are custom colors, because we like colors :D

for the color coding look at the version number (both are green so you are on the latest release)

Share this post


Link to post
Share on other sites
Posted (edited)

When I bring up the list of mods that KSP AVC is monitoring, what does the different color of the texts mean?

 

Edited by gamerscircle

Share this post


Link to post
Share on other sites
1 hour ago, gamerscircle said:

When I bring up the list of mods that KSP AVC is monitoring, what does the different color of the texts mean?

 

I just read through the past couple of pages.. now I know..

Share this post


Link to post
Share on other sites
Posted (edited)

@cybutek is it possible to feed the ".version" information to KSP-AVC directly from the plugin rather than from a .version file?

Edited by Sigma88

Share this post


Link to post
Share on other sites

This has been bugging me, and I think I've found a real bug:

It seems that when the KSP_VERSION is lower than the version of the game, it doesn't check the VERSION at all.

I'm basing this on the following:

AVC file in folder:

{
	"NAME":"K2CommandPodContinued",
	"URL":"http://ksp-avc.cybutek.net/version.php?id=428",
	"VERSION":
	{
		"MAJOR":1,
		"MINOR":1,
		"PATCH":8,
		"BUILD":1
	},
	"KSP_VERSION":
	{
		"MAJOR":1,
		"MINOR":3,
		"PATCH":1
	},
	"KSP_VERSION_MIN":
	{
		"MAJOR":1,
		"MINOR":2,
		"PATCH":0
	},
	"KSP_VERSION_MAX":
	{
		"MAJOR":1,
		"MINOR":3,
		"PATCH":99
	}
}

AVC downloaded from URL (run through a JSON formatter):

{
  "NAME": "K2CommandPodContinued",
  "URL": "http://ksp-avc.cybutek.net/version.php?id=428",
  "VERSION": {
    "MAJOR": 1,
    "MINOR": 1,
    "PATCH": 8,
    "BUILD": 2
  },
  "KSP_VERSION": {
    "MAJOR": 1,
    "MINOR": 3,
    "PATCH": 0
  },
  "KSP_VERSION_MIN": {
    "MAJOR": 1,
    "MINOR": 2,
    "PATCH": 0
  },
  "KSP_VERSION_MAX": {
    "MAJOR": 1,
    "MINOR": 3,
    "PATCH": 99
  }
}

In the output_log.txt:

KSP-AVC -> R:\KSP_1.3.1_dev\GameData\JFJohnny5\K2.version
	NAME: K2CommandPodContinued
	URL: http://ksp-avc.cybutek.net/version.php?id=428
	DOWNLOAD: NULL
	GITHUB: NULL
	VERSION: 1.1.8.1
	KSP_VERSION: 1.3
	KSP_VERSION_MIN: 1.2
	KSP_VERSION_MAX: 1.3.99
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
 
(Filename: C:/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

KSP-AVC -> http://ksp-avc.cybutek.net/version.php?id=428
	NAME: K2CommandPodContinued
	URL: http://ksp-avc.cybutek.net/version.php?id=428
	DOWNLOAD: NULL
	GITHUB: NULL
	VERSION: 1.1.8.2
	KSP_VERSION: 1.3
	KSP_VERSION_MIN: 1.2
	KSP_VERSION_MAX: 1.3.99
	CompatibleKspVersion: False
	CompatibleKspVersionMin: True
	CompatibleKspVersionMax: True
	CompatibleGitHubVersion: True
	UpdateAvailable: False

You can clearly see that in the log, it specifically says that no update is available, AND in-game, it shows the mod in green

when I changed the website to reflect the correct version of the game.  It's obviously using the data from the website, and, IMHO, is also obviously now totally useless to verify that mods are ok after the game has updated.

The specific circumstance I ran into was when checking parts mods, which have a very relaxed MIN and MAX values;  but if the base KSP_VERSION is not matching the current game, it doesn't raise a flag at all.

 

Share this post


Link to post
Share on other sites

The fix is rather simple for this, it's a one line change in two files (one file for the full AVC, one for the MiniAVC)

I've sent a PM to @cybutek about this.

I've also submitted a PR on Github with the bug fix.

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites
13 hours ago, Sigma88 said:

@cybutek is it possible to feed the ".version" information to KSP-AVC directly from the plugin rather than from a .version file?

I would doubt it.  KSP-AVC runs before the plugins are loaded, to do what you ask would require changing the way it runs.

I would think it would be possible to add an API for it, though.

Share this post


Link to post
Share on other sites
23 minutes ago, linuxgurugamer said:

I would doubt it.  KSP-AVC runs before the plugins are loaded, to do what you ask would require changing the way it runs.

I would think it would be possible to add an API for it, though.

Avc uses a monobehaviour that runs at "Instantly" which can be used by other plugins as well

Share this post


Link to post
Share on other sites
Just now, Sigma88 said:

Avc uses a monobehaviour that runs at "Instantly" which can be used by other plugins as well

Yes, but there is no guarantee that one runs before another.  What if your mod ran before this one?  Either you would have to put in code checking to see if AVC is ready, or AVC would need to be changed a bit.

All in all, I personally don't see a real need for this.  All of my mods have the version number baked into the DLL, but that is pulled from the .version file itself.

Share this post


Link to post
Share on other sites
34 minutes ago, linuxgurugamer said:

Yes, but there is no guarantee that one runs before another.  What if your mod ran before this one?  Either you would have to put in code checking to see if AVC is ready, or AVC would need to be changed a bit.

as long as the required classes and fields are public it means that any plugin can modify them, loading order can be easily controlled that's definitely not an issue :wink:

23 minutes ago, linuxgurugamer said:

I personally don't see a real need for this.

that's fine, you don't need to :)

I do, that's why I asked

Share this post


Link to post
Share on other sites
3 minutes ago, Sigma88 said:

as long as the required classes and fields are public it means that any plugin can modify them, loading order can be easily controlled that's definitely not an issue :wink:

that's fine, you don't need to :)

I do, that's why I asked

In order for this to be useful, there would be some sort of wrapper file similar to what the Blizzy toolbar uses. This adds more code to an already bloated game.

I am really trying to understand what advantage there would be to having a mod do the update of the info rather than reading the information from the version file.

Share this post


Link to post
Share on other sites
21 minutes ago, linuxgurugamer said:

In order for this to be useful, there would be some sort of wrapper file similar to what the Blizzy toolbar uses. This adds more code to an already bloated game.

I am really trying to understand what advantage there would be to having a mod do the update of the info rather than reading the information from the version file.

I have no idea what you are talking about, for sure KSP-AVC has some kind of list / dictionary where all the information loaded from the .version files are stored.

if that list is publicly accessible it means that it can be modified by other plugins, simple as that.

 

I just don't feel like going through all the code if I can ask the developer to answer one simple question

 

if you need a list of reasons why this would be useful here are some that come to mind:

1- multiple copies of the same .version file show up as multiple mods on KSP-AVC list (if that was integrated in the plugin, only the version from the running plugin would show up)

2- integrating the version in the plugin means there's one less file to keep track of

3- it also means that I can automate the version check to read the plugin assemby version and pass that info to KSP-AVC directly rather than having to change 2 things (assembly version and kspavc version)

4- .version files can be modified by anyone with a notepad redistributing my mod, while plugins at least need to be recompiled which make the system safer for the user (if someone was concerned about security I could share the hash of my plugin so they can check that the version of my mod they are downloading from a third party source is the legitimate one and not a modified version)

5- cybutek already has 2 plugins (AVC and miniAVC) so it's possible the feature is already in place since both plugin would access the same informations

 

 

I hope that's enough, if not, I still think I'm allowed to ask if it is possible regardless of it being even remotely useful

 

Edited by Sigma88

Share this post


Link to post
Share on other sites

I’m sorry, it seems you may have been taking my comments as an attack.

They aren’t, and I’m sorry if you felt that way.

I just spent some time tracking down a bug in AVC, so have a little familiarity with the code now, and am just trying to have a discussion about your request.  I am not the maintainer, nor do I have any influence with him.

I actually agree with at least two of your reasons above, #1 and #4

Regarding #3, might I suggest you take a look at the AssemblyVersion.tt  in my mods, which read the version file and inserts it into the assemblyversion.  It automates the process so I dont need to think about that issue any more

Edited by linuxgurugamer

Share this post


Link to post
Share on other sites
8 minutes ago, linuxgurugamer said:

I’m sorry, it seems you may have been taking my comments as an attack.

They aren’t, and I’m sorry if you felt that way.

I just spent some time tracking down a bug in AVC, so have a little familiarity with the code now, and am just trying to have a discussion about your request.  I am not the maintainer, nor do I have any influence with him.

don't worry I am not offended

but you didn't answer my question, you just shut it down.

which is weird since it was a question I addressed to the developer.

10 minutes ago, linuxgurugamer said:

Regarding #3, might I suggest you take a look at the AssemblyVersion.tt  in my mods, which read the version file and inserts it into the assemblyversion.  It automates the process so I dont need to think about that issue any more

this workaround would be useful to me only if #1 was solved

 

I'd still rather use the universal infrastructure which is already in place for the plugin versioning and use that one to feed KSPAVC rather than doing the opposite, but if that's the only solution provided I will be fine with it.

 

anyways, I know for sure that #1 is an issue right now, but I don't know if interacting with AVC via plugin is possible or not, that's why I asked

Share this post


Link to post
Share on other sites
7 hours ago, Sigma88 said:

but you didn't answer my question, you just shut it down.

Sorry, didn't mean to do that

Share this post


Link to post
Share on other sites

I think I've figured it out mostly, the list I need to edit is not public, but I should be able to access it anyways.

Share this post


Link to post
Share on other sites
On 10/10/2017 at 12:08 PM, linuxgurugamer said:

This has been bugging me, and I think I've found a real bug:

It seems that when the KSP_VERSION is lower than the version of the game, it doesn't check the VERSION at all.

<SNIP>

The specific circumstance I ran into was when checking parts mods, which have a very relaxed MIN and MAX values;  but if the base KSP_VERSION is not matching the current game, it doesn't raise a flag at all.

 

Heh, just ran into the same issue after adding a .version to KDEX.

I thought that if the current game version (1.3.1) is between KSP_VERSION_MIN (1.0)  and KSP_VERSION_MAX (1.3.99), it would be "Compatible". However, it's showing as "CompatibleKspVersion: False" which means it thinks there's no update, even though the online version is newer.

Hopefully @cybutek will review your merge request soon..

Alternatively, what constitutes a "Compatible KSP Version" - Major + Minor must match (ie, 1.3 matches 1.3(.x)) or Major + Minor + Revision has to match?

EDIT: Looking at your bug report (not pull request), it appears the full version must match. 

Edited by micha

Share this post


Link to post
Share on other sites

Sorry for not being around. I've been very busy lately with IRL stuff.

The original reason why a "built for" ksp version is required if min/max is used was due to how the user interface makes use of this value. I have looked over the pull request but would rather the fix be in the "IsCompatibleVersion" property due to dependencies. This on its own will not be the complete fix though as it will only cascade the bug down into the user interface. I'm busy all weekend but should have some time on monday to sort this out.

Share this post


Link to post
Share on other sites
1 hour ago, cybutek said:

Sorry for not being around. I've been very busy lately with IRL stuff.

No need to apologise!!  This is all hobby and volunteer work, RL takes priority.  But thanks for the heads-up, means I will wait instead of working around the issue myself.

Share this post


Link to post
Share on other sites

I just noticed that the MKS parts no longer show up in the filter by function/simple mode parts list.  Is that a known issue ?

Share this post


Link to post
Share on other sites
On 10/20/2017 at 6:42 AM, cybutek said:

Sorry for not being around. I've been very busy lately with IRL stuff.

The original reason why a "built for" ksp version is required if min/max is used was due to how the user interface makes use of this value. I have looked over the pull request but would rather the fix be in the "IsCompatibleVersion" property due to dependencies. This on its own will not be the complete fix though as it will only cascade the bug down into the user interface. I'm busy all weekend but should have some time on monday to sort this out.

Status on this, I've seen more comments from people about this not working properly.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now