Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update QuestariaAereospace.netkan #144

Merged
merged 1 commit into from
Jan 15, 2024
Merged

Conversation

cheese3660
Copy link
Contributor

@cheese3660 cheese3660 commented Jan 15, 2024

@cheese3660
Copy link
Contributor Author

The heck did I mess up here?
image

@HebaruSan
Copy link
Member

It's something with the swinfo.json file, haven't taken a look at it yet...

1780 [1] FATAL CKAN.NetKAN.Program (null) - Object reference not set to an instance of an object.
1847 [1] FATAL CKAN.NetKAN.Program (null) -    at CKAN.NetKAN.Transformers.SpaceWarpInfoTransformer.<Transform>d__3.MoveNext()
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)
   at CKAN.NetKAN.Transformers.NetkanTransformer.Transform(Metadata metadata, TransformOptions opts)
   at CKAN.NetKAN.Processors.Inflator.<>c__DisplayClass1_0.<Inflate>b__0(Metadata netkan)
   at System.Linq.Enumerable.<SelectManyIterator>d__17`2.MoveNext()
   at System.Linq.Lookup`2.Create[TSource](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
   at System.Linq.GroupedEnumerable`3.GetEnumerator()
   at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at CKAN.NetKAN.Processors.Inflator.Inflate(String filename, Metadata[] netkans, TransformOptions opts)
   at CKAN.NetKAN.Program.Main(String[] args)

@HebaruSan
Copy link
Member

Whatever that error is, it's already live in production without these changes.

image

image

@cheese3660
Copy link
Contributor Author

cheese3660 commented Jan 15, 2024

For reference here is the swinfo.json from the latest download

{
  "spec": "2.0",
  "mod_id": "QuestariaAerospace",
  "name": "Questaria Aerospace",
  "author": "IsaQuest",
  "description": "Parts for Exploration",
  "source": "",
  "version": "1.1.1",
  "dependencies": [
    {
      "id": "com.github.x606.spacewarp",
      "version": {
        "min": "1.7.0",
        "max": "*"
      }
    },
    {
      "id":  "PatchManager",
      "version": {
        "min": "0.7.2",
        "max": "*"
      }
    },
    {
      "id": "lfo",
      "version": {
        "min": "1.0.0",
        "max": "*"
      }
    }
  ],
  "conflicts": []
}

@cheese3660
Copy link
Contributor Author

Wait, hmm, I edited it out cuz it looked like a formating error, but the indentation before the { before "id": "PatchManager" is 2 tabs not spaces

@jan-bures
Copy link
Contributor

Plus, I see that KSP2 version info is missing, whether that has anything to do with the error or not

@HebaruSan
Copy link
Member

HebaruSan commented Jan 15, 2024

Plus, I see that KSP2 version info is missing, whether that has anything to do with the error or not

Yes, I think SpaceWarpInfoTransformer is throwing here because ksp2_version is null:

if (GameVersion.TryParse(swinfo.ksp2_version.min, out GameVersion minVer)
    || GameVersion.TryParse(swinfo.ksp2_version.max, out maxVer))

@cheese3660
Copy link
Contributor Author

cheese3660 commented Jan 15, 2024

So, I know why that likely wasn't set
It's a bug that I fixed today with KSP2 Unity Tools, where KSP2UnityTools would not generate the version_check and ksp2_version fields for the swinfo ... even though I did all the other code for them

@HebaruSan
Copy link
Member

Is ksp2_version intended to be required in the swinfo spec? I don't think that was something I considered explicitly when writing the above code. If it's supposed to be required, we can add an explicit check and clear error message for it. Otherwise we can make that line more forgiving of nulls.

@cheese3660
Copy link
Contributor Author

cheese3660 commented Jan 15, 2024

[JsonProperty("ksp2_version", Required = Required.DisallowNull)]
public SupportedVersionsInfo SupportedKsp2Versions { get; internal set; } = new()
{
    Min = "*",
    Max = "*"
};

It's defined as being allowed to be missing, or to have a non-null value, with the default if it is missing being unbounded compatibility

@cheese3660
Copy link
Contributor Author

Alright issue has been fixed mod-side, will merge now

@cheese3660 cheese3660 merged commit 2c45787 into main Jan 15, 2024
1 check passed
@HebaruSan HebaruSan deleted the cheese3660-update-questaria branch January 15, 2024 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants