kill cheatmanager, add configs

This commit is contained in:
Lapis
2026-04-03 13:39:51 -04:00
parent 78a9a2e824
commit 5a8b4b2d52
3 changed files with 39 additions and 10 deletions
+3 -3
View File
@@ -58,9 +58,9 @@ public class Photon_AppSettings_Patch
__result = new()
{
AppVersion = __result?.AppVersion,
AppIdRealtime = "c74d22b7-6665-41cf-9ce8-fc70b625caa6",
AppIdVoice = "f7adbf03-edae-4a7d-bb4b-9e06de75bd96",
AppIdChat = "4538ca46-903b-48d9-bf33-247ea468a29d",
AppIdRealtime = Plugin.AppIdRT.Value,
AppIdVoice = Plugin.AppIdVoice.Value,
AppIdChat = Plugin.AppIdChat.Value,
FixedRegion = "us",
UseNameServer = true,
Protocol = ConnectionProtocol.Udp,
+1 -1
View File
@@ -13,7 +13,7 @@ public class SendRequestPatch
Plugin.Log.LogInfo($"hi {request.Uri.Host}");
if (request.Uri.Host.ToString().Contains("ns.rec.net"))
request.Uri = new Il2CppSystem.Uri("https://ns.lapis.codes");
request.Uri = new Il2CppSystem.Uri(Plugin.ServerHostname.Value);
}
}
}
+35 -6
View File
@@ -1,25 +1,54 @@
using System;
using System.Collections;
using System.Text.Json;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using BepInEx.Unity.IL2CPP;
using BepInEx.Unity.IL2CPP.Utils.Collections;
using HarmonyLib;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.Networking;
namespace CannedNet.Client;
[BepInPlugin("lapis.cannednet.client", "CannedNet Client", "1.0.0")]
public class Plugin : BasePlugin
{
private const string PhotonDataUrl = "https://ns.lapis.codes/photon";
internal static new ManualLogSource Log;
public static string appIdRT;
public static string appIdVoice;
public static string appIdChat;
public static ConfigEntry<string> AppIdRT { get; private set; }
public static ConfigEntry<string> AppIdVoice { get; private set; }
public static ConfigEntry<string> AppIdChat { get; private set; }
public static ConfigEntry<string> ServerHostname { get; private set; }
public override void Load()
{
Log = base.Log;
Log.LogInfo($"I JUST HIT THE JACKPOTTTT!!!!! YUH YUH YUH!");
AppIdRT = Config.Bind("Photon", "App Id Realtime", "", "Photon Realtime App ID");
AppIdVoice = Config.Bind("Photon", "App Id Voice", "", "Photon Voice App ID");
AppIdChat = Config.Bind("Photon", "App Id Chat", "", "Photon Chat App ID");
ServerHostname = Config.Bind("Server", "NameServer Host", "https://ns.lapis.codes", "Host for the NameServer.");
Harmony.CreateAndPatchAll(typeof(Plugin).Assembly);
SceneManager.sceneLoaded += (Action<Scene, LoadSceneMode>)OnSceneLoaded;
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (scene.name == "ScreenAccountSelection")
{
var cheatMgr = GameObject.Find("GameRoot/Startup/Core Systems/[CheatManager]");
if (cheatMgr != null)
{
GameObject.Destroy(cheatMgr);
Log.LogInfo("cheatmanager destroyed");
}
}
}
}