From a7fe3b2b61aa1465bd0c71a97bfaa1e7f5f2a3d3 Mon Sep 17 00:00:00 2001 From: Lapis Date: Wed, 22 Jul 2026 19:16:11 -0400 Subject: [PATCH] Revert "Disable cheatmanager to preserve DUID function" --- CannedNet.Client/Plugin.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/CannedNet.Client/Plugin.cs b/CannedNet.Client/Plugin.cs index e8a4484..edf4d9f 100644 --- a/CannedNet.Client/Plugin.cs +++ b/CannedNet.Client/Plugin.cs @@ -46,18 +46,14 @@ public class Plugin : BasePlugin private void OnSceneLoaded(Scene scene, LoadSceneMode mode) { - // CheatManager boots us out of rooms when it runs, but it's ALSO the DUID service the DI - // container resolves for account creation / login (destroying it removes that service). - // So instead of destroying it, *deactivate* the GameObject: it stops running (no Update / - // coroutines, so no boot) while the component still exists, so the DI container can still - // resolve PGECJHKNIEN and call its DUID methods. It's recreated per scene, so deactivate - // each freshly-spawned (active) instance on every load. (GameObject.Find only returns active - // objects, so once deactivated it isn't found again.) - var cheatMgr = GameObject.Find("GameRoot/(Startup)(Clone)/Core Systems/[CheatManager]"); - if (cheatMgr != null) + if (scene.name != "TitleScreen" && scene.name != "empty") { - cheatMgr.SetActive(false); - Log.LogInfo("cheatmanager deactivated"); + var cheatMgr = GameObject.Find("GameRoot/(Startup)(Clone)/Core Systems/[CheatManager]"); + if (cheatMgr != null) + { + GameObject.Destroy(cheatMgr); + Log.LogInfo("cheatmanager destroyed"); + } } } }