Remove serializer registration at startup

This commit is contained in:
NGnius (Graham) 2020-05-17 11:52:55 -04:00
parent 500cb9b716
commit ebea9da232
2 changed files with 9 additions and 7 deletions

View file

@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Version>1.0.1</Version>
<Version>1.0.2</Version>
<Authors>Exmods</Authors>
<PackageLicenseExpression>GNU General Public Licence 3+</PackageLicenseExpression>
<PackageProjectUrl>https://git.exmods.org/modtainers/GamecraftModdingAPI</PackageProjectUrl>

View file

@ -35,6 +35,12 @@ namespace GamecraftModdingAPI.Utility
/// </summary>
public static void Enable()
{
if (!SerializerManager.ExistsSerializer(typeof(ModVersionStruct).FullName))
{
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
));
}
EventManager.AddEventEmitter(versionEngine);
isEnabled = true;
}
@ -48,12 +54,8 @@ namespace GamecraftModdingAPI.Utility
isEnabled = false;
}
public static void Init()
{
SerializerManager.AddSerializer<ModVersionDescriptor>(new SimpleEntitySerializer<ModVersionDescriptor>(
(_) => { return new EGID[1] { new EGID(0u, ApiExclusiveGroups.versionGroup) }; }
));
}
public static void Init() { }
}
internal class VersionTrackingEngine : IEventEmitterEngine