mirror of
https://github.com/djdevin/recnet-plugin.git
synced 2026-09-08 14:41:30 -07:00
kill cheatmanager, add configs
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user