Decompiled source of PEAKER v0.4.4
BepInEx/plugins/PEAKER.dll
Decompiled 4 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak.Network; using Photon.Pun; using Photon.Realtime; using Steamworks; using TMPro; using Unity.Collections; using UnityEngine; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; using UnityEngine.UI; using Zorro.Core; using Zorro.Core.Serizalization; using Zorro.Settings; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: IgnoresAccessChecksTo("Photon3Unity3D")] [assembly: IgnoresAccessChecksTo("PhotonRealtime")] [assembly: IgnoresAccessChecksTo("PhotonUnityNetworking")] [assembly: IgnoresAccessChecksTo("PhotonVoice")] [assembly: AssemblyCompany("PEAKER")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright © 2024")] [assembly: AssemblyFileVersion("0.4.4.0")] [assembly: AssemblyInformationalVersion("0.4.4")] [assembly: AssemblyProduct("PEAKER")] [assembly: AssemblyTitle("PEAKER")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.4.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 { public class BannedScouts : MonoBehaviour { private static Callback<LobbyChatUpdate_t> _onLobbyChatUpdateCallback; internal static readonly Dictionary<ulong, string> bannedScouts = new Dictionary<ulong, string>(); internal static readonly HashSet<ulong> ignoredScouts = new HashSet<ulong>(); private static CSteamID _lastSentChat; [Localized("BannedScouts", "TriedToJoinButIsBanned", "{userColor} {0} ({1})</color>{joinedColor} tried to join,</color>{leftColor} but</color>{userColor} {2} ({3})</color>{leftColor} is banned! Not letting them in...</color>", "When a player tries to join, but a banned player is in the Steam lobby. 0 is joining persona name, 1 is joining steam id, 2 is banned persona name, 3 is banned steam id.", null)] private static string Localized_TriedToJoinButIsBanned(string joiningPersonaName, ulong joiningSteamId, string bannedPersonaName, ulong bannedSteamId) { return Localization.GetText("BannedScouts_TriedToJoinButIsBanned", joiningPersonaName, joiningSteamId, bannedPersonaName, bannedSteamId); } 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() { UpdateBannedScouts(); PEAKER.Patches.PatchAll(typeof(BannedScouts)); } internal static void BanScout(CSteamID steamId, string reason) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Banning {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); File.AppendAllText(Path.Combine(Paths.BepInExRootPath, "banned.txt"), $"\n{steamId.m_SteamID} | {SteamFriends.GetFriendPersonaName(steamId)} | {reason}"); UpdateBannedScouts(); ignoredScouts.Add(steamId.m_SteamID); } internal static void UnbanScout(CSteamID steamId) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Unbanning {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}..."); string[] source = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt")); source = source.Where((string line) => !line.StartsWith(steamId.m_SteamID.ToString())).ToArray(); File.WriteAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt"), source); UpdateBannedScouts(); ignoredScouts.Remove(steamId.m_SteamID); } internal static void IgnoreScout(CSteamID steamId) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) PEAKER.Logger.LogInfo((object)$"Ignoring {steamId.m_SteamID}: {SteamFriends.GetFriendPersonaName(steamId)}"); ignoredScouts.Add(steamId.m_SteamID); } internal static void UpdateBannedScouts() { PEAKER.Logger.LogInfo((object)"Updating Banned Scouts..."); bannedScouts.Clear(); if (!File.Exists(Path.Combine(Paths.BepInExRootPath, "banned.txt"))) { File.WriteAllText(Path.Combine(Paths.BepInExRootPath, "banned.txt"), ""); } else { string[] array = File.ReadAllLines(Path.Combine(Paths.BepInExRootPath, "banned.txt")); foreach (string text in array) { int num = text.IndexOf('|'); if (num == -1) { num = text.Length; } ulong result; ulong num2 = (ulong.TryParse(text.Substring(0, num).Trim(), out result) ? result : 0); if (num2 != 0L && !bannedScouts.ContainsKey(num2)) { string value = string.Empty; if (num != text.Length) { string text2 = text; int num3 = num + 1; value = text2.Substring(num3, text2.Length - num3).Trim(); } bannedScouts.Add(num2, value); } } } foreach (ulong key in bannedScouts.Keys) { PEAKER.Logger.LogInfo((object)$"Banned Scout: {key} ({bannedScouts[key]})"); } } private static void OnLobbyChatUpdate(LobbyChatUpdate_t data) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) if (data.m_ulSteamIDLobby == GameHandler.GetService<SteamLobbyHandler>().m_currentLobby.m_SteamID) { if (data.m_rgfChatMemberStateChange == 1) { PEAKER.Logger.LogInfo((object)$"{SteamFriends.GetFriendPersonaName(new CSteamID(data.m_ulSteamIDUserChanged))} ({data.m_ulSteamIDUserChanged}) entered the Steam lobby."); return; } PEAKER.Logger.LogInfo((object)$"{SteamFriends.GetFriendPersonaName(new CSteamID(data.m_ulSteamIDUserChanged))} ({data.m_ulSteamIDUserChanged}) left the Steam lobby. ({(object)(EChatMemberStateChange)data.m_rgfChatMemberStateChange})"); ignoredScouts.Remove(data.m_ulSteamIDUserChanged); } } [HarmonyPatch(typeof(GameHandler), "Awake")] [HarmonyPostfix] internal static void PostGameHandlerAwake() { _onLobbyChatUpdateCallback = Callback<LobbyChatUpdate_t>.Create((DispatchDelegate<LobbyChatUpdate_t>)OnLobbyChatUpdate); } [HarmonyPatch(typeof(GameHandler), "OnDestroy")] [HarmonyPostfix] internal static void PostGameHandlerOnDestroy() { _onLobbyChatUpdateCallback?.Unregister(); } [HarmonyPatch(typeof(SteamLobbyHandler), "OnLobbyEnter")] [HarmonyPostfix] internal static void PostSteamLobbyHandlerOnLobbyEnter() { ignoredScouts.Clear(); } [HarmonyPatch(typeof(SteamLobbyHandler), "OnLobbyChat")] [HarmonyPrefix] internal static void PreSteamLobbyHandlerOnLobbyChat(SteamLobbyHandler __instance, ref LobbyChatMsg_t param) { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) _lastSentChat = new CSteamID(param.m_ulSteamIDUser); PEAKER.Logger.LogInfo((object)$"Steam Chat Message Received: '{SteamFriends.GetFriendPersonaName(new CSteamID(param.m_ulSteamIDUser))}' ({param.m_ulSteamIDUser})"); int numLobbyMembers = SteamMatchmaking.GetNumLobbyMembers(__instance.m_currentLobby); for (int i = 0; i < numLobbyMembers; i++) { PEAKER.Logger.LogInfo((object)$"Steam Lobby Member: '{SteamFriends.GetFriendPersonaName(SteamMatchmaking.GetLobbyMemberByIndex(__instance.m_currentLobby, i))}' ({SteamMatchmaking.GetLobbyMemberByIndex(__instance.m_currentLobby, i).m_SteamID})"); } } [HarmonyPatch(typeof(SteamLobbyHandler), "SendRoomID")] [HarmonyPrefix] internal static bool PreSteamLobbyHandlerSendRoomID(SteamLobbyHandler __instance) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e0: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_01f3: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: 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_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021e: 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(Localized_TriedToJoinButIsBanned(SteamFriends.GetFriendPersonaName(_lastSentChat), _lastSentChat.m_SteamID, SteamFriends.GetFriendPersonaName(lobbyMemberByIndex), lobbyMemberByIndex.m_SteamID), onlySendOnce: true, sfxJoin: false, sfxLeave: true); string text = Guid.NewGuid().ToString(); string[] obj = new string[5] { text.Substring(0, 14), (new char[15] { '0', '1', '2', '3', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' })[Random.Range(0, 15)].ToString(), text.Substring(15, 4), (new char[12] { '0', '1', '2', '3', '4', '5', '6', '7', 'c', 'd', 'e', 'f' })[Random.Range(0, 12)].ToString(), null }; string text2 = text; obj[4] = text2.Substring(20, text2.Length - 20); text = string.Concat(obj); BinarySerializer val = new BinarySerializer(256, (Allocator)2); val.WriteByte((byte)2); val.WriteString(text, Encoding.ASCII); byte[] array = NativeArrayExtensions.ToByteArray(val.buffer); val.Dispose(); if (!SteamMatchmaking.SendLobbyChatMsg(__instance.m_currentLobby, array, array.Length)) { __instance.m_currentlyRequestingRoomID = Optionable<CSteamID>.None; PEAKER.Logger.LogError((object)"Failed to send Room ID..."); return false; } PEAKER.Logger.LogInfo((object)("Lobby has been requested. Sending " + text + " (fake room)")); return false; } } return true; } } public class CheatDetections : MonoBehaviour, IInRoomCallbacks, ILobbyCallbacks { private enum OwnershipCondition { None, IsMasterClient, IsViewOwner, IsMasterClientOrViewOwner } [CompilerGenerated] private sealed class <CheckScoutsForMods>d__17 : 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__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown int num = <>1__state; CheatDetections cheatDetections = <>4__this; if (num != 0) { if (num != 1) { return false; } <>1__state = -1; if (PhotonNetwork.InRoom) { foreach (Player value in PhotonNetwork.CurrentRoom.Players.Values) { cheatDetections.CheckScoutForMods(value); } } } else { <>1__state = -1; } <>2__current = (object)new WaitForSeconds(5f); <>1__state = 1; return true; } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } internal static readonly HashSet<int> ignoredPlayerNumbers = new HashSet<int>(); private bool _autoKickAtlasCherry; internal void Awake() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0039: Expected O, but got Unknown //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0081: Expected O, but got Unknown PEAKER.Logger.LogInfo((object)"Checking cheat detections"); if (!PEAKER.Config.Bind<bool>(new ConfigDefinition("Cheat Detections", "Enabled"), true, new ConfigDescription("Whether or not to enable PEAKER's cheat detections. (Client)", (AcceptableValueBase)null, Array.Empty<object>())).Value) { PEAKER.Logger.LogInfo((object)"Cheat detections not enabled"); Object.DestroyImmediate((Object)(object)this); return; } _autoKickAtlasCherry = PEAKER.Config.Bind<bool>(new ConfigDefinition("Cheat Detections", "AutoKickAtlasCherry"), false, new ConfigDescription("Whether or not to automatically kick scouts using Atlas or Cherry. (Host)", (AcceptableValueBase)null, Array.Empty<object>())).Value; PEAKER.Logger.LogInfo((object)"Cheat detections enabled"); ((MonoBehaviour)this).StartCoroutine(CheckScoutsForMods()); PEAKER.Patches.PatchAll(typeof(CheatDetections)); } internal void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } internal void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } public static bool IsIgnored(Player player) { if (player != null) { return ignoredPlayerNumbers.Contains(player.ActorNumber); } return false; } internal static void IgnorePlayer(Player player) { if (player != null) { PEAKER.Logger.LogInfo((object)$"Ignoring #{player.ActorNumber}: {player.NickName}"); ignoredPlayerNumbers.Add(player.ActorNumber); } } internal static void UnignorePlayer(Player player) { if (player != null) { PEAKER.Logger.LogInfo((object)$"Unignoring #{player.ActorNumber}: {player.NickName}"); ignoredPlayerNumbers.Remove(player.ActorNumber); } } public void OnPlayerEnteredRoom(Player newPlayer) { } public void OnPlayerLeftRoom(Player otherPlayer) { UnignorePlayer(otherPlayer); } public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) { } public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) { if (((Dictionary<object, object>)(object)changedProps).ContainsKey((object)"NickName")) { PEAKER.Logger.LogInfo((object)$"{targetPlayer.NickName} (#{targetPlayer.ActorNumber}) changed their Photon name!"); PEAKER.LogVisually("{userColor} " + targetPlayer.NickName + "</color>{joinedColor} changed their Photon name!", onlySendOnce: true, sfxJoin: true); } } public void OnMasterClientSwitched(Player newMasterClient) { 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); } public void OnJoinedLobby() { ignoredPlayerNumbers.Clear(); } public void OnLeftLobby() { ignoredPlayerNumbers.Clear(); } public void OnRoomListUpdate(List<RoomInfo> roomList) { } public void OnLobbyStatisticsUpdate(List<TypedLobbyInfo> lobbyStatistics) { } [IteratorStateMachine(typeof(<CheckScoutsForMods>d__17))] private IEnumerator CheckScoutsForMods() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <CheckScoutsForMods>d__17(0) { <>4__this = this }; } private void CheckScoutForMods(Player player) { if (player.ActorNumber == PhotonNetwork.LocalPlayer.ActorNumber || ignoredPlayerNumbers.Contains(player.ActorNumber)) { return; } if (((Dictionary<object, object>)(object)player.CustomProperties).ContainsKey((object)"CherryUser")) { PEAKER.LogVisually("{userColor} " + player.NickName + "</color>{leftColor} is using the Cherry mod!</color>", onlySendOnce: true); if (PhotonNetwork.IsMasterClient && _autoKickAtlasCherry) { PlayerHandler.Kick(player.ActorNumber); } } 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 (PhotonNetwork.IsMasterClient && _autoKickAtlasCherry) { PlayerHandler.Kick(player.ActorNumber); } } 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 (PhotonNetwork.IsMasterClient && _autoKickAtlasCherry) { PlayerHandler.Kick(player.ActorNumber); } } 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); if (PhotonNetwork.IsMasterClient && _autoKickAtlasCherry) { PlayerHandler.Kick(player.ActorNumber); } } } private static bool IsRpcValid(PhotonView view, Player sender, OwnershipCondition ownershipCondition, Func<bool> validCondition = null) { if (sender == null || ignoredPlayerNumbers.Contains(sender.ActorNumber)) { return true; } switch (ownershipCondition) { case OwnershipCondition.IsMasterClient: if (sender.IsMasterClient) { return true; } break; case OwnershipCondition.IsViewOwner: if (sender.ActorNumber == view.Owner.ActorNumber) { return true; } break; case OwnershipCondition.IsMasterClientOrViewOwner: if (sender.IsMasterClient || sender.ActorNumber == view.Owner.ActorNumber) { return true; } break; } return validCondition?.Invoke() ?? true; } [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), "BeginAirportLoadRPC")] [HarmonyPostfix] internal static void PostGameOverHandlerBeginAirportLoadRPC(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_0119; case 8: if (!(text == "BeeSwarm")) { break; } goto IL_0119; case 20: if (!(text == "Bingbong_Push_Gentle")) { break; } goto IL_0119; case 7: { if (!(text == "Tornado")) { break; } goto IL_0119; } IL_0119: PEAKER.LogVisually("{userColor} " + parameters.creator.NickName + "</color>{leftColor} instantiated the '" + parameters.prefabName + "' prefab!</color>", onlySendOnce: false, sfxJoin: false, sfxLeave: true); break; } } } [LocalizedEnum] public enum CharacterPhysicsOptimizationMode { [LocalizedEnumDescription("Disabled.")] None, [LocalizedEnumDescription("Disable scout's colliders when they're dead.")] DisableCollidersWhenDead } [LocalizedEnum] public enum LateJoinAntiFlingMode { [LocalizedEnumDescription("Disabled.")] None, [LocalizedEnumDescription("Slow a scout's max velocity when they join late.")] Slow } public class ClientImprovements : MonoBehaviour, IInRoomCallbacks { internal static ConfigEntry<CharacterPhysicsOptimizationMode> characterPhysicsOptimizationMode; internal static ConfigEntry<LateJoinAntiFlingMode> lateJoinAntiFlingMode; internal void Awake() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_002a: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown //IL_0059: Expected O, but got Unknown characterPhysicsOptimizationMode = PEAKER.Config.Bind<CharacterPhysicsOptimizationMode>(new ConfigDefinition("Client Improvements", "CharacterPhysicsOptimizationMode"), CharacterPhysicsOptimizationMode.DisableCollidersWhenDead, new ConfigDescription("Decides how to optimize the physics of scout's characters. DisableCollidersWhenDead will prevent the lag caused by every dead character's colliders overlapping at one point in the void.", (AcceptableValueBase)null, Array.Empty<object>())); lateJoinAntiFlingMode = PEAKER.Config.Bind<LateJoinAntiFlingMode>(new ConfigDefinition("Client Improvements", "LateJoinAntiFlingMode"), LateJoinAntiFlingMode.None, new ConfigDescription("Experimental! Desides how to prematurely prevent late joiners from potentially bugging out on your client and flinging you. Slow will limit their ragdoll's maximum velocity upon joining.", (AcceptableValueBase)null, Array.Empty<object>())); PEAKER.Patches.PatchAll(typeof(ClientImprovements)); } internal void OnEnable() { PhotonNetwork.AddCallbackTarget((object)this); } internal void OnDisable() { PhotonNetwork.RemoveCallbackTarget((object)this); } public void OnPlayerEnteredRoom(Player newPlayer) { } public void OnPlayerLeftRoom(Player otherPlayer) { } public void OnRoomPropertiesUpdate(Hashtable propertiesThatChanged) { } public void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) { } public void OnMasterClientSwitched(Player newMasterClient) { } [HarmonyPatch(typeof(Character), "RPCA_Die")] [HarmonyPostfix] internal static void PostCharacterRPCA_Die(Character __instance) { if (characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead) { __instance.refs.ragdoll.ToggleCollision(false); } } [HarmonyPatch(typeof(Character), "RPCA_Revive")] [HarmonyPrefix] internal static void PreCharacterRPCA_Revive(Character __instance) { if (characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead) { __instance.refs.ragdoll.ToggleCollision(true); } } [HarmonyPatch(typeof(CharacterRagdoll), "Awake")] [HarmonyPostfix] internal static void PostCharacterRagdollAwake(CharacterRagdoll __instance) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance.character == (Object)(object)Character.localCharacter || __instance.character.isBot) { return; } Scene activeScene = SceneManager.GetActiveScene(); if (((Scene)(ref activeScene)).name == "Airport" || Time.timeSinceLevelLoad < 60f || lateJoinAntiFlingMode.Value != LateJoinAntiFlingMode.Slow) { return; } PEAKER.Logger.LogInfo((object)("Slowing down " + __instance.character.view.Owner.NickName + "...")); foreach (Bodypart part in __instance.partList) { part.rig.maxLinearVelocity = 10f; } PEAKER.Logger.LogInfo((object)__instance.partList[0].rig.maxLinearVelocity); } [HarmonyPatch(typeof(PhotonNetwork), "RPC", new Type[] { typeof(PhotonView), typeof(string), typeof(RpcTarget), typeof(Player), typeof(bool), typeof(object[]) })] [HarmonyPrefix] internal static void PrePhotonNetworkRPC(PhotonView view, string methodName, ref RpcTarget target) { if ((int)target == 3 || (int)target == 4 || (int)target == 6) { if (methodName == "RemoveSkeletonRPC" && (int)target == 3) { target = (RpcTarget)0; PEAKER.Logger.LogInfo((object)$"Changed Buffering of RPC: '{((Component)view).gameObject}'-'{methodName}' {target}"); } else { PEAKER.Logger.LogInfo((object)$"Buffering RPC: '{((Component)view).gameObject}'-'{methodName}' {target}"); } } } [HarmonyPatch(typeof(GameHandler), "Initialize")] [HarmonyPostfix] internal static void PostGameHandlerInitialize() { ((Setting)GameHandler.Instance.SettingsHandler.GetSetting<LobbyTypeSetting>()).RegisterListener((Action<Setting>)OnLobbyTypeSettingChanged); ((Setting)GameHandler.Instance.SettingsHandler.GetSetting<LobbyTypeSetting>()).RegisterExternalListener((Action<Setting>)OnLobbyTypeSettingChanged); } private static void OnLobbyTypeSettingChanged(Setting setting) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) LobbyTypeSetting val = (LobbyTypeSetting)(object)((setting is LobbyTypeSetting) ? setting : null); if (val != null) { CSteamID currentLobby = GameHandler.GetService<SteamLobbyHandler>().m_currentLobby; if (SteamMatchmaking.GetLobbyOwner(currentLobby) == SteamUser.GetSteamID()) { SteamMatchmaking.SetLobbyType(currentLobby, (ELobbyType)(((int)((EnumSetting<LobbyType>)(object)val).Value == 0) ? 1 : 0)); } } } [HarmonyPatch(typeof(LobbyTypeSetting), "ShouldShow")] [HarmonyPrefix] internal static bool PreLobbyTypeSettingShouldShow(ref bool __result) { __result = true; return false; } } public sealed class Gui : MonoBehaviour { private enum Guis { None, Actions, Scouts, NoFlyList, Config } private static class ActionsGui { public static Rect rect = new Rect(0f, 0f, 220f, -1f); [Localized("GuiActions", "UnlockStartKiosk", "Unlock Start Kiosk", "The unlock text for the Start Kiosk Lock action.", null)] private static string Localized_UnlockStartKiosk { get; set; } [Localized("GuiActions", "LockStartKiosk", "Lock Start Kiosk", "The lock text for the Start Kiosk Lock action.", null)] private static string Localized_LockStartKiosk { get; set; } [Localized("GuiActions", "LightNearbyCampfire", "Light Nearby Campfire", "The text for the Light Nearby Campfire action.", null)] private static string Localized_LightNearbyCampfire { get; set; } [Localized("GuiActions", "SpawnBackpack", "Spawn Backpack", "The text for the Spawn Backpack action.", null)] private static string Localized_SpawnBackpack { get; set; } [Localized("GuiActions", "SkipEndScreen", "Skip End Screen", "The text for the Skip End Screen action.", null)] private static string Localized_SkipEndScreen { get; set; } [Localized("GuiActions", "UnlockSteamLobby", "Unlock Steam Lobby", "The unlock text for the Steam Lobby Lock action.", null)] private static string Localized_UnlockSteamLobby { get; set; } [Localized("GuiActions", "LockSteamLobby", "Lock Steam Lobby", "The lock text for the Steam Lobby Lock action.", null)] private static string Localized_LockSteamLobby { get; set; } public static void DrawGui(int _) { //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Invalid comparison between Unknown and I4 //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(StartKioskLock.StartKioskLocked ? Localized_UnlockStartKiosk : Localized_LockStartKiosk, WrapButton, Array.Empty<GUILayoutOption>())) { StartKioskLock.TryToggle(); } if (GUILayout.Button(Localized_LightNearbyCampfire, WrapButton, Array.Empty<GUILayoutOption>())) { Vector3 center = Character.localCharacter.Center; Campfire[] array = Object.FindObjectsByType<Campfire>((FindObjectsSortMode)0); foreach (Campfire val in array) { if (!val.Lit) { Vector3 position = ((Component)val).transform.position; if (Vector3.Distance(center, position) <= 10f) { PEAKER.Logger.LogInfo((object)"Forcibly lighting campfire."); val.view.RPC("SetFireWoodCount", (RpcTarget)0, new object[1] { 3 }); val.view.RPC("Light_Rpc", (RpcTarget)3, Array.Empty<object>()); break; } } } PEAKER.Logger.LogInfo((object)"No campfire nearby to forcibly light."); } if (GUILayout.Button(Localized_SpawnBackpack, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)"Giving backpack to self."); ItemDatabase.Add(ObjectDatabaseAsset<ItemDatabase, Item>.GetObjectFromString("Backpack")); } GUI.enabled = PhotonNetwork.IsMasterClient && Object.op_Implicit((Object)(object)Singleton<GameOverHandler>.Instance) && ((MenuWindow)GUIManager.instance.endScreen).isOpen; if (GUILayout.Button(Localized_SkipEndScreen, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)"Forcing all scouts to be done with the end screen."); Singleton<GameOverHandler>.Instance.ForceEveryPlayerDoneWithEndScreen(); } GUI.enabled = PhotonNetwork.IsMasterClient; if (GUILayout.Button(SteamLobbyLock.SteamLobbyLocked ? Localized_UnlockSteamLobby : Localized_LockSteamLobby, WrapButton, Array.Empty<GUILayoutOption>())) { SteamLobbyLock.TryToggle(); } GUI.enabled = true; GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } } private static class ScoutsGui { [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawPhotonWindow; public static WindowFunction <1>__DrawSteamWindow; } public static Rect rect = new Rect(0f, 0f, 320f, -1f); private static Rect _photonRect = new Rect(0f, 0f, 400f, 600f); private static Rect _steamRect = new Rect(0f, 0f, 400f, 600f); private static bool _resizingPhoton = false; private static Vector2 _resizePhotonStartPos = Vector2.zero; private static Vector2 _resizePhotonStartSize = Vector2.zero; private static bool _resizingSteam = false; private static Vector2 _resizeSteamStartPos = Vector2.zero; private static Vector2 _resizeSteamStartSize = Vector2.zero; private static Vector2 _scroll = new Vector2(0f, 0f); private static int _photonActorNumber = -1; private static CSteamID _steamId = CSteamID.Nil; private static string _banReason = "No reason specified."; [Localized("GuiScouts", "PhotonScouts", "Photon Scouts", "The title of the Photon Scouts section of the Scouts GUI.", null)] private static string Localized_PhotonScouts { get; set; } [Localized("GuiScouts", "SteamScouts", "Steam Scouts", "The title of the Steam Scouts section of the Scouts GUI.", null)] private static string Localized_SteamScouts { get; set; } [Localized("GuiScouts", "PhotonScoutInfoNone", "Photon Scout: None", "Shown when no Photon scout is selected.", null)] private static string Localized_PhotonScoutInfoNone { get; set; } [Localized("GuiScouts", "Kick", "Kick", "Kick the selected Photon scout from the room.", null)] private static string Localized_Kick { get; set; } [Localized("GuiScouts", "DecreaseMaxVelocity", "Decrease Max Velocity", "Button to decrease the scout's max velocity.", null)] private static string Localized_DecreaseMaxVelocity { get; set; } [Localized("GuiScouts", "IncreaseMaxVelocity", "Increase Max Velocity", "Button to increase the scout's max velocity.", null)] private static string Localized_IncreaseMaxVelocity { get; set; } [Localized("GuiScouts", "IgnoreDetections", "Ignore Detections", "Ignore cheat detections for the selected scout.", null)] private static string Localized_IgnoreDetections { get; set; } [Localized("GuiScouts", "UnignoreDetections", "Unignore Detections", "Stop ignoring cheat detections for the selected scout.", null)] private static string Localized_UnignoreDetections { get; set; } [Localized("GuiScouts", "SteamScoutInfoNone", "Steam Scout: None", "Shown when no Steam scout is selected.", null)] private static string Localized_SteamScoutInfoNone { get; set; } [Localized("GuiScouts", "CopySteamId", "Copy Steam ID", "Copies the selected Steam ID to the clipboard.", null)] private static string Localized_CopySteamId { get; set; } [Localized("GuiScouts", "BanReason", "Ban Reason:", "Label for the ban reason text field.", null)] private static string Localized_BanReason { get; set; } [Localized("GuiScouts", "Ban", "Ban", "Ban the selected Steam scout.", null)] private static string Localized_Ban { get; set; } [Localized("GuiScouts", "Banned", "Banned", "Shown when the selected scout is already banned.", null)] private static string Localized_Banned { get; set; } [Localized("GuiScouts", "TempIgnoredBan", "Temp Ignored Ban", "Shown when a ban is temporarily ignored.", null)] private static string Localized_TempIgnoredBan { get; set; } [Localized("GuiScouts", "TempIgnoreBan", "Temp Ignore Ban", "Temporarily ignore a ban for the selected scout.", null)] private static string Localized_TempIgnoreBan { get; set; } [Localized("GuiScouts", "NotInPhotonRoom", "Not in a Photon Room.", "Shown when the player is not in a Photon room.", null)] private static string Localized_NotInPhotonRoom { get; set; } [Localized("GuiScouts", "NotInSteamLobby", "Not in a Steam Lobby.", "Shown when the player is not in a Steam lobby.", null)] private static string Localized_NotInSteamLobby { get; set; } [Localized("GuiScouts", "You", "YOU", "Label indicating the local player.", null)] private static string Localized_You { get; set; } [Localized("GuiScouts", "PhotonScoutInfo", "Photon Scout: #{0}: {1}", "Displays information about the currently selected Photon scout. 0 is their ActorNumber, 1 is their NickName.", "SteamScouts")] private static string Localized_PhotonScoutInfo(int actorNumber, string nickName) { return Localization.GetText("GuiScouts_PhotonScoutInfo", actorNumber, nickName); } [Localized("GuiScouts", "CurrentMaxVelocity", "Is this scout glitching out for you? Try decreasing their max velocity! Current: {0}", "Displays the current max velocity of the selected scout. 0 is current max velocity.", "Kick")] private static string Localized_CurrentMaxVelocity(string value) { return Localization.GetText("GuiScouts_CurrentMaxVelocity", value); } [Localized("GuiScouts", "SteamScoutInfo", "Steam Scout: {0}: {1}", "Displays Steam ID and name of the selected Steam scout. 0 is their Steam ID, 1 is their persona name.", "UnignoreDetections")] private static string Localized_SteamScoutInfo(ulong steamId, string personaName) { return Localization.GetText("GuiScouts_SteamScoutInfo", steamId, personaName); } public static void DrawGui(int _) { //IL_038b: Unknown result type (might be due to invalid IL or missing references) //IL_0390: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_03d0: Unknown result type (might be due to invalid IL or missing references) //IL_03d5: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044b: Unknown result type (might be due to invalid IL or missing references) //IL_0457: Unknown result type (might be due to invalid IL or missing references) //IL_045c: Unknown result type (might be due to invalid IL or missing references) //IL_04df: Unknown result type (might be due to invalid IL or missing references) //IL_04e4: Unknown result type (might be due to invalid IL or missing references) //IL_0468: Unknown result type (might be due to invalid IL or missing references) //IL_04f0: Unknown result type (might be due to invalid IL or missing references) //IL_057d: Unknown result type (might be due to invalid IL or missing references) //IL_0583: Invalid comparison between Unknown and I4 //IL_04fc: Unknown result type (might be due to invalid IL or missing references) //IL_04ad: Unknown result type (might be due to invalid IL or missing references) //IL_058a: Unknown result type (might be due to invalid IL or missing references) //IL_058f: Unknown result type (might be due to invalid IL or missing references) //IL_0541: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); Player player = default(Player); if (PhotonNetwork.TryGetPlayer(_photonActorNumber, ref player)) { GUILayout.Label(Localized_PhotonScoutInfo(player.ActorNumber, player.NickName), Array.Empty<GUILayoutOption>()); } else { GUILayout.Label(Localized_PhotonScoutInfoNone, Array.Empty<GUILayoutOption>()); } GUI.enabled = player != null && player.ActorNumber != PhotonNetwork.LocalPlayer.ActorNumber; if (PhotonNetwork.IsMasterClient && GUILayout.Button(Localized_Kick, WrapButton, Array.Empty<GUILayoutOption>())) { PlayerHandler.Kick(player.ActorNumber); } float num = 0f; Scoutmaster val2 = default(Scoutmaster); Character val = ((player == null) ? null : Character.AllCharacters.FindLast((Character character) => character.view.Owner.ActorNumber == player.ActorNumber && !((Component)character).TryGetComponent<Scoutmaster>(ref val2))); if ((Object)(object)val != (Object)null && val.refs.ragdoll.partList.Count > 0) { num = val.refs.ragdoll.partList[0].rig.maxLinearVelocity; } GUILayout.Label(Localized_CurrentMaxVelocity(((Object)(object)val == (Object)null) ? "N/A" : num.ToString()), Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (GUILayout.Button(Localized_DecreaseMaxVelocity, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)("Slowing down " + player.NickName + "...")); if ((Object)(object)val != (Object)null) { foreach (Bodypart part in val.refs.ragdoll.partList) { Rigidbody rig = part.rig; rig.maxLinearVelocity *= 0.1f; if (part.rig.maxLinearVelocity < 0.1f) { part.rig.maxLinearVelocity = 0.1f; } } PEAKER.Logger.LogInfo((object)val.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } if (GUILayout.Button(Localized_IncreaseMaxVelocity, WrapButton, Array.Empty<GUILayoutOption>())) { PEAKER.Logger.LogInfo((object)("Speeding up " + player.NickName + "...")); if ((Object)(object)val != (Object)null) { foreach (Bodypart part2 in val.refs.ragdoll.partList) { Rigidbody rig2 = part2.rig; rig2.maxLinearVelocity *= 10f; if (part2.rig.maxLinearVelocity > 1E+16f) { part2.rig.maxLinearVelocity = 1E+16f; } } PEAKER.Logger.LogInfo((object)val.refs.ragdoll.partList[0].rig.maxLinearVelocity); } } GUILayout.EndHorizontal(); if (CheatDetections.IsIgnored(player)) { if (GUILayout.Button(Localized_UnignoreDetections, WrapButton, Array.Empty<GUILayoutOption>())) { CheatDetections.UnignorePlayer(player); } } else if (GUILayout.Button(Localized_IgnoreDetections, WrapButton, Array.Empty<GUILayoutOption>())) { CheatDetections.IgnorePlayer(player); } GUI.enabled = true; GUILayout.Space(8f); if (_steamId != CSteamID.Nil) { GUILayout.Label(Localized_SteamScoutInfo(_steamId.m_SteamID, SteamFriends.GetFriendPersonaName(_steamId)), Array.Empty<GUILayoutOption>()); } else { GUILayout.Label(Localized_SteamScoutInfoNone, Array.Empty<GUILayoutOption>()); } GUI.enabled = _steamId != CSteamID.Nil; if (GUILayout.Button(Localized_CopySteamId, WrapButton, Array.Empty<GUILayoutOption>())) { GUIUtility.systemCopyBuffer = _steamId.m_SteamID.ToString(); } GUI.enabled = true; GUILayout.Label(Localized_BanReason, Array.Empty<GUILayoutOption>()); _banReason = GUILayout.TextField(_banReason, Array.Empty<GUILayoutOption>()).Replace("\n", " "); if (_steamId != CSteamID.Nil && _steamId != SteamUser.GetSteamID()) { if (BannedScouts.IsBanned(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_Banned, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } else if (GUILayout.Button(Localized_Ban, WrapButton, Array.Empty<GUILayoutOption>())) { BannedScouts.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_Ban, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } if (_steamId != CSteamID.Nil && BannedScouts.IsBanned(_steamId)) { if (BannedScouts.IsIgnored(_steamId)) { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoredBan, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } else if (GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty<GUILayoutOption>())) { BannedScouts.BanScout(_steamId, _banReason); } } else { GUI.enabled = false; GUILayout.Button(Localized_TempIgnoreBan, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } public static void SubWindows() { //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Expected O, but got Unknown //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown ((Rect)(ref _photonRect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width; ((Rect)(ref _photonRect)).y = ((Rect)(ref rect)).y; ((Rect)(ref _steamRect)).x = ((Rect)(ref _photonRect)).x + ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).y = ((Rect)(ref _photonRect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect photonRect = _photonRect; object obj = <>O.<0>__DrawPhotonWindow; if (obj == null) { WindowFunction val = DrawPhotonWindow; <>O.<0>__DrawPhotonWindow = val; obj = (object)val; } _photonRect = GUI.Window(controlID, photonRect, (WindowFunction)obj, Localized_PhotonScouts); ((Rect)(ref rect)).x = ((Rect)(ref _photonRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _photonRect)).y; ((Rect)(ref _steamRect)).x = ((Rect)(ref _photonRect)).x + ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).y = ((Rect)(ref _photonRect)).y; int controlID2 = GUIUtility.GetControlID((FocusType)2); Rect steamRect = _steamRect; object obj2 = <>O.<1>__DrawSteamWindow; if (obj2 == null) { WindowFunction val2 = DrawSteamWindow; <>O.<1>__DrawSteamWindow = val2; obj2 = (object)val2; } _steamRect = GUI.Window(controlID2, steamRect, (WindowFunction)obj2, Localized_SteamScouts); ((Rect)(ref _photonRect)).x = ((Rect)(ref _steamRect)).x - ((Rect)(ref _photonRect)).width; ((Rect)(ref _photonRect)).y = ((Rect)(ref _steamRect)).y; ((Rect)(ref rect)).x = ((Rect)(ref _photonRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _photonRect)).y; } private static void DrawPhotonWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Expected O, but got Unknown //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) //IL_03a2: Unknown result type (might be due to invalid IL or missing references) //IL_03a6: Unknown result type (might be due to invalid IL or missing references) //IL_0372: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Invalid comparison between Unknown and I4 //IL_029e: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c1: Unknown result type (might be due to invalid IL or missing references) //IL_02c6: Unknown result type (might be due to invalid IL or missing references) //IL_02d7: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_03bf: Unknown result type (might be due to invalid IL or missing references) //IL_03c4: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0325: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _photonRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _photonRect)).height - 28f - 25f) }); if (!PhotonNetwork.InRoom) { GUILayout.Label(Localized_NotInPhotonRoom, Array.Empty<GUILayoutOption>()); } else { Player[] playerList = PhotonNetwork.PlayerList; foreach (Player val in playerList) { GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>()); if (PhotonNetwork.LocalPlayer.ActorNumber == val.ActorNumber) { Vector2 val2 = GUI.skin.label.CalcSize(new GUIContent(Localized_You)); GUILayout.Label(Localized_You, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(Mathf.Min(val2.x + 3f, 80f)) }); } if (GUILayout.Button($"#{val.ActorNumber}: {val.NickName}", WrapButton, Array.Empty<GUILayoutOption>())) { _photonActorNumber = val.ActorNumber; } GUILayout.EndHorizontal(); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref _photonRect)).width - 30f, ((Rect)(ref _photonRect)).height - 30f, 25f, 25f); Rect val4 = default(Rect); ((Rect)(ref val4))..ctor(((Rect)(ref _photonRect)).width - 27f, ((Rect)(ref _photonRect)).height - 27f, 19f, 19f); GUI.Box(val4, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val4)).x + 3f, ((Rect)(ref val4)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizingPhoton) { if (Mouse.current.leftButton.isPressed) { Vector2 val5 = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); val5.y = (float)Screen.height - val5.y; Vector2 val6 = val5 - _resizePhotonStartPos; ((Rect)(ref _photonRect)).width = Mathf.Max(_resizePhotonStartSize.x + val6.x, 300f); ((Rect)(ref _photonRect)).height = Mathf.Max(_resizePhotonStartSize.y + val6.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizingPhoton = false; ((Rect)(ref _steamRect)).width = ((Rect)(ref _photonRect)).width; ((Rect)(ref _steamRect)).height = ((Rect)(ref _photonRect)).height; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val3)).Contains(mousePosition)) { _resizingPhoton = true; _resizePhotonStartPos = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); _resizePhotonStartPos.y = (float)Screen.height - _resizePhotonStartPos.y; _resizePhotonStartSize = new Vector2(((Rect)(ref _photonRect)).width, ((Rect)(ref _photonRect)).height); Event.current.Use(); } } GUI.DragWindow(); } private static void DrawSteamWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_01b9: Unknown result type (might be due to invalid IL or missing references) //IL_01c4: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Expected O, but got Unknown //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b5: Unknown result type (might be due to invalid IL or missing references) //IL_0381: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Invalid comparison between Unknown and I4 //IL_02ad: Unknown result type (might be due to invalid IL or missing references) //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02bc: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Unknown result type (might be due to invalid IL or missing references) //IL_02cb: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02d5: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_0407: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _steamRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _steamRect)).height - 28f - 25f) }); CSteamID currentLobby = GameHandler.GetService<SteamLobbyHandler>().m_currentLobby; if (currentLobby == CSteamID.Nil) { GUILayout.Label(Localized_NotInSteamLobby, Array.Empty<GUILayoutOption>()); } else { 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) { Vector2 val = GUI.skin.label.CalcSize(new GUIContent(Localized_You)); GUILayout.Label(Localized_You, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(Mathf.Min(val.x + 3f, 80f)) }); } if (GUILayout.Button($"{lobbyMemberByIndex.m_SteamID}: {SteamFriends.GetFriendPersonaName(lobbyMemberByIndex)}", WrapButton, Array.Empty<GUILayoutOption>())) { _steamId = lobbyMemberByIndex; } GUILayout.EndHorizontal(); } } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _steamRect)).width - 30f, ((Rect)(ref _steamRect)).height - 30f, 25f, 25f); Rect val3 = default(Rect); ((Rect)(ref val3))..ctor(((Rect)(ref _steamRect)).width - 27f, ((Rect)(ref _steamRect)).height - 27f, 19f, 19f); GUI.Box(val3, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val3)).x + 3f, ((Rect)(ref val3)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizingSteam) { if (Mouse.current.leftButton.isPressed) { Vector2 val4 = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); val4.y = (float)Screen.height - val4.y; Vector2 val5 = val4 - _resizeSteamStartPos; ((Rect)(ref _steamRect)).width = Mathf.Max(_resizeSteamStartSize.x + val5.x, 300f); ((Rect)(ref _steamRect)).height = Mathf.Max(_resizeSteamStartSize.y + val5.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizingSteam = false; ((Rect)(ref _photonRect)).width = ((Rect)(ref _steamRect)).width; ((Rect)(ref _photonRect)).height = ((Rect)(ref _steamRect)).height; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val2)).Contains(mousePosition)) { _resizingSteam = true; _resizeSteamStartPos = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); _resizeSteamStartPos.y = (float)Screen.height - _resizeSteamStartPos.y; _resizeSteamStartSize = new Vector2(((Rect)(ref _steamRect)).width, ((Rect)(ref _steamRect)).height); Event.current.Use(); } } GUI.DragWindow(); } } private static class NoFlyListGui { [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawListWindow; } public static Rect rect = new Rect(0f, 0f, 320f, -1f); private static Rect _listRect = new Rect(0f, 0f, 400f, 600f); private static bool _resizing = false; private static Vector2 _resizeStartPos = Vector2.zero; private static Vector2 _resizeStartSize = Vector2.zero; private static Vector2 _scroll = new Vector2(0f, 0f); private static ulong _steamId = 0uL; [Localized("GuiNoFlyList", "BannedScoutInfoNone", "Banned Scout: None", "Shown when no banned scout is selected.", null)] private static string Localized_BannedScoutInfoNone { get; set; } [Localized("GuiNoFlyList", "None", "None", "Generic None label when no banned scout is selected.", null)] private static string Localized_None { get; set; } [Localized("GuiNoFlyList", "Unban", "Unban", "Unban the selected scout.", null)] private static string Localized_Unban { get; set; } [Localized("GuiNoFlyList", "OpenBannedTxt", "Open banned.txt", "Opens the banned.txt file in file explorer.", null)] private static string Localized_OpenBannedTxt { get; set; } [Localized("GuiNoFlyList", "TheNoFlyList", "The No Fly List", "The title of the No Fly List section of the No Fly List GUI.", null)] private static string Localized_TheNoFlyList { get; set; } [Localized("GuiNoFlyList", "BannedScoutInfo", "Banned Scout: {0}", "Displays the currently selected banned scout's Steam ID.", null)] private static string Localized_BannedScoutInfo(ulong steamId) { return Localization.GetText("GuiNoFlyList_BannedScoutInfo", steamId); } public static void DrawGui(int _) { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Invalid comparison between Unknown and I4 //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); if (_steamId != 0L && !BannedScouts.IsBanned(new CSteamID(_steamId))) { _steamId = 0uL; } if (_steamId != 0L) { GUILayout.Label(Localized_BannedScoutInfo(_steamId), Array.Empty<GUILayoutOption>()); } else { GUILayout.Label(Localized_BannedScoutInfoNone, Array.Empty<GUILayoutOption>()); } GUILayout.Label((_steamId != 0L) ? BannedScouts.bannedScouts[_steamId] : Localized_None, Array.Empty<GUILayoutOption>()); if (_steamId != 0L) { if (GUILayout.Button(Localized_Unban, WrapButton, Array.Empty<GUILayoutOption>())) { BannedScouts.UnbanScout(new CSteamID(_steamId)); } } else { GUI.enabled = false; GUILayout.Button(Localized_Unban, WrapButton, Array.Empty<GUILayoutOption>()); GUI.enabled = true; } GUILayout.Space(8f); if (GUILayout.Button(Localized_OpenBannedTxt, WrapButton, Array.Empty<GUILayoutOption>())) { Process.Start("explorer.exe", "/select," + Path.Combine(Paths.BepInExRootPath, "banned.txt").Replace("/", "\\")); } GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } public static void SubWindow() { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Expected O, but got Unknown ((Rect)(ref _listRect)).x = ((Rect)(ref rect)).x + ((Rect)(ref rect)).width; ((Rect)(ref _listRect)).y = ((Rect)(ref rect)).y; int controlID = GUIUtility.GetControlID((FocusType)2); Rect listRect = _listRect; object obj = <>O.<0>__DrawListWindow; if (obj == null) { WindowFunction val = DrawListWindow; <>O.<0>__DrawListWindow = val; obj = (object)val; } _listRect = GUI.Window(controlID, listRect, (WindowFunction)obj, Localized_TheNoFlyList); ((Rect)(ref rect)).x = ((Rect)(ref _listRect)).x - ((Rect)(ref rect)).width; ((Rect)(ref rect)).y = ((Rect)(ref _listRect)).y; } private static void DrawListWindow(int _) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0144: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01fc: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_02e4: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Invalid comparison between Unknown and I4 //IL_0238: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0271: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_0331: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c5: Invalid comparison between Unknown and I4 GUILayout.BeginVertical((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _listRect)).height - 28f - 25f) }); _scroll = GUILayout.BeginScrollView(_scroll, false, true, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(((Rect)(ref _listRect)).height - 28f - 25f) }); bool flag = false; foreach (ulong key in BannedScouts.bannedScouts.Keys) { if (flag) { GUILayout.Space(8f); } flag = true; if (GUILayout.Button(key.ToString(), WrapButton, Array.Empty<GUILayoutOption>())) { _steamId = key; } GUILayout.Label(BannedScouts.bannedScouts[key], Array.Empty<GUILayoutOption>()); } GUILayout.EndScrollView(); GUILayout.EndVertical(); Rect val = default(Rect); ((Rect)(ref val))..ctor(((Rect)(ref _listRect)).width - 30f, ((Rect)(ref _listRect)).height - 30f, 25f, 25f); Rect val2 = default(Rect); ((Rect)(ref val2))..ctor(((Rect)(ref _listRect)).width - 27f, ((Rect)(ref _listRect)).height - 27f, 19f, 19f); GUI.Box(val2, string.Empty); Color color = GUI.color; GUI.color = new Color(1f, 1f, 1f, 0.6f); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 4f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 9f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.DrawTexture(new Rect(((Rect)(ref val2)).x + 3f, ((Rect)(ref val2)).y + 14f, 13f, 1f), (Texture)(object)Texture2D.whiteTexture); GUI.color = color; if (_resizing) { if (Mouse.current.leftButton.isPressed) { Vector2 val3 = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); val3.y = (float)Screen.height - val3.y; Vector2 val4 = val3 - _resizeStartPos; ((Rect)(ref _listRect)).width = Mathf.Max(_resizeStartSize.x + val4.x, 300f); ((Rect)(ref _listRect)).height = Mathf.Max(_resizeStartSize.y + val4.y, 200f); if ((int)Event.current.type == 0 || (int)Event.current.type == 3) { Event.current.Use(); } } else { _resizing = false; if ((int)Event.current.type == 1) { Event.current.Use(); } } } else if ((int)Event.current.type == 0) { Vector2 mousePosition = Event.current.mousePosition; if (((Rect)(ref val)).Contains(mousePosition)) { _resizing = true; _resizeStartPos = ((InputControl<Vector2>)(object)((Pointer)Mouse.current).position).ReadValue(); _resizeStartPos.y = (float)Screen.height - _resizeStartPos.y; _resizeStartSize = new Vector2(((Rect)(ref _listRect)).width, ((Rect)(ref _listRect)).height); Event.current.Use(); } } GUI.DragWindow(); } } private static class ConfigGui { public static Rect rect = new Rect(0f, 0f, 320f, -1f); [Localized("GuiConfig", "Locale", "Locale/Language", "The locale to use.", null)] private static string Localized_Locale { get; set; } [Localized("GuiConfig", "CharacterPhysicsOptimizationMode", "Character Physics Optimization Mode", "The name of the Character Physics Optimization Mode section of the Config GUI.", null)] private static string Localized_CharacterPhysicsOptimizationMode { get; set; } [Localized("GuiConfig", "LateJoinAntiFlingMode", "Late Join Anti Fling Mode", "The name of the Late Join Anti Fling Mode section of the Config GUI.", null)] private static string Localized_LateJoinAntiFlingMode { get; set; } public static void DrawGui(int _) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042a: Invalid comparison between Unknown and I4 //IL_0431: Unknown result type (might be due to invalid IL or missing references) //IL_0436: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02e6: Unknown result type (might be due to invalid IL or missing references) GUIStyle val = new GUIStyle(GUI.skin.label) { alignment = (TextAnchor)4 }; GUILayout.BeginVertical(Array.Empty<GUILayoutOption>()); GUILayout.Label(Localized_Locale, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); HashSet<string> hashSet = new HashSet<string>(); hashSet.Add("en-US"); foreach (string item in from file in Directory.GetFiles(Localization.FullDirectory, "locale.*-*.cfg") select Path.GetFileName(file).Split('.')[1]) { hashSet.Add(item); } string[] array = hashSet.ToArray(); lock (Localization.localeEntryLock) { int num = Array.IndexOf(array, Localization.localeEntry.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num = (num - 1 + array.Length) % array.Length; } GUILayout.Label(Localization.Localized_Name, val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num = (num + 1) % array.Length; } Localization.localeEntry.Value = array[num]; } GUILayout.EndHorizontal(); GUILayout.Label(Localized_CharacterPhysicsOptimizationMode, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); CharacterPhysicsOptimizationMode[] array2 = (CharacterPhysicsOptimizationMode[])Enum.GetValues(typeof(CharacterPhysicsOptimizationMode)); int num2 = Array.IndexOf(array2, ClientImprovements.characterPhysicsOptimizationMode.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num2 = (num2 - 1 + array2.Length) % array2.Length; } GUILayout.Label(Localization.GetText(ClientImprovements.characterPhysicsOptimizationMode.Value), val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num2 = (num2 + 1) % array2.Length; } ClientImprovements.characterPhysicsOptimizationMode.Value = array2[num2]; foreach (Character allCharacter in Character.AllCharacters) { if ((Object)(object)allCharacter == (Object)(object)Character.localCharacter || allCharacter.view.IsMine || (ClientImprovements.characterPhysicsOptimizationMode.Value == CharacterPhysicsOptimizationMode.DisableCollidersWhenDead && allCharacter.data.dead) || allCharacter.data.isCarried) { continue; } foreach (BodypartType key in allCharacter.refs.ragdoll.partDict.Keys) { ((Collider)allCharacter.refs.ragdoll.partDict[key].colliders[0].col).enabled = true; } } GUILayout.EndHorizontal(); GUILayout.Label(Localized_LateJoinAntiFlingMode, Array.Empty<GUILayoutOption>()); GUILayout.BeginHorizontal((GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); LateJoinAntiFlingMode[] array3 = (LateJoinAntiFlingMode[])Enum.GetValues(typeof(LateJoinAntiFlingMode)); int num3 = Array.IndexOf(array3, ClientImprovements.lateJoinAntiFlingMode.Value); if (GUILayout.Button("<", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num3 = (num3 - 1 + array3.Length) % array3.Length; } GUILayout.Label(Localization.GetText(ClientImprovements.lateJoinAntiFlingMode.Value), val, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.ExpandWidth(true) }); if (GUILayout.Button(">", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(40f) })) { num3 = (num3 + 1) % array3.Length; } ClientImprovements.lateJoinAntiFlingMode.Value = array3[num3]; GUILayout.EndHorizontal(); GUILayout.EndVertical(); if ((int)Event.current.type == 7) { Rect lastRect = GUILayoutUtility.GetLastRect(); ((Rect)(ref rect)).height = ((Rect)(ref lastRect)).yMax + 10f; } GUI.DragWindow(); } } [CompilerGenerated] private static class <>O { public static WindowFunction <0>__DrawGui; public static WindowFunction <1>__DrawGui; public static WindowFunction <2>__DrawGui; public static WindowFunction <3>__DrawGui; } private Key _key; private static bool _open; private Rect _rect = new Rect(20f, 20f, 140f, -1f); private Guis _current; private static GUIStyle _wrapButton; private static GUIStyle _windowTitleWrapped; private static GUIStyle WrapButton { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown object obj = _wrapButton; if (obj == null) { GUIStyle val = new GUIStyle(GUI.skin.button) { wordWrap = true, alignment = (TextAnchor)4, fixedHeight = 0f }; _wrapButton = val; obj = (object)val; } return (GUIStyle)obj; } } private static GUIStyle WindowTitleWrapped { get { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown object obj = _windowTitleWrapped; if (obj == null) { GUIStyle val = new GUIStyle(GUI.skin.label) { fontSize = GUI.skin.window.fontSize, fontStyle = (FontStyle)1, alignment = (TextAnchor)1, wordWrap = true }; _windowTitleWrapped = val; obj = (object)val; } return (GUIStyle)obj; } } [Localized("Gui", "Actions", "Actions", "The name of the Actions tab in the PEAKER GUI.", null)] private static string Localized_Actions { get; set; } [Localized("Gui", "Scouts", "Scouts", "The name of the Scouts tab in the PEAKER GUI.", null)] private static string Localized_Scouts { get; set; } [Localized("Gui", "NoFlyList", "No Fly List", "The name of the No Fly List tab in the PEAKER GUI.", null)] private static string Localized_NoFlyList { get; set; } [Localized("Gui", "Config", "Config", "The name of the Config tab in the PEAKER GUI.", null)] private static string Localized_Config { get; set; } [Localized("GuiTitle", "Main", "PEAKER GUI", "The main title of the PEAKER GUI.", null)] private static string Localized_MainTitle { get; set; } [Localized("GuiTitle", "Actions", "Actions GUI", "The title of the Actions tab in the PEAKER GUI.", null