Browse Source

Began implementing support for modsaber.ml

pull/46/head
Anairkoen Schno 6 years ago
parent
commit
d5b1da3d51
5 changed files with 56 additions and 3 deletions
  1. +3
    -2
      IllusionInjector/IllusionInjector.csproj
  2. +52
    -0
      IllusionInjector/Updating/ModsaberML/ApiEndpoint.cs
  3. +0
    -0
      IllusionInjector/Updating/Old/ModUpdater.cs
  4. +0
    -0
      IllusionInjector/Updating/Old/UpdateScript.cs
  5. +1
    -1
      IllusionInjector/obj/Debug/IllusionInjector.csproj.CoreCompileInputs.cache

+ 3
- 2
IllusionInjector/IllusionInjector.csproj View File

@ -68,8 +68,9 @@
<Compile Include="PluginManager.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="PluginComponent.cs" />
<Compile Include="Updating\ModUpdater.cs" />
<Compile Include="Updating\UpdateScript.cs" />
<Compile Include="Updating\ModsaberML\ApiEndpoint.cs" />
<Compile Include="Updating\Old\ModUpdater.cs" />
<Compile Include="Updating\Old\UpdateScript.cs" />
<Compile Include="Utilities\SimpleJson.cs" />
</ItemGroup>
<ItemGroup>


+ 52
- 0
IllusionInjector/Updating/ModsaberML/ApiEndpoint.cs View File

@ -0,0 +1,52 @@
using SimpleJSON;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace IllusionInjector.Updating.ModsaberML
{
class ApiEndpoint
{
const string ApiBase = "https://www.modsaber.ml/api/";
const string GetApprovedEndpoint = "public/temp/approved";
public class Mod
{
public string Name;
public Version Version;
public bool Approved;
public string Title;
public Version GameVersion;
public string Author;
public string SteamFile;
public string OculusFile;
public static Mod DecodeJSON(JSONObject obj)
{
var outp = new Mod
{
Name = obj["name"],
Version = new Version(obj["version"]),
Approved = obj["approved"].AsBool,
Title = obj["title"],
GameVersion = new Version(obj["gameVersion"]),
Author = obj["author"]
};
foreach (var item in obj["files"].Keys)
{
var key = item as JSONString;
if (key.Value == "steam")
outp.SteamFile = obj[key.Value]["url"];
if (key.Value == "oculus")
outp.OculusFile = obj[key.Value]["url"];
}
return outp;
}
}
}
}

IllusionInjector/Updating/ModUpdater.cs → IllusionInjector/Updating/Old/ModUpdater.cs View File


IllusionInjector/Updating/UpdateScript.cs → IllusionInjector/Updating/Old/UpdateScript.cs View File


+ 1
- 1
IllusionInjector/obj/Debug/IllusionInjector.csproj.CoreCompileInputs.cache View File

@ -1 +1 @@
c45de925bb8a7971d5428fabdc9f32b04b599913
1b7ab3d058c6a212976e4869e8586d3cc95bb707

Loading…
Cancel
Save