using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; using System.Numerics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Cryptography; using System.Security.Permissions; using System.Text; using System.Text.RegularExpressions; using System.Threading; using System.Threading.Tasks; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BombRushMP.BunchOfEmotes; using BombRushMP.Common; using BombRushMP.Common.Networking; using BombRushMP.Common.Packets; using BombRushMP.CrewBoom; using BombRushMP.MapStation; using BombRushMP.Mono; using BombRushMP.Mono.Runtime; using BombRushMP.NetRadio; using BombRushMP.NetworkInterfaceProvider; using BombRushMP.Plugin; using BombRushMP.Plugin.Gamemodes; using BombRushMP.Plugin.LocalServer; using BombRushMP.Plugin.OfflineInterface; using BombRushMP.Plugin.Patches; using BombRushMP.Plugin.Phone; using BombRushMP.PluginCommon; using BombRushMP.Server; using CommonAPI; using CommonAPI.Phone; using HarmonyLib; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Reptile; using Reptile.Phone; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Playables; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.TextCore; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: AssemblyCompany("BombRushMP.Plugin")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyDescription("My first plugin")] [assembly: AssemblyFileVersion("1.0.1.0")] [assembly: AssemblyInformationalVersion("1.0.1+c7b1b5d46d095617c81eaf82b70b65c1d0c82a16")] [assembly: AssemblyProduct("BombRushMP.Plugin")] [assembly: AssemblyTitle("BombRushMP.Plugin")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.1.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; } } } public class AppJoinLobbyDebug : CustomApp { public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("debug join lobby", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Lobbies", 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); } public override void OnAppEnable() { ((App)this).OnAppEnable(); PopulateButtons(); } private void PopulateButtons() { //IL_00b0: Unknown result type (might be due to invalid IL or missing references) base.ScrollView.RemoveAllButtons(); ClientController clientController = ClientController.Instance; foreach (KeyValuePair lobby in clientController.ClientLobbyManager.Lobbies) { MPPlayer mPPlayer = clientController.Players[lobby.Value.LobbyState.HostId]; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton($"[{lobby.Value.LobbyState.Players.Count}] {GamemodeFactory.GetGamemodeName(lobby.Value.LobbyState.Gamemode)} - {MPUtility.GetPlayerDisplayName(mPPlayer.ClientState)}"); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { clientController.ClientLobbyManager.JoinLobby(lobby.Key); }); base.ScrollView.AddButton((PhoneButton)(object)val); } } } public class AppMultiplayer : CustomApp { private PhoneButton _createLobbyButton; private PhoneButton _lobbyButton; private bool _waitingForLobbyCreateResponse; public static void Initialize() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Expected O, but got Unknown //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Expected O, but got Unknown byte[] array = File.ReadAllBytes(Path.Combine(MPSettings.Instance.Directory, "acn_icon.png")); Texture2D val = new Texture2D(1, 1); ImageConversion.LoadImage(val, array); ((Texture)val).wrapMode = (TextureWrapMode)1; Sprite val2 = TextureUtility.CreateSpriteFromTexture(val); PhoneAPI.RegisterApp("multiplayer", val2); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Multiplayer", 70f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); PopulateButtons(); } public override void OnAppUpdate() { ((App)this).OnAppUpdate(); ClientController instance = ClientController.Instance; if (!instance.Connected) { _waitingForLobbyCreateResponse = false; ClientController.PacketReceived = (Action)Delegate.Remove(ClientController.PacketReceived, new Action(OnPacketReceived_LobbyCreation)); } if (instance.ClientLobbyManager.CurrentLobby != null) { if ((Object)(object)_lobbyButton == (Object)null) { MakeLobbyButton(); } if ((Object)(object)_createLobbyButton != (Object)null) { base.ScrollView.RemoveButton(_createLobbyButton); _createLobbyButton = null; } } else { if ((Object)(object)_createLobbyButton == (Object)null) { MakeCreateLobbyButton(); } if ((Object)(object)_lobbyButton != (Object)null) { base.ScrollView.RemoveButton(_lobbyButton); _lobbyButton = null; } } } private void MakeCreateLobbyButton() { ClientLobbyManager lobbyManager = ClientController.Instance.ClientLobbyManager; _createLobbyButton = (PhoneButton)(object)PhoneUIUtility.CreateSimpleButton("Create Lobby"); PhoneButton createLobbyButton = _createLobbyButton; createLobbyButton.OnConfirm = (Action)Delegate.Combine(createLobbyButton.OnConfirm, (Action)delegate { if (!_waitingForLobbyCreateResponse) { GamemodeSettings gamemodeSettings = GamemodeFactory.GetGamemodeSettings((GamemodeIDs)0); SavedGamemodeSettings savedSettings = MPSaveData.Instance.GetSavedSettings((GamemodeIDs)0); if (savedSettings != null) { gamemodeSettings.ApplySaved(savedSettings); } lobbyManager.CreateLobby((GamemodeIDs)0, gamemodeSettings); _waitingForLobbyCreateResponse = true; ClientController.PacketReceived = (Action)Delegate.Combine(ClientController.PacketReceived, new Action(OnPacketReceived_LobbyCreation)); } }); base.ScrollView.InsertButton(0, _createLobbyButton); } private void OnPacketReceived_LobbyCreation(Packets packetId, Packet packet) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)packetId == 14) { _waitingForLobbyCreateResponse = false; ClientController.PacketReceived = (Action)Delegate.Remove(ClientController.PacketReceived, new Action(OnPacketReceived_LobbyCreation)); ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerCurrentLobby)); } } private void MakeLobbyButton() { _lobbyButton = (PhoneButton)(object)PhoneUIUtility.CreateSimpleButton("Lobby"); PhoneButton lobbyButton = _lobbyButton; lobbyButton.OnConfirm = (Action)Delegate.Combine(lobbyButton.OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerCurrentLobby)); }); base.ScrollView.InsertButton(0, _lobbyButton); } private void PopulateButtons() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Invites"); SimplePhoneButton obj = val; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerInvites)); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Join Public Lobby"); SimplePhoneButton obj2 = val; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerPublicLobbies)); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Stages"); SimplePhoneButton obj3 = val; ((PhoneButton)obj3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj3).OnConfirm, (Action)delegate { if (MapStationSupport.Stages.Count > 0) { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerStages)); } else { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerBaseStages)); } }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Spectate"); SimplePhoneButton obj4 = val; ((PhoneButton)obj4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj4).OnConfirm, (Action)delegate { SpectatorController.StartSpectating(forced: false); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Go AFK"); SimplePhoneButton obj5 = val; ((PhoneButton)obj5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj5).OnConfirm, (Action)delegate { PlayerComponent.Get(((App)this).MyPhone.player).ForceAFK(); ((App)this).MyPhone.TurnOff(true); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Stop AFK"); SimplePhoneButton obj6 = val; ((PhoneButton)obj6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj6).OnConfirm, (Action)delegate { PlayerComponent.Get(((App)this).MyPhone.player).StopAFK(); ((App)this).MyPhone.TurnOff(true); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Movestyle"); SimplePhoneButton obj7 = val; ((PhoneButton)obj7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj7).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(MoveStylePickerApp)); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Stats"); SimplePhoneButton obj8 = val; ((PhoneButton)obj8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj8).OnConfirm, (Action)delegate { SpectatorController instance = SpectatorController.Instance; if (!((Object)(object)instance != (Object)null) || !instance.Forced) { StatsUI instance2 = StatsUI.Instance; if (!instance2.Displaying) { ((App)this).MyPhone.TurnOff(false); instance2.Activate(); } } }); base.ScrollView.AddButton((PhoneButton)(object)val); } } public class AppMultiplayerBaseStages : StageListApp { private static bool LastSortedByPlayerCount = false; private static Dictionary StageMap = new Dictionary { { "Hideout", (Stage)5 }, { "Versum Hill", (Stage)4 }, { "Millenium Square", (Stage)11 }, { "Brink Terminal", (Stage)12 }, { "Millenium Mall", (Stage)6 }, { "Mataan", (Stage)7 }, { "Pyramid Island", (Stage)9 }, { "Police Station", (Stage)8 } }; public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("base stages", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Base Stages", 70f); ((CustomApp)this).ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); } public override void OnAppEnable() { ((App)this).OnAppEnable(); PopulateButtons(LastSortedByPlayerCount); } private void PopulateButtons(bool sortByPlayerCount = false) { //IL_0106: Unknown result type (might be due to invalid IL or missing references) LastSortedByPlayerCount = sortByPlayerCount; ((CustomApp)this).ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Sort: Player Count"); SimplePhoneButton obj = val; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { PopulateButtons(sortByPlayerCount: true); }); ((CustomApp)this).ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Sort: Default"); SimplePhoneButton obj2 = val; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { PopulateButtons(); }); ((CustomApp)this).ScrollView.AddButton((PhoneButton)(object)val); Dictionary dictionary = new Dictionary(StageMap); if (sortByPlayerCount) { dictionary = StageMap.OrderByDescending((KeyValuePair x) => base.ClientController.GetPlayerCountForStage(x.Value)).ToDictionary((KeyValuePair x) => x.Key, (KeyValuePair x) => x.Value); } foreach (KeyValuePair item in dictionary) { CreateStageButton(item.Key, item.Value); } } } public class AppMultiplayerCustomStages : StageListApp { private static bool LastSortedByPlayerCount; public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("custom stages", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Custom Stages", 70f); ((CustomApp)this).ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); PopulateButtons(LastSortedByPlayerCount); } private void PopulateButtons(bool sortByPlayerCount = false) { LastSortedByPlayerCount = sortByPlayerCount; ((CustomApp)this).ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Sort: Player Count"); SimplePhoneButton obj = val; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { PopulateButtons(sortByPlayerCount: true); }); ((CustomApp)this).ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Sort: Alphabetically"); SimplePhoneButton obj2 = val; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { PopulateButtons(); }); ((CustomApp)this).ScrollView.AddButton((PhoneButton)(object)val); List source = new List(MapStationSupport.Stages); source = source.OrderBy((MPStage x) => x.DisplayName).ToList(); if (sortByPlayerCount) { source = source.OrderByDescending((MPStage x) => base.ClientController.GetPlayerCountForStage((Stage)x.Id)).ToList(); } foreach (MPStage item in source) { CreateStageButton(item.DisplayName, (Stage)item.Id); } } } public class AppMultiplayerDebug : CustomApp { public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("multiplayer debug", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Debug", 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); PopulateButtons(); } private void PopulateButtons() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Join Lobby"); SimplePhoneButton obj = val; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppJoinLobbyDebug)); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("LowTierGod Skin"); SimplePhoneButton obj2 = val; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { Player currentPlayer8 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer8, (SpecialSkins)9); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Sean Kingston Skin"); SimplePhoneButton obj3 = val; ((PhoneButton)obj3).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj3).OnConfirm, (Action)delegate { Player currentPlayer7 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer7, (SpecialSkins)3); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Steve Skin"); SimplePhoneButton obj4 = val; ((PhoneButton)obj4).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj4).OnConfirm, (Action)delegate { Player currentPlayer6 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer6, (SpecialSkins)6); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Minecraft Skin"); SimplePhoneButton obj5 = val; ((PhoneButton)obj5).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj5).OnConfirm, (Action)delegate { Player currentPlayer5 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer5, (SpecialSkins)8); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Red Minecraft Skin"); SimplePhoneButton obj6 = val; ((PhoneButton)obj6).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj6).OnConfirm, (Action)delegate { Player currentPlayer4 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer4, (SpecialSkins)7); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Cop Skin Test"); SimplePhoneButton obj7 = val; ((PhoneButton)obj7).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj7).OnConfirm, (Action)delegate { Player currentPlayer3 = WorldHandler.instance.GetCurrentPlayer(); if (Random.Range(0, 2) == 0) { SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer3, (SpecialSkins)0); } else { SpecialSkinManager.Instance.ApplySpecialSkinToPlayer(currentPlayer3, (SpecialSkins)1); } SpecialSkinManager.Instance.ApplyRandomVariantToPlayer(currentPlayer3); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Remove Skin"); SimplePhoneButton obj8 = val; ((PhoneButton)obj8).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj8).OnConfirm, (Action)delegate { Player currentPlayer2 = WorldHandler.instance.GetCurrentPlayer(); SpecialSkinManager.Instance.RemoveSpecialSkinFromPlayer(currentPlayer2); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Enable ProSkater Mode"); SimplePhoneButton obj9 = val; ((PhoneButton)obj9).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj9).OnConfirm, (Action)delegate { ProSkaterPlayer.Set(WorldHandler.instance.GetCurrentPlayer(), set: true); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Disable ProSkater Mode"); SimplePhoneButton obj10 = val; ((PhoneButton)obj10).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj10).OnConfirm, (Action)delegate { ProSkaterPlayer.Set(WorldHandler.instance.GetCurrentPlayer(), set: false); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Enable Prop Hunt Mode"); SimplePhoneButton obj11 = val; ((PhoneButton)obj11).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj11).OnConfirm, (Action)delegate { PropDisguiseController.Instance.FreezeProps(); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Disable Prop Hunt Mode"); SimplePhoneButton obj12 = val; ((PhoneButton)obj12).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj12).OnConfirm, (Action)delegate { PropDisguiseController.Instance.UnfreezeProps(); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Apply Nearest Disguise"); SimplePhoneButton obj13 = val; ((PhoneButton)obj13).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj13).OnConfirm, (Action)delegate { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) Player currentPlayer = WorldHandler.instance.GetCurrentPlayer(); PropDisguiseController instance = PropDisguiseController.Instance; float num = float.PositiveInfinity; int disguiseId = 0; bool flag = false; foreach (KeyValuePair item in instance.PropByIndex) { float num2 = Vector3.Distance(((Component)currentPlayer).transform.position, item.Value.transform.position); if (!flag) { num = num2; disguiseId = item.Key; flag = true; } else if (num2 < num) { num = num2; disguiseId = item.Key; } } if (flag) { PlayerComponent.Get(currentPlayer).ApplyPropDisguise(disguiseId); } }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Remove Disguise"); SimplePhoneButton obj14 = val; ((PhoneButton)obj14).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj14).OnConfirm, (Action)delegate { PlayerComponent.GetLocal().RemovePropDisguise(); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Kill Yourself"); SimplePhoneButton obj15 = val; ((PhoneButton)obj15).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj15).OnConfirm, (Action)delegate { WorldHandler.instance.GetCurrentPlayer().ChangeHP(99999); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Test Map Ping"); SimplePhoneButton obj16 = val; ((PhoneButton)obj16).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj16).OnConfirm, (Action)delegate { MPUtility.PingInMap(((Component)WorldHandler.instance.GetCurrentPlayer()).gameObject, 2f); }); base.ScrollView.AddButton((PhoneButton)(object)val); } } public class AppMultiplayerPublicLobbies : CustomApp { public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("public lobbies", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Lobbies", 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); } public override void OnAppEnable() { ((App)this).OnAppEnable(); PopulateButtons(); } private void PopulateButtons() { base.ScrollView.RemoveAllButtons(); ClientController clientController = ClientController.Instance; ClientLobbyManager clientLobbyManager = clientController.ClientLobbyManager; foreach (KeyValuePair lobby in clientLobbyManager.Lobbies.OrderBy((KeyValuePair p) => p.Value.InGame ? 1 : 0)) { if ((clientLobbyManager.CurrentLobby != null && clientLobbyManager.CurrentLobby.LobbyState.Id == lobby.Key) || !lobby.Value.LobbyState.Challenge) { continue; } string text = $"({lobby.Value.LobbyState.Players.Count}) {clientLobbyManager.GetLobbyName(lobby.Key)} - {MPUtility.GetPlayerDisplayName(clientController.Players[lobby.Value.LobbyState.HostId].ClientState)}"; if (lobby.Value.LobbyState.InGame) { text += " (In Progress)"; } _ = clientController.Players[lobby.Value.LobbyState.HostId]; SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton(text); ((TMP_Text)val.Label).spriteAsset = MPAssets.Instance.Sprites; ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { if (lobby.Value.LobbyState.Challenge) { if (lobby.Value.LobbyState.InGame) { clientController.ClientLobbyManager.QueueJoinLobby(lobby.Key); ChatUI.Instance.AddMessage("Lobby is currently in-game. You will join when the game ends."); } else { clientController.ClientLobbyManager.JoinLobby(lobby.Key); } } }); base.ScrollView.AddButton((PhoneButton)(object)val); } } } public class AppMultiplayerStages : CustomApp { public override bool Available => false; public static void Initialize() { PhoneAPI.RegisterApp("stages", (Sprite)null); } public override void OnAppInit() { ((CustomApp)this).OnAppInit(); ((CustomApp)this).CreateIconlessTitleBar("Stages", 80f); base.ScrollView = PhoneScrollView.Create((CustomApp)(object)this, 275f, 1600f); PopulateButtons(); } private void PopulateButtons() { base.ScrollView.RemoveAllButtons(); SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("Base Stages"); SimplePhoneButton obj = val; ((PhoneButton)obj).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerBaseStages)); }); base.ScrollView.AddButton((PhoneButton)(object)val); val = PhoneUIUtility.CreateSimpleButton("Custom Stages"); SimplePhoneButton obj2 = val; ((PhoneButton)obj2).OnConfirm = (Action)Delegate.Combine(((PhoneButton)obj2).OnConfirm, (Action)delegate { ((App)this).MyPhone.OpenApp(typeof(AppMultiplayerCustomStages)); }); base.ScrollView.AddButton((PhoneButton)(object)val); } } public abstract class StageListApp : CustomApp { protected ClientController ClientController => ClientController.Instance; protected SimplePhoneButton CreateStageButton(string label, Stage stage) { //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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) SimplePhoneButton val = PhoneUIUtility.CreateSimpleButton("(0) " + label); ((PhoneButton)val).OnConfirm = (Action)Delegate.Combine(((PhoneButton)val).OnConfirm, (Action)delegate { //IL_0010: Unknown result type (might be due to invalid IL or missing references) Core.Instance.BaseModule.StageManager.ExitCurrentStage(stage, (Stage)(-1)); }); StageButton stageButton = ((Component)val).gameObject.AddComponent(); stageButton.Stage = stage; stageButton.StageName = label; base.ScrollView.AddButton((PhoneButton)(object)val); return val; } } namespace BombRushMP.Plugin { public static class AprilClient { public const string AprilTag = "april"; public static int[] AprilBadges = new int[18] { 38, 47, 34, 35, 25, 2, 55, 56, 57, 58, 59, 60, 61, 62, 54, 64, 65, 66 }; public static int GetBadgeForName(string name) { Random random = new Random(name.GetHashCode()); return AprilBadges[random.Next(AprilBadges.Length)]; } public static bool GetAprilEventEnabled() { ClientController instance = ClientController.Instance; if ((Object)(object)instance == (Object)null) { return false; } if (instance.ServerState == null) { return false; } return instance.ServerState.Tags.Contains("april"); } } public static class AudioLibraryUtils { public static AudioLibrary CreateFromSpecialSkin(SpecialSkinDefinition definition) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Expected O, but got Unknown //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown AudioLibrary val = new AudioLibrary(); AudioCollection val2 = new AudioCollection(); AudioCollection val3 = new AudioCollection(); AudioCollection val4 = new AudioCollection(); AudioCollection val5 = new AudioCollection(); AudioCollection val6 = new AudioCollection(); AudioCollection val7 = new AudioCollection(); AudioCollection val8 = new AudioCollection(); val2.Clips.AddRange(definition.Jump); val3.Clips.AddRange(definition.GetHit); val4.Clips.AddRange(definition.Die); val5.Clips.AddRange(definition.DieFall); val6.Clips.AddRange(definition.Combo); val7.Clips.AddRange(definition.BoostTrick); val8.Clips.AddRange(definition.Talk); val.Collections[(AudioClipID)489] = val2; val.Collections[(AudioClipID)488] = val3; val.Collections[(AudioClipID)484] = val4; val.Collections[(AudioClipID)485] = val5; val.Collections[(AudioClipID)487] = val6; val.Collections[(AudioClipID)498] = val7; val.Collections[(AudioClipID)486] = val8; return val; } } public class BadgeMap { private TMP_SpriteAsset _spriteAsset; public BadgeMap(TMP_SpriteAsset spriteAsset) { _spriteAsset = spriteAsset; } public void ParseFromDirectory(string path, int padding) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Expected O, but got Unknown //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_0182: 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_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Expected O, but got Unknown //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Expected O, but got Unknown string[] files = Directory.GetFiles(path, "*.png"); List list = new List(); List list2 = new List(); string[] array = files; foreach (string path2 in array) { Texture2D val = new Texture2D(2, 2); ImageConversion.LoadImage(val, File.ReadAllBytes(path2), false); int item = int.Parse(Path.GetFileNameWithoutExtension(path2)); list.Add(val); list2.Add(item); } Texture2D val2 = new Texture2D(2, 2); Rect[] array2 = val2.PackTextures(list.ToArray(), padding); ((Texture)val2).filterMode = (FilterMode)(MPSettings.Instance.SmoothSprites ? 1 : 0); ((Texture)val2).wrapMode = (TextureWrapMode)1; _spriteAsset.spriteSheet = (Texture)(object)val2; int num = list2.Max() + 1; TMP_SpriteGlyph[] collection = (TMP_SpriteGlyph[])(object)new TMP_SpriteGlyph[num]; TMP_SpriteCharacter[] collection2 = (TMP_SpriteCharacter[])(object)new TMP_SpriteCharacter[num]; _spriteAsset.spriteGlyphTable.Clear(); _spriteAsset.spriteCharacterTable.Clear(); _spriteAsset.spriteGlyphTable.AddRange(collection); _spriteAsset.spriteCharacterTable.AddRange(collection2); for (int j = 0; j < list.Count; j++) { TMP_SpriteGlyph val3 = new TMP_SpriteGlyph { index = (uint)list2[j], glyphRect = new GlyphRect((int)(((Rect)(ref array2[j])).x * (float)((Texture)val2).width), (int)(((Rect)(ref array2[j])).y * (float)((Texture)val2).height), (int)(((Rect)(ref array2[j])).width * (float)((Texture)val2).width), (int)(((Rect)(ref array2[j])).height * (float)((Texture)val2).height)), metrics = new GlyphMetrics(((Rect)(ref array2[j])).width * (float)((Texture)val2).width, ((Rect)(ref array2[j])).height * (float)((Texture)val2).height, 0f, ((Rect)(ref array2[j])).height * (float)((Texture)val2).height * MPSettings.Instance.SpriteBaseline, ((Rect)(ref array2[j])).width * (float)((Texture)val2).width), scale = 1.2f }; TMP_SpriteCharacter value = new TMP_SpriteCharacter((uint)list2[j], val3); _spriteAsset.spriteGlyphTable[list2[j]] = val3; _spriteAsset.spriteCharacterTable[list2[j]] = value; Object.Destroy((Object)(object)list[j]); } _spriteAsset.UpdateLookupTables(); ((TMP_Asset)_spriteAsset).material.mainTexture = (Texture)(object)val2; } } internal class BadgeSettings { } public class BalanceUI : MonoBehaviour { public enum Types { TypeA, TypeB, TypeC } private const float TypeARotation = 61.62f; private const float TypeBRotation = 90f; private const float TypeCRotation = 52f; private Types Type = Types.TypeB; private GameObject _grindUI; private Image _grindUIBG; private RawImage _grindUIIndicatorImage; private GameObject _grindUIIndicator; private GameObject _manualUI; private Image _manualUIBG; private RawImage _manualUIIndicatorImage; private GameObject _manualUIIndicator; public static BalanceUI Instance { get; private set; } private void Awake() { Instance = this; Transform val = ((Component)this).transform.Find("Canvas"); _grindUI = ((Component)val.Find("Grind Balance UI")).gameObject; _manualUI = ((Component)val.Find("Manual Balance UI")).gameObject; _grindUIBG = ((Component)_grindUI.transform.Find("Image")).GetComponent(); _grindUIIndicator = ((Component)_grindUI.transform.Find("Indicator")).gameObject; _grindUIIndicatorImage = _grindUIIndicator.GetComponentInChildren(true); _manualUIBG = ((Component)_manualUI.transform.Find("Image")).GetComponent(); _manualUIIndicator = ((Component)_manualUI.transform.Find("Indicator")).gameObject; _manualUIIndicatorImage = _manualUIIndicator.GetComponentInChildren(true); _manualUI.SetActive(false); _grindUI.SetActive(false); } private void Update() { //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_0211: Unknown result type (might be due to invalid IL or missing references) UIManager uIManager = Core.Instance.UIManager; if ((Object)(object)uIManager.gameplay == (Object)null || (Object)(object)uIManager.gameplay.gameplayScreen == (Object)null) { return; } if (!((Component)uIManager.gameplay.gameplayScreen).gameObject.activeInHierarchy) { _grindUI.SetActive(false); _manualUI.SetActive(false); return; } WorldHandler instance = WorldHandler.instance; if ((Object)(object)instance == (Object)null) { return; } Player currentPlayer = instance.GetCurrentPlayer(); if ((Object)(object)currentPlayer == (Object)null) { return; } ProSkaterPlayer proSkaterPlayer = ProSkaterPlayer.Get(currentPlayer); if ((Object)(object)proSkaterPlayer == (Object)null) { _grindUI.SetActive(false); _manualUI.SetActive(false); return; } float num = 61.62f; if (Type == Types.TypeB) { num = 90f; } else if (Type == Types.TypeC) { num = 52f; } if (!proSkaterPlayer.DidGrind) { _grindUI.SetActive(false); } else { _grindUI.SetActive(true); Color color = ((Graphic)_grindUIBG).color; color.a = 0.3f; if (currentPlayer.ability != null && (currentPlayer.ability is GrindAbility || currentPlayer.ability is HandplantAbility)) { color.a = 1f; } ((Graphic)_grindUIBG).color = color; ((Graphic)_grindUIIndicatorImage).color = color; _grindUIIndicator.transform.localRotation = Quaternion.Euler(0f, 0f, (0f - proSkaterPlayer.GrindBalance.Current) * num); } if (!proSkaterPlayer.DidManual) { _manualUI.SetActive(false); return; } _manualUI.SetActive(true); Color color2 = ((Graphic)_manualUIBG).color; color2.a = 0.3f; if (proSkaterPlayer.IsOnManual()) { color2.a = 1f; } ((Graphic)_manualUIBG).color = color2; ((Graphic)_manualUIIndicatorImage).color = color2; _manualUIIndicator.transform.localRotation = Quaternion.Euler(0f, 0f, (0f - proSkaterPlayer.ManualBalance.Current) * num); } public static void Create() { if ((Object)(object)Instance != (Object)null) { Object.Destroy((Object)(object)((Component)Instance).gameObject); } MPAssets instance = MPAssets.Instance; GameObject val = instance.Bundle.LoadAsset("Balance UI"); if (MPSettings.Instance.BalanceUIType == Types.TypeB) { val = instance.Bundle.LoadAsset("Balance UI B"); } else if (MPSettings.Instance.BalanceUIType == Types.TypeC) { val = instance.Bundle.LoadAsset("Balance UI C"); } GameObject obj = Object.Instantiate(val); obj.transform.SetParent(((Component)Core.Instance.UIManager).transform, false); obj.AddComponent().Type = MPSettings.Instance.BalanceUIType; } } public class ChatUI : MonoBehaviour { public enum States { None, Unfocused, Focused } private const int MaxMessages = 250; private Button _sendButton; private TMP_InputField _inputField; private ScrollRect _scrollRect; private Image _scrollRectImage; private Image[] _scrollBarImages; private GameObject _chatWindow; private TextMeshProUGUI _referenceText; private List _messages = new List(); public Action OnTrySendMessage; private const float TimeForMessagesToHide = 30f; private bool _messagesHidden; private float _messageHideTimer; public static ChatUI Instance { get; private set; } private float FontSize => MPSettings.Instance.ChatFontSize; public States State { get; private set; } private void Awake() { //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Expected O, but got Unknown Instance = this; _chatWindow = ((Component)((Component)this).transform.Find("Canvas").Find("Chat Window")).gameObject; _sendButton = ((Component)_chatWindow.transform.Find("Send Button")).GetComponent