The BepInEx console will not appear when launching like it does for other games on Thunderstore (you can turn it back on in your BepInEx.cfg file). If your PEAK crashes on startup, add -dx12 to your launch parameters.
Decompiled source of PEAKER v0.2.4
BepInEx/plugins/PEAKER.dll
Decompiled 2 weeks 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.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Photon.Pun; using Photon.Realtime; using Steamworks; using TMPro; using Unity.Collections; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; 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: AssemblyCompany("PEAKER")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyFileVersion("0.2.4.0")] [assembly: AssemblyInformationalVersion("0.2.4")] [assembly: AssemblyProduct("PEAKER")] [assembly: AssemblyTitle("PEAKER")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.2.4.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 { internal static class AntiCheatDependency { internal const string PluginGuid = "com.hiccup444.anticheat"; internal static bool ListenForCheaterDetections(Action<Player, string, CSteamID, string> listener) { if (!Chainloader.PluginInfos.TryGetValue("com.hiccup444.anticheat", out var value)) { return false; } Assembly assembly = ((value == null) ? null : ((object)value.Instance)?.GetType()?.Assembly); if (assembly == null) { return false; } Type type = assembly.GetType("AntiCheatMod.AntiCheatEvents"); if (type == null) { return false; } EventInfo @event = type.GetEvent("OnCheaterDetected", BindingFlags.Static | BindingFlags.Public); if (@event == null) { return false; } @event.AddEventHandler(null, listener); return true; } } public class BannedScouts : MonoBehaviour { private readonly struct LoggedCheatDetection { public readonly Player player; public readonly string reason; public readonly CSteamID steamID; public readonly string timestamp; public LoggedCheatDetection(Player player, string reason, CSteamID steamID, string timestamp) { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) this.player = player; this.reason = reason; this.steamID = steamID; this.timestamp = timestamp; } } private static Callback<LobbyChatUpdate_t> _onLobbyChatUpdateCallback; private static readonly Dictionary<ulong, string> _bannedScouts = new Dictionary<ulong, string>(); private static readonly HashSet<ulong> _ignoredScouts = new HashSet<ulong>(); private static CSteamID _lastSentChat; private bool _showScoutList; private Key _toggleScoutListKey; private static bool _listeningForCheatDetections; private readonly Queue<LoggedCheatDetection> _loggedCheatDetections = new Queue<LoggedCheatDetection>(); public static bool ListeningForCheatDetections => _listeningForCheatDetections; 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() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) _toggleScoutListKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "ToggleScoutListKey"), (Key)102, new ConfigDescription("The key used to toggle the scout list, where you may ban scouts from joining your future lobbies. (Client)", (AcceptableValueBase)null, Array.Empty<object>())).Value; PEAKER.Logger.LogInfo((object)$"Scout List Key: {_toggleScoutListKey}"); UpdateBannedScouts(); PEAKER.Patches.PatchAll(typeof(BannedScouts)); _listeningForCheatDetections = AntiCheatDependency.ListenForCheaterDetections(delegate(Player player, string reason, CSteamID steamID, string timestamp) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) _loggedCheatDetections.Enqueue(new LoggedCheatDetection(player, reason, steamID, timestamp)); while (_loggedCheatDetections.Count > 15) { _loggedCheatDetections.Dequeue(); } }); } internal void Update() { //IL_0017: 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 (_showScoutList && !PhotonNetwork.InRoom) { _showScoutList = false; } if ((int)_toggleScoutListKey != 0 && ((ButtonControl)Keyboard.current[_toggleScoutListKey]).wasPressedThisFrame && PhotonNetwork.InRoom) { _showScoutList = !_showScoutList; PEAKER.Logger.LogInfo((object)$"Showing Scout List: {_showScoutList}"); if (_showScoutList) { UpdateBannedScouts(); } } } internal void OnGUI() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Expected O, but got Unknown //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Expected O, but got Unknown //IL_00c2: Unknown result type (might be due to invalid IL or missing references) if (_showScoutList) { int num = (int)((float)Screen.width * 0.25f); int num2 = (int)((float)Screen.height * 0.75f); GUI.Window(GUIUtility.GetControlID((FocusType)2), new Rect(0f, (float)((Screen.height - num2) / 2), (float)(num * 2), (float)num2), new WindowFunction(DrawCheatDetectionLog), "Cheat Detection Log"); GUI.Window(GUIUtility.GetControlID((FocusType)2), new Rect((float)(num * 2), (float)((Screen.height - num2) / 2), (float)num, (float)num2), new WindowFunction(DrawPhotonWindow), "Photon Scouts"); GUI.Window(GUIUtility.GetControlID((FocusType)2), new Rect((float)(Screen.width - num), (float)((Screen.height - num2) / 2), (float)num, (float)num2), new WindowFunction(DrawSteamWindow), "Steam Scouts"); } } private void DrawCheatDetectionLog(int windowID) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)3, fontSize = 20, fixedHeight = 28f }; if (!_listeningForCheatDetections) { GUILayout.Label("PEAKAntiCheat by hiccup is not installed, or was not detected.", val, Array.Empty<GUILayoutOption>()); return; } GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); foreach (LoggedCheatDetection loggedCheatDetection in _loggedCheatDetections) { GUILayout.Label($"{loggedCheatDetection.timestamp} | {loggedCheatDetection.player.NickName} (#{loggedCheatDetection.player.ActorNumber}) | {SteamFriends.GetFriendPersonaName(loggedCheatDetection.steamID)} ({loggedCheatDetection.steamID.m_SteamID})", val, Array.Empty<GUILayoutOption>()); GUILayout.Label("- " + loggedCheatDetection.reason, val, Array.Empty<GUILayoutOption>()); GUILayout.Space(5f); } GUILayout.EndVertical(); } private void DrawPhotonWindow(int windowID) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0065: Expected O, but got Unknown GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)3, fontSize = 20, fixedHeight = 28f }; if (!PhotonNetwork.InRoom) { GUILayout.Label("Not in a Photon Room.", val, Array.Empty<GUILayoutOption>()); return; } GUIStyle val2 = new GUIStyle(GUI.skin.button) { fontSize = 20, fixedHeight = 28f }; GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); Player[] playerList = PhotonNetwork.PlayerList; Scoutmaster val6 = default(Scoutmaster); Scoutmaster val5 = default(Scoutmaster); foreach (Player player in playerList) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button("Slow", val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(95f) })) { PEAKER.Logger.LogInfo((object)("Slowing down " + player.NickName + "...")); Character val3 = Character.AllCharacters.FindLast((Character character) => character.view.Owner.ActorNumber == player.ActorNumber && !((Component)character).TryGetComponent<Scoutmaster>(ref val6)); if ((Object)(object)val3 != (Object)null) { foreach (Bodypart part in val3.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)val3.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } if (GUILayout.Button("Speed", val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(95f) })) { PEAKER.Logger.LogInfo((object)("Speeding up " + player.NickName + "...")); Character val4 = Character.AllCharacters.FindLast((Character character) => character.view.Owner.ActorNumber == player.ActorNumber && !((Component)character).TryGetComponent<Scoutmaster>(ref val5)); if ((Object)(object)val4 != (Object)null) { foreach (Bodypart part2 in val4.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)val4.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } GUILayout.Label($"#{player.ActorNumber}: {player.NickName}", val, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); } GUILayout.EndVertical(); } private void DrawSteamWindow(int windowID) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0062: 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_0076: Expected O, but got Unknown //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0234: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0206: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)3, fontSize = 20, fixedHeight = 28f }; CSteamID currentLobby = GameHandler.GetService<SteamLobbyHandler>().m_currentLobby; if (currentLobby == CSteamID.Nil) { GUILayout.Label("Not in a Steam Lobby.", val, Array.Empty<GUILayoutOption>()); return; } GUIStyle val2 = new GUIStyle(GUI.skin.button) { fontSize = 20, fixedHeight = 28f }; GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); int numLobbyMembers = SteamMatchmaking.GetNumLobbyMembers(currentLobby); for (int i = 0; i < numLobbyMembers; i++) { CSteamID lobbyMemberByIndex = SteamMatchmaking.GetLobbyMemberByIndex(currentLobby, i); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (SteamUser.GetSteamID() == lobbyMemberByIndex) { GUILayout.Label("You", val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(85f) }); } else if (_bannedScouts.ContainsKey(lobbyMemberByIndex.m_SteamID)) { GUILayout.Label("BANNED", val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(85f) }); if (_ignoredScouts.Contains(lobbyMemberByIndex.m_SteamID)) { GUILayout.Label("IGNORED", val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(95f) }); } else if (GUILayout.Button("Ignore", val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(95f) })) { PEAKER.Logger.LogInfo((object)$"Ignoring {lobbyMemberByIndex.m_SteamID}: {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}..."); _ignoredScouts.Add(lobbyMemberByIndex.m_SteamID); } } else if (GUILayout.Button("Ban", val2, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(85f) })) { PEAKER.Logger.LogInfo((object)$"Banning {lobbyMemberByIndex.m_SteamID}: {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}..."); File.AppendAllText(Path.Combine(Paths.BepInExRootPath, "banned.txt"), $"\n{lobbyMemberByIndex.m_SteamID} | {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)} | No reason specified"); UpdateBannedScouts(); _ignoredScouts.Add(lobbyMemberByIndex.m_SteamID); } GUILayout.Label($"{lobbyMemberByIndex.m_SteamID}: {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}", val, Array.Empty<GUILayoutOption>()); GUILayout.EndHorizontal(); } GUILayout.EndVertical(); } private 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_003b: 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_0057: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: 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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0201: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_0214: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_023f: 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); 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($"{{userColor}} {SteamFriends.GetFriendPersonaName(_lastSentChat)}' ({_lastSentChat.m_SteamID})</color>{{joinedColor}} tried to join, but</color>{{userColor}} {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)} ({lobbyMemberByIndex.m_SteamID})</color>{{leftColor}} is banned! Not letting them in...", onlySendOnce: false, 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; Debug.LogError((object)"Failed to send Room ID..."); return false; } Debug.Log((object)("Lobby has been requested. Sending " + text + " (fake room)")); return false; } } return true; } } public class CheatDetections : MonoBehaviour, IInRoomCallbacks { private enum OwnershipCondition { None, IsMasterClient, IsViewOwner, IsMasterClientOrViewOwner } [CompilerGenerated] private sealed class <CheckScoutsForMods>d__8 : 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__8(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 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 if (!PEAKER.Config.Bind<bool>(new ConfigDefinition("Cheat Detections", "Enabled"), true, new ConfigDescription("Whether or not to enable PEAKER's cheat detections. Will be ignored is PEAKAntiCheat is in use. (Client)", (AcceptableValueBase)null, Array.Empty<object>())).Value || BannedScouts.ListeningForCheatDetections) { Object.DestroyImmediate((Object)(object)this); return; } ((MonoBehaviour)this).StartCoroutine(CheckScoutsForMods()); try { PEAKER.Patches.PatchAll(typeof(CheatDetections)); } catch { } } 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) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"{newMasterClient.NickName} (#{newMasterClient.ActorNumber}) is the new owner of the lobby!"); PEAKER.LogVisually("{userColor} " + newMasterClient.NickName + "</color>{joinedColor} is the new owner of the lobby!", onlySendOnce: true, sfxJoin: true); if (SteamMatchmaking.GetLobbyOwner(GameHandler.GetService<SteamLobbyHandler>().m_currentLobby) == SteamUser.GetSteamID()) { PEAKER.Logger.LogInfo((object)"Ownership of the lobby was taken from you! Taking it back..."); PEAKER.LogVisually("{leftColor} Ownership of the lobby was taken from you! Taking it back...", onlySendOnce: true, sfxJoin: false, sfxLeave: true); PhotonNetwork.SetMasterClient(PhotonNetwork.LocalPlayer); } } [IteratorStateMachine(typeof(<CheckScoutsForMods>d__8))] private IEnumerator CheckScoutsForMods() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckScoutsForMods>d__8(0) { <>4__this = this }; } private void CheckScoutForMods(Player player) { if (player.ActorNumber != PhotonNetwork.LocalPlayer.ActorNumber) { if (((Dictionary<object, object>)(object)player.CustomProperties).ContainsKey((object)"CherryUser")) { PEAKER.LogVisually("{userColor} " + player.NickName + "</color>{leftColor} is using the Cherry mod!</color>", onlySendOnce: true); } if (((Dictionary<object, object>)(object)player.CustomProperties).ContainsKey((object)"CherryOwner")) { PEAKER.LogVisually("{userColor} " + player.NickName + "</color>{leftColor} is the Owner of the Cherry mod!</color>", onlySendOnce: true); } if (((Dictionary<object, object>)(object)player.CustomProperties).ContainsKey((object)"AtlUser")) { PEAKER.LogVisually("{userColor} " + player.NickName + "</color>{leftColor} is using the Atlas mod!</color>", onlySendOnce: true); } if (((Dictionary<object, object>)(object)player.CustomProperties).ContainsKey((object)"AtlOwner")) { PEAKER.LogVisually("{userColor} " + player.NickName + "</color>{leftColor} is the Owner of the Atlas mod!</color>", onlySendOnce: true); } } } private static bool IsRpcValid(PhotonView view, Player sender, OwnershipCondition ownershipCondition, Func<bool> validCondition = null) { if (sender == null) { 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; } [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}) slipped {PhotonView.Find(viewID).Owner.NickName} (#{PhotonView.Find(viewID).Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} slipped</color>{userColor} " + PhotonView.Find(viewID).Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) dispersed a swarm!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} dispersed a swarm!</color>", 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("{userColor} " + info.Sender.NickName + "</color>{leftColor} changed a swarm's anger!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) attached a tick to {PhotonView.Find(targetID).Owner.NickName} (#{PhotonView.Find(targetID).Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} attached a tick to</color>{userColor} " + PhotonView.Find(targetID).Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) triggered the helicopter!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} triggered the helicopter!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(Campfire), "SetFireWoodCount")] [HarmonyPrefix] internal static bool PreCampfireSetFireWoodCount(Campfire __instance, int count, ref PhotonMessageInfo info) { //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Invalid comparison between Unknown and I4 bool flag = IsRpcValid(__instance.view, info.Sender, OwnershipCondition.IsMasterClient, () => (int)__instance.state == 2 && count == 0); if (!flag) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) tried to set the log count to {count} for the {__instance.advanceToSegment} campfire!"); if (PhotonNetwork.IsMasterClient) { __instance.view.RPC("SetFireWoodCount", (RpcTarget)0, new object[1] { ((int)__instance.state != 2) ? 3 : 0 }); } } return flag; } [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) //IL_0061: 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}) tried to extinguish the {__instance.advanceToSegment} campfire!"); PEAKER.LogVisually($"{{userColor}} {info.Sender.NickName}</color>{{leftColor}} tried to extinguish the {__instance.advanceToSegment} campfire!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } return num; } [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}) forcefully won!</color>"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} forcefully won!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) killed {__instance.view.Owner.NickName} (#{__instance.view.Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} killed</color>{userColor} " + __instance.view.Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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("{userColor} " + info.Sender.NickName + "</color>{leftColor} revived</color>{userColor} " + __instance.view.Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) warped {__instance.view.Owner.NickName} (#{__instance.view.Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} warped</color>{userColor} " + __instance.view.Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) inited the ghost of {__instance.m_view.Owner.NickName} (#{__instance.m_view.Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} inited the ghost of</color>{userColor} " + __instance.m_view.Owner.NickName + "!</color>", 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}) controlled the ghost of {__instance.m_view.Owner.NickName} (#{__instance.m_view.Owner.ActorNumber})!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} controlled the ghost of</color>{userColor} " + __instance.m_view.Owner.NickName + "!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) spawned an eruption!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} spawned an eruption!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) grew a magic bean!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} grew a magic bean!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) started the fog!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} started the fog!</color>", 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}) synced the fog!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} synced the fog!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) started the game!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} started the game!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [HarmonyPatch(typeof(GameOverHandler), "BeginIslandLoadRPC")] [HarmonyPostfix] internal static void PostGameOverHandlerBeginIslandLoadRPC(AirportCheckInKiosk __instance, ref PhotonMessageInfo info) { if (!IsRpcValid(((MonoBehaviourPun)__instance).photonView, info.Sender, OwnershipCondition.IsMasterClient)) { PEAKER.Logger.LogWarning((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) loaded the airport!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} loaded the airport!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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}) shook a bridge!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} shook a bridge!</color>", 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}) made a bridge fall!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} made a bridge fall!</color>", 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}) detached a rope!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} detached a rope!</color>", 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}) shook an icicle!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} shook an icicle!</color>", 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}) made an icicle fall!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} made an icicle fall!</color>", 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}) started breaking a pitton!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} started breaking a pitton!</color>", 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}) broke a pitton!"); PEAKER.LogVisually("{userColor} " + info.Sender.NickName + "</color>{leftColor} broke a pitton!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); } } [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_012c; case 8: if (!(text == "BeeSwarm")) { break; } goto IL_012c; case 20: if (!(text == "Bingbong_Push_Gentle")) { break; } goto IL_012c; case 18: if (!(text == "BingBongVoiceRelay")) { break; } goto IL_012c; case 7: { if (!(text == "Tornado")) { break; } goto IL_012c; } IL_012c: PEAKER.LogVisually("{userColor} " + parameters.creator.NickName + "</color>{leftColor} instantiated the '" + parameters.prefabName + "' prefab!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); break; } } } public class ClientImprovements : MonoBehaviour { private Key _fixPassOutBlindnessKey; internal void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) _fixPassOutBlindnessKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "FixPassOutBlindnessKey"), (Key)95, new ConfigDescription("The key used to fix the pass-out induced blindness bug. (Client)", (AcceptableValueBase)null, Array.Empty<object>())).Value; PEAKER.Patches.PatchAll(typeof(ClientImprovements)); } internal void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) if ((int)_fixPassOutBlindnessKey == 0 || !((ButtonControl)Keyboard.current[_fixPassOutBlindnessKey]).wasPressedThisFrame || !Object.op_Implicit((Object)(object)Transitions.instance)) { return; } Transition[] transitions = Transitions.instance.transitions; foreach (Transition obj in transitions) { Transition_CanvasGroup val = (Transition_CanvasGroup)(object)((obj is Transition_CanvasGroup) ? obj : null); if (val != null && Object.op_Implicit((Object)(object)val.gr)) { PEAKER.Logger.LogInfo((object)("Setting " + ((Object)val).name + " alpha to 0.")); val.gr.alpha = 0f; } } } [HarmonyPatch(typeof(CharacterInput), "Sample")] [HarmonyPostfix] internal static void PostCharacterInputSample(CharacterInput __instance) { bool isPressed = Mouse.current.forwardButton.isPressed; bool isPressed2 = Mouse.current.backButton.isPressed; if (!(isPressed && isPressed2)) { if (isPressed) { __instance.scrollInput += 0.5f; } else if (isPressed2) { __instance.scrollInput -= 0.5f; } if (Keyboard.current.shiftKey.isPressed) { __instance.scrollInput *= 4f; } __instance.scrolledUp = __instance.scrollInput > 0f; __instance.scrolledDown = __instance.scrollInput < 0f; } } [HarmonyPatch(typeof(Character), "RPCA_Die")] [HarmonyPostfix] internal static void PostCharacterRPCA_Die(Character __instance) { __instance.refs.ragdoll.ToggleCollision(false); } [HarmonyPatch(typeof(Character), "RPCA_Revive")] [HarmonyPrefix] internal static void PreCharacterRPCA_Revive(Character __instance) { __instance.refs.ragdoll.ToggleCollision(true); } [HarmonyPatch(typeof(CharacterCustomization), "OnPlayerDataChange")] [HarmonyPrefix] internal static void PreCharacterCustomizationOnPlayerDataChange(CharacterCustomization __instance, PersistentPlayerData playerData) { CharacterCustomizationData customizationData = playerData.customizationData; customizationData.currentSkin %= Singleton<Customization>.Instance.skins.Length; CharacterCustomizationData customizationData2 = playerData.customizationData; customizationData2.currentAccessory %= Singleton<Customization>.Instance.accessories.Length; CharacterCustomizationData customizationData3 = playerData.customizationData; customizationData3.currentEyes %= Singleton<Customization>.Instance.eyes.Length; CharacterCustomizationData customizationData4 = playerData.customizationData; customizationData4.currentMouth %= Singleton<Customization>.Instance.mouths.Length; CharacterCustomizationData customizationData5 = playerData.customizationData; customizationData5.currentOutfit %= Singleton<Customization>.Instance.fits.Length; CharacterCustomizationData customizationData6 = playerData.customizationData; customizationData6.currentHat %= Singleton<Customization>.Instance.hats.Length; CharacterCustomizationData customizationData7 = playerData.customizationData; customizationData7.currentSash %= __instance.refs.sashAscentMaterials.Length; } [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 HostKeybinds : MonoBehaviour { private Key _toggleStartKioskLockKey; private Key _lightNearbyCampfireKey; private Key _spawnBackpackKey; private Key _skipEndScreenKey; private Key _toggleSteamLobbyLockKey; internal void Awake() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Expected O, but got Unknown //IL_002c: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_0062: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Expected O, but got Unknown //IL_0098: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Expected O, but got Unknown //IL_00ce: Expected O, but got Unknown //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Expected O, but got Unknown //IL_0104: Expected O, but got Unknown //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) _toggleStartKioskLockKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "ToggleStartKioskLockKey"), (Key)94, new ConfigDescription("The key used to toggle the Start Kiosk Lock. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; _lightNearbyCampfireKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "LightNearbyCampfireKey"), (Key)96, new ConfigDescription("The key used to forcefully light the nearby campfire. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; _spawnBackpackKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "SpawnBackpackKey"), (Key)97, new ConfigDescription("The key used to spawn a backpack. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; _skipEndScreenKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "SkipEndScreenKey"), (Key)98, new ConfigDescription("The key used to skip the end screen when waiting for everyone to click next. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; _toggleSteamLobbyLockKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Keybinds", "ToggleSteamLobbyLockKey"), (Key)101, new ConfigDescription("The key used to toggle the Steam Lobby Lock. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; } internal void Update() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0072: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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) if (!PhotonNetwork.InRoom || !PhotonNetwork.IsMasterClient) { return; } if ((int)_toggleStartKioskLockKey != 0 && ((ButtonControl)Keyboard.current[_toggleStartKioskLockKey]).wasPressedThisFrame) { StartKioskLock.TryToggle(); } if ((int)_lightNearbyCampfireKey != 0 && ((ButtonControl)Keyboard.current[_lightNearbyCampfireKey]).wasPressedThisFrame && Object.op_Implicit((Object)(object)Character.localCharacter)) { Vector3 center = Character.localCharacter.Center; Campfire[] array = Object.FindObjectsByType<Campfire>((FindObjectsSortMode)0); foreach (Campfire val in array) { 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 ((int)_spawnBackpackKey != 0 && ((ButtonControl)Keyboard.current[_spawnBackpackKey]).wasPressedThisFrame && Object.op_Implicit((Object)(object)Character.localCharacter)) { PEAKER.Logger.LogInfo((object)"Giving backpack to self."); ItemDatabase.Add(ObjectDatabaseAsset<ItemDatabase, Item>.GetObjectFromString("Backpack")); } if ((int)_skipEndScreenKey != 0 && ((ButtonControl)Keyboard.current[_skipEndScreenKey]).wasPressedThisFrame && Object.op_Implicit((Object)(object)Singleton<GameOverHandler>.Instance) && ((MenuWindow)GUIManager.instance.endScreen).isOpen) { PEAKER.Logger.LogInfo((object)"Forcing all scouts to be done with the end screen."); Singleton<GameOverHandler>.Instance.ForceEveryPlayerDoneWithEndScreen(); } if ((int)_toggleSteamLobbyLockKey != 0 && ((ButtonControl)Keyboard.current[_toggleSteamLobbyLockKey]).wasPressedThisFrame) { SteamLobbyLock.TryToggle(); } } } public class MoreScouts : MonoBehaviour { [CompilerGenerated] private sealed class <RespawnAllPlayersHereDelayed>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RespawnChest respawnChest; private Vector3 <position>5__2; private float <angleBetweenCharacters>5__3; private int <characterIndex>5__4; private List<Character>.Enumerator <>7__wrap4; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <RespawnAllPlayersHereDelayed>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { int num = <>1__state; if (num == -3 || num == 1) { try { } finally { <>m__Finally1(); } } <>7__wrap4 = default(List<Character>.Enumerator); <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Expected O, but got Unknown //IL_0151: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) try { int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -3; if (((PhotonPeer)PhotonNetwork.NetworkingClient.LoadBalancingPeer).QueuedOutgoingCommands > 5) { goto IL_0171; } <characterIndex>5__4++; } else { <>1__state = -1; <position>5__2 = ((Component)respawnChest).transform.position + ((Component)respawnChest).transform.up * 6f; List<Character> list = new List<Character>(Character.AllCharacters.Count); foreach (Character allCharacter in Character.AllCharacters) { if (allCharacter.data.dead || allCharacter.data.fullyPassedOut) { list.Add(allCharacter); } } <angleBetweenCharacters>5__3 = 360f / (float)list.Count; <characterIndex>5__4 = 0; <>7__wrap4 = list.GetEnumerator(); <>1__state = -3; } if (<>7__wrap4.MoveNext()) { Character current2 = <>7__wrap4.Current; float num2 = MathF.PI / 180f * ((float)<characterIndex>5__4 * <angleBetweenCharacters>5__3); Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(Mathf.Cos(num2) * 2.5f, 0f, Mathf.Sin(num2) * 2.5f); _ = current2.view.ViewID; ((MonoBehaviourPun)current2).photonView.RPC("RPCA_ReviveAtPosition", (RpcTarget)0, new object[2] { <position>5__2 + val, true }); goto IL_0171; } <>m__Finally1(); <>7__wrap4 = default(List<Character>.Enumerator); return false; IL_0171: <>2__current = (object)new WaitForSeconds(0.5f); <>1__state = 1; return true; } catch { //try-fault ((IDisposable)this).Dispose(); throw; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } private void <>m__Finally1() { <>1__state = -1; ((IDisposable)<>7__wrap4).Dispose(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0032: Expected O, but got Unknown NetworkConnector.MAX_PLAYERS = Mathf.Clamp(PEAKER.Config.Bind<int>(new ConfigDefinition("Host", "MaxScouts"), 20, new ConfigDescription("The maximum number of scouts that may join your lobbies. Due to the ragdoll physics of the characters, playing with around 20 scouts (and especially true with more) leads to serious lag on most CPUs trying to handle it all. The limit is set to 30, as I've been told the maximum number for scouts that can exist in one room is 30.", (AcceptableValueBase)(object)new AcceptableValueRange<int>(1, 30), Array.Empty<object>())).Value, 1, 30); PEAKER.Logger.LogInfo((object)$"Set the max scouts to {NetworkConnector.MAX_PLAYERS}!"); PEAKER.Patches.PatchAll(typeof(MoreScouts)); } [HarmonyPatch(typeof(VersionString), "Update")] [HarmonyPostfix] internal static void PostVersionStringUpdate(VersionString __instance) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) if (PhotonNetwork.InRoom) { int num = SteamMatchmaking.GetLobbyMemberLimit(GameHandler.GetService<SteamLobbyHandler>().m_currentLobby); if (num == 0) { num = PhotonNetwork.CurrentRoom.PlayerCount; } string text = $"\n{PhotonNetwork.CurrentRoom.PlayerCount}/{num} Scouts"; if (num == 0) { text += " (No Steam Lobby)"; } TextMeshProUGUI text2 = __instance.m_text; ((TMP_Text)text2).text = ((TMP_Text)text2).text + text; } } [HarmonyPatch(typeof(Campfire), "Awake")] [HarmonyPostfix] internal static void PostCampfireAwake(Campfire __instance) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) if (!PhotonNetwork.IsMasterClient) { return; } if ((int)__instance.advanceToSegment == 0) { PEAKER.Logger.LogInfo((object)"Not spawning marshmallows for the campfire on the beach."); return; } PEAKER.Logger.LogInfo((object)$"Attempting to spawn marshmallows for the {__instance.advanceToSegment} campfire..."); int num = PhotonNetwork.CurrentRoom.PlayerCount - 4; if (num <= 0) { PEAKER.Logger.LogInfo((object)"Not enough scouts to spawn marshmallows."); return; } PEAKER.Logger.LogInfo((object)$"Spawning {num} marshmallows..."); float num2 = 360f / (float)num; Item objectFromString = ObjectDatabaseAsset<ItemDatabase, Item>.GetObjectFromString("Marshmallow"); Vector3 val = default(Vector3); for (int i = 0; i < num; i++) { float num3 = MathF.PI / 180f * ((float)i * num2); float num4 = Random.Range(1.75f, 3f); ((Vector3)(ref val))..ctor(Mathf.Cos(num3) * num4, 2f, Mathf.Sin(num3) * num4); Vector3 groundPos = HelperFunctions.GetGroundPos(((Component)__instance).transform.position + val, (LayerType)1, 0f); PhotonNetwork.Instantiate("0_Items/" + ((Object)objectFromString).name, groundPos, Quaternion.Euler(0f, Random.Range(0f, 360f), 0f), (byte)0, (object[])null); } } [HarmonyPatch(typeof(RespawnChest), "RespawnAllPlayersHere")] [HarmonyPrefix] internal static bool PreRespawnChestRespawnAllPlayersHere(RespawnChest __instance) { ((MonoBehaviour)PEAKER.Instance).StartCoroutine(RespawnAllPlayersHereDelayed(__instance)); return false; } [IteratorStateMachine(typeof(<RespawnAllPlayersHereDelayed>d__4))] private static IEnumerator RespawnAllPlayersHereDelayed(RespawnChest respawnChest) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <RespawnAllPlayersHereDelayed>d__4(0) { respawnChest = respawnChest }; } [HarmonyPatch(typeof(AudioLevels), "OnEnable")] [HarmonyPrefix] internal static void PreAudioLevelsOnEnable(AudioLevels __instance) { int count = Character.AllCharacters.Count; if (__instance.sliders.Count >= count) { return; } for (int i = 0; i < count; i++) { if (i >= __instance.sliders.Count) { __instance.sliders.Add(Object.Instantiate<AudioLevelSlider>(__instance.sliders[0], ((Component)__instance.sliders[0]).transform.parent)); } } } [HarmonyPatch(typeof(UIPlayerNames), "Init")] [HarmonyPrefix] internal static void PreUIPlayerNamesInit(UIPlayerNames __instance) { if (__instance.playerNameText.Length > __instance.indexCounter) { return; } PlayerName[] array = (PlayerName[])(object)new PlayerName[__instance.indexCounter + 1]; for (int i = 0; i < array.Length; i++) { if (i < __instance.playerNameText.Length) { array[i] = __instance.playerNameText[i]; } else { array[i] = Object.Instantiate<PlayerName>(__instance.playerNameText[0], ((Component)__instance.playerNameText[0]).transform.parent); } } __instance.playerNameText = array; } [HarmonyPatch(typeof(WaitingForPlayersUI), "Update")] [HarmonyPrefix] internal static void PreWaitingForPlayersUIUpdate(WaitingForPlayersUI __instance) { int count = Character.AllCharacters.Count; if (__instance.scoutImages.Length >= count) { return; } Image[] array = (Image[])(object)new Image[count]; for (int i = 0; i < array.Length; i++) { if (i < __instance.scoutImages.Length) { array[i] = __instance.scoutImages[i]; } else { array[i] = (((Object)(object)__instance.scoutImages[0] == (Object)null) ? null : Object.Instantiate<Image>(__instance.scoutImages[0], ((Component)__instance.scoutImages[0]).transform.parent)); } } __instance.scoutImages = array; } [HarmonyPatch(typeof(EndScreen), "Start")] [HarmonyPrefix] internal static void PreEndScreenStart(EndScreen __instance) { int count = Character.AllCharacters.Count; if (__instance.scouts.Length >= count) { return; } Image[] array = (Image[])(object)new Image[count]; Transform[] array2 = (Transform[])(object)new Transform[count]; Image[] array3 = (Image[])(object)new Image[count]; Image[] array4 = (Image[])(object)new Image[count]; EndScreenScoutWindow[] array5 = (EndScreenScoutWindow[])(object)new EndScreenScoutWindow[count]; for (int i = 0; i < array3.Length; i++) { if (i < __instance.scouts.Length) { array[i] = __instance.oldPip[i]; array2[i] = __instance.scoutLines[i]; array3[i] = __instance.scouts[i]; array4[i] = __instance.scoutsAtPeak[i]; array5[i] = __instance.scoutWindows[i]; } else { array[i] = (((Object)(object)__instance.oldPip[0] == (Object)null) ? null : Object.Instantiate<Image>(__instance.oldPip[0], ((Component)__instance.oldPip[0]).transform.parent)); array2[i] = (((Object)(object)__instance.scoutLines[0] == (Object)null) ? null : Object.Instantiate<Transform>(__instance.scoutLines[0], ((Component)__instance.scoutLines[0]).transform.parent)); array3[i] = (((Object)(object)__instance.scouts[0] == (Object)null) ? null : Object.Instantiate<Image>(__instance.scouts[0], ((Component)__instance.scouts[0]).transform.parent)); array4[i] = (((Object)(object)__instance.scoutsAtPeak[0] == (Object)null) ? null : Object.Instantiate<Image>(__instance.scoutsAtPeak[0], ((Component)__instance.scoutsAtPeak[0]).transform.parent)); array5[i] = (((Object)(object)__instance.scoutWindows[0] == (Object)null) ? null : Object.Instantiate<EndScreenScoutWindow>(__instance.scoutWindows[0], ((Component)__instance.scoutWindows[0]).transform.parent)); } } __instance.oldPip = array; __instance.scoutLines = array2; __instance.scouts = array3; __instance.scoutsAtPeak = array4; __instance.scoutWindows = array5; } [HarmonyPatch(typeof(PeakHandler), "SetCosmetics")] [HarmonyPostfix] internal static void PostPeakHandlerSetCosmetics(PeakHandler __instance, List<Character> characters) { //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) List<Character> list = characters.Where((Character character) => character.refs.stats.won).ToList(); list.Sort((Character c1, Character c2) => ((MonoBehaviourPun)c1).photonView.ViewID.CompareTo(((MonoBehaviourPun)c2).photonView.ViewID)); int num = 4; int num2 = 1; Vector3 val = default(Vector3); ((Vector3)(ref val))..ctor(0f, 0f, 0.15f); while (num < list.Count) { Transform[] array = (Transform[])(object)new Transform[4] { Object.Instantiate<Transform>(((Component)__instance.cutsceneScoutRefs[0]).transform, ((Component)__instance.cutsceneScoutRefs[0]).transform.parent), Object.Instantiate<Transform>(((Component)__instance.cutsceneScoutRefs[1]).transform, ((Component)__instance.cutsceneScoutRefs[1]).transform.parent), Object.Instantiate<Transform>(((Component)__instance.cutsceneScoutRefs[2]).transform, ((Component)__instance.cutsceneScoutRefs[2]).transform.parent), Object.Instantiate<Transform>(((Component)__instance.cutsceneScoutRefs[3]).transform, ((Component)__instance.cutsceneScoutRefs[3]).transform.parent) }; Transform obj = array[0]; obj.localPosition += val * (float)num2; Transform obj2 = array[1]; obj2.localPosition += val * (float)num2; Transform obj3 = array[2]; obj3.localPosition += val * (float)num2; Transform obj4 = array[3]; obj4.localPosition += val * (float)num2; CustomizationRefs[] array2 = (CustomizationRefs[])(object)new CustomizationRefs[4] { ((Component)array[0]).GetComponent<CustomizationRefs>(), ((Component)array[1]).GetComponent<CustomizationRefs>(), ((Component)array[2]).GetComponent<CustomizationRefs>(), ((Component)array[3]).GetComponent<CustomizationRefs>() }; EndCutsceneScoutHelper[] array3 = (EndCutsceneScoutHelper[])(object)new EndCutsceneScoutHelper[4] { ((Component)array[0]).GetComponent<EndCutsceneScoutHelper>(), ((Component)array[1]).GetComponent<EndCutsceneScoutHelper>(), ((Component)array[2]).GetComponent<EndCutsceneScoutHelper>(), ((Component)array[3]).GetComponent<EndCutsceneScoutHelper>() }; int num3 = 0; for (int i = num; i < num + 4; i++) { if (i >= list.Count) { ((Component)array2[num3]).gameObject.SetActive(false); } else { list[i].refs.customization.SetCustomizationForRef(array2[num3]); BadgeUnlocker.SetBadges(list[i], array2[num3].sashRenderer); ((Component)array2[num3]).GetComponent<AnimatedMouth>().audioSource = ((Component)list[i]).GetComponent<AnimatedMouth>().audioSource; if (list[i].IsLocal) { __instance.localMouths.Add(((Component)array2[num3]).GetComponent<AnimatedMouth>()); } } num3++; } if (list.Count - num <= 1) { array3[0].alone = true; } if (list.Count - num <= 2) { array3[1].alone = true; } num += 4; num2++; } } } [BepInPlugin("lammas123.PEAKER", "PEAKER", "0.2.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PEAKER : BaseUnityPlugin { internal static PEAKER Instance; internal static ManualLogSource Logger; internal static ConfigFile Config; internal static Harmony Patches; private static PlayerConnectionLog _connectionLog; private static readonly Queue<(string, bool, bool, bool)> _queuedLogs = new Queue<(string, bool, bool, bool)>(8); internal void Awake() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Expected O, but got Unknown //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Expected O, but got Unknown Instance = this; Logger = Logger.CreateLogSource("PEAKER"); Config = new ConfigFile(Path.Combine(Paths.ConfigPath, "lammas123.PEAKER.cfg"), true); Patches = new Harmony("lammas123.PEAKER"); ((Component)this).gameObject.AddComponent<ClientImprovements>(); ((Component)this).gameObject.AddComponent<MoreScouts>(); ((Component)this).gameObject.AddComponent<HostKeybinds>(); ((Component)this).gameObject.AddComponent<StartKioskLock>(); ((Component)this).gameObject.AddComponent<SteamLobbyLock>(); ((Component)this).gameObject.AddComponent<BannedScouts>(); ((Component)this).gameObject.AddComponent<CheatDetections>(); ((Component)this).gameObject.AddComponent<Testing>(); Logger.LogInfo((object)"Loaded PEAKER 0.2.4"); } internal void Update() { while (_queuedLogs.Count != 0) { var (message, onlySendOnce, sfxJoin, sfxLeave) = _queuedLogs.Peek(); if (LogVisually(message, onlySendOnce, sfxJoin, sfxLeave)) { _queuedLogs.Dequeue(); continue; } break; } } public static bool LogVisually(string message, bool onlySendOnce = false, bool sfxJoin = false, bool sfxLeave = false) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)_connectionLog)) { _connectionLog = Object.FindAnyObjectByType<PlayerConnectionLog>(); } if (!Object.op_Implicit((Object)(object)_connectionLog)) { _queuedLogs.Enqueue((message, onlySendOnce, sfxJoin, sfxLeave)); return false; } StringBuilder stringBuilder = new StringBuilder(message); stringBuilder.Replace("{joinedColor}", _connectionLog.GetColorTag(_connectionLog.joinedColor)); stringBuilder.Replace("{leftColor}", _connectionLog.GetColorTag(_connectionLog.leftColor)); stringBuilder.Replace("{userColor}", _connectionLog.GetColorTag(_connectionLog.userColor)); message = stringBuilder.ToString(); if (onlySendOnce && _connectionLog.currentLog.Contains(message)) { return true; } _connectionLog.AddMessage(message); if (sfxJoin && Object.op_Implicit((Object)(object)_connectionLog.sfxJoin)) { _connectionLog.sfxJoin.Play(Vector3.zero); } if (sfxLeave && Object.op_Implicit((Object)(object)_connectionLog.sfxLeave)) { _connectionLog.sfxLeave.Play(Vector3.zero); } return true; } } public class StartKioskLock : MonoBehaviour { private static bool _startKioskLocked = true; public static bool StartKioskLocked => _startKioskLocked; internal void Awake() { PEAKER.Patches.PatchAll(typeof(StartKioskLock)); } internal void Update() { if (!_startKioskLocked && !PhotonNetwork.InRoom) { _startKioskLocked = true; } } public static bool TryToggle() { if (!Object.op_Implicit((Object)(object)Object.FindAnyObjectByType<AirportCheckInKiosk>())) { return false; } _startKioskLocked = !_startKioskLocked; PEAKER.Logger.LogInfo((object)("The Start Kiosk is now " + (_startKioskLocked ? "Locked" : "Unlocked") + "!")); PEAKER.LogVisually("{joinedColor} The Start Kiosk is now " + (_startKioskLocked ? "Locked" : "Unlocked") + "!", onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } [HarmonyPatch(typeof(AirportCheckInKiosk), "LoadIslandMaster")] [HarmonyPrefix] internal static bool PreAirportCheckInKioskLoadIslandMaster(int ascent, ref PhotonMessageInfo info) { if (!PhotonNetwork.IsMasterClient || info.Sender == null) { return true; } PEAKER.Logger.LogInfo((object)$"{info.Sender.NickName} (#{info.Sender.ActorNumber}) tried to start the game on ascent {ascent}."); if (_startKioskLocked) { return info.Sender.IsMasterClient; } return true; } } public class SteamLobbyLock : MonoBehaviour { private static bool _steamLobbyLocked; public static bool StartKioskLocked => _steamLobbyLocked; internal void Update() { if (!_steamLobbyLocked && !PhotonNetwork.InRoom) { _steamLobbyLocked = false; } } public static bool TryToggle() { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) CSteamID val = (GameHandler.Initialized ? GameHandler.GetService<SteamLobbyHandler>().m_currentLobby : CSteamID.Nil); if (val == CSteamID.Nil) { return false; } _steamLobbyLocked = !_steamLobbyLocked; SteamMatchmaking.SetLobbyJoinable(val, !_steamLobbyLocked); PEAKER.Logger.LogInfo((object)("The Steam Lobby is now " + (_steamLobbyLocked ? "Locked" : "Unlocked") + "!")); PEAKER.LogVisually("{joinedColor} The Steam Lobby is now " + (_steamLobbyLocked ? "Locked" : "Unlocked") + "!", onlySendOnce: false, sfxJoin: false, sfxLeave: true); return true; } } public class Testing : MonoBehaviour { [CompilerGenerated] private sealed class <>c__DisplayClass4_0 { public int currentSegment; public Vector3 position; internal bool <SpawnTornado>b__0(Campfire campfire) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 return (int)campfire.advanceToSegment == currentSegment + 1; } internal bool <SpawnTornado>b__1(Character character) { //IL_0016: 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_0027: 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) return Vector2.Distance(new Vector2(position.x, position.z), new Vector2(character.Center.x, character.Center.z)) < 30f; } } [CompilerGenerated] private sealed class <SpawnTornado>d__4 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; private <>c__DisplayClass4_0 <>8__1; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <SpawnTornado>d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <>1__state = -2; } private bool MoveNext() { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0205: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: 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_0245: Unknown result type (might be due to invalid IL or missing references) int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (PhotonNetwork.IsMasterClient && Object.op_Implicit((Object)(object)Singleton<MapHandler>.Instance)) { <>8__1.currentSegment = Singleton<MapHandler>.Instance.currentSegment; float num2 = -380f; float num3 = (Object.op_Implicit((Object)(object)Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment].segmentCampfire) ? Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment].segmentCampfire.transform.position.z : ((Component)Object.FindObjectsByType<Campfire>((FindObjectsInactive)1, (FindObjectsSortMode)0).First((Campfire campfire) => (int)campfire.advanceToSegment == <>8__1.currentSegment + 1)).transform.position.z); float num4 = (Object.op_Implicit((Object)(object)Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment].segmentCampfire) ? Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment].segmentCampfire.transform.position.y : Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment - 1].segmentCampfire.transform.position.y); if (<>8__1.currentSegment != 0) { num2 = Singleton<MapHandler>.Instance.segments[<>8__1.currentSegment - 1].segmentCampfire.transform.position.z; } <>8__1.position = default(Vector3); do { <>8__1.position = new Vector3(Random.Range(-135f, 135f), num4, Random.Range(num2 + 50f, num3 - 50f)); <>c__DisplayClass4_0 <>c__DisplayClass4_ = <>8__1; RaycastHit groundPosRaycast = HelperFunctions.GetGroundPosRaycast(<>8__1.position, (LayerType)1, 0f); <>c__DisplayClass4_.position = ((RaycastHit)(ref groundPosRaycast)).point; } while (Character.AllCharacters.Any((Character character) => Vector2.Distance(new Vector2(<>8__1.position.x, <>8__1.position.z), new Vector2(character.Center.x, character.Center.z)) < 30f)); PhotonNetwork.Instantiate("Tornado", <>8__1.position, Quaternion.identity, (byte)0, (object[])null); <>8__1 = null; } } else { <>1__state = -1; } <>8__1 = new <>c__DisplayClass4_0(); <>2__current = (object)new WaitForSeconds(Random.Range(60f, 120f)); <>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(); } } [CompilerGenerated] private sealed class <TryUseRespawnChestLoop>d__10 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public RespawnChest respawnChest; public List<Transform> spawnSpots; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <TryUseRespawnChestLoop>d__10(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown int num = <>1__state; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (MayUseRespawnChest(respawnChest)) { ((Spawner)respawnChest).SpawnItems(spawnSpots); return false; } } else { <>1__state = -1; } PEAKER.LogVisually("{joinedColor} Waiting for all players to finish the section...</color>", onlySendOnce: true); <>2__current = (object)new WaitForSeconds(1f); <>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(); } } private Key _weakKey; private static bool _waitForAncientStatue; 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_004e: 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) //IL_0069: Expected O, but got Unknown //IL_0069: Expected O, but got Unknown //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_009d: Expected O, but got Unknown if (PEAKER.Config.Bind<bool>(new ConfigDefinition("Testing", "Tornadoes"), false, new ConfigDescription("Tornadoes..? (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value) { ((MonoBehaviour)this).StartCoroutine(SpawnTornado()); } _weakKey = PEAKER.Config.Bind<Key>(new ConfigDefinition("Testing", "WeakKey"), (Key)0, new ConfigDescription("Make yourself weak in the knees. (Client)", (AcceptableValueBase)null, Array.Empty<object>())).Value; _waitForAncientStatue = PEAKER.Config.Bind<bool>(new ConfigDefinition("Testing", "WaitForAncientStatue"), false, new ConfigDescription("Wait until all scouts have reached the top of the current section to activate the ancient statue. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; PEAKER.Patches.PatchAll(typeof(Testing)); } internal void Update() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown if ((int)_weakKey != 0 && ((ButtonControl)Keyboard.current[_weakKey]).wasPressedThisFrame && PhotonNetwork.InLobby) { object value; Hashtable val = new Hashtable { [(object)"PEAKER_Testing_Weak"] = !((Dictionary<object, object>)(object)PhotonNetwork.LocalPlayer.CustomProperties).TryGetValue((object)"PEAKER_Testing_Weak", out value) || !(value is bool flag) || !flag }; PhotonNetwork.LocalPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } [IteratorStateMachine(typeof(<SpawnTornado>d__4))] private IEnumerator SpawnTornado() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <SpawnTornado>d__4(0); } [HarmonyPatch(typeof(Tornado), "Movement")] [HarmonyPrefix] internal static bool PreTornadoStart(Tornado __instance) { //IL_0012: 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_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) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_004a: 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_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0066: 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_0070: 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_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.target == (Object)null) { return false; } Vector3 vel = __instance.vel; Vector3 val = Vector3Extensions.Flat(__instance.target.position - __instance.tornad