Browse Source

Added ConfigProviderFeature

Bumped version
pull/11/head 3.12.4
Anairkoen Schno 5 years ago
parent
commit
1f506afe3f
7 changed files with 76 additions and 9 deletions
  1. +2
    -2
      IPA.Injector/Properties/AssemblyInfo.cs
  2. +1
    -1
      IPA.Loader/Config/SelfConfig.cs
  3. +1
    -0
      IPA.Loader/IPA.Loader.csproj
  4. +65
    -0
      IPA.Loader/Loader/Features/ConfigProviderFeature.cs
  5. +4
    -3
      IPA.Loader/Loader/manifest.json
  6. +2
    -2
      IPA/Properties/AssemblyInfo.cs
  7. +1
    -1
      appveyor.yml

+ 2
- 2
IPA.Injector/Properties/AssemblyInfo.cs View File

@ -33,5 +33,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.12.3")]
[assembly: AssemblyFileVersion("3.12.3")]
[assembly: AssemblyVersion(IPA.Config.SelfConfig.IPAVersion)]
[assembly: AssemblyFileVersion(IPA.Config.SelfConfig.IPAVersion)]

+ 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.3";
internal const string IPAVersion = "3.12.4"; // this should be completely outdated soon-ish
public bool Regenerate = true; public bool Regenerate = true;


+ 1
- 0
IPA.Loader/IPA.Loader.csproj View File

@ -63,6 +63,7 @@
<Compile Include="Config\SelfConfig.cs" /> <Compile Include="Config\SelfConfig.cs" />
<Compile Include="Loader\Composite\CompositeBSPlugin.cs" /> <Compile Include="Loader\Composite\CompositeBSPlugin.cs" />
<Compile Include="Loader\Features\AddInFeature.cs" /> <Compile Include="Loader\Features\AddInFeature.cs" />
<Compile Include="Loader\Features\ConfigProviderFeature.cs" />
<Compile Include="Loader\Features\DefineFeature.cs" /> <Compile Include="Loader\Features\DefineFeature.cs" />
<Compile Include="Loader\Features\InitInjectorFeature.cs" /> <Compile Include="Loader\Features\InitInjectorFeature.cs" />
<Compile Include="Loader\Features\NoUpdateFeature.cs" /> <Compile Include="Loader\Features\NoUpdateFeature.cs" />


+ 65
- 0
IPA.Loader/Loader/Features/ConfigProviderFeature.cs View File

@ -0,0 +1,65 @@
using System;
using System.IO;
namespace IPA.Loader.Features
{
internal class ConfigProviderFeature : Feature
{
public override bool Initialize(PluginLoader.PluginMetadata meta, string[] parameters)
{// parameters should be (fully qualified name of provider type)
if (parameters.Length != 1)
{
InvalidMessage = "Incorrect number of parameters";
return false;
}
RequireLoaded(meta);
Type getType;
try
{
getType = meta.Assembly.GetType(parameters[0]);
}
catch (ArgumentException)
{
InvalidMessage = $"Invalid type name {parameters[0]}";
return false;
}
catch (Exception e) when (e is FileNotFoundException || e is FileLoadException || e is BadImageFormatException)
{
string filename;
switch (e)
{
case FileNotFoundException fn:
filename = fn.FileName;
goto hasFilename;
case FileLoadException fl:
filename = fl.FileName;
goto hasFilename;
case BadImageFormatException bi:
filename = bi.FileName;
hasFilename:
InvalidMessage = $"Could not find {filename} while loading type";
break;
default:
InvalidMessage = $"Error while loading type: {e}";
break;
}
return false;
}
try
{
Config.Config.Register(getType);
return true;
}
catch (Exception e)
{
InvalidMessage = $"Error generated while creating delegate: {e}";
return false;
}
}
}
}

+ 4
- 3
IPA.Loader/Loader/manifest.json View File

@ -2,16 +2,17 @@
"$schema": "https://raw.githubusercontent.com/nike4613/ModSaber-MetadataFileSchema/master/Schema.json", "$schema": "https://raw.githubusercontent.com/nike4613/ModSaber-MetadataFileSchema/master/Schema.json",
"author": "DaNike", "author": "DaNike",
"description": "A mod loader specifically for Beat Saber.", "description": "A mod loader specifically for Beat Saber.",
"gameVersion": "0.12.2",
"gameVersion": "0.13.1",
"id": "beatsaber-ipa-reloaded", "id": "beatsaber-ipa-reloaded",
"name": "BSIPA", "name": "BSIPA",
"version": "3.12.3",
"version": "3.12.4",
"features": [ "features": [
"define-feature(print, IPA.Loader.Features.PrintFeature)", "define-feature(print, IPA.Loader.Features.PrintFeature)",
"define-feature(debug, IPA.Loader.Features.DebugFeature)", "define-feature(debug, IPA.Loader.Features.DebugFeature)",
"define-feature(warn, IPA.Loader.Features.WarnFeature)", "define-feature(warn, IPA.Loader.Features.WarnFeature)",
"define-feature(no-update, IPA.Loader.Features.NoUpdateFeature)", "define-feature(no-update, IPA.Loader.Features.NoUpdateFeature)",
"define-feature(add-in, IPA.Loader.Features.AddInFeature)", "define-feature(add-in, IPA.Loader.Features.AddInFeature)",
"define-feature(init-injector, IPA.Loader.Features.InitInjectorFeature)"
"define-feature(init-injector, IPA.Loader.Features.InitInjectorFeature)",
"define-feature(config-provider, IPA.Loader.Features.ConfigProviderFeature)"
] ]
} }

+ 2
- 2
IPA/Properties/AssemblyInfo.cs View File

@ -31,5 +31,5 @@ using System.Runtime.InteropServices;
// You can specify all the values or you can default the Build and Revision Numbers // You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below: // by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")] // [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("3.12.3")]
[assembly: AssemblyFileVersion("3.12.3")]
[assembly: AssemblyVersion("3.12.4")]
[assembly: AssemblyFileVersion("3.12.4")]

+ 1
- 1
appveyor.yml View File

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


Loading…
Cancel
Save