Save game details were changed, they may not work properly Game mode change event no longer sends game data, needs fixing
34 lines
No EOL
1.1 KiB
C#
34 lines
No EOL
1.1 KiB
C#
using System;
|
|
using System.Reflection;
|
|
|
|
using HarmonyLib;
|
|
using Svelto.ECS;
|
|
using RobocraftX.CR.MainGame;
|
|
using RobocraftX.Multiplayer;
|
|
using RobocraftX.StateSync;
|
|
using TechbloxModdingAPI.Utility;
|
|
|
|
namespace TechbloxModdingAPI.Commands
|
|
{
|
|
/// <summary>
|
|
/// Patch of RobocraftX.CR.MainGame.MainGameCompositionRoot.DeterministicCompose<T>()
|
|
/// Initializes custom commands
|
|
/// </summary>
|
|
[HarmonyPatch]
|
|
static class CommandPatch
|
|
{
|
|
public static void Postfix(StateSyncRegistrationHelper stateSyncReg)
|
|
{
|
|
/*CommandLineCompositionRoot.Compose(contextHolder, stateSyncReg.enginesRoot, reloadGame, multiplayerParameters,
|
|
stateSyncReg); - uREPL C# compilation not supported anymore */
|
|
var enginesRoot = stateSyncReg.enginesRoot;
|
|
CommandManager.RegisterEngines(enginesRoot);
|
|
}
|
|
|
|
public static MethodInfo TargetMethod()
|
|
{
|
|
return AccessTools.Method(typeof(MainGameCompositionRoot), "DeterministicCompose")
|
|
.MakeGenericMethod(typeof(object));
|
|
}
|
|
}
|
|
} |