using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak.Network; using Photon.Pun; using Photon.Realtime; using Steamworks; using TMPro; using Unity.Collections; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; using UnityEngine.UI; using Zorro.Core; using Zorro.Core.Serizalization; using Zorro.Settings; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: AssemblyCompany("PEAKER")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyFileVersion("0.4.9.0")] [assembly: AssemblyInformationalVersion("0.4.9")] [assembly: AssemblyProduct("PEAKER")] [assembly: AssemblyTitle("PEAKER")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.4.9.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace PEAKER { public class AccessGate : MonoBehaviour { private static Callback _onLobbyChatUpdateCallback; internal static readonly Dictionary allowedScouts = new Dictionary(); internal static readonly Dictionary bannedScouts = new Dictionary(); internal static readonly HashSet ignoredScouts = new HashSet(); private static CSteamID _lastSentChat; [Localized("BannedScouts", "TriedToJoinButIsBanned", "{{userColor}} {0} ({1}){{joinedColor}} tried to join,{{leftColor}} but{{userColor}} {2} ({3}){{leftColor}} is banned! Not letting them in...", "When a player tries to join, but a banned player is in the Steam lobby. 0 is joining persona name, 1 is joining steam id, 2 is banned persona name, 3 is banned steam id.", null)] private static string Localized_TriedToJoinButIsBanned(string joiningPersonaName, ulong joiningSteamId, string bannedPersonaName, ulong bannedSteamId) { return Localization.GetText("BannedScouts_TriedToJoinButIsBanned", joiningPersonaName, joiningSteamId, bannedPersonaName, bannedSteamId); } [Localized("BannedScouts", "TriedToJoinButIsNotFirstClass", "{{userColor}} {0} ({1}){{joinedColor}} tried to join,{{leftColor}} but{{userColor}} {2} ({3}){{leftColor}} is not First Class! Not letting them in...", "When a player tries to join, but a non-First Class player is in the Steam lobby. 0 is joining persona name, 1 is joining steam id, 2 is non-First Class persona name, 3 is non-First Class steam id.", null)] private static string Localized_TriedToJoinButIsNotFirstClass(string joiningPersonaName, ulong joiningSteamId, string notFirstClassPersonaName, ulong notFirstClassSteamId) { return Localization.GetText("BannedScouts_TriedToJoinButIsNotFirstClass", joiningPersonaName, joiningSteamId, notFirstClassPersonaName, notFirstClassSteamId); } public static bool IsAllowed(CSteamID steamId, bool checkFriends = true) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) if (allowedScouts.ContainsKey(steamId.m_SteamID)) { return true; } if (!checkFriends || !FirstClass.FriendsEnabled) { return false; } int friendCount = SteamFriends.GetFriendCount((EFriendFlags)4); for (int i = 0; i < friendCount; i++) { if (SteamFriends.GetFriendByIndex(i, (EFriendFlags)4) == steamId) { return true; } } return false; } public static bool IsBanned(CSteamID steamId) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return bannedScouts.ContainsKey(steamId.m_SteamID); } public static bool IsIgnored(CSteamID steamId) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) return ignoredScouts.Contains(steamId.m_SteamID); } internal void Awake() { UpdateAllowedScouts(); UpdateBannedScouts(); PEAKER.Patches.PatchAll(typeof(AccessGate)); } internal static void AllowScout(CSteamID steamId) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Allowing {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); File.AppendAllText(Path.Combine(Paths.BepInExRootPath, "first-class.txt"), $"\n{steamId.m_SteamID} | {SteamFriends.GetFriendPersonaName(steamId)}"); UpdateAllowedScouts(); } internal static void UnallowScout(CSteamID steamId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Unallowing {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); string[] source = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "first-class.txt")); source = source.Where((string line) => !line.StartsWith(steamId.m_SteamID.ToString())).ToArray(); File.WriteAllLines(Path.Combine(Paths.BepInExRootPath, "first-class.txt"), source); UpdateAllowedScouts(); } internal static void UpdateAllowedScouts() { PEAKER.Logger.LogInfo((object)"Updating Allowed Scouts..."); allowedScouts.Clear(); if (!File.Exists(Path.Combine(Paths.BepInExRootPath, "first-class.txt"))) { File.WriteAllText(Path.Combine(Paths.BepInExRootPath, "first-class.txt"), ""); } else { string[] array = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "first-class.txt")); foreach (string text in array) { int num = text.IndexOf('|'); if (num == -1) { num = text.Length; } ulong result; ulong num2 = (ulong.TryParse(text.Substring(0, num).Trim(), out result) ? result : 0); if (num2 != 0L && !allowedScouts.ContainsKey(num2)) { string value = string.Empty; if (num != text.Length) { string text2 = text; int num3 = num + 1; value = text2.Substring(num3, text2.Length - num3).Trim(); } allowedScouts.Add(num2, value); } } } foreach (ulong key in allowedScouts.Keys) { PEAKER.Logger.LogInfo((object)$"Allowed Scout: {key} ({allowedScouts[key]})"); } } internal static void BanScout(CSteamID steamId, string reason) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Banning {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); File.AppendAllText(Path.Combine(Paths.BepInExRootPath, "banned.txt"), $"\n{steamId.m_SteamID} | {SteamFriends.GetFriendPersonaName(steamId)} | {reason}"); UpdateBannedScouts(); ignoredScouts.Add(steamId.m_SteamID); } internal static void UnbanScout(CSteamID steamId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Unbanning {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); string[] source = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt")); source = source.Where((string line) => !line.StartsWith(steamId.m_SteamID.ToString())).ToArray(); File.WriteAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt"), source); UpdateBannedScouts(); ignoredScouts.Remove(steamId.m_SteamID); } internal static void IgnoreScout(CSteamID steamId) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Ignoring {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}"); ignoredScouts.Add(steamId.m_SteamID); } internal static void UpdateBannedScouts() { PEAKER.Logger.LogInfo((object)"Updating Banned Scouts..."); bannedScouts.Clear(); if (!File.Exists(Path.Combine(Paths.BepInExRootPath, "banned.txt"))) { File.WriteAllText(Path.Combine(Paths.BepInExRootPath, "banned.txt"), ""); } else { string[] array = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt")); foreach (string text in array) { int num = text.IndexOf('|'); if (num == -1) { num = text.Length; } ulong result; ulong num2 = (ulong.TryParse(text.Substring(0, num).Trim(), out result) ? result : 0); if (num2 != 0L && !bannedScouts.ContainsKey(num2)) { string value = string.Empty; if (num != text.Length) { string text2 = text; int num3 = num + 1; value = text2.Substring(num3, text2.Length - num3).Trim(); } bannedScouts.Add(num2, value); } } } foreach (ulong key in bannedScouts.Keys) { PEAKER.Logger.LogInfo((object)$"Banned Scout: {key} ({bannedScouts[key]})"); } } private static void OnLobbyChatUpdate(LobbyChatUpdate_t data) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (data.m_ulSteamIDLobby == GameHandler.GetService().LobbySteamId.m_SteamID) { if (data.m_rgfChatMemberStateChange == 1) { PEAKER.Logger.LogInfo((object)$"{SteamFriends.GetFriendPersonaName(new CSteamID(data.m_ulSteamIDUserChanged))} ({data.m_ulSteamIDUserChanged}) entered the Steam lobby."); return; } PEAKER.Logger.LogInfo((object)$"{SteamFriends.GetFriendPersonaName(new CSteamID(data.m_ulSteamIDUserChanged))} ({data.m_ulSteamIDUserChanged}) left the Steam lobby. ({(object)(EChatMemberStateChange)data.m_rgfChatMemberStateChange})"); ignoredScouts.Remove(data.m_ulSteamIDUserChanged); } } [HarmonyPatch(typeof(GameHandler), "Awake")] [HarmonyPostfix] internal static void PostGameHandlerAwake() { _onLobbyChatUpdateCallback = Callback.Create((DispatchDelegate)OnLobbyChatUpdate); } [HarmonyPatch(typeof(GameHandler), "OnDestroy")] [HarmonyPostfix] internal static void PostGameHandlerOnDestroy() { _onLobbyChatUpdateCallback?.Unregister(); } [HarmonyPatch(typeof(SteamLobbyHandler), "OnLobbyEnter")] [HarmonyPostfix] internal static void PostSteamLobbyHandlerOnLobbyEnter() { ignoredScouts.Clear(); } [HarmonyPatch(typeof(SteamLobbyHandler), "OnLobbyChat")] [HarmonyPrefix] internal static void PreSteamLobbyHandlerOnLobbyChat(SteamLobbyHandler __instance, ref LobbyChatMsg_t param) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) _lastSentChat = new CSteamID(param.m_ulSteamIDUser); PEAKER.Logger.LogInfo((object)$"Steam Chat Message Received: '{SteamFriends.GetFriendPersonaName(new CSteamID(param.m_ulSteamIDUser))}' ({param.m_ulSteamIDUser})"); int numLobbyMembers = SteamMatchmaking.GetNumLobbyMembers(__instance.LobbySteamId); for (int i = 0; i < numLobbyMembers; i++) { PEAKER.Logger.LogInfo((object)$"Steam Lobby Member: '{SteamFriends.GetFriendPersonaName(SteamMatchmaking.GetLobbyMemberByIndex(__instance.LobbySteamId, i))}' ({SteamMatchmaking.GetLobbyMemberByIndex(__instance.LobbySteamId, i).m_SteamID})"); } } [HarmonyPatch(typeof(SteamLobbyHandler), "SendRoomID")] [HarmonyPrefix] internal static bool PreSteamLobbyHandlerSendRoomID(SteamLobbyHandler __instance) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_0240: Unknown result type (might be due to invalid IL or missing references) //IL_0258: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02da: Unknown result type (might be due to invalid IL or missing references) //IL_02f0: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e3: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_0408: Unknown result type (might be due to invalid IL or missing references) //IL_040d: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return true; } int numLobbyMembers = SteamMatchmaking.GetNumLobbyMembers(__instance.LobbySteamId); for (int i = 0; i < numLobbyMembers; i++) { CSteamID lobbyMemberByIndex = SteamMatchmaking.GetLobbyMemberByIndex(__instance.LobbySteamId, i); if (FirstClass.Enabled) { PEAKER.Logger.LogInfo((object)$"Checking first class status for '{SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}' ({lobbyMemberByIndex.m_SteamID}): {allowedScouts.ContainsKey(lobbyMemberByIndex.m_SteamID)}"); if (!IsAllowed(lobbyMemberByIndex)) { PEAKER.Logger.LogWarning((object)$"'{SteamFriends.GetFriendPersonaName(_lastSentChat)}' ({_lastSentChat.m_SteamID}) tried to join, but there is a non-First Class user in the lobby: '{SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}' ({lobbyMemberByIndex.m_SteamID}) not letting them in..."); PEAKER.LogVisually(Localized_TriedToJoinButIsNotFirstClass(SteamFriends.GetFriendPersonaName(_lastSentChat), _lastSentChat.m_SteamID, SteamFriends.GetFriendPersonaName(lobbyMemberByIndex), lobbyMemberByIndex.m_SteamID), onlySendOnce: true, sfxJoin: false, sfxLeave: true); string text = Guid.NewGuid().ToString(); string[] obj = new string[5] { text.Substring(0, 14), (new char[15] { '0', '1', '2', '3', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' })[Random.Range(0, 15)].ToString(), text.Substring(15, 4), (new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', 'c', 'd', 'e', 'f' })[Random.Range(0, 12)].ToString(), null }; string text2 = text; obj[4] = text2.Substring(20, text2.Length - 20); text = string.Concat(obj); BinarySerializer val = new BinarySerializer(256, (Allocator)2); val.WriteByte((byte)2); val.WriteString(text, Encoding.ASCII); byte[] array = NativeArrayExtensions.ToByteArray(val.buffer); val.Dispose(); if (!SteamMatchmaking.SendLobbyChatMsg(__instance.LobbySteamId, array, array.Length)) { __instance.m_currentlyRequestingRoomID = Optionable.None; PEAKER.Logger.LogError((object)"Failed to send Room ID..."); return false; } PEAKER.Logger.LogInfo((object)("Lobby has been requested. Sending " + text + " (fake room)")); return false; } } PEAKER.Logger.LogInfo((object)$"Checking banned and !ignored status for '{SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}' ({lobbyMemberByIndex.m_SteamID}): {bannedScouts.ContainsKey(lobbyMemberByIndex.m_SteamID)} {!ignoredScouts.Contains(lobbyMemberByIndex.m_SteamID)}"); if (bannedScouts.ContainsKey(lobbyMemberByIndex.m_SteamID) && !ignoredScouts.Contains(lobbyMemberByIndex.m_SteamID)) { PEAKER.Logger.LogWarning((object)$"'{SteamFriends.GetFriendPersonaName(_lastSentChat)}' ({_lastSentChat.m_SteamID}) tried to join, but there is a banned user in the lobby: '{SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}' ({lobbyMemberByIndex.m_SteamID}) not letting them in..."); PEAKER.LogVisually(Localized_TriedToJoinButIsBanned(SteamFriends.GetFriendPersonaName(_lastSentChat), _lastSentChat.m_SteamID, SteamFriends.GetFriendPersonaName(lobbyMemberByIndex), lobbyMemberByIndex.m_SteamID), onlySendOnce: true, sfxJoin: false, sfxLeave: true); string text3 = Guid.NewGuid().ToString(); string[] obj2 = new string[5] { text3.Substring(0, 14), (new char[15] { '0', '1', '2', '3', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' })[Random.Range(0, 15)].ToString(), text3.Substring(15, 4), (new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', 'c', 'd', 'e', 'f' })[Random.Range(0, 12)].ToString(), null }; string text2 = text3; obj2[4] = text2.Substring(20, text2.Length - 20); text3 = string.Concat(obj2); BinarySerializer val2 = new BinarySerializer(256, (Allocator)2); val2.WriteByte((byte)2); val2.WriteString(text3, Encoding.ASCII); byte[] array2 = NativeArrayExtensions.ToByteArray(val2.buffer); val2.Dispose(); if (!SteamMatchmaking.SendLobbyChatMsg(__instance.LobbySteamId, array2, array2.Length)) { __instance.m_currentlyRequestingRoomID = Optionable.None; PEAKER.Logger.LogError((object)"Failed to send Room ID..."); return false; } PEAKER.Logger.LogInfo((object)("Lobby has been requested. Sending " + text3 + " (fake room)")); return false; } } return true; } } public class CheatDetections : MonoBehaviour, IInRoomCallbacks, ILobbyCallbacks { private enum OwnershipCondition { None, IsMasterClient, IsViewOwner, IsMasterClientOrViewOwner } [CompilerGenerated] private sealed class d__36 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CheatDetections <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__36(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; CheatDetections cheatDetections = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (PhotonNetwork.InRoom) { foreach (Player value in PhotonNetwork.CurrentRoom.Players.Values) { cheatDetections.CheckScoutForMods(value); } } } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static readonly HashSet ignoredPlayerNumbers = new HashSet(); internal ConfigEntry detectionsEnabled; internal ConfigEntry autoKickAtlasCherry; private Coroutine _checkScoutsForMods; private Harmony _patches; [Localized("CheatDetections", "CherryMod", "Cherry", "The name of the Cherry mod.", null)] private static string Localized_CherryMod { get; set; } [Localized("CheatDetections", "AtlasMod", "Atlas", "The name of the Atlas mod.", null)] private static string Localized_AtlasMod { get; set; } [Localized("CheatDetections", "FailedToEnable", "{{leftColor}} Failed to enable cheat detections, check log for details.", "When cheat detections fail to enable.", null)] private static string Localized_FailedToEnable { get; set; } [Localized("CheatDetections", "ChangedPhotonName", "{{userColor}} {0}{{joinedColor}} changed their Photon name!", "Shown when a scout changes their Photon name. 0 is their NickName.", null)] private static string Localized_ChangedPhotonName(string nickName) { return Localization.GetText("CheatDetections_ChangedPhotonName", nickName); } [Localized("CheatDetections", "NewMasterClient", "{{userColor}} {0}{{joinedColor}} is the new Master Client!", "Shown when the Master Client changes. 0 is their NickName.", null)] private static string Localized_NewMasterClient(string nickName) { return Localization.GetText("CheatDetections_NewMasterClient", nickName); } [Localized("CheatDetections", "UsingCheatMod", "{{userColor}} {0}{{leftColor}} is using the {1} mod!", "Shown when a scout is using a cheat mod. 0 is their NickName, 1 is the name of the cheat mod.", "AtlasMod")] private static string Localized_UsingCheatMod(string nickName, string cheatModName) { return Localization.GetText("CheatDetections_UsingCheatMod", nickName, cheatModName); } [Localized("CheatDetections", "OwnerOfCheatMod", "{{userColor}} {0}{{leftColor}} is the owner of the {1} mod!", "Shown when a scout is the owner of a cheat mod. 0 is their NickName, 1 is the name of the cheat mod.", "UsingCheatMod")] private static string Localized_OwnerOfCheatMod(string nickName, string cheatModName) { return Localization.GetText("CheatDetections_OwnerOfCheatMod", nickName, cheatModName); } internal void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002b: Expected O, but got Unknown //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_006f: Expected O, but got Unknown detectionsEnabled = PEAKER.Config.Bind(new ConfigDefinition("Cheat Detections", "Enabled"), true, new ConfigDescription("Whether or not to enable PEAKER's cheat detections. (Client)", (AcceptableValueBase)null, Array.Empty())); if (!detectionsEnabled.Value) { ((Behaviour)this).enabled = false; } autoKickAtlasCherry = PEAKER.Config.Bind(new ConfigDefinition("Cheat Detections", "AutoKickAtlasCherry"), false, new ConfigDescription("Whether or not to automatically kick scouts using Atlas or Cherry. (Host)", (AcceptableValueBase)null, Array.Empty())); } internal void OnEnable() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown PEAKER.Logger.LogInfo((object)"Enabling cheat detections."); try { PhotonNetwork.AddCallbackTarget((object)this); _checkScoutsForMods = ((MonoBehaviour)this).StartCoroutine(CheckScoutsForMods()); _patches = new Harmony("lammas123.PEAKER.CheatDetections"); _patches.PatchAll(typeof(CheatDetections)); } catch (Exception arg) { detectionsEnabled.Value = false; ((Behaviour)this).enabled = false; PEAKER.Logger.LogError((object)$"Failed to enable cheat detections: {arg}"); PEAKER.LogVisually(Localized_FailedToEnable, onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } internal void OnDisable() { PEAKER.Logger.LogInfo((object)"Disabling cheat detections."); PhotonNetwork.RemoveCallbackTarget((object)this); if (_checkScoutsForMods != null) { ((MonoBehaviour)this).StopCoroutine(_checkScoutsForMods); } Harmony patches = _patches; if (patches != null) { patches.UnpatchSelf(); } } public static bool IsIgnored(Player player) { if (player != null) { return ignoredPlayerNumbers.Contains(player.ActorNumber); } return false; } internal static void IgnorePlayer(Player player) { if (player != null) { PEAKER.Logger.LogInfo((object)$"Ignoring #{player.ActorNumber}: {player.NickName}"); ignoredPlayerNumbers.Add(player.ActorNumber); } } internal static void UnignorePlayer(Player player) { if (player != null) { PEAKER.Logger.LogInfo((object)$"Unignoring #{player.ActorNumber}: {player.NickName}"); ignoredPlayerNumbers.Remove(player.ActorNumber); } } public void OnPlayerEnteredRoom(Player newPlayer) { } public void OnPlayerLeftRoom(Player otherPlayer) { UnignorePlayer(otherPlayer); } public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) { } public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) { if (((Dictionary)(object)changedProps).ContainsKey((object)"NickName")) { PEAKER.Logger.LogInfo((object)$"{targetPlayer.NickName} (#{targetPlayer.ActorNumber}) changed their Photon name!"); PEAKER.LogVisually(Localized_ChangedPhotonName(targetPlayer.NickName), onlySendOnce: true, sfxJoin: true); } } public void OnMasterClientSwitched(Player newMasterClient) { PEAKER.Logger.LogInfo((object)$"{newMasterClient.NickName} (#{newMasterClient.ActorNumber}) is the new Master Client!"); PEAKER.LogVisually(Localized_NewMasterClient(newMasterClient.NickName), onlySendOnce: true, sfxJoin: true); } public void OnJoinedLobby() { ignoredPlayerNumbers.Clear(); } public void OnLeftLobby() { ignoredPlayerNumbers.Clear(); } public void OnRoomListUpdate(List roomList) { } public void OnLobbyStatisticsUpdate(List lobbyStatistics) { } [IteratorStateMachine(typeof(d__36))] private IEnumerator CheckScoutsForMods() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__36(0) { <>4__this = this }; } private void CheckScoutForMods(Player player) { if (player.ActorNumber == PhotonNetwork.LocalPlayer.ActorNumber || ignoredPlayerNumbers.Contains(player.ActorNumber)) { return; } if (((Dictionary)(object)player.CustomProperties).ContainsKey((object)"CherryUser")) { PEAKER.LogVisually(Localized_UsingCheatMod(player.NickName, Localized_CherryMod), onlySendOnce: true); if (PhotonNetwork.IsMasterClient && autoKickAtlasCherry.Value) { PlayerHandler.Kick(player.ActorNumber); } } if (((Dictionary)(object)player.CustomProperties).ContainsKey((object)"CherryOwner")) { PEAKER.LogVisually(Localized_OwnerOfCheatMod(player.NickName, Localized_CherryMod), onlySendOnce: true); if (PhotonNetwork.IsMasterClient && autoKickAtlasCherry.Value) { PlayerHandler.Kick(player.ActorNumber); } } if (((Dictionary)(object)player.CustomProperties).ContainsKey((object)"AtlUser")) { PEAKER.LogVisually(Localized_UsingCheatMod(player.NickName, Localized_AtlasMod), onlySendOnce: true); if (PhotonNetwork.IsMasterClient && autoKickAtlasCherry.Value) { PlayerHandler.Kick(player.ActorNumber); } } if (((Dictionary)(object)player.CustomProperties).ContainsKey((object)"AtlOwner")) { PEAKER.LogVisually(Localized_OwnerOfCheatMod(player.NickName, Localized_AtlasMod), onlySendOnce: true); if (PhotonNetwork.IsMasterClient && autoKickAtlasCherry.Value) { PlayerHandler.Kick(player.ActorNumber); } } } private static bool IsRpcValid(PhotonView view, Player sender, OwnershipCondition ownershipCondition, Func validCondition = null) { if (sender == null || ignoredPlayerNumbers.Contains(sender.ActorNumber)) { return true; } switch (ownershipCondition) { case OwnershipCondition.IsMasterClient: if (sender.IsMasterClient) { return true; } break; case OwnershipCondition.IsViewOwner: if (sender.ActorNumber == view.Owner.ActorNumber) { return true; } break; case OwnershipCondition.IsMasterClientOrViewOwner: if (sender.IsMasterClient || sender.ActorNumber == view.Owner.ActorNumber) { return true; } break; } return validCondition?.Invoke() ?? true; } [Localized("CheatDetections", "IllegalBananaPeelSlip", "{{userColor}} {0}{{leftColor}} illegally slipped{{userColor}} {1}!", "Shown when a scout illegally makes another scout slip on a banana peel. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalBananaPeelSlip(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalBananaPeelSlip", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(BananaPeel), "RPCA_TriggerBanana")] [HarmonyPostfix] internal static void PostBananaPeelRPCA_TriggerBanana(int viewID, ref PhotonMessageInfo info) { if (!IsRpcValid(PhotonView.Find(viewID), info.Sender, OwnershipCondition.IsViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally slipped {PhotonView.Find(viewID).Owner.NickName} (#{PhotonView.Find(viewID).Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalBananaPeelSlip(info.Sender.NickName, PhotonView.Find(viewID).Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalBeeSwarmDisperse", "{{userColor}} {0}{{leftColor}} illegally dispersed a swarm!", "Shown when a scout illegally disperses a bee swarm. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalBeeSwarmDisperse(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalBeeSwarmDisperse", cheaterNickName); } [Localized("CheatDetections", "IllegalBeeSwarmAnger", "{{userColor}} {0}{{leftColor}} illegally changed a swarm's anger!", "Shown when a scout illegally makes a bee swarm angry. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalBeeSwarmAnger(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalBeeSwarmAnger", cheaterNickName); } [HarmonyPatch(typeof(BeeSwarm), "DisperseRPC")] [HarmonyPostfix] internal static void PostBeeSwarmDisperseRPC(BeeSwarm __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((MonoBehaviourPun)__instance).photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally dispersed a swarm!"); PEAKER.LogVisually(Localized_IllegalBeeSwarmDisperse(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(BeeSwarm), "SetBeesAngryRPC")] [HarmonyPostfix] internal static void PostBeeSwarmSetBeesAngryRPC(BeeSwarm __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((MonoBehaviourPun)__instance).photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) changed a swarm's anger!"); PEAKER.LogVisually(Localized_IllegalBeeSwarmAnger(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalAttachTick", "{{userColor}} {0}{{leftColor}} illegally attached a tick to{{userColor}} {1}!", "Shown when a scout illegally attaches a tick to another scout. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalAttachTick(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalAttachTick", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(Bugfix), "AttachBug")] [HarmonyPostfix] internal static void PostBugfixAttachBug(int targetID, ref PhotonMessageInfo info) { if (!IsRpcValid(PhotonView.Find(targetID), info.Sender, OwnershipCondition.IsViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally attached a tick to {PhotonView.Find(targetID).Owner.NickName} (#{PhotonView.Find(targetID).Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalAttachTick(info.Sender.NickName, PhotonView.Find(targetID).Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalTriggerHelicopter", "{{userColor}} {0}{{leftColor}} illegally triggered the helicopter!", "Shown when a scout illegally triggers the end game helicopter. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalTriggerHelicopter(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalTriggerHelicopter", cheaterNickName); } [HarmonyPatch(typeof(Flare), "TriggerHelicopter")] [HarmonyPostfix] internal static void PostFlareTriggerHelicopter(Flare __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((ItemComponent)__instance).photonView, info.Sender, OwnershipCondition.None, () => Singleton.Instance.summonedHelicopter || (((ItemComponent)__instance).GetData((DataEntryKey)3).Value && Singleton.Instance.IsAtPeak(((Component)__instance).transform.position + new Vector3(0f, 0f, 10f))))) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally triggered the helicopter!"); PEAKER.LogVisually(Localized_IllegalTriggerHelicopter(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalCampfireExtinguish", "{{userColor}} {0}{{leftColor}} illegally tried to extinguish the {1} campfire!", "Shown when a scout illegally tries to extinguish a campfire. 0 is the cheating scout's NickName, 1 is the segment name.", null)] private static string Localized_IllegalCampfireExtinguish(string cheaterNickName, string segmentName) { return Localization.GetText("CheatDetections_IllegalCampfireExtinguish", cheaterNickName, segmentName); } [HarmonyPatch(typeof(Campfire), "Extinguish_Rpc")] [HarmonyPrefix] internal static bool PreCampfireExtinguish_Rpc(Campfire __instance, ref PhotonMessageInfo info) { //IL_003c: Unknown result type (might be due to invalid IL or missing references) bool num = IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient); if (!num) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally tried to extinguish the {__instance.advanceToSegment} campfire!"); PEAKER.LogVisually(Localized_IllegalCampfireExtinguish(info.Sender.NickName, ((object)(Segment)(ref __instance.advanceToSegment)).ToString()), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } return num; } [Localized("CheatDetections", "IllegalEndGame", "{{userColor}} {0}{{leftColor}} illegally forced the game to end!", "Shown when a scout illegally forces the game to end. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalEndGame(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalEndGame", cheaterNickName); } [HarmonyPatch(typeof(Character), "RPCEndGame")] [HarmonyPatch(typeof(Character), "RPCEndGame_ForceWin")] [HarmonyPostfix] internal static void PostCharacterRPCEndGame(Character __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally forced the game to end!"); PEAKER.LogVisually(Localized_IllegalEndGame(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalKill", "{{userColor}} {0}{{leftColor}} illegally killed{{userColor}} {1}!", "Shown when a scout illegally kills another scout. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalKill(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalKill", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(Character), "RPCA_Die")] [HarmonyPostfix] internal static void PostCharacterRPCA_Die(Character __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClientOrViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally killed {__instance.view.Owner.NickName} (#{__instance.view.Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalKill(info.Sender.NickName, __instance.view.Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "Revive", "{{userColor}} {0}{{leftColor}} revived{{userColor}} {1}!", "Shown when a scout revives another scout. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_Revive(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_Revive", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(Character), "RPCA_Revive")] [HarmonyPatch(typeof(Character), "RPCA_ReviveAtPosition")] [HarmonyPostfix] internal static void PostCharacterRPCA_ReviveAtPosition(Character __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) revived {__instance.view.Owner.NickName} (#{__instance.view.Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_Revive(info.Sender.NickName, __instance.view.Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalWarp", "{{userColor}} {0}{{leftColor}} illegally warped{{userColor}} {1}!", "Shown when a scout illegally warps another scout. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalWarp(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalWarp", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(Character), "WarpPlayerRPC")] [HarmonyPostfix] internal static void PostCharacterWarpPlayerRPC(Character __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClientOrViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally warped {__instance.view.Owner.NickName} (#{__instance.view.Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalWarp(info.Sender.NickName, __instance.view.Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalGhostInit", "{{userColor}} {0}{{leftColor}} illegally initialized the ghost of{{userColor}} {1}!", "Shown when a scout illegally initializes another scout's ghost. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalGhostInit(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalGhostInit", cheaterNickName, affectedNickName); } [Localized("CheatDetections", "IllegalGhostTarget", "{{userColor}} {0}{{leftColor}} illegally controlled the ghost of{{userColor}} {1}!", "Shown when a scout illegally changes the target of another scout's ghost. 0 is the cheating scout's NickName, 1 is the affected scout's NickName.", null)] private static string Localized_IllegalGhostTarget(string cheaterNickName, string affectedNickName) { return Localization.GetText("CheatDetections_IllegalGhostTarget", cheaterNickName, affectedNickName); } [HarmonyPatch(typeof(PlayerGhost), "RPCA_InitGhost")] [HarmonyPostfix] internal static void PostPlayerGhostRPCA_InitGhost(PlayerGhost __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.m_view, info.Sender, OwnershipCondition.IsViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally initialized the ghost of {__instance.m_view.Owner.NickName} (#{__instance.m_view.Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalGhostInit(info.Sender.NickName, __instance.m_view.Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(PlayerGhost), "RPCA_SetTarget")] [HarmonyPostfix] internal static void PostPlayerGhostRPCA_SetTarget(PlayerGhost __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.m_view, info.Sender, OwnershipCondition.IsViewOwner)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally controlled the ghost of {__instance.m_view.Owner.NickName} (#{__instance.m_view.Owner.ActorNumber})!"); PEAKER.LogVisually(Localized_IllegalGhostTarget(info.Sender.NickName, __instance.m_view.Owner.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalSpawnEruption", "{{userColor}} {0}{{leftColor}} illegally spawned an eruption!", "Shown when a scout illegally spawns an eruption. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalSpawnEruption(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalSpawnEruption", cheaterNickName); } [HarmonyPatch(typeof(EruptionSpawner), "RPCA_SpawnEruption")] [HarmonyPostfix] internal static void PostEruptionSpawnerRPCA_SpawnEruption(EruptionSpawner __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally spawned an eruption!"); PEAKER.LogVisually(Localized_IllegalSpawnEruption(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalGrowBean", "{{userColor}} {0}{{leftColor}} illegally grew a magic bean!", "Shown when a scout illegally grows a magic bean. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalGrowBean(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalGrowBean", cheaterNickName); } [HarmonyPatch(typeof(MagicBean), "GrowVineRPC")] [HarmonyPostfix] internal static void PostMagicBeanGrowVineRPC(MagicBean __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((ItemComponent)__instance).photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally grew a magic bean!"); PEAKER.LogVisually(Localized_IllegalGrowBean(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalStartFog", "{{userColor}} {0}{{leftColor}} illegally started the fog!", "Shown when a scout illegally starts the fog. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalStartFog(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalStartFog", cheaterNickName); } [Localized("CheatDetections", "IllegalSyncFog", "{{userColor}} {0}{{leftColor}} illegally synced the fog!", "Shown when a scout illegally syncs the fog. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalSyncFog(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalSyncFog", cheaterNickName); } [HarmonyPatch(typeof(OrbFogHandler), "StartMovingRPC")] [HarmonyPostfix] internal static void PostOrbFogHandlerStartMovingRPC(OrbFogHandler __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally started the fog!"); PEAKER.LogVisually(Localized_IllegalStartFog(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(OrbFogHandler), "RPCA_SyncFog")] [HarmonyPostfix] internal static void PostOrbFogHandlerRPCA_SyncFog(OrbFogHandler __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally synced the fog!"); PEAKER.LogVisually(Localized_IllegalSyncFog(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalStartGame", "{{userColor}} {0}{{leftColor}} illegally started the game!", "Shown when a scout illegally starts the game. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalStartGame(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalStartGame", cheaterNickName); } [Localized("CheatDetections", "IllegalLoadAirport", "{{userColor}} {0}{{leftColor}} illegally loaded the airport!", "Shown when a scout illegally loads the airport. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalLoadAirport(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalLoadAirport", cheaterNickName); } [HarmonyPatch(typeof(AirportCheckInKiosk), "BeginIslandLoadRPC")] [HarmonyPostfix] internal static void PostAirportCheckInKioskBeginIslandLoadRPC(AirportCheckInKiosk __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((MonoBehaviourPun)__instance).photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally started the game!"); PEAKER.LogVisually(Localized_IllegalStartGame(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(GameOverHandler), "BeginAirportLoadRPC")] [HarmonyPostfix] internal static void PostGameOverHandlerBeginAirportLoadRPC(GameOverHandler __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally loaded the airport!"); PEAKER.LogVisually(Localized_IllegalLoadAirport(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalBridgeShake", "{{userColor}} {0}{{leftColor}} illegally shook a bridge!", "Shown when a scout illegally shakes a bridge. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalBridgeShake(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalBridgeShake", cheaterNickName); } [Localized("CheatDetections", "IllegalBridgeFall", "{{userColor}} {0}{{leftColor}} illegally made a bridge fall!", "Shown when a scout illegally makes a bridge fall. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalBridgeFall(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalBridgeFall", cheaterNickName); } [Localized("CheatDetections", "IllegalRopeDetach", "{{userColor}} {0}{{leftColor}} illegally detached a rope!", "Shown when a scout illegally detaches a rope. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalRopeDetach(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalRopeDetach", cheaterNickName); } [Localized("CheatDetections", "IllegalIcicleShake", "{{userColor}} {0}{{leftColor}} illegally shook an icicle!", "Shown when a scout illegally shakes an icicle. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalIcicleShake(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalIcicleShake", cheaterNickName); } [Localized("CheatDetections", "IllegalIcicleFall", "{{userColor}} {0}{{leftColor}} illegally made an icicle fall!", "Shown when a scout illegally makes an icicle fall. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalIcicleFall(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalIcicleFall", cheaterNickName); } [Localized("CheatDetections", "IllegalPitonStartBreak", "{{userColor}} {0}{{leftColor}} illegally started breaking a piton!", "Shown when a scout illegally starts breaking a piton. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalPitonStartBreak(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalPitonStartBreak", cheaterNickName); } [Localized("CheatDetections", "IllegalPitonBreak", "{{userColor}} {0}{{leftColor}} illegally broke a piton!", "Shown when a scout illegally breaks a piton. 0 is the cheating scout's NickName.", null)] private static string Localized_IllegalPitonBreak(string cheaterNickName) { return Localization.GetText("CheatDetections_IllegalPitonBreak", cheaterNickName); } [HarmonyPatch(typeof(BreakableBridge), "ShakeBridge_Rpc")] [HarmonyPostfix] internal static void PostBreakableBridgeShakeBridge_Rpc(BreakableBridge __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally shook a bridge!"); PEAKER.LogVisually(Localized_IllegalBridgeShake(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(BreakableBridge), "Fall_Rpc")] [HarmonyPostfix] internal static void PostBreakableBridgeFall_Rpc(BreakableBridge __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally made a bridge fall!"); PEAKER.LogVisually(Localized_IllegalBridgeFall(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(Rope), "Detach_Rpc")] [HarmonyPostfix] internal static void PostRopeDetach_Rpc(Rope __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally detached a rope!"); PEAKER.LogVisually(Localized_IllegalRopeDetach(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(ShakyIcicleIce2), "ShakeRock_Rpc")] [HarmonyPostfix] internal static void PostShakyIcicleIce2ShakeRock_Rpc(ShakyIcicleIce2 __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally shook an icicle!"); PEAKER.LogVisually(Localized_IllegalIcicleShake(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(ShakyIcicleIce2), "Fall_Rpc")] [HarmonyPostfix] internal static void PostShakyIcicleIce2Fall_Rpc(ShakyIcicleIce2 __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally made an icicle fall!"); PEAKER.LogVisually(Localized_IllegalIcicleFall(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(ShittyPiton), "RPCA_StartBreaking")] [HarmonyPostfix] internal static void PostShittyPitonRPCA_StartBreaking(ShittyPiton __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally started breaking a piton!"); PEAKER.LogVisually(Localized_IllegalPitonStartBreak(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(ShittyPiton), "RPCA_Break")] [HarmonyPostfix] internal static void PostShittyPitonRPCA_Break(ShittyPiton __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) illegally broke a piton!"); PEAKER.LogVisually(Localized_IllegalPitonBreak(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalInstantiate", "{{userColor}} {0}{{leftColor}} illegally instantiated the {1} prefab!", "Shown when a scout illegally tries to instantiate a prefab. 0 is the cheating scout's NickName, 1 is the prefab name.", null)] private static string Localized_IllegalInstantiate(string cheaterNickName, string segmentName) { return Localization.GetText("CheatDetections_IllegalInstantiate", cheaterNickName, segmentName); } [HarmonyPatch(typeof(PhotonNetwork), "NetworkInstantiate", new Type[] { typeof(InstantiateParameters), typeof(bool), typeof(bool) })] [HarmonyPostfix] internal static void PostPhotonNetworkNetworkInstantiate(ref InstantiateParameters parameters, ref GameObject __result, bool instantiateEvent) { if (!instantiateEvent || (Object)(object)__result == (Object)null) { return; } PEAKER.Logger.LogInfo((object)$"{parameters.creator.NickName} (#{parameters.creator.ActorNumber}) instantiated the {parameters.prefabName} prefab."); string name = ((Object)__result).name; int num = ((Object)__result).name.LastIndexOf('/') + 1; string text = name.Substring(num, name.Length - num); if (text == null) { return; } switch (text.Length) { case 13: switch (text[9]) { default: return; case 'B': if (!(text == "Bingbong_Blow")) { return; } break; case 'G': if (!(text == "Bingbong_Grab")) { return; } break; case 'P': if (!(text == "Bingbong_Push")) { return; } break; case 'S': if (!(text == "Bingbong_Suck")) { return; } break; } goto IL_0119; case 8: if (!(text == "BeeSwarm")) { break; } goto IL_0119; case 20: if (!(text == "Bingbong_Push_Gentle")) { break; } goto IL_0119; case 7: { if (!(text == "Tornado")) { break; } goto IL_0119; } IL_0119: PEAKER.LogVisually(Localized_IllegalInstantiate(parameters.creator.NickName, parameters.prefabName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); break; } } } [LocalizedEnum] public enum CharacterPhysicsOptimizationMode { [LocalizedEnumDescription("Disabled.")] None, [LocalizedEnumDescription("Disable scout's colliders when they're dead.")] DisableCollidersWhenDead } [LocalizedEnum] public enum LateJoinAntiFlingMode { [LocalizedEnumDescription("Disabled.")] None, [LocalizedEnumDescription("Slow a scout's max velocity when they join late.")] Slow } public class ClientImprovements : MonoBehaviour, IInRoomCallbacks { internal static ConfigEntry characterPhysicsOptimizationMode; internal static ConfigEntry lateJoinAntiFlingMode; internal void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002a: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Expected O, but got Unknown characterPhysicsOptimizationMode = PEAKER.Config.Bind(new ConfigDefinition("Client Improvements", "CharacterPhysicsOptimizationMode"), CharacterPhysicsOptimizationMode.DisableCollidersWhenDead, new ConfigDescription("Decides how to optimize the physics of scout's characters. DisableCollidersWhenDead will prevent the lag caused by every dead character's colliders overlapping at one point in the void.", (AcceptableValueBase)null, Array.Empty())); lateJoinAntiFlingMode = PEAKER.Config.Bind(new ConfigDefinition("Client Improvements", "LateJoinAntiFlingMode"), LateJoinAntiFlingMode.None, new ConfigDescription("Experimental! Desides how to prematurely prevent late joiners from potentially bugging out on your client and flinging you. Slow will limit their ragdoll's maximum velocity upon joining.", (AcceptableValueBase)null, Array.Empty())); PEAKER.Patches.PatchAll(typeof(ClientImprovements)); } internal void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } internal void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } public void OnPlayerEnteredRoom(Player newPlayer) { } public void OnPlayerLeftRoom(Player otherPlayer) { } public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) { } public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) { } public void OnMasterClientSwitched(Player newMasterClient) { } [HarmonyPatch(typeof(Character), "RPCA_Die")] [HarmonyPostfix] internal static void PostCharacterRPCA_Die(Character __instance) { if (characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead) { __instance.refs.ragdoll.ToggleCollision(false); } } [HarmonyPatch(typeof(Character), "RPCA_Revive")] [HarmonyPrefix] internal static void PreCharacterRPCA_Revive(Character __instance) { if (characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead) { __instance.refs.ragdoll.ToggleCollision(true); } } [HarmonyPatch(typeof(CharacterRagdoll), "Awake")] [HarmonyPostfix] internal static void PostCharacterRagdollAwake(CharacterRagdoll __instance) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.character == (Object)(object)Character.localCharacter || __instance.character.isBot) { return; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Airport" || Time.timeSinceLevelLoad < 60f || lateJoinAntiFlingMode.Value != LateJoinAntiFlingMode.Slow) { return; } PEAKER.Logger.LogInfo((object)("Slowing down " + __instance.character.view.Owner.NickName + "...")); foreach (Bodypart part in __instance.partList) { part.rig.maxLinearVelocity = 10f; } PEAKER.Logger.LogInfo((object)__instance.partList[0].rig.maxLinearVelocity); } [HarmonyPatch(typeof(PhotonNetwork), "RPC", new Type[] { typeof(PhotonView), typeof(string), typeof(RpcTarget), typeof(Player), typeof(bool), typeof(object[]) })] [HarmonyPrefix] internal static void PrePhotonNetworkRPC(PhotonView view, string methodName, ref RpcTarget target) { if ((int)target == 3 || (int)target == 4 || (int)target == 6) { if (methodName == "RemoveSkeletonRPC" && (int)target == 3) { target = (RpcTarget)0; PEAKER.Logger.LogInfo((object)$"Changed Buffering of RPC: '{((Component)view).gameObject}'-'{methodName}' {target}"); } else { PEAKER.Logger.LogInfo((object)$"Buffering RPC: '{((Component)view).gameObject}'-'{methodName}' {target}"); } } } [HarmonyPatch(typeof(GameHandler), "Initialize")] [HarmonyPostfix] internal static void PostGameHandlerInitialize() { ((Setting)GameHandler.Instance.SettingsHandler.GetSetting()).RegisterListener((Action)OnLobbyTypeSettingChanged); ((Setting)GameHandler.Instance.SettingsHandler.GetSetting()).RegisterExternalListener((Action)OnLobbyTypeSettingChanged); } private static void OnLobbyTypeSettingChanged(Setting setting) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) LobbyTypeSetting val = (LobbyTypeSetting)(object)((setting is LobbyTypeSetting) ? setting : null); if (val != null) { CSteamID lobbySteamId = GameHandler.GetService().LobbySteamId; if (SteamMatchmaking.GetLobbyOwner(lobbySteamId) == SteamUser.GetSteamID()) { SteamMatchmaking.SetLobbyType(lobbySteamId, (ELobbyType)(((int)((EnumSetting)(object)val).Value == 0) ? 1 : 0)); } } } [HarmonyPatch(typeof(LobbyTypeSetting), "ShouldShow")] [HarmonyPrefix] internal static bool PreLobbyTypeSettingShouldShow(ref bool __result) { __result = true; return false; } } public class FirstClass : MonoBehaviour { private static bool _enabled; private static bool _friendsEnabled; public static bool Enabled => _enabled; public static bool FriendsEnabled => _friendsEnabled; [Localized("FirstClass", "Disabled", "{joinedColor} First Class is now Disabled!", "When First Class is disabled.", null)] private static string Localized_Disabled { get; set; } [Localized("FirstClass", "Enabled", "{joinedColor} First Class is now Enabled!", "When First Class is enabled.", null)] private static string Localized_Enabled { get; set; } [Localized("FirstClass", "FriendsDisallowed", "{joinedColor} Friends are no longer First Class!", "When First Class is disabled.", null)] private static string Localized_FriendsDisallowed { get; set; } [Localized("FirstClass", "FriendsAllowed", "{joinedColor} Friends are now First Class!", "When First Class is enabled.", null)] private static string Localized_FriendsAllowed { get; set; } internal void FixedUpdate() { if (!_enabled && !PhotonNetwork.InRoom) { _enabled = false; _friendsEnabled = false; } } public static bool TryToggle() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if ((GameHandler.Initialized ? GameHandler.GetService().LobbySteamId : CSteamID.Nil) == CSteamID.Nil) { return false; } _enabled = !_enabled; PEAKER.Logger.LogInfo((object)("First Class is now " + (_enabled ? "Enabled" : "Disabled") + "!")); PEAKER.LogVisually(_enabled ? Localized_Enabled : Localized_Disabled, onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } public static bool TryToggleFriends() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) if ((GameHandler.Initialized ? GameHandler.GetService().LobbySteamId : CSteamID.Nil) == CSteamID.Nil) { return false; } _friendsEnabled = !_friendsEnabled; PEAKER.Logger.LogInfo((object)("Friends are " + (_enabled ? "now" : "no longer") + " First Class!")); PEAKER.LogVisually(_friendsEnabled ? Localized_FriendsAllowed : Localized_FriendsDisallowed, onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } } public sealed class Gui : MonoBehaviour { private enum Guis { None, Actions, Scouts, FirstClass, NoFlyList, Config } private static class ActionsGui { public static Rect rect = new Rect(0f, 0f, 220f, -1f); [Localized("GuiActions", "UnlockStartKiosk", "Unlock Start Kiosk", "The unlock text for the Start Kiosk Lock action.", null)] private static string Localized_UnlockStartKiosk { get; set; } [Localized("GuiActions", "LockStartKiosk", "Lock Start Kiosk", "The lock text for the Start Kiosk Lock action.", null)] private static string Localized_LockStartKiosk { get; set; } [Localized("GuiActions", "LightNearbyCampfire", "Light Nearby Campfire", "The text for the Light Nearby Campfire action.", null)] private static string Localized_LightNearbyCampfire { get; set; } [Localized("GuiActions", "SpawnBackpack", "Spawn Backpack", "The text for the Spawn Backpack action.", null)] private static string Localized_SpawnBackpack { get; set; } [Localized("GuiActions", "SkipEndScreen", "Skip End Screen", "The text for the Skip End Screen action.", null)] private static string Localized_SkipEndScreen { get; set; } [Localized("GuiActions", "CopyInvite", "Copy Invite", "The text for the Copy Invite action.", null)] private static string Localized_CopyInvite { get; set; } [Localized("GuiActions", "UnlockSteamLobby", "Unlock Steam Lobby", "The unlock text for the Steam Lobby Lock action.", null)] private static string Localized_UnlockSteamLobby { get; set; } [Localized("GuiActions", "LockSteamLobby", "Lock Steam Lobby", "The lock text for the Steam Lobby Lock action.", null)] private static string Localized_LockSteamLobby { get; set; } public static void DrawGui(int _) { //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01be: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f7: Unknown result type (might be due to invalid IL or missing references) //IL_0243: Unknown result type (might be due to invalid IL or missing references) //IL_0249: Invalid comparison between Unknown and I4 //IL_0250: Unknown result type (might be due to invalid IL or missing references) //IL_0255: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty()); GUI.enabled = PhotonNetwork.IsMasterClient && Object.op_Implicit((Object)(object)Object.FindAnyObjectByType()); if (GUILayout.Button(StartKioskLock.StartKioskLocked ? Localized_UnlockStartKiosk : Localized_LockStartKiosk, WrapButton, Array.Empty())) { StartKioskLock.TryToggle(); } GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(Localized_LightNearbyCampfire, WrapButton, Array.Empty())) { Vector3 center = Character.localCharacter.Center; Campfire[] array = Object.FindObjectsByType((FindObjectsSortMode)0); foreach (Campfire val in array) { if (!val.Lit) { Vector3 position = ((Component)val).transform.position; if (Vector3.Distance(center, position) <= 10f) { PEAKER.Logger.LogInfo((object)"Forcibly lighting campfire."); val.view.RPC("Light_Rpc", (RpcTarget)0, new object[1] { true }); break; } } } PEAKER.Logger.LogInfo((object)"No campfire nearby to forcibly light."); } if (GUILayout.Button(Localized_SpawnBackpack, WrapButton, Array.Empty())) { PEAKER.Logger.LogInfo((object)"Giving backpack to self."); ItemDatabase.Add(ObjectDatabaseAsset.GetObjectFromString("Backpack")); } GUI.enabled = PhotonNetwork.IsMasterClient && Object.op_Implicit((Object)(object)Singleton.Instance) && ((MenuWindow)GUIManager.instance.endScreen).isOpen; if (GUILayout.Button(Localized_SkipEndScreen, WrapButton, Array.Empty())) { PEAKER.Logger.LogInfo((object)"Forcing all scouts to be done with the end screen."); Singleton.Instance.ForceEveryPlayerDoneWithEndScreen(); } GUI.enabled = GameHandler.GetService().LobbySteamId != CSteamID.Nil; if (GUILayout.Button(Localized_CopyInvite, WrapButton, Array.Empty())) { GUIUtility.systemCopyBuffer = $"steam://joinlobby/3527290/{GameHandler.GetService().LobbySteamId.m_SteamID}/{SteamUser.GetSteamID().m_SteamID}"; } GUI.enabled = PhotonNetwork.IsMasterClient && GameHandler.GetService().LobbySteamId != CSteamID.Nil; if (GUILayout.Button(SteamLobbyLock.SteamLobbyLocked ? Localized_UnlockSteamLobby : Localized_LockSteamLobby, WrapButton, Array.Empty())) { SteamLobbyLock.TryToggle(); } GUI.enabled = true; GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } } private static class ScoutsGui { [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawPhotonWindow; public static WindowFunction <1>__DrawSteamWindow; } public static Rect rect = new Rect(0f, 0f, 320f, -1f); private static Rect _photonRect = new Rect(0f, 0f, 400f, 600f); private static Rect _steamRect = new Rect(0f, 0f, 400f, 600f); private static bool _resizingPhoton = false; private static Vector2 _resizePhotonStartPos = Vector2.zero; private static Vector2 _resizePhotonStartSize = Vector2.zero; private static bool _resizingSteam = false; private static Vector2 _resizeSteamStartPos = Vector2.zero; private static Vector2 _resizeSteamStartSize = Vector2.zero; private static Vector2 _scroll = new Vector2(0f, 0f); private static int _photonActorNumber = -1; private static CSteamID _steamId = CSteamID.Nil; private static string _banReason = "No reason specified."; [Localized("GuiScouts", "PhotonScouts", "Photon Scouts", "The title of the Photon Scouts section of the Scouts GUI.", null)] private static string Localized_PhotonScouts { get; set; } [Localized("GuiScouts", "SteamScouts", "Steam Scouts", "The title of the Steam Scouts section of the Scouts GUI.", null)] private static string Localized_SteamScouts { get; set; } [Localized("GuiScouts", "PhotonScoutInfoNone", "Photon Scout: None", "Shown when no Photon scout is selected.", null)] private static string Localized_PhotonScoutInfoNone { get; set; } [Localized("GuiScouts", "Kick", "Kick", "Kick the selected Photon scout from the room.", null)] private static string Localized_Kick { get; set; } [Localized("GuiScouts", "DecreaseMaxVelocity", "Decrease Max Velocity", "Button to decrease the scout's max velocity.", null)] private static string Localized_DecreaseMaxVelocity { get; set; } [Localized("GuiScouts", "IncreaseMaxVelocity", "Increase Max Velocity", "Button to increase the scout's max velocity.", null)] private static string Localized_IncreaseMaxVelocity { get; set; } [Localized("GuiScouts", "IgnoreDetections", "Ignore Detections", "Ignore cheat detections for the selected scout.", null)] private static string Localized_IgnoreDetections { get; set; } [Localized("GuiScouts", "UnignoreDetections", "Unignore Detections", "Stop ignoring cheat detections for the selected scout.", null)] private static string Localized_UnignoreDetections { get; set; } [Localized("GuiScouts", "SteamScoutInfoNone", "Steam Scout: None", "Shown when no Steam scout is selected.", null)] private static string Localized_SteamScoutInfoNone { get; set; } [Localized("GuiScouts", "CopySteamId", "Copy Steam ID", "Copies the selected Steam ID to the clipboard.", null)] private static string Localized_CopySteamId { get; set; } [Localized("GuiScouts", "SteamProfile", "Open Steam Profile", "Open's the Steam scout's profile in the Steam overlay.", null)] private static string Localized_SteamProfile { get; set; } [Localized("GuiScouts", "BanReason", "Ban Reason:", "Label for the ban reason text field.", null)] private static string Localized_BanReason { get; set; } [Localized("GuiScouts", "Ban", "Ban", "Ban the selected Steam scout.", null)] private static string Localized_Ban { get; set; } [Localized("GuiScouts", "Banned", "Banned", "Shown when the selected scout is already banned.", null)] private static string Localized_Banned { get; set; } [Localized("GuiScouts", "TempIgnoredBan", "Temp Ignored Ban", "Shown when a ban is temporarily ignored.", null)] private static string Localized_TempIgnoredBan { get; set; } [Localized("GuiScouts", "TempIgnoreBan", "Temp Ignore Ban", "Temporarily ignore a ban for the selected scout.", null)] private static string Localized_TempIgnoreBan { get; set; } [Localized("GuiScouts", "Allow", "Allow", "Allow the selected Steam scout.", null)] private static string Localized_Allow { get; set; } [Localized("GuiScouts", "Unallow", "Unallow", "Unallow the selected Steam scout.", null)] private static string Localized_Unallow { get; set; } [Localized("GuiScouts", "NotInPhotonRoom", "Not in a Photon Room.", "Shown when the player is not in a Photon room.", null)] private static string Localized_NotInPhotonRoom { get; set; } [Localized("GuiScouts", "NotInSteamLobby", "Not in a Steam Lobby.", "Shown when the player is not in a Steam lobby.", null)] private static string Localized_NotInSteamLobby { get; set; } [Localized("GuiScouts", "You", "YOU", "Label indicating the local player.", null)] private static string Localized_You { get; set; } [Localized("GuiScouts", "PhotonScoutInfo", "Photon Scout: #{0}: {1}", "Displays information about the currently selected Photon scout. 0 is their ActorNumber, 1 is their NickName.", "SteamScouts")] private static string Localized_PhotonScoutInfo(int actorNumber, string nickName) { return Localization.GetText("GuiScouts_PhotonScoutInfo", actorNumber, nickName); } [Localized("GuiScouts", "CurrentMaxVelocity", "Is this scout glitching out for you? Try decreasing their max velocity! Current: {0}", "Displays the current max velocity of the selected scout. 0 is current max velocity.", "Kick")] private static string Localized_CurrentMaxVelocity(string value) { return Localization.GetText("GuiScouts_CurrentMaxVelocity", value); } [Localized("GuiScouts", "SteamScoutInfo", "Steam Scout: {0}: {1}", "Displays Steam ID and name of the selected Steam scout. 0 is their Steam ID, 1 is their persona name.", "UnignoreDetections")] private static string Localized_SteamScoutInfo(ulong steamId, string personaName) { return Localization.GetText("GuiScouts_SteamScoutInfo", steamId, personaName); } public static void DrawGui(int _) { //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_046b: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_0429: Unknown result type (might be due to invalid IL or missing references) //IL_047c: Unknown result type (might be due to invalid IL or missing references) //IL_0481: Unknown result type (might be due to invalid IL or missing references) //IL_0504: Unknown result type (might be due to invalid IL or missing references) //IL_0509: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_0515: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Unknown result type (might be due to invalid IL or missing references) //IL_05a7: Unknown result type (might be due to invalid IL or missing references) //IL_0521: Unknown result type (might be due to invalid IL or missing references) //IL_04d2: Unknown result type (might be due to invalid IL or missing references) //IL_05b3: Unknown result type (might be due to invalid IL or missing references) //IL_05b8: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Invalid comparison between Unknown and I4 //IL_05c4: Unknown result type (might be due to invalid IL or missing references) //IL_0566: Unknown result type (might be due to invalid IL or missing references) //IL_064d: Unknown result type (might be due to invalid IL or missing references) //IL_0652: Unknown result type (might be due to invalid IL or missing references) //IL_0609: Unknown result type (might be due to invalid IL or missing references) //IL_05e7: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty()); Player player = default(Player); if (PhotonNetwork.TryGetPlayer(_photonActorNumber, ref player)) { GUILayout.Label(Localized_PhotonScoutInfo(player.ActorNumber, player.NickName), Array.Empty()); } else { GUILayout.Label(Localized_PhotonScoutInfoNone, Array.Empty()); } GUI.enabled = player != null && player.ActorNumber != PhotonNetwork.LocalPlayer.ActorNumber; if (PhotonNetwork.IsMasterClient && GUILayout.Button(Localized_Kick, WrapButton, Array.Empty())) { PlayerHandler.Kick(player.ActorNumber); } float num = 0f; Scoutmaster val2 = default(Scoutmaster); Character val = ((player == null) ? null : Character.AllCharacters.FindLast((Character character) => character.view.Owner.ActorNumber == player.ActorNumber && !((Component)character).TryGetComponent(ref val2))); if ((Object)(object)val != (Object)null && val.refs.ragdoll.partList.Count > 0) { num = val.refs.ragdoll.partList[0].rig.maxLinearVelocity; } GUILayout.Label(Localized_CurrentMaxVelocity(((Object)(object)val == (Object)null) ? "N/A" : num.ToString()), Array.Empty()); GUILayout.BeginHorizontal(Array.Empty()); if (GUILayout.Button(Localized_DecreaseMaxVelocity, WrapButton, Array.Empty())) { PEAKER.Logger.LogInfo((object)("Slowing down " + player.NickName + "...")); if ((Object)(object)val != (Object)null) { foreach (Bodypart part in val.refs.ragdoll.partList) { Rigidbody rig = part.rig; rig.maxLinearVelocity *= 0.1f; if (part.rig.maxLinearVelocity < 0.1f) { part.rig.maxLinearVelocity = 0.1f; } } PEAKER.Logger.LogInfo((object)val.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } if (GUILayout.Button(Localized_IncreaseMaxVelocity, WrapButton, Array.Empty())) { PEAKER.Logger.LogInfo((object)("Speeding up " + player.NickName + "...")); if ((Object)(object)val != (Object)null) { foreach (Bodypart part2 in val.refs.ragdoll.partList) { Rigidbody rig2 = part2.rig; rig2.maxLinearVelocity *= 10f; if (part2.rig.maxLinearVelocity > 1E+16f) { part2.rig.maxLinearVelocity = 1E+16f; } } PEAKER.Logger.LogInfo((object)val.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } GUILayout.EndHorizontal(); if (CheatDetections.IsIgnored(player)) { if (GUILayout.Button(Localized_UnignoreDetections, WrapButton, Array.Empty())) { CheatDetections.UnignorePlayer(player); } } else if (GUILayout.Button(Localized_IgnoreDetections, WrapButton, Array.Empty())) { CheatDetections.IgnorePlayer(player); } GUI.enabled = true; GUILayout.Space(8f); if (_steamId != CSteamID.Nil) { GUILayout.Label(Localized_SteamScoutInfo(_steamId.m_SteamID, SteamFriends.GetFriendPersonaName(_steamId)), Array.Empty()); } else { GUILayout.Label(Localized_SteamScoutInfoNone, Array.Empty()); } GUI.enabled = _steamId != CSteamID.Nil; if (GUILayout.Button(Localized_CopySteamId, WrapButton, Array.Empty())) { GUIUtility.systemCopyBuffer = _steamId.m_SteamID.ToString(); } if (GUILayout.Button(Localized_SteamProfile, WrapButton, Array.Empty())) { SteamFriends.ActivateGameOverlayToUser("steamid", _steamId); } GUI.enabled = true; GUILayout.Label(Localized_BanReason, Array.Empty()); _banReason = GUILayout.TextField(_banReason, Array.Empty()).Replace("\n", " "); if (_steamId != CSteamID.Nil && _steamId != SteamUser.GetSteamID()) { if (AccessGate.IsBanned(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_Banned, WrapButton, Array.Empty()); GUI.enabled = true; } else if (GUILayout.Button(Localized_Ban, WrapButton, Array.Empty())) { AccessGate.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_Ban, WrapButton, Array.Empty()); GUI.enabled = true; } if (_steamId != CSteamID.Nil && AccessGate.IsBanned(_steamId)) { if (AccessGate.IsIgnored(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoredBan, WrapButton, Array.Empty()); GUI.enabled = true; } else if (GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty())) { AccessGate.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty()); GUI.enabled = true; } GUILayout.Space(4f); if (_steamId != CSteamID.Nil && _steamId != SteamUser.GetSteamID()) { if (AccessGate.IsAllowed(_steamId, checkFriends: false)) { if (GUILayout.Button(Localized_Unallow, WrapButton, Array.Empty())) { AccessGate.UnallowScout(_steamId); } } else if (GUILayout.Button(Localized_Allow, WrapButton, Array.Empty())) { AccessGate.AllowScout(_steamId); } } else { GUI.enabled = false; GUILayout.Button(Localized_Allow, WrapButton, Array.Empty()); GUI.enabled = true; } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } public static void SubWindows() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown ((Rect)(ref _photonRect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width; ((Rect)(ref _photonRect)).y = ((Rect)(ref rect)).y; ((Rect)(ref _steamRect)).x = ((Rect)(ref _photonRect)).x + ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).y = ((Rect)(ref _photonRect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect photonRect = _photonRect; object obj = <>O.<0>__DrawPhotonWindow; if (obj == null) { WindowFunction val = DrawPhotonWindow; <>O.<0>__DrawPhotonWindow = val; obj = (object)val; } _photonRect = GUI.Window(controlID, photonRect, (WindowFunction)obj, Localized_PhotonScouts); ((Rect)(ref rect)).x = ((Rect)(ref _photonRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _photonRect)).y; ((Rect)(ref _steamRect)).x = ((Rect)(ref _photonRect)).x + ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).y = ((Rect)(ref _photonRect)).y; int controlID2 = GUIUtility.GetControlID((FocusType)2); Rect steamRect = _steamRect; object obj2 = <>O.<1>__DrawSteamWindow; if (obj2 == null) { WindowFunction val2 = DrawSteamWindow; <>O.<1>__DrawSteamWindow = val2; obj2 = (object)val2; } _steamRect = GUI.Window(controlID2, steamRect, (WindowFunction)obj2, Localized_SteamScouts); ((Rect)(ref _photonRect)).x = ((Rect)(ref _steamRect)).x - ((Rect)(ref _photonRect)).width; ((Rect)(ref _photonRect)).y = ((Rect)(ref _steamRect)).y; ((Rect)(ref rect)).x = ((Rect)(ref _photonRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _photonRect)).y; } private static void DrawPhotonWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Invalid comparison between Unknown and I4 //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _photonRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _photonRect)).height - 28f - 25f) }); if (!PhotonNetwork.InRoom) { GUILayout.Label(Localized_NotInPhotonRoom, Array.Empty()); } else { Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { GUILayout.BeginHorizontal(Array.Empty()); if (PhotonNetwork.LocalPlayer.ActorNumber == val.ActorNumber) { Vector2 val2 = GUI.skin.label.CalcSize(new GUIContent(Localized_You)); GUILayout.Label(Localized_You, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(Mathf.Min(val2.x + 3f, 80f)) }); } if (GUILayout.Button($"#{val.ActorNumber}: {val.NickName}", WrapButton, Array.Empty())) { _photonActorNumber = val.ActorNumber; } GUILayout.EndHorizontal(); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref _photonRect)).width - 30f, ((Rect)(ref _photonRect)).height - 30f, 25f, 25f); Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(((Rect)(ref _photonRect)).width - 27f, ((Rect)(ref _photonRect)).height - 27f, 19f, 19f); GUI.Box(val4, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizingPhoton) { if (Mouse.current.leftButton.isPressed) { Vector2 val5 = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); val5.y = (float)Screen.height - val5.y; Vector2 val6 = val5 - _resizePhotonStartPos; ((Rect)(ref _photonRect)).width = Mathf.Max(_resizePhotonStartSize.x + val6.x, 300f); ((Rect)(ref _photonRect)).height = Mathf.Max(_resizePhotonStartSize.y + val6.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizingPhoton = false; ((Rect)(ref _steamRect)).width = ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).height = ((Rect)(ref _photonRect)).height; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val3)).Contains(mousePosition)) { _resizingPhoton = true; _resizePhotonStartPos = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); _resizePhotonStartPos.y = (float)Screen.height - _resizePhotonStartPos.y; _resizePhotonStartSize = new Vector2(((Rect)(ref _photonRect)).width, ((Rect)(ref _photonRect)).height); Event.current.Use(); } } GUI.DragWindow(); } private static void DrawSteamWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Invalid comparison between Unknown and I4 //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _steamRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _steamRect)).height - 28f - 25f) }); CSteamID lobbySteamId = GameHandler.GetService().LobbySteamId; if (lobbySteamId == CSteamID.Nil) { GUILayout.Label(Localized_NotInSteamLobby, Array.Empty()); } else { int numLobbyMembers = SteamMatchmaking.GetNumLobbyMembers(lobbySteamId); for (int i = 0; i < numLobbyMembers; i++) { CSteamID lobbyMemberByIndex = SteamMatchmaking.GetLobbyMemberByIndex(lobbySteamId, i); GUILayout.BeginHorizontal(Array.Empty()); if (SteamUser.GetSteamID() == lobbyMemberByIndex) { Vector2 val = GUI.skin.label.CalcSize(new GUIContent(Localized_You)); GUILayout.Label(Localized_You, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(Mathf.Min(val.x + 3f, 80f)) }); } if (GUILayout.Button($"{lobbyMemberByIndex.m_SteamID}: {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}", WrapButton, Array.Empty())) { _steamId = lobbyMemberByIndex; } GUILayout.EndHorizontal(); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _steamRect)).width - 30f, ((Rect)(ref _steamRect)).height - 30f, 25f, 25f); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref _steamRect)).width - 27f, ((Rect)(ref _steamRect)).height - 27f, 19f, 19f); GUI.Box(val3, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizingSteam) { if (Mouse.current.leftButton.isPressed) { Vector2 val4 = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); val4.y = (float)Screen.height - val4.y; Vector2 val5 = val4 - _resizeSteamStartPos; ((Rect)(ref _steamRect)).width = Mathf.Max(_resizeSteamStartSize.x + val5.x, 300f); ((Rect)(ref _steamRect)).height = Mathf.Max(_resizeSteamStartSize.y + val5.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizingSteam = false; ((Rect)(ref _photonRect)).width = ((Rect)(ref _steamRect)).width; ((Rect)(ref _photonRect)).height = ((Rect)(ref _steamRect)).height; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val2)).Contains(mousePosition)) { _resizingSteam = true; _resizeSteamStartPos = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); _resizeSteamStartPos.y = (float)Screen.height - _resizeSteamStartPos.y; _resizeSteamStartSize = new Vector2(((Rect)(ref _steamRect)).width, ((Rect)(ref _steamRect)).height); Event.current.Use(); } } GUI.DragWindow(); } } private static class FirstClassGui { [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawSeatingWindow; } public static Rect rect = new Rect(0f, 0f, 320f, -1f); private static Rect _seatingRect = new Rect(0f, 0f, 400f, 600f); private static bool _resizing = false; private static Vector2 _resizeStartPos = Vector2.zero; private static Vector2 _resizeStartSize = Vector2.zero; private static Vector2 _scroll = new Vector2(0f, 0f); private static ulong _steamId = 0uL; [Localized("GuiFirstClass", "Enable", "Enable", "The enable text for First Class.", null)] private static string Localized_Enable { get; set; } [Localized("GuiFirstClass", "Disable", "Disable", "The disable text for First Class.", null)] private static string Localized_Disable { get; set; } [Localized("GuiFirstClass", "AllowFriends", "Allow Friends", "The allow friends text for First Class.", null)] private static string Localized_AllowFriends { get; set; } [Localized("GuiFirstClass", "DisallowFriends", "Disallow Friends", "The disallow friends text for First Class.", null)] private static string Localized_DisallowFriends { get; set; } [Localized("GuiNoFlyList", "AllowedScoutInfoNone", "First Class Scout: None", "Shown when no allowed scout is selected.", null)] private static string Localized_AllowedScoutInfoNone { get; set; } [Localized("GuiFirstClass", "None", "None", "Generic None label when no allowed scout is selected.", null)] private static string Localized_None { get; set; } [Localized("GuiFirstClass", "Unallow", "Unallow", "Unallow the selected scout.", null)] private static string Localized_Unallow { get; set; } [Localized("GuiFirstClass", "OpenFirstClassTxt", "Open first-class.txt", "Opens the first-class.txt file in file explorer.", null)] private static string Localized_OpenFirstClassTxt { get; set; } [Localized("GuiFirstClass", "FirstClassSeating", "First Class Seating", "The title of the First Class section of the First Class GUI.", null)] private static string Localized_FirstClassSeating { get; set; } [Localized("GuiFirstClass", "AllowedScoutInfo", "First Class Scout: {0}", "Displays the currently selected allowed scout's Steam ID.", null)] private static string Localized_AllowedScoutInfo(ulong steamId) { return Localization.GetText("GuiNoFlyList_AllowedScoutInfo", steamId); } public static void DrawGui(int _) { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Invalid comparison between Unknown and I4 //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty()); GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(FirstClass.Enabled ? Localized_Disable : Localized_Enable, WrapButton, Array.Empty())) { FirstClass.TryToggle(); } GUI.enabled = FirstClass.Enabled; if (GUILayout.Button(FirstClass.FriendsEnabled ? Localized_DisallowFriends : Localized_AllowFriends, WrapButton, Array.Empty())) { FirstClass.TryToggleFriends(); } GUI.enabled = true; GUILayout.Space(8f); if (_steamId != 0L && !AccessGate.IsAllowed(new CSteamID(_steamId), checkFriends: false)) { _steamId = 0uL; } if (_steamId != 0L) { GUILayout.Label(Localized_AllowedScoutInfo(_steamId), Array.Empty()); } else { GUILayout.Label(Localized_AllowedScoutInfoNone, Array.Empty()); } GUILayout.Label((_steamId != 0L) ? AccessGate.allowedScouts[_steamId] : Localized_None, Array.Empty()); if (_steamId != 0L) { if (GUILayout.Button(Localized_Unallow, WrapButton, Array.Empty())) { AccessGate.UnbanScout(new CSteamID(_steamId)); } } else { GUI.enabled = false; GUILayout.Button(Localized_Unallow, WrapButton, Array.Empty()); GUI.enabled = true; } GUILayout.Space(8f); if (GUILayout.Button(Localized_OpenFirstClassTxt, WrapButton, Array.Empty())) { Application.OpenURL(Path.Combine(Paths.BepInExRootPath, "first-class.txt").Replace('/', '\\')); } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } public static void SubWindow() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown ((Rect)(ref _seatingRect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width; ((Rect)(ref _seatingRect)).y = ((Rect)(ref rect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect seatingRect = _seatingRect; object obj = <>O.<0>__DrawSeatingWindow; if (obj == null) { WindowFunction val = DrawSeatingWindow; <>O.<0>__DrawSeatingWindow = val; obj = (object)val; } _seatingRect = GUI.Window(controlID, seatingRect, (WindowFunction)obj, Localized_FirstClassSeating); ((Rect)(ref rect)).x = ((Rect)(ref _seatingRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _seatingRect)).y; } private static void DrawSeatingWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _seatingRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _seatingRect)).height - 28f - 25f) }); bool flag = false; foreach (ulong key in AccessGate.allowedScouts.Keys) { if (flag) { GUILayout.Space(8f); } flag = true; if (GUILayout.Button(key.ToString(), WrapButton, Array.Empty())) { _steamId = key; } GUILayout.Label(AccessGate.allowedScouts[key], Array.Empty()); } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _seatingRect)).width - 30f, ((Rect)(ref _seatingRect)).height - 30f, 25f, 25f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _seatingRect)).width - 27f, ((Rect)(ref _seatingRect)).height - 27f, 19f, 19f); GUI.Box(val2, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizing) { if (Mouse.current.leftButton.isPressed) { Vector2 val3 = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); val3.y = (float)Screen.height - val3.y; Vector2 val4 = val3 - _resizeStartPos; ((Rect)(ref _seatingRect)).width = Mathf.Max(_resizeStartSize.x + val4.x, 300f); ((Rect)(ref _seatingRect)).height = Mathf.Max(_resizeStartSize.y + val4.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizing = false; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val)).Contains(mousePosition)) { _resizing = true; _resizeStartPos = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); _resizeStartPos.y = (float)Screen.height - _resizeStartPos.y; _resizeStartSize = new Vector2(((Rect)(ref _seatingRect)).width, ((Rect)(ref _seatingRect)).height); Event.current.Use(); } } GUI.DragWindow(); } } private static class NoFlyListGui { [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawListWindow; } public static Rect rect = new Rect(0f, 0f, 320f, -1f); private static Rect _listRect = new Rect(0f, 0f, 400f, 600f); private static bool _resizing = false; private static Vector2 _resizeStartPos = Vector2.zero; private static Vector2 _resizeStartSize = Vector2.zero; private static Vector2 _scroll = new Vector2(0f, 0f); private static ulong _steamId = 0uL; [Localized("GuiNoFlyList", "BannedScoutInfoNone", "Banned Scout: None", "Shown when no banned scout is selected.", null)] private static string Localized_BannedScoutInfoNone { get; set; } [Localized("GuiNoFlyList", "None", "None", "Generic None label when no banned scout is selected.", null)] private static string Localized_None { get; set; } [Localized("GuiNoFlyList", "Unban", "Unban", "Unban the selected scout.", null)] private static string Localized_Unban { get; set; } [Localized("GuiNoFlyList", "OpenBannedTxt", "Open banned.txt", "Opens the banned.txt file in file explorer.", null)] private static string Localized_OpenBannedTxt { get; set; } [Localized("GuiNoFlyList", "TheNoFlyList", "The No Fly List", "The title of the No Fly List section of the No Fly List GUI.", null)] private static string Localized_TheNoFlyList { get; set; } [Localized("GuiNoFlyList", "BannedScoutInfo", "Banned Scout: {0}", "Displays the currently selected banned scout's Steam ID.", null)] private static string Localized_BannedScoutInfo(ulong steamId) { return Localization.GetText("GuiNoFlyList_BannedScoutInfo", steamId); } public static void DrawGui(int _) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Invalid comparison between Unknown and I4 //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty()); if (_steamId != 0L && !AccessGate.IsBanned(new CSteamID(_steamId))) { _steamId = 0uL; } if (_steamId != 0L) { GUILayout.Label(Localized_BannedScoutInfo(_steamId), Array.Empty()); } else { GUILayout.Label(Localized_BannedScoutInfoNone, Array.Empty()); } GUILayout.Label((_steamId != 0L) ? AccessGate.bannedScouts[_steamId] : Localized_None, Array.Empty()); if (_steamId != 0L) { if (GUILayout.Button(Localized_Unban, WrapButton, Array.Empty())) { AccessGate.UnbanScout(new CSteamID(_steamId)); } } else { GUI.enabled = false; GUILayout.Button(Localized_Unban, WrapButton, Array.Empty()); GUI.enabled = true; } GUILayout.Space(8f); if (GUILayout.Button(Localized_OpenBannedTxt, WrapButton, Array.Empty())) { Application.OpenURL(Path.Combine(Paths.BepInExRootPath, "banned.txt").Replace('/', '\\')); } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } public static void SubWindow() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown ((Rect)(ref _listRect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width; ((Rect)(ref _listRect)).y = ((Rect)(ref rect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect listRect = _listRect; object obj = <>O.<0>__DrawListWindow; if (obj == null) { WindowFunction val = DrawListWindow; <>O.<0>__DrawListWindow = val; obj = (object)val; } _listRect = GUI.Window(controlID, listRect, (WindowFunction)obj, Localized_TheNoFlyList); ((Rect)(ref rect)).x = ((Rect)(ref _listRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _listRect)).y; } private static void DrawListWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _listRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _listRect)).height - 28f - 25f) }); bool flag = false; foreach (ulong key in AccessGate.bannedScouts.Keys) { if (flag) { GUILayout.Space(8f); } flag = true; if (GUILayout.Button(key.ToString(), WrapButton, Array.Empty())) { _steamId = key; } GUILayout.Label(AccessGate.bannedScouts[key], Array.Empty()); } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _listRect)).width - 30f, ((Rect)(ref _listRect)).height - 30f, 25f, 25f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _listRect)).width - 27f, ((Rect)(ref _listRect)).height - 27f, 19f, 19f); GUI.Box(val2, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizing) { if (Mouse.current.leftButton.isPressed) { Vector2 val3 = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); val3.y = (float)Screen.height - val3.y; Vector2 val4 = val3 - _resizeStartPos; ((Rect)(ref _listRect)).width = Mathf.Max(_resizeStartSize.x + val4.x, 300f); ((Rect)(ref _listRect)).height = Mathf.Max(_resizeStartSize.y + val4.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizing = false; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val)).Contains(mousePosition)) { _resizing = true; _resizeStartPos = ((InputControl)(object)((Pointer)Mouse.current).position).ReadValue(); _resizeStartPos.y = (float)Screen.height - _resizeStartPos.y; _resizeStartSize = new Vector2(((Rect)(ref _listRect)).width, ((Rect)(ref _listRect)).height); Event.current.Use(); } } GUI.DragWindow(); } } private static class ConfigGui { public static Rect rect = new Rect(0f, 0f, 320f, -1f); [Localized("GuiConfig", "Locale", "Locale/Language", "The locale to use.", null)] private static string Localized_Locale { get; set; } [Localized("GuiConfig", "CharacterPhysicsOptimizationMode", "Character Physics Optimization Mode", "The name of the Character Physics Optimization Mode section of the Config GUI.", null)] private static string Localized_CharacterPhysicsOptimizationMode { get; set; } [Localized("GuiConfig", "LateJoinAntiFlingMode", "Late Join Anti Fling Mode", "The name of the Late Join Anti Fling Mode section of the Config GUI.", null)] private static string Localized_LateJoinAntiFlingMode { get; set; } [Localized("GuiConfig", "CheatDetections", "Cheat Detections", "The name of the Cheat Detections section of the Config GUI.", null)] private static string Localized_CheatDetections { get; set; } [Localized("GuiConfig", "AutoKickAtlasCherry", "Automatically Kick Atlas and Cherry Users", "The name of the Automatically Kick Atlas and Cherry Users section of the Config GUI.", null)] private static string Localized_AutoKickAtlasCherry { get; set; } [Localized("GuiConfig", "Enabled", "Enabled", "The Enabled state of a setting of the Config GUI.", null)] private static string Localized_Enabled { get; set; } [Localized("GuiConfig", "Disabled", "Disabled", "The Disabled state of a setting of the Config GUI.", null)] private static string Localized_Disabled { get; set; } [Localized("GuiConfig", "MaxScouts", "Max Scouts - {0}", "Displays the current maximum number of scouts.", "LateJoinAntiFlingMode")] private static string Localized_MaxScouts(int maxScouts) { return Localization.GetText("GuiConfig_MaxScouts", maxScouts); } public static void DrawGui(int _) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0459: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_04b2: Unknown result type (might be due to invalid IL or missing references) //IL_04b7: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_05d7: Unknown result type (might be due to invalid IL or missing references) //IL_05dd: Invalid comparison between Unknown and I4 //IL_05e4: Unknown result type (might be due to invalid IL or missing references) //IL_05e9: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4 }; GUILayout.BeginVertical(Array.Empty()); GUILayout.Label(Localized_Locale, Array.Empty()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); HashSet hashSet = new HashSet(); hashSet.Add("en-US"); foreach (string item in from file in Directory.GetFiles(Localization.FullDirectory, "locale.*-*.cfg") select Path.GetFileName(file).Split('.')[1]) { hashSet.Add(item); } string[] array = hashSet.ToArray(); lock (Localization.localeEntryLock) { int num = Array.IndexOf(array, Localization.localeEntry.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num = (num - 1 + array.Length) % array.Length; } GUILayout.Label(Localization.Localized_Name, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num = (num + 1) % array.Length; } Localization.localeEntry.Value = array[num]; } GUILayout.EndHorizontal(); GUILayout.Label(Localized_CharacterPhysicsOptimizationMode, Array.Empty()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); CharacterPhysicsOptimizationMode[] array2 = (CharacterPhysicsOptimizationMode[])Enum.GetValues(typeof(CharacterPhysicsOptimizationMode)); int num2 = Array.IndexOf(array2, ClientImprovements.characterPhysicsOptimizationMode.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num2 = (num2 - 1 + array2.Length) % array2.Length; } GUILayout.Label(Localization.GetText(ClientImprovements.characterPhysicsOptimizationMode.Value), val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num2 = (num2 + 1) % array2.Length; } ClientImprovements.characterPhysicsOptimizationMode.Value = array2[num2]; foreach (Character allCharacter in Character.AllCharacters) { if ((Object)(object)allCharacter == (Object)(object)Character.localCharacter || allCharacter.view.IsMine || (ClientImprovements.characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead && allCharacter.data.dead) || allCharacter.data.isCarried) { continue; } foreach (BodypartType key in allCharacter.refs.ragdoll.partDict.Keys) { ((Collider)allCharacter.refs.ragdoll.partDict[key].colliders[0].col).enabled = true; } } GUILayout.EndHorizontal(); GUILayout.Label(Localized_LateJoinAntiFlingMode, Array.Empty()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); LateJoinAntiFlingMode[] array3 = (LateJoinAntiFlingMode[])Enum.GetValues(typeof(LateJoinAntiFlingMode)); int num3 = Array.IndexOf(array3, ClientImprovements.lateJoinAntiFlingMode.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num3 = (num3 - 1 + array3.Length) % array3.Length; } GUILayout.Label(Localization.GetText(ClientImprovements.lateJoinAntiFlingMode.Value), val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num3 = (num3 + 1) % array3.Length; } ClientImprovements.lateJoinAntiFlingMode.Value = array3[num3]; GUILayout.EndHorizontal(); int value = MoreScouts.maxScouts.Value; int[] obj = new int[3] { 1, 0, 0 }; Room currentRoom = PhotonNetwork.CurrentRoom; obj[1] = ((currentRoom != null) ? currentRoom.PlayerCount : (-1)); obj[2] = SteamMatchmaking.GetNumLobbyMembers(GameHandler.Initialized ? GameHandler.GetService().LobbySteamId : CSteamID.Nil); int num4 = Mathf.Max(obj); GUILayout.Label(Localized_MaxScouts(value), Array.Empty()); int num5 = (int)GUILayout.HorizontalSlider((float)value, (float)num4, 30f, Array.Empty()); if (value != num5) { MoreScouts.maxScouts.Value = num5; if (GameHandler.Initialized && GameHandler.GetService().LobbySteamId != CSteamID.Nil) { SteamMatchmaking.SetLobbyMemberLimit(GameHandler.GetService().LobbySteamId, num5); } if (PhotonNetwork.CurrentRoom != null) { PhotonNetwork.CurrentRoom.MaxPlayers = num5; } } GUILayout.Label(Localized_CheatDetections, Array.Empty()); if (GUILayout.Button(PEAKER.CheatDetections.detectionsEnabled.Value ? Localized_Enabled : Localized_Disabled, Array.Empty())) { PEAKER.CheatDetections.detectionsEnabled.Value = !PEAKER.CheatDetections.detectionsEnabled.Value; ((Behaviour)PEAKER.CheatDetections).enabled = PEAKER.CheatDetections.detectionsEnabled.Value; } GUILayout.Label(Localized_AutoKickAtlasCherry, Array.Empty()); GUI.enabled = PEAKER.CheatDetections.detectionsEnabled.Value; if (GUILayout.Button(PEAKER.CheatDetections.autoKickAtlasCherry.Value ? Localized_Enabled : Localized_Disabled, Array.Empty())) { PEAKER.CheatDetections.autoKickAtlasCherry.Value = !PEAKER.CheatDetections.autoKickAtlasCherry.Value; } GUI.enabled = true; GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } } [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawGui; public static WindowFunction <1>__DrawGui; public static WindowFunction <2>__DrawGui; public static WindowFunction <3>__DrawGui; public static WindowFunction <4>__DrawGui; } private Key _key; private static bool _open; private Rect _rect = new Rect(20f, 20f, 140f, -1f); private Guis _current; private static GUIStyle _wrapButton; private static GUIStyle _windowTitleWrapped; private static GUIStyle WrapButton { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown object obj = _wrapButton; if (obj == null) { GUIStyle val = new GUIStyle(GUI.skin.button) { wordWrap = true, alignment = (TextAnchor)4, fixedHeight = 0f }; _wrapButton = val; obj = (object)val; } return (GUIStyle)obj; } } private static GUIStyle WindowTitleWrapped { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown object obj = _windowTitleWrapped; if (obj == null) { GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = GUI.skin.window.fontSize, fontStyle = (FontStyle)1, alignment = (TextAnchor)1, wordWrap = true }; _windowTitleWrapped = val; obj = (object)val; } return (GUIStyle)obj; } } [Localized("Gui", "Actions", "Actions", "The name of the Actions tab in the PEAKER GUI.", null)] private static string Localized_Actions { get; set; } [Localized("Gui", "Scouts", "Scouts", "The name of the Scouts tab in the PEAKER GUI.", null)] private static string Localized_Scouts { get; set; } [Localized("Gui", "FirstClass", "First Class", "The name of the First Class tab in the PEAKER GUI.", null)] private static string Localized_FirstClass { get; set; } [Localized("Gui", "NoFlyList", "No Fly List", "The name of the No Fly List tab in the PEAKER GUI.", null)] private static string Localized_NoFlyList { get; set; } [Localized("Gui", "Config", "Config", "The name of the Config tab in the PEAKER GUI.", null)] private static string Localized_Config { get; set; } [Localized("GuiTitle", "Main", "PEAKER GUI", "The main title of the PEAKER GUI.", null)] private static string Localized_MainTitle { get; set; } [Localized("GuiTitle", "Actions", "Actions GUI", "The title of the Actions tab in the PEAKER GUI.", null)] private static string Localized_ActionsTitle { get; set; } [Localized("GuiTitle", "Scouts", "Scouts GUI", "The title of the Scouts tab in the PEAKER GUI.", null)] private static string Localized_ScoutsTitle { get; set; } [Localized("GuiTitle", "FistClass", "First Class GUI", "The title of the First Class tab in the PEAKER GUI.", null)] private static string Localized_FirstClassTitle { get; set; } [Localized("GuiTitle", "NoFlyList", "No Fly List GUI", "The title of the No Fly List tab in the PEAKER GUI.", null)] private static string Localized_NoFlyListTitle { get; set; } [Localized("GuiTitle", "Config", "Config GUI", "The title of the Config tab in the PEAKER GUI.", null)] private static string Localized_ConfigTitle { get; set; } internal void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) _key = PEAKER.Config.Bind(new ConfigDefinition("Keybinds", "GUIKey"), (Key)102, new ConfigDescription("The key used to toggle the PEAKER GUI. (Client)", (AcceptableValueBase)null, Array.Empty())).Value; PEAKER.Patches.PatchAll(typeof(Gui)); } internal void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) if ((int)_key != 0 && ((ButtonControl)Keyboard.current[_key]).wasPressedThisFrame) { _open = !_open; if (_open) { AccessGate.UpdateBannedScouts(); } } } internal void OnGUI() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_0285: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Unknown result type (might be due to invalid IL or missing references) //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Expected O, but got Unknown //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_029f: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: Expected O, but got Unknown //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_033c: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_0347: Expected O, but got Unknown if (!_open) { return; } _rect = GUI.Window(GUIUtility.GetControlID((FocusType)2), _rect, new WindowFunction(DrawGui), Localized_MainTitle); switch (_current) { case Guis.Actions: { ((Rect)(ref ActionsGui.rect)).x = ((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width; ((Rect)(ref ActionsGui.rect)).y = ((Rect)(ref _rect)).y; int controlID3 = GUIUtility.GetControlID((FocusType)2); Rect rect3 = ActionsGui.rect; object obj3 = <>O.<0>__DrawGui; if (obj3 == null) { WindowFunction val3 = ActionsGui.DrawGui; <>O.<0>__DrawGui = val3; obj3 = (object)val3; } ActionsGui.rect = GUI.Window(controlID3, rect3, (WindowFunction)obj3, Localized_ActionsTitle); ((Rect)(ref _rect)).x = ((Rect)(ref ActionsGui.rect)).x - ((Rect)(ref _rect)).width; ((Rect)(ref _rect)).y = ((Rect)(ref ActionsGui.rect)).y; break; } case Guis.Scouts: { ((Rect)(ref ScoutsGui.rect)).x = ((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width; ((Rect)(ref ScoutsGui.rect)).y = ((Rect)(ref _rect)).y; ScoutsGui.SubWindows(); int controlID5 = GUIUtility.GetControlID((FocusType)2); Rect rect5 = ScoutsGui.rect; object obj5 = <>O.<1>__DrawGui; if (obj5 == null) { WindowFunction val5 = ScoutsGui.DrawGui; <>O.<1>__DrawGui = val5; obj5 = (object)val5; } ScoutsGui.rect = GUI.Window(controlID5, rect5, (WindowFunction)obj5, Localized_ScoutsTitle); ((Rect)(ref _rect)).x = ((Rect)(ref ScoutsGui.rect)).x - ((Rect)(ref _rect)).width; ((Rect)(ref _rect)).y = ((Rect)(ref ScoutsGui.rect)).y; break; } case Guis.FirstClass: { ((Rect)(ref FirstClassGui.rect)).x = ((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width; ((Rect)(ref FirstClassGui.rect)).y = ((Rect)(ref _rect)).y; FirstClassGui.SubWindow(); int controlID2 = GUIUtility.GetControlID((FocusType)2); Rect rect2 = FirstClassGui.rect; object obj2 = <>O.<2>__DrawGui; if (obj2 == null) { WindowFunction val2 = FirstClassGui.DrawGui; <>O.<2>__DrawGui = val2; obj2 = (object)val2; } FirstClassGui.rect = GUI.Window(controlID2, rect2, (WindowFunction)obj2, Localized_FirstClassTitle); ((Rect)(ref _rect)).x = ((Rect)(ref FirstClassGui.rect)).x - ((Rect)(ref _rect)).width; ((Rect)(ref _rect)).y = ((Rect)(ref FirstClassGui.rect)).y; break; } case Guis.NoFlyList: { ((Rect)(ref NoFlyListGui.rect)).x = ((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width; ((Rect)(ref NoFlyListGui.rect)).y = ((Rect)(ref _rect)).y; NoFlyListGui.SubWindow(); int controlID4 = GUIUtility.GetControlID((FocusType)2); Rect rect4 = NoFlyListGui.rect; object obj4 = <>O.<3>__DrawGui; if (obj4 == null) { WindowFunction val4 = NoFlyListGui.DrawGui; <>O.<3>__DrawGui = val4; obj4 = (object)val4; } NoFlyListGui.rect = GUI.Window(controlID4, rect4, (WindowFunction)obj4, Localized_NoFlyListTitle); ((Rect)(ref _rect)).x = ((Rect)(ref NoFlyListGui.rect)).x - ((Rect)(ref _rect)).width; ((Rect)(ref _rect)).y = ((Rect)(ref NoFlyListGui.rect)).y; break; } case Guis.Config: { ((Rect)(ref ConfigGui.rect)).x = ((Rect)(ref _rect)).x + ((Rect)(ref _rect)).width; ((Rect)(ref ConfigGui.rect)).y = ((Rect)(ref _rect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect rect = ConfigGui.rect; object obj = <>O.<4>__DrawGui; if (obj == null) { WindowFunction val = ConfigGui.DrawGui; <>O.<4>__DrawGui = val; obj = (object)val; } ConfigGui.rect = GUI.Window(controlID, rect, (WindowFunction)obj, Localized_ConfigTitle); ((Rect)(ref _rect)).x = ((Rect)(ref ConfigGui.rect)).x - ((Rect)(ref _rect)).width; ((Rect)(ref _rect)).y = ((Rect)(ref ConfigGui.rect)).y; break; } } } private void DrawGui(int _) { //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Invalid comparison between Unknown and I4 //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty()); Guis guis = Guis.None; if (GUILayout.Button(Localized_Actions, WrapButton, Array.Empty())) { guis = Guis.Actions; } if (GUILayout.Button(Localized_Scouts, WrapButton, Array.Empty())) { guis = Guis.Scouts; if (_current != guis) { AccessGate.UpdateAllowedScouts(); AccessGate.UpdateBannedScouts(); } } if (GUILayout.Button(Localized_FirstClass, WrapButton, Array.Empty())) { guis = Guis.FirstClass; if (_current != guis) { AccessGate.UpdateAllowedScouts(); } } if (GUILayout.Button(Localized_NoFlyList, WrapButton, Array.Empty())) { guis = Guis.NoFlyList; if (_current != guis) { AccessGate.UpdateBannedScouts(); } } if (GUILayout.Button(Localized_Config, WrapButton, Array.Empty())) { guis = Guis.Config; } if (guis != 0) { if (guis == _current) { _current = Guis.None; } else { _current = guis; } } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { ref Rect rect = ref _rect; Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } [HarmonyPatch(typeof(CursorHandler), "Update")] [HarmonyPrefix] internal static bool PreCursorHandlerUpdate() { if (!_open) { return true; } Cursor.lockState = (CursorLockMode)0; Cursor.visible = true; return false; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property)] internal sealed class LocalizedAttribute : Attribute { public string Section { get; } public string Key { get; } public string DefaultText { get; } public string Description { get; } public string AfterKey { get; set; } public LocalizedAttribute(string section, string key, string defaultText, string description, string afterKey = null) { Section = section; Key = key; DefaultText = defaultText; Description = description; AfterKey = afterKey; base..ctor(); } } [AttributeUsage(AttributeTargets.Enum)] internal sealed class LocalizedEnumAttribute : Attribute { } [AttributeUsage(AttributeTargets.Field)] internal sealed class LocalizedEnumDescriptionAttribute : Attribute { public string Description { get; } public LocalizedEnumDescriptionAttribute(string description) { Description = description; base..ctor(); } } internal static class Localization { private static readonly string Directory = "lammas123.PEAKER"; internal static string FullDirectory; private static readonly object _textsLock = new object(); private static readonly Dictionary> _unsafeTexts = new Dictionary>(); private static readonly Dictionary> _texts = new Dictionary>(); private static readonly Dictionary> _defaultTexts = new Dictionary>(); private static readonly Dictionary _boundProps = new Dictionary(); private static ManualLogSource _logger; private static ConfigFile _config; private static FileSystemWatcher _watcher; private static DateTime _lastModified = DateTime.MinValue; private static ConfigFile _pluginConfig; internal static object localeEntryLock = new object(); internal static ConfigEntry localeEntry; internal static string ConfigFile { get { string text = "en-US"; lock (localeEntryLock) { if (File.Exists(Path.Combine(FullDirectory, "locale." + localeEntry.Value + ".cfg"))) { text = localeEntry.Value; } else { localeEntry.Value = text; } } return "locale." + text + ".cfg"; } } internal static string FullPath => Path.Combine(FullDirectory, ConfigFile); [Localized("Locale", "Name", "English (US)", "The name of this locale.", null)] internal static string Localized_Name { get; private set; } internal static void Init(ConfigFile pluginConfig) { //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Expected O, but got Unknown //IL_0057: Expected O, but got Unknown FullDirectory = Path.Combine(Paths.ConfigPath, Directory); _logger = Logger.CreateLogSource("PEAKER.Localization"); _pluginConfig = pluginConfig; localeEntry = _pluginConfig.Bind(new ConfigDefinition("Localization", "Locale"), "en-US", new ConfigDescription("The locale file to load strings from.", (AcceptableValueBase)null, Array.Empty())); localeEntry.SettingChanged += LocaleEntryChanged; _pluginConfig.Save(); DiscoverDefaults(); LoadConfig(FullPath); _watcher = new FileSystemWatcher(FullDirectory, "locale.*-*.cfg") { NotifyFilter = NotifyFilters.LastWrite }; _watcher.Created += LocaleFileModified; _watcher.Changed += LocaleFileModified; _watcher.Deleted += LocaleFileModified; _watcher.EnableRaisingEvents = true; } private static void DiscoverDefaults() { Assembly executingAssembly = Assembly.GetExecutingAssembly(); Dictionary localizedAfter = new Dictionary(); Type[] types = executingAssembly.GetTypes(); foreach (Type type in types) { Check(type); if (type.IsEnum) { CheckEnum(type); continue; } MemberInfo[] members = type.GetMembers(BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); for (int j = 0; j < members.Length; j++) { Check(members[j]); } localizedAfter.Clear(); } void Check(MemberInfo member) { LocalizedAttribute customAttribute = member.GetCustomAttribute(); if (customAttribute != null) { if (member is MethodInfo && customAttribute.AfterKey != null && !localizedAfter.TryGetValue(customAttribute.AfterKey, out var _)) { localizedAfter[customAttribute.AfterKey] = member; } else { if (!_defaultTexts.TryGetValue(customAttribute.Section, out var value3)) { value3 = new List<(string, string, string)>(); _defaultTexts[customAttribute.Section] = value3; } value3.Add((customAttribute.Key, customAttribute.DefaultText, customAttribute.Description)); if (member is PropertyInfo propertyInfo && propertyInfo.CanWrite && propertyInfo.PropertyType == typeof(string)) { _boundProps.Add(customAttribute.Section + "_" + customAttribute.Key, propertyInfo); } if (localizedAfter.TryGetValue(customAttribute.Key, out var value4)) { Check(value4); localizedAfter.Remove(customAttribute.Key); } } } } static void CheckEnum(Type enumType) { if (enumType.GetCustomAttribute() != null) { string name = enumType.Name; if (!_defaultTexts.TryGetValue(name, out var value)) { value = new List<(string, string, string)>(); _defaultTexts[name] = value; } FieldInfo[] fields = enumType.GetFields(BindingFlags.Static | BindingFlags.Public); foreach (FieldInfo fieldInfo in fields) { string text = fieldInfo.GetCustomAttribute()?.Description; if (text == null) { _logger.LogWarning((object)("Localized enum entry '" + enumType?.FullName + "." + fieldInfo.Name + "' is missing a description!")); } else { value.Add((fieldInfo.Name, fieldInfo.Name, text)); } } } } } private static void LocaleEntryChanged(object sender, EventArgs e) { lock (localeEntryLock) { _logger.LogInfo((object)("Locale changed! " + localeEntry.Value)); if (!File.Exists(FullPath)) { localeEntry.Value = "en-US"; _pluginConfig.Save(); } _watcher.EnableRaisingEvents = false; LoadConfig(FullPath); _watcher.EnableRaisingEvents = true; } } private static void LocaleFileModified(object sender, FileSystemEventArgs e) { string fullPath = FullPath; if (!(e.FullPath != fullPath) && !((File.GetLastWriteTimeUtc(fullPath) - _lastModified).TotalMilliseconds < 250.0)) { _logger.LogInfo((object)"Locale file modified!"); _watcher.EnableRaisingEvents = false; LoadConfig(fullPath); _watcher.EnableRaisingEvents = true; } } private static void LoadConfig(string fullPath) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00a5: Expected O, but got Unknown _unsafeTexts.Clear(); _config = new ConfigFile(fullPath, false) { SaveOnConfigSet = false }; string key; foreach (KeyValuePair> defaultText in _defaultTexts) { defaultText.Deconstruct(out key, out var value); string text = key; foreach (var item4 in value) { string item = item4.Item1; string item2 = item4.Item2; string item3 = item4.Item3; string key2 = text + "_" + item; _unsafeTexts[key2] = _config.Bind(new ConfigDefinition(text, item), item2, new ConfigDescription(item3, (AcceptableValueBase)null, Array.Empty())); if (localeEntry.Value == "en-US") { _unsafeTexts[key2].Value = item2; } if (_boundProps.TryGetValue(key2, out var value2)) { value2.SetValue(null, _unsafeTexts[key2].Value); } } } _config.Save(); _lastModified = File.GetLastWriteTimeUtc(fullPath); lock (_textsLock) { _texts.Clear(); foreach (KeyValuePair> unsafeText in _unsafeTexts) { unsafeText.Deconstruct(out key, out var value3); string key3 = key; ConfigEntry value4 = value3; _texts[key3] = value4; } } } internal static string GetText(string key, params object[] args) { lock (_textsLock) { if (!_texts.TryGetValue(key, out var value)) { PEAKER.Logger.LogWarning((object)("Failed to find the " + key + " localization string.")); PEAKER.Logger.LogWarning((object)Environment.StackTrace); return "UnsupportedLocalizationKey: " + key + " [" + string.Join(',', args) + "]"; } try { return (args.Length == 0) ? value.Value : string.Format(value.Value, args); } catch (Exception ex) { PEAKER.Logger.LogError((object)("Failed to format the " + key + " localization string: " + value.Value + " [" + string.Join(',', args) + "]")); PEAKER.Logger.LogError((object)ex); return key + " [" + string.Join(',', args) + "]"; } } } internal static string GetText(TEnum value) where TEnum : Enum { lock (_textsLock) { string name = typeof(TEnum).Name; string name2 = Enum.GetName(typeof(TEnum), value); if (name2 == null) { return $"UnsupportedEnumLocalizationKey:{name}_{value}"; } string text = name + "_" + name2; if (!_texts.TryGetValue(text, out var value2)) { return "UnsupportedLocalizationKey:" + text; } return value2.Value; } } } public class MoreScouts : MonoBehaviour { internal static ConfigEntry maxScouts; [Localized("MoreScouts", "TopLeftStatus", "{0}/{1} Scouts", "The status text displayed in the top left below the game version. 0 is number of scouts in the room, 1 is the total number of scouts that can be in the room.", null)] private static string Localized_TopLeftStatus(int currentScouts, int maxScouts) { return Localization.GetText("MoreScouts_TopLeftStatus", currentScouts, maxScouts); } [Localized("MoreScouts", "TopLeftStatusNoSteamLobby", "{0}/{1} Scouts (No Steam Lobby)", "The status text displayed in the top left below the game version, when there's no Steam lobby. 0 is number of scouts in the room, 1 is the total number of scouts that can be in the room.", null)] private static string Localized_TopLeftStatusNoSteamLobby(int currentScouts, int maxScouts) { return Localization.GetText("MoreScouts_TopLeftStatusNoSteamLobby", currentScouts, maxScouts); } internal void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0032: Expected O, but got Unknown maxScouts = PEAKER.Config.Bind(new ConfigDefinition("Host", "MaxScouts"), 20, new ConfigDescription("The maximum number of scouts that may join your lobbies. Due to the ragdoll physics of the characters, playing with around 20 scouts (and especially true with more) leads to serious lag on most CPUs trying to handle it all. The limit is set to 30, as I've been told the maximum number for scouts that can exist in one room is 30.", (AcceptableValueBase)(object)new AcceptableValueRange(1, 30), Array.Empty())); maxScouts.Value = Mathf.Clamp(maxScouts.Value, 1, 30); PEAKER.Logger.LogInfo((object)$"Set the max scouts to {maxScouts.Value}!"); PEAKER.Patches.PatchAll(typeof(MoreScouts)); } [HarmonyPatch(typeof(SteamMatchmaking), "CreateLobby")] [HarmonyPrefix] internal static void PreSteamMatchmakingCreateLobby(ref int cMaxMembers) { cMaxMembers = maxScouts.Value; PEAKER.Logger.LogInfo((object)$"Overrode SteamMatchmaking.CreateLobby cMaxMembers with {maxScouts}!"); } [HarmonyPatch(typeof(NetworkingUtilities), "HostRoomOptions")] [HarmonyPostfix] internal static void PostNetworkingUtilitiesHostRoomOptions(ref RoomOptions __result) { __result.MaxPlayers = maxScouts.Value; PEAKER.Logger.LogInfo((object)$"Overrode Peak.Network.NetworkingUtilities.HostRoomOptions MaxPlayers with {maxScouts.Value}!"); } [HarmonyPatch(typeof(VersionString), "Update")] [HarmonyPostfix] internal static void PostVersionStringUpdate(VersionString __instance) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.InRoom) { int num; int num2 = (num = SteamMatchmaking.GetLobbyMemberLimit(GameHandler.GetService().LobbySteamId)); if (num == 0) { num = PhotonNetwork.CurrentRoom.PlayerCount; } string text = ((num2 != 0) ? Localized_TopLeftStatus(PhotonNetwork.CurrentRoom.PlayerCount, num) : Localized_TopLeftStatusNoSteamLobby(PhotonNetwork.CurrentRoom.PlayerCount, num)); TextMeshProUGUI text2 = __instance.m_text; ((TMP_Text)text2).text = ((TMP_Text)text2).text + "\n" + text; } } [HarmonyPatch(typeof(Campfire), "Awake")] [HarmonyPostfix] internal static void PostCampfireAwake(Campfire __instance) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } if ((int)__instance.advanceToSegment == 0) { PEAKER.Logger.LogInfo((object)"Not spawning marshmallows for the campfire on the beach."); return; } PEAKER.Logger.LogInfo((object)$"Attempting to spawn marshmallows for the {__instance.advanceToSegment} campfire..."); int num = PhotonNetwork.CurrentRoom.PlayerCount - 4; if (num <= 0) { PEAKER.Logger.LogInfo((object)"Not enough scouts to spawn marshmallows."); return; } PEAKER.Logger.LogInfo((object)$"Spawning {num} marshmallows..."); float num2 = 360f / (float)num; Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num3 = MathF.PI / 180f * ((float)i * num2); float num4 = Random.Range(1.75f, 3f); ((Vector3)(ref val))..ctor(Mathf.Cos(num3) * num4, 2f, Mathf.Sin(num3) * num4); string name = ((Object)LootData.GetRandomItem((SpawnPool)33554432, false)).name; Vector3 groundPos = HelperFunctions.GetGroundPos(((Component)__instance).transform.position + val, (LayerType)1, 0f); PhotonNetwork.Instantiate("0_Items/" + name, groundPos, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), (byte)0, (object[])null); } } [HarmonyPatch(typeof(AudioLevels), "OnEnable")] [HarmonyPrefix] internal static void PreAudioLevelsOnEnable(AudioLevels __instance) { int count = Character.AllCharacters.Count; if (__instance.sliders.Count >= count) { return; } for (int i = 0; i < count; i++) { if (i >= __instance.sliders.Count) { __instance.sliders.Add(Object.Instantiate(__instance.sliders[0], ((Component)__instance.sliders[0]).transform.parent)); } } } [HarmonyPatch(typeof(PauseMenuMainPage), "Start")] [HarmonyPostfix] internal static void PostPauseMenuMainPageStart(PauseMenuMainPage __instance) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) GameObject gameObject = ((Component)((Component)__instance).GetComponentInChildren(true)).gameObject; RectTransform component = gameObject.GetComponent(); Transform parent = ((Transform)component).parent; GameObject val = new GameObject("AudioLevelsScrollView", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(ScrollRect) }); RectTransform component2 = val.GetComponent(); ((Transform)component2).SetParent(parent, false); component2.anchorMin = Vector2.one; component2.anchorMax = Vector2.one; component2.pivot = Vector2.one; ((Graphic)val.GetComponent()).color = new Color(0f, 0f, 0f, 0f); component2.sizeDelta = new Vector2(500f, 1080f); GameObject val2 = new GameObject("Viewport", new Type[4] { typeof(RectTransform), typeof(CanvasRenderer), typeof(Image), typeof(Mask) }); RectTransform component3 = val2.GetComponent(); ((Transform)component3).SetParent((Transform)(object)component2, false); component3.anchorMin = Vector2.zero; component3.anchorMax = Vector2.one; component3.pivot = Vector2.one * 0.5f; component3.anchoredPosition = Vector2.zero; component3.sizeDelta = Vector2.zero; val2.GetComponent().showMaskGraphic = false; ((Transform)component).SetParent((Transform)(object)component3, false); component.anchorMin = new Vector2(0f, 1f); component.anchorMax = new Vector2(0f, 1f); component.pivot = new Vector2(0f, 1f); component.anchoredPosition = new Vector2(100f, 0f); component.sizeDelta = new Vector2(350f, component.sizeDelta.y); VerticalLayoutGroup component4 = ((Component)component).GetComponent(); ((LayoutGroup)component4).padding.top = 50; ((LayoutGroup)component4).padding.bottom = 50; ContentSizeFitter obj = gameObject.AddComponent(); obj.verticalFit = (FitMode)2; obj.horizontalFit = (FitMode)0; ScrollRect component5 = val.GetComponent(); component5.content = component; component5.viewport = component3; component5.vertical = true; component5.horizontal = false; component5.movementType = (MovementType)2; component5.inertia = true; } [HarmonyPatch(typeof(UIPlayerNames), "Init")] [HarmonyPrefix] internal static void PreUIPlayerNamesInit(UIPlayerNames __instance) { if (__instance.playerNameText.Length > __instance.indexCounter) { return; } PlayerName[] array = (PlayerName[])(object)new PlayerName[__instance.indexCounter + 1]; for (int i = 0; i < array.Length; i++) { if (i < __instance.playerNameText.Length) { array[i] = __instance.playerNameText[i]; } else { array[i] = Object.Instantiate(__instance.playerNameText[0], ((Component)__instance.playerNameText[0]).transform.parent); } } __instance.playerNameText = array; } [HarmonyPatch(typeof(WaitingForPlayersUI), "Update")] [HarmonyPrefix] internal static void PreWaitingForPlayersUIUpdate(WaitingForPlayersUI __instance) { int count = Character.AllCharacters.Count; if (__instance.scoutImages.Length >= count) { return; } Image[] array = (Image[])(object)new Image[count]; for (int i = 0; i < array.Length; i++) { if (i < __instance.scoutImages.Length) { array[i] = __instance.scoutImages[i]; } else { array[i] = (((Object)(object)__instance.scoutImages[0] == (Object)null) ? null : Object.Instantiate(__instance.scoutImages[0], ((Component)__instance.scoutImages[0]).transform.parent)); } } __instance.scoutImages = array; } [HarmonyPatch(typeof(EndScreen), "Start")] [HarmonyPrefix] internal static void PreEndScreenStart(EndScreen __instance) { int count = Character.AllCharacters.Count; if (__instance.scouts.Length >= count) { return; } Image[] array = (Image[])(object)new Image[count]; Transform[] array2 = (Transform[])(object)new Transform[count]; Image[] array3 = (Image[])(object)new Image[count]; Image[] array4 = (Image[])(object)new Image[count]; EndScreenScoutWindow[] array5 = (EndScreenScoutWindow[])(object)new EndScreenScoutWindow[count]; for (int i = 0; i < array3.Length; i++) { if (i < __instance.scouts.Length) { array[i] = __instance.oldPip[i]; array2[i] = __instance.scoutLines[i]; array3[i] = __instance.scouts[i]; array4[i] = __instance.scoutsAtPeak[i]; array5[i] = __instance.scoutWindows[i]; } else { array[i] = (((Object)(object)__instance.oldPip[0] == (Object)null) ? null : Object.Instantiate(__instance.oldPip[0], ((Component)__instance.oldPip[0]).transform.parent)); array2[i] = (((Object)(object)__instance.scoutLines[0] == (Object)null) ? null : Object.Instantiate(__instance.scoutLines[0], ((Component)__instance.scoutLines[0]).transform.parent)); array3[i] = (((Object)(object)__instance.scouts[0] == (Object)null) ? null : Object.Instantiate(__instance.scouts[0], ((Component)__instance.scouts[0]).transform.parent)); array4[i] = (((Object)(object)__instance.scoutsAtPeak[0] == (Object)null) ? null : Object.Instantiate(__instance.scoutsAtPeak[0], ((Component)__instance.scoutsAtPeak[0]).transform.parent)); array5[i] = (((Object)(object)__instance.scoutWindows[0] == (Object)null) ? null : Object.Instantiate(__instance.scoutWindows[0], ((Component)__instance.scoutWindows[0]).transform.parent)); } } __instance.oldPip = array; __instance.scoutLines = array2; __instance.scouts = array3; __instance.scoutsAtPeak = array4; __instance.scoutWindows = array5; } [HarmonyPatch(typeof(PeakHandler), "SetCosmetics")] [HarmonyPostfix] internal static void PostPeakHandlerSetCosmetics(PeakHandler __instance, List characters) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) List list = characters.Where((Character character) => character.refs.stats.won).ToList(); list.Sort((Character c1, Character c2) => ((MonoBehaviourPun)c1).photonView.ViewID.CompareTo(((MonoBehaviourPun)c2).photonView.ViewID)); int num = 4; int num2 = 1; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, 0.15f); while (num < list.Count) { Transform[] array = (Transform[])(object)new Transform[4] { Object.Instantiate(((Component)__instance.cutsceneScoutRefs[0]).transform, ((Component)__instance.cutsceneScoutRefs[0]).transform.parent), Object.Instantiate(((Component)__instance.cutsceneScoutRefs[1]).transform, ((Component)__instance.cutsceneScoutRefs[1]).transform.parent), Object.Instantiate(((Component)__instance.cutsceneScoutRefs[2]).transform, ((Component)__instance.cutsceneScoutRefs[2]).transform.parent), Object.Instantiate(((Component)__instance.cutsceneScoutRefs[3]).transform, ((Component)__instance.cutsceneScoutRefs[3]).transform.parent) }; Transform obj = array[0]; obj.localPosition += val * (float)num2; Transform obj2 = array[1]; obj2.localPosition += val * (float)num2; Transform obj3 = array[2]; obj3.localPosition += val * (float)num2; Transform obj4 = array[3]; obj4.localPosition += val * (float)num2; CustomizationRefs[] array2 = (CustomizationRefs[])(object)new CustomizationRefs[4] { ((Component)array[0]).GetComponent(), ((Component)array[1]).GetComponent(), ((Component)array[2]).GetComponent(), ((Component)array[3]).GetComponent() }; EndCutsceneScoutHelper[] array3 = (EndCutsceneScoutHelper[])(object)new EndCutsceneScoutHelper[4] { ((Component)array[0]).GetComponent(), ((Component)array[1]).GetComponent(), ((Component)array[2]).GetComponent(), ((Component)array[3]).GetComponent() }; int num3 = 0; for (int i = num; i < num + 4; i++) { if (i >= list.Count) { ((Component)array2[num3]).gameObject.SetActive(false); } else { list[i].refs.customization.SetCustomizationForRef(array2[num3]); BadgeUnlocker.SetBadges(list[i], array2[num3].sashRenderer); ((Component)array2[num3]).GetComponent().audioSource = ((Component)list[i]).GetComponent().audioSource; if (list[i].IsLocal) { __instance.localMouths.Add(((Component)array2[num3]).GetComponent()); } } num3++; } if (list.Count - num <= 1) { array3[0].alone = true; } if (list.Count - num <= 2) { array3[1].alone = true; } num += 4; num2++; } } } [BepInPlugin("lammas123.PEAKER", "PEAKER", "0.4.9")] public class PEAKER : BaseUnityPlugin { internal static PEAKER Instance; internal static ManualLogSource Logger; internal static ConfigFile Config; internal static Harmony Patches; internal static CheatDetections CheatDetections; private static PlayerConnectionLog _connectionLog; private static readonly Queue<(string, bool, bool, bool)> _queuedLogs = new Queue<(string, bool, bool, bool)>(8); internal void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown Instance = this; Logger = Logger.CreateLogSource("PEAKER"); Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "lammas123.PEAKER.cfg"), true); Patches = new Harmony("lammas123.PEAKER"); Localization.Init(Config); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); CheatDetections = ((Component)this).gameObject.AddComponent(); ((Component)this).gameObject.AddComponent(); Logger.LogInfo((object)"Loaded PEAKER 0.4.9"); } internal void Update() { while (_queuedLogs.Count != 0) { var (message, onlySendOnce, sfxJoin, sfxLeave) = _queuedLogs.Peek(); if (LogVisually(message, onlySendOnce, sfxJoin, sfxLeave)) { _queuedLogs.Dequeue(); continue; } break; } } public static bool LogVisually(string message, bool onlySendOnce = false, bool sfxJoin = false, bool sfxLeave = false) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_connectionLog)) { _connectionLog = Object.FindAnyObjectByType(); } if (!Object.op_Implicit((Object)(object)_connectionLog)) { _queuedLogs.Enqueue((message, onlySendOnce, sfxJoin, sfxLeave)); return false; } StringBuilder stringBuilder = new StringBuilder(message); stringBuilder.Replace("{joinedColor}", _connectionLog.GetColorTag(_connectionLog.joinedColor)); stringBuilder.Replace("{leftColor}", _connectionLog.GetColorTag(_connectionLog.leftColor)); stringBuilder.Replace("{userColor}", _connectionLog.GetColorTag(_connectionLog.userColor)); message = stringBuilder.ToString(); if (onlySendOnce && _connectionLog.currentLog.Contains(message)) { return true; } _connectionLog.AddMessage(message); if (sfxJoin && Object.op_Implicit((Object)(object)_connectionLog.sfxJoin)) { _connectionLog.sfxJoin.Play(Vector3.zero); } if (sfxLeave && Object.op_Implicit((Object)(object)_connectionLog.sfxLeave)) { _connectionLog.sfxLeave.Play(Vector3.zero); } return true; } } public class StartKioskLock : MonoBehaviour { private static bool _startKioskLocked = true; public static bool StartKioskLocked => _startKioskLocked; [Localized("StartKioskLock", "Unlocked", "{joinedColor} The Start Kiosk is now Unlocked!", "When the Stark Kiosk is unlocked.", null)] private static string Localized_Unlocked { get; set; } [Localized("StartKioskLock", "Locked", "{joinedColor} The Start Kiosk is now Locked!", "When the Stark Kiosk is locked.", null)] private static string Localized_Locked { get; set; } internal void Awake() { PEAKER.Patches.PatchAll(typeof(StartKioskLock)); } internal void FixedUpdate() { if (!_startKioskLocked && !PhotonNetwork.InRoom) { _startKioskLocked = true; } } public static bool TryToggle() { if (!Object.op_Implicit((Object)(object)Object.FindAnyObjectByType())) { return false; } _startKioskLocked = !_startKioskLocked; PEAKER.Logger.LogInfo((object)("The Start Kiosk is now " + (_startKioskLocked ? "Locked" : "Unlocked") + "!")); PEAKER.LogVisually(_startKioskLocked ? Localized_Locked : Localized_Unlocked, onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } [HarmonyPatch(typeof(AirportCheckInKiosk), "LoadIslandMaster")] [HarmonyPrefix] internal static bool PreAirportCheckInKioskLoadIslandMaster(int ascent, ref PhotonMessageInfo info) { if (!PhotonNetwork.IsMasterClient || info.Sender == null) { return true; } PEAKER.Logger.LogInfo((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) tried to start the game on ascent {ascent}."); if (_startKioskLocked) { return info.Sender.IsMasterClient; } return true; } } public class SteamLobbyLock : MonoBehaviour { private static bool _steamLobbyLocked; public static bool SteamLobbyLocked => _steamLobbyLocked; [Localized("SteamLobbyLock", "Unlocked", "{joinedColor} The Steam Lobby is now Unlocked!", "When the Steam Lobby is unlocked.", null)] private static string Localized_Unlocked { get; set; } [Localized("SteamLobbyLock", "Locked", "{joinedColor} The Steam Lobby is now Locked!", "When the Steam Lobby is locked.", null)] private static string Localized_Locked { get; set; } internal void FixedUpdate() { if (!_steamLobbyLocked && !PhotonNetwork.InRoom) { _steamLobbyLocked = false; } } public static bool TryToggle() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) CSteamID val = (GameHandler.Initialized ? GameHandler.GetService().LobbySteamId : CSteamID.Nil); if (val == CSteamID.Nil) { return false; } _steamLobbyLocked = !_steamLobbyLocked; SteamMatchmaking.SetLobbyJoinable(val, !_steamLobbyLocked); PEAKER.Logger.LogInfo((object)("The Steam Lobby is now " + (_steamLobbyLocked ? "Locked" : "Unlocked") + "!")); PEAKER.LogVisually(_steamLobbyLocked ? Localized_Locked : Localized_Unlocked, onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } } public class Testing : MonoBehaviour { [HarmonyPatch] private static class TranspileLuggageSpawnItemRoutine { private const string TargetTypeName = "<g__SpawnItemRoutine|16_0>d"; private const string TargetMethodName = "MoveNext"; private const string StateFieldName = "<>1__state"; private const string CurrentFieldName = "<>2__current"; private const string ThisFieldName = "<>4__this"; private static MethodBase TargetMethod() { return typeof(Luggage).GetNestedType("<g__SpawnItemRoutine|16_0>d", BindingFlags.Public | BindingFlags.NonPublic).GetMethod("MoveNext", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } private static IEnumerable Transpiler(IEnumerable instructions, ILGenerator il) { //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Expected O, but got Unknown //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Expected O, but got Unknown //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019a: Expected O, but got Unknown //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Expected O, but got Unknown //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Expected O, but got Unknown //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Expected O, but got Unknown //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01ff: Expected O, but got Unknown //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Expected O, but got Unknown //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Expected O, but got Unknown //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Expected O, but got Unknown //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_0245: Expected O, but got Unknown //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Expected O, but got Unknown //IL_025d: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Expected O, but got Unknown //IL_026e: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Expected O, but got Unknown //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Expected O, but got Unknown //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Expected O, but got Unknown //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Expected O, but got Unknown //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Expected O, but got Unknown List list = instructions.ToList(); Type? nestedType = typeof(Luggage).GetNestedType("<g__SpawnItemRoutine|16_0>d", BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field = nestedType.GetField("<>1__state", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field2 = nestedType.GetField("<>2__current", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); FieldInfo field3 = nestedType.GetField("<>4__this", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); MethodInfo getSpawnSpotsMethod = typeof(Spawner).GetMethod("GetSpawnSpots", BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); int num = list.FindIndex((CodeInstruction c) => c.opcode == OpCodes.Callvirt && c.operand is MethodInfo methodInfo && methodInfo == getSpawnSpotsMethod); if (num < 0) { PEAKER.Logger.LogError((object)"TranspileLuggageSpawnItemRoutine: Spawner.GetSpawnSpots not found."); return list; } int index = num - 2; int num2 = list.FindIndex((CodeInstruction c) => c.opcode == OpCodes.Switch); if (num2 < 0) { PEAKER.Logger.LogError((object)"TranspileLuggageSpawnItemRoutine: switch not found."); return list; } Label label = il.DefineLabel(); Label item = il.DefineLabel(); Label[] first = (Label[])list[num2].operand; list[num2].operand = first.Concat(new <>z__ReadOnlySingleElementList