Browse Source

Added BeatMods gameVersion field support

pull/46/head
Anairkoen Schno 5 years ago
parent
commit
00faf5bd7a
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 IPAVersion = "3.12.16";
internal const string IPAVersion = "3.12.17";
public bool Regenerate = true;


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

@ -8,7 +8,7 @@
"gameVersion": "0.13.2",
"id": "BSIPA",
"name": "Beat Saber IPA",
"version": "3.12.16",
"version": "3.12.17",
"icon": "IPA.icon.png",
"features": [
"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))]
public Version Version;
[JsonProperty("gameVersion"),
JsonConverter(typeof(SemverVersionConverter))]
public Version GameVersion;
[Serializable]
public class AuthorType
{
@ -116,22 +120,6 @@ namespace IPA.Updating.BeatMods
[JsonProperty("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")]
public string Status;
public const string ApprovedStatus = "approved";
@ -146,35 +134,6 @@ namespace IPA.Updating.BeatMods
public Uri Link;
#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]
public class DownloadsObject
@ -209,28 +168,6 @@ namespace IPA.Updating.BeatMods
[JsonProperty("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))]
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
.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(conflictsCheck => dep.Conflicts == null || !dep.Conflicts.IsSatisfied(conflictsCheck.Version)) // not a conflicting 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
}
public const string FileVersion = "3.12.16";
public const string FileVersion = "3.12.17";
public static Version Version => Assembly.GetEntryAssembly().GetName().Version;


+ 1
- 1
appveyor.yml View File

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


Loading…
Cancel
Save