Browse Source

Added BeatMods gameVersion field support

pull/12/head
Anairkoen Schno 5 years ago
parent
commit
f7f7d2e26a
6 changed files with 9 additions and 72 deletions
  1. +1
    -1
      IPA.Loader/Config/SelfConfig.cs
  2. +1
    -1
      IPA.Loader/Loader/manifest.json
  3. +4
    -67
      IPA.Loader/Updating/BeatMods/ApiEndpoint.cs
  4. +1
    -1
      IPA.Loader/Updating/BeatMods/Updater.cs
  5. +1
    -1
      IPA/Program.cs
  6. +1
    -1
      appveyor.yml

+ 1
- 1
IPA.Loader/Config/SelfConfig.cs View File

@ -33,7 +33,7 @@ namespace IPA.Config
} }
internal const string IPAName = "Beat Saber IPA"; internal const string IPAName = "Beat Saber IPA";
internal const string IPAVersion = "3.12.16";
internal const string IPAVersion = "3.12.17";
public bool Regenerate = true; public bool Regenerate = true;


+ 1
- 1
IPA.Loader/Loader/manifest.json View File

@ -8,7 +8,7 @@
"gameVersion": "0.13.2", "gameVersion": "0.13.2",
"id": "BSIPA", "id": "BSIPA",
"name": "Beat Saber IPA", "name": "Beat Saber IPA",
"version": "3.12.16",
"version": "3.12.17",
"icon": "IPA.icon.png", "icon": "IPA.icon.png",
"features": [ "features": [
"define-feature(print, IPA.Loader.Features.PrintFeature)", "define-feature(print, IPA.Loader.Features.PrintFeature)",


+ 4
- 67
IPA.Loader/Updating/BeatMods/ApiEndpoint.cs View File

@ -102,6 +102,10 @@ namespace IPA.Updating.BeatMods
JsonConverter(typeof(SemverVersionConverter))] JsonConverter(typeof(SemverVersionConverter))]
public Version Version; public Version Version;
[JsonProperty("gameVersion"),
JsonConverter(typeof(SemverVersionConverter))]
public Version GameVersion;
[Serializable] [Serializable]
public class AuthorType public class AuthorType
{ {
@ -116,22 +120,6 @@ namespace IPA.Updating.BeatMods
[JsonProperty("author")] [JsonProperty("author")]
public AuthorType Author; public AuthorType Author;
/*[Serializable]
public class DetailsData
{
[JsonProperty("author")]
public AuthorType Author;
[JsonProperty("title")]
public string Title;
[JsonProperty("description")]
public string Description;
[JsonProperty("published")]
public string Published;
}
[JsonProperty("details")]
public DetailsData Details;*/
[JsonProperty("status")] [JsonProperty("status")]
public string Status; public string Status;
public const string ApprovedStatus = "approved"; public const string ApprovedStatus = "approved";
@ -146,35 +134,6 @@ namespace IPA.Updating.BeatMods
public Uri Link; public Uri Link;
#pragma warning restore CS0649 #pragma warning restore CS0649
/*[Serializable]
public class PlatformFile
{
[JsonProperty("hash"),
JsonConverter(typeof(HexArrayConverter))]
public byte[] Hash = new byte[20];
[JsonProperty("files", ItemConverterType = typeof(HexArrayConverter))]
public Dictionary<string, byte[]> FileHashes = new Dictionary<string, byte[]>();
[JsonProperty("url")]
public string DownloadPath;
public override string ToString() =>
$"{Utils.ByteArrayToString(Hash)}@{DownloadPath}({string.Join(",", FileHashes.Select(o => $"\"{o.Key}\":\"{Utils.ByteArrayToString(o.Value)}\""))})";
}
[Serializable]
public class FilesObject
{
[JsonProperty("steam")]
public PlatformFile Steam;
[JsonProperty("oculus")]
public PlatformFile Oculus;
}
[JsonProperty("files")]
public FilesObject Files;*/
[Serializable] [Serializable]
public class DownloadsObject public class DownloadsObject
@ -209,28 +168,6 @@ namespace IPA.Updating.BeatMods
[JsonProperty("downloads")] [JsonProperty("downloads")]
public DownloadsObject[] Downloads; public DownloadsObject[] Downloads;
/*public class Dependency
{
public string Name = null;
public Range VersionRange = null;
}
[Serializable]
public class LinksType
{
[JsonProperty("dependencies", ItemConverterType = typeof(ModSaberDependencyConverter))]
public Dependency[] Dependencies = new Dependency[0];
[JsonProperty("conflicts", ItemConverterType = typeof(ModSaberDependencyConverter))]
public Dependency[] Conflicts = new Dependency[0];
}
[JsonProperty("links")]
public LinksType Links;
[JsonProperty("oldVersions", ItemConverterType = typeof(SemverVersionConverter))]
public Version[] OldVersions = new Version[0];*/
[JsonProperty("dependencies", ItemConverterType = typeof(ModMultiformatJsonConverter))] [JsonProperty("dependencies", ItemConverterType = typeof(ModMultiformatJsonConverter))]
public Mod[] Dependencies; public Mod[] Dependencies;


+ 1
- 1
IPA.Loader/Updating/BeatMods/Updater.cs View File

@ -365,7 +365,7 @@ namespace IPA.Updating.BeatMods
var ver = modsMatching.Value var ver = modsMatching.Value
.Where(nullCheck => nullCheck != null) // entry is not null .Where(nullCheck => nullCheck != null) // entry is not null
//.Where(versionCheck => versionCheck.GameVersion.Version == BeatSaber.GameVersion) // game version matches
.Where(versionCheck => versionCheck.GameVersion == BeatSaber.GameVersion) // game version matches
.Where(approvalCheck => approvalCheck.Status == ApiEndpoint.Mod.ApprovedStatus) // version approved .Where(approvalCheck => approvalCheck.Status == ApiEndpoint.Mod.ApprovedStatus) // version approved
.Where(conflictsCheck => dep.Conflicts == null || !dep.Conflicts.IsSatisfied(conflictsCheck.Version)) // not a conflicting version .Where(conflictsCheck => dep.Conflicts == null || !dep.Conflicts.IsSatisfied(conflictsCheck.Version)) // not a conflicting version
.Select(mod => mod.Version).Max(); // (2.1) get the max version .Select(mod => mod.Version).Max(); // (2.1) get the max version


+ 1
- 1
IPA/Program.cs View File

@ -23,7 +23,7 @@ namespace IPA
Unknown Unknown
} }
public const string FileVersion = "3.12.16";
public const string FileVersion = "3.12.17";
public static Version Version => Assembly.GetEntryAssembly().GetName().Version; public static Version Version => Assembly.GetEntryAssembly().GetName().Version;


+ 1
- 1
appveyor.yml View File

@ -1,6 +1,6 @@
version: 'BSIPA-{branch}-{build}' version: 'BSIPA-{branch}-{build}'
environment: environment:
bsipa_version: '3.12.16'
bsipa_version: '3.12.17'
pull_requests: pull_requests:
do_not_increment_build_number: true do_not_increment_build_number: true
install: install:


Loading…
Cancel
Save