using System.Collections.Generic; using System.IO; using System.Linq; using System.Net.Http; using BepInEx; using ExitGames.Client.Photon; using HarmonyLib; using Newtonsoft.Json.Linq; using Photon.Pun; using TooMuchInfo.Tools; using Extensions = TooMuchInfo.Tools.Extensions; namespace TooMuchInfo; [BepInPlugin(Constants.Guid, Constants.Name, Constants.Version)] public class Plugin : BaseUnityPlugin { public static bool ShowSpecialCosmetics; public static bool ShowKnownPeople; public static bool ShowFpsPlatformPing; public static bool ShowCreationDate; public static bool ShowMods; public static List LineOrder; public static Dictionary KnownMods; public static Dictionary KnownCheats; public static Dictionary KnownPeople; public static Dictionary KnownCosmetics; private void Awake() { ShowSpecialCosmetics = Config.Bind("Display", "SpecialCosmetics", true).Value; ShowKnownPeople = Config.Bind("Display", "KnownPeople", true).Value; ShowFpsPlatformPing = Config.Bind("Display", "FpsPlatformPing", true).Value; ShowCreationDate = Config.Bind("Display", "CreationDate", true).Value; ShowMods = Config.Bind("Display", "Mods", true).Value; LineOrder = Config.Bind( "Order", "LineOrder", "SpecialCosmetics,Name,FpsPlatformPing,CreationDate,Mods" ).Value.Split(',').Select(x => x.Trim()).ToList(); new Harmony(Constants.Guid).PatchAll(); } private void Start() => GorillaTagger.OnPlayerSpawned(() => { Hashtable properties = new() { { $"{Constants.HashKey}", $"Made by Deez - {Constants.Name}" }, }; PhotonNetwork.LocalPlayer.SetCustomProperties(properties); VRRigCache.OnRigDeactivated += rigContainer => { VRRig vrrig = rigContainer.vrrig; Extensions.PlayerWithCosmetics.Remove(vrrig); Extensions.PlayerPlatforms.Remove(vrrig); Extensions.PlayerMods.Remove(vrrig); }; using HttpClient httpClient = new(); HttpResponseMessage response = httpClient.GetAsync( "https://deez.uk/data").Result; using Stream deezDataStream = response.Content.ReadAsStreamAsync().Result; using StreamReader reader = new(deezDataStream); JObject root = JObject.Parse(reader.ReadToEnd()); KnownCheats = root["knownCheats"]? .ToObject>(); KnownMods = root["knownMods"]? .ToObject>(); KnownPeople = root["knownPeople"]? .ToObject>(); KnownCosmetics = root["specialCosmetics"]? .ToObject>(); }); private void Update() { if (VRRig.LocalRig.playerText1 == null || NetworkSystem.Instance.LocalPlayer == null) return; VRRig.LocalRig.playerText1.text = NetworkSystem.Instance.LocalPlayer.SanitizedNickName.AnimateGradiant(VRRig.LocalRig.playerColor); } }