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:
@@ -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