diff --git a/Source/Client/Syncing/Dict/SyncDictRimWorld.cs b/Source/Client/Syncing/Dict/SyncDictRimWorld.cs index 0ceefbe2..e88548bb 100644 --- a/Source/Client/Syncing/Dict/SyncDictRimWorld.cs +++ b/Source/Client/Syncing/Dict/SyncDictRimWorld.cs @@ -955,6 +955,10 @@ public static class SyncDictRimWorld } }, true // implicit }, + { + (ByteWriter _, ResearchManager _) => { }, + (ByteReader _) => Find.ResearchManager + }, #endregion #region Areas diff --git a/Source/Client/Syncing/Game/SyncMethods.cs b/Source/Client/Syncing/Game/SyncMethods.cs index dc63361b..51faf59c 100644 --- a/Source/Client/Syncing/Game/SyncMethods.cs +++ b/Source/Client/Syncing/Game/SyncMethods.cs @@ -55,6 +55,15 @@ public static void Init() SyncMethod.Register(typeof(AreaManager), nameof(AreaManager.TryMakeNewAllowed)); SyncMethod.Register(typeof(MainTabWindow_Research), nameof(MainTabWindow_Research.DoBeginResearch)) .TransformTarget(Serializer.SimpleReader(() => new MainTabWindow_Research())); + SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.StopProject)); + // ResearchManager.SetCurrentProject changes the current project and is synced by + // MainTabWindow_Research.DoBeginResearch. It will still be called when selecting + // "Debug: Finish now". The issue with this is that when triggered by a player who + // can't execute debug-only methods it may change the current project to a research + // project which cannot be research due to prerequisites, allowing to research them. + SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.SetCurrentProject)).SetDebugOnly(); + SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.FinishProject)).SetDebugOnly(); + SyncMethod.Register(typeof(ResearchManager), nameof(ResearchManager.ApplyTechprint)).SetDebugOnly(); SyncMethod.Register(typeof(DrugPolicyDatabase), nameof(DrugPolicyDatabase.MakeNewDrugPolicy)); SyncMethod.Register(typeof(DrugPolicyDatabase), nameof(DrugPolicyDatabase.TryDelete)).CancelIfAnyArgNull();