Decompiled source of PEAKER v0.4.6
BepInEx/plugins/PEAKER.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; 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.6.0")] [assembly: AssemblyInformationalVersion("0.4.6")] [assembly: AssemblyProduct("PEAKER")] [assembly: AssemblyTitle("PEAKER")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.4.6.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<LobbyChatUpdate_t> _onLobbyChatUpdateCallback; internal static readonly Dictionary<ulong, string> allowedScouts = new Dictionary<ulong, string>(); internal static readonly Dictionary<ulong, string> bannedScouts = new Dictionary<ulong, string>(); internal static readonly HashSet<ulong> ignoredScouts = new HashSet<ulong>(); private static CSteamID _lastSentChat; [Localized("BannedScouts", "TriedToJoinButIsBanned", "{userColor} {0} ({1})</color>{joinedColor} tried to join,</color>{leftColor} but</color>{userColor} {2} ({3})</color>{leftColor} is banned! Not letting them in...</color>", "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})</color>{joinedColor} tried to join,</color>{leftColor} but</color>{userColor} {2} ({3})</color>{leftColor} is not First Class! Not letting them in...</color>", "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_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<SteamLobbyHandler>().m_currentLobby.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<LobbyChatUpdate_t>.Create((DispatchDelegate<LobbyChatUpdate_t>)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.m_currentLobby); for (int i = 0; i < numLobbyMembers; i++) { PEAKER.Logger.LogInfo((object)$"Steam Lobby Member: '{SteamFriends.GetFriendPersonaName(SteamMatchmaking.GetLobbyMemberByIndex(__instance.m_currentLobby, i))}' ({SteamMatchmaking.GetLobbyMemberByIndex(__instance.m_currentLobby, 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.m_currentLobby); for (int i = 0; i < numLobbyMembers; i++) { CSteamID lobbyMemberByIndex = SteamMatchmaking.GetLobbyMemberByIndex(__instance.m_currentLobby, 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.m_currentLobby, array, array.Length)) { __instance.m_currentlyRequestingRoomID = Optionable<CSteamID>.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.m_currentLobby, array2, array2.Length)) { __instance.m_currentlyRequestingRoomID = Optionable<CSteamID>.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 <CheckScoutsForMods>d__36 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public CheatDetections <>4__this; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <CheckScoutsForMods>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<int> ignoredPlayerNumbers = new HashSet<int>(); internal ConfigEntry<bool> detectionsEnabled; internal ConfigEntry<bool> 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.</color>", "When cheat detections fail to enable.", null)] private static string Localized_FailedToEnable { get; set; } [Localized("CheatDetections", "ChangedPhotonName", "{userColor} {0}</color>{joinedColor} changed their Photon name!</color>", "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}</color>{joinedColor} is the new Master Client!</color>", "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}</color>{leftColor} is using the {1} mod!</color>", "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}</color>{leftColor} is the owner of the {1} mod!</color>", "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<bool>(new ConfigDefinition("Cheat Detections", "Enabled"), true, new ConfigDescription("Whether or not to enable PEAKER's cheat detections. (Client)", (AcceptableValueBase)null, Array.Empty<object>())); if (!detectionsEnabled.Value) { ((Behaviour)this).enabled = false; } autoKickAtlasCherry = PEAKER.Config.Bind<bool>(new ConfigDefinition("Cheat Detections", "AutoKickAtlasCherry"), false, new ConfigDescription("Whether or not to automatically kick scouts using Atlas or Cherry. (Host)", (AcceptableValueBase)null, Array.Empty<object>())); } 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, object>)(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<RoomInfo> roomList) { } public void OnLobbyStatisticsUpdate(List<TypedLobbyInfo> lobbyStatistics) { } [IteratorStateMachine(typeof(<CheckScoutsForMods>d__36))] private IEnumerator CheckScoutsForMods() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckScoutsForMods>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, object>)(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, object>)(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, object>)(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, object>)(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<bool> 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}</color>{leftColor} illegally slipped</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally dispersed a swarm!</color>", "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}</color>{leftColor} illegally changed a swarm's anger!</color>", "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}</color>{leftColor} illegally attached a tick to</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally triggered the helicopter!</color>", "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<PeakHandler>.Instance.summonedHelicopter || (((ItemComponent)__instance).GetData<BoolItemData>((DataEntryKey)3).Value && Singleton<MountainProgressHandler>.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}</color>{leftColor} illegally tried to extinguish the {1} campfire!</color>", "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}</color>{leftColor} illegally forced the game to end!</color>", "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!</color>"); PEAKER.LogVisually(Localized_IllegalEndGame(info.Sender.NickName), onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [Localized("CheatDetections", "IllegalKill", "{userColor} {0}</color>{leftColor} illegally killed</color>{userColor} {1}!</color>", "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}</color>{leftColor} revived</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally warped</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally initialized the ghost of</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally controlled the ghost of</color>{userColor} {1}!</color>", "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}</color>{leftColor} illegally spawned an eruption!</color>", "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}</color>{leftColor} illegally grew a magic bean!</color>", "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}</color>{leftColor} illegally started the fog!</color>", "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}</color>{leftColor} illegally synced the fog!</color>", "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}</color>{leftColor} illegally started the game!</color>", "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}</color>{leftColor} illegally loaded the airport!</color>", "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}</color>{leftColor} illegally shook a bridge!</color>", "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}</color>{leftColor} illegally made a bridge fall!</color>", "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}</color>{leftColor} illegally detached a rope!</color>", "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}</color>{leftColor} illegally shook an icicle!</color>", "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}</color>{leftColor} illegally made an icicle fall!</color>", "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}</color>{leftColor} illegally started breaking a piton!</color>", "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}</color>{leftColor} illegally broke a piton!</color>", "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}</color>{leftColor} illegally instantiated the {1} prefab!</color>", "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> characterPhysicsOptimizationMode; internal static ConfigEntry<LateJoinAntiFlingMode> 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<CharacterPhysicsOptimizationMode>(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<object>())); lateJoinAntiFlingMode = PEAKER.Config.Bind<LateJoinAntiFlingMode>(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<object>())); 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<LobbyTypeSetting>()).RegisterListener((Action<Setting>)OnLobbyTypeSettingChanged); ((Setting)GameHandler.Instance.SettingsHandler.GetSetting<LobbyTypeSetting>()).RegisterExternalListener((Action<Setting>)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 currentLobby = GameHandler.GetService<SteamLobbyHandler>().m_currentLobby; if (SteamMatchmaking.GetLobbyOwner(currentLobby) == SteamUser.GetSteamID()) { SteamMatchmaking.SetLobbyType(currentLobby, (ELobbyType)(((int)((EnumSetting<LobbyType>)(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!</color>", "When First Class is disabled.", null)] private static string Localized_Disabled { get; set; } [Localized("FirstClass", "Enabled", "{joinedColor} First Class is now Enabled!</color>", "When First Class is enabled.", null)] private static string Localized_Enabled { get; set; } [Localized("FirstClass", "FriendsDisallowed", "{joinedColor} Friends are no longer First Class!</color>", "When First Class is disabled.", null)] private static string Localized_FriendsDisallowed { get; set; } [Localized("FirstClass", "FriendsAllowed", "{joinedColor} Friends are now First Class!</color>", "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<SteamLobbyHandler>().m_currentLobby : 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<SteamLobbyHandler>().m_currentLobby : 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_005c: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: 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_0087: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Invalid comparison between Unknown and I4 //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0226: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(StartKioskLock.StartKioskLocked ? Localized_UnlockStartKiosk : Localized_LockStartKiosk, WrapButton, Array.Empty<GUILayoutOption>())) { StartKioskLock.TryToggle(); } if (GUILayout.Button(Localized_LightNearbyCampfire, WrapButton, Array.Empty<GUILayoutOption>())) { Vector3 center = Character.localCharacter.Center; Campfire[] array = Object.FindObjectsByType<Campfire>((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("SetFireWoodCount", (RpcTarget)0, new object[1] { 3 }); val.view.RPC("Light_Rpc", (RpcTarget)3, Array.Empty<object>()); break; } } } PEAKER.Logger.LogInfo((object)"No campfire nearby to forcibly light."); } if (GUILayout.Button(Localized_SpawnBackpack, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)"Giving backpack to self."); ItemDatabase.Add(ObjectDatabaseAsset<ItemDatabase, Item>.GetObjectFromString("Backpack")); } GUI.enabled = PhotonNetwork.IsMasterClient && Object.op_Implicit((Object)(object)Singleton<GameOverHandler>.Instance) && ((MenuWindow)GUIManager.instance.endScreen).isOpen; if (GUILayout.Button(Localized_SkipEndScreen, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)"Forcing all scouts to be done with the end screen."); Singleton<GameOverHandler>.Instance.ForceEveryPlayerDoneWithEndScreen(); } GUI.enabled = true; if (GUILayout.Button(Localized_CopyInvite, WrapButton, Array.Empty<GUILayoutOption>())) { GUIUtility.systemCopyBuffer = $"steam://joinlobby/3527290/{GameHandler.GetService<SteamLobbyHandler>().m_currentLobby.m_SteamID}/{SteamUser.GetSteamID().m_SteamID}"; } GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(SteamLobbyLock.SteamLobbyLocked ? Localized_UnlockSteamLobby : Localized_LockSteamLobby, WrapButton, Array.Empty<GUILayoutOption>())) { 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<GUILayoutOption>()); Player player = default(Player); if (PhotonNetwork.TryGetPlayer(_photonActorNumber, ref player)) { GUILayout.Label(Localized_PhotonScoutInfo(player.ActorNumber, player.NickName), Array.Empty<GUILayoutOption>()); } else { GUILayout.Label(Localized_PhotonScoutInfoNone, Array.Empty<GUILayoutOption>()); } GUI.enabled = player != null && player.ActorNumber != PhotonNetwork.LocalPlayer.ActorNumber; if (PhotonNetwork.IsMasterClient && GUILayout.Button(Localized_Kick, WrapButton, Array.Empty<GUILayoutOption>())) { 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<Scoutmaster>(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<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button(Localized_DecreaseMaxVelocity, WrapButton, Array.Empty<GUILayoutOption>())) { 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<GUILayoutOption>())) { 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<GUILayoutOption>())) { CheatDetections.UnignorePlayer(player); } } else if (GUILayout.Button(Localized_IgnoreDetections, WrapButton, Array.Empty<GUILayoutOption>())) { 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<GUILayoutOption>()); } else { GUILayout.Label(Localized_SteamScoutInfoNone, Array.Empty<GUILayoutOption>()); } GUI.enabled = _steamId != CSteamID.Nil; if (GUILayout.Button(Localized_CopySteamId, WrapButton, Array.Empty<GUILayoutOption>())) { GUIUtility.systemCopyBuffer = _steamId.m_SteamID.ToString(); } if (GUILayout.Button(Localized_SteamProfile, WrapButton, Array.Empty<GUILayoutOption>())) { SteamFriends.ActivateGameOverlayToUser("steamid", _steamId); } GUI.enabled = true; GUILayout.Label(Localized_BanReason, Array.Empty<GUILayoutOption>()); _banReason = GUILayout.TextField(_banReason, Array.Empty<GUILayoutOption>()).Replace("\n", " "); if (_steamId != CSteamID.Nil && _steamId != SteamUser.GetSteamID()) { if (AccessGate.IsBanned(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_Banned, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } else if (GUILayout.Button(Localized_Ban, WrapButton, Array.Empty<GUILayoutOption>())) { AccessGate.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_Ban, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } if (_steamId != CSteamID.Nil && AccessGate.IsBanned(_steamId)) { if (AccessGate.IsIgnored(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoredBan, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } else if (GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty<GUILayoutOption>())) { AccessGate.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty<GUILayoutOption>()); 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<GUILayoutOption>())) { AccessGate.UnallowScout(_steamId); } } else if (GUILayout.Button(Localized_Allow, WrapButton, Array.Empty<GUILayoutOption>())) { AccessGate.AllowScout(_steamId); } } else { GUI.enabled = false; GUILayout.Button(Localized_Allow, WrapButton, Array.Empty<GUILayoutOption>()); 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<GUILayoutOption>()); } else { Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); 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<GUILayoutOption>())) { _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<Vector2>)(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<Vector2>)(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