Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
fix for neos version 2021.10.17.1326
Browse files Browse the repository at this point in the history
  • Loading branch information
EIA485 committed Oct 17, 2021
1 parent b0a8c19 commit 134c0be
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 80 deletions.
91 changes: 46 additions & 45 deletions NeosModLoader/ExecutionHook.cs
Original file line number Diff line number Diff line change
@@ -1,45 +1,46 @@
using FrooxEngine;
using System;

namespace NeosModLoader
{
[ImplementableClass(true)]
class ExecutionHook
{
#pragma warning disable CS0169
// field must exist due to reflective access
private static Type __connectorType;
#pragma warning restore CS0169

static ExecutionHook()
{
try
{
Logger.MsgInternal($"NeosModLoader v{ModLoader.VERSION} starting up!{(Configuration.get().Debug ? " Debug logs will be shown." : "")}");
NeosVersionReset.Initialize();
ModLoader.LoadMods();
}
catch (Exception e) // it's important that this doesn't send exceptions back to Neos
{
Logger.ErrorInternal($"Exception in execution hook!\n{e}");
}
}

// implementation not strictly required, but method must exist due to reflective access
private static DummyConnector InstantiateConnector()
{
return new DummyConnector();
}

// type must match return type of InstantiateConnector()
private class DummyConnector : IConnector
{
public IImplementable Owner { get; private set; }
public void ApplyChanges() { }
public void AssignOwner(IImplementable owner) => Owner = owner;
public void Destroy(bool destroyingWorld) { }
public void Initialize() { }
public void RemoveOwner() => Owner = null;
}
}
}
using FrooxEngine;
using System;

namespace NeosModLoader
{
[ImplementableClass(true)]
class ExecutionHook
{
#pragma warning disable CS0169
// field must exist due to reflective access
private static Type __connectorType;
private static Type __connectorTypes;
#pragma warning restore CS0169

static ExecutionHook()
{
try
{
Logger.MsgInternal($"NeosModLoader v{ModLoader.VERSION} starting up!{(Configuration.get().Debug ? " Debug logs will be shown." : "")}");
NeosVersionReset.Initialize();
ModLoader.LoadMods();
}
catch (Exception e) // it's important that this doesn't send exceptions back to Neos
{
Logger.ErrorInternal($"Exception in execution hook!\n{e}");
}
}

// implementation not strictly required, but method must exist due to reflective access
private static DummyConnector InstantiateConnector()
{
return new DummyConnector();
}

// type must match return type of InstantiateConnector()
private class DummyConnector : IConnector
{
public IImplementable Owner { get; private set; }
public void ApplyChanges() { }
public void AssignOwner(IImplementable owner) => Owner = owner;
public void Destroy(bool destroyingWorld) { }
public void Initialize() { }
public void RemoveOwner() => Owner = null;
}
}
}
70 changes: 35 additions & 35 deletions NeosModLoader/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NeosModLoader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NeosModLoader")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d4627c7f-8091-477a-abdc-f1465d94d8d9")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.3.1.0")]
[assembly: AssemblyFileVersion("1.3.1.0")]
using System.Reflection;
using System.Runtime.InteropServices;

// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("NeosModLoader")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("NeosModLoader")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("d4627c7f-8091-477a-abdc-f1465d94d8d9")]

// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.4.0.0")]
[assembly: AssemblyFileVersion("1.4.0.0")]

0 comments on commit 134c0be

Please sign in to comment.