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.RegularExpressions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ExitGames.Client.Photon; using HarmonyLib; using LobbyImprovements.Patches; using MenuLib; using MenuLib.MonoBehaviors; using Microsoft.CodeAnalysis; using Newtonsoft.Json; using Photon.Pun; using Photon.Realtime; using Steamworks; using Steamworks.Data; using TMPro; using UnityEngine; using UnityEngine.Networking; [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: AssemblyCompany("uk.1a3.lobbyimprovements")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.2.2.0")] [assembly: AssemblyInformationalVersion("1.2.2+fc347b35f64bdcb0e1dd91da7848bf2d3095ecf2")] [assembly: AssemblyProduct("LobbyImprovements")] [assembly: AssemblyTitle("uk.1a3.lobbyimprovements")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.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 LobbyImprovements { public class ObjectScreenshotTaker : MonoBehaviour { private enum ScreenshotTypes { None, Modules, Enemies, Items, Valuables } [CompilerGenerated] private sealed class d__22 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ObjectScreenshotTaker <>4__this; public string ssType; public GameObject[] modules; private bool 5__2; private GameObject[] <>7__wrap2; private int <>7__wrap3; private GameObject 5__5; private string 5__6; private string 5__7; private bool 5__8; private GameObject 5__9; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__22(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>7__wrap2 = null; 5__5 = null; 5__6 = null; 5__7 = null; 5__9 = null; <>1__state = -2; } private bool MoveNext() { //IL_0807: Unknown result type (might be due to invalid IL or missing references) //IL_080c: Unknown result type (might be due to invalid IL or missing references) //IL_0817: Unknown result type (might be due to invalid IL or missing references) //IL_0826: Unknown result type (might be due to invalid IL or missing references) //IL_0835: Unknown result type (might be due to invalid IL or missing references) //IL_088c: Unknown result type (might be due to invalid IL or missing references) //IL_0891: Unknown result type (might be due to invalid IL or missing references) //IL_0895: Unknown result type (might be due to invalid IL or missing references) //IL_089a: Unknown result type (might be due to invalid IL or missing references) //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b3: Unknown result type (might be due to invalid IL or missing references) //IL_05ec: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Unknown result type (might be due to invalid IL or missing references) //IL_0958: Unknown result type (might be due to invalid IL or missing references) //IL_095c: Unknown result type (might be due to invalid IL or missing references) //IL_0961: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_0929: Unknown result type (might be due to invalid IL or missing references) //IL_092e: Unknown result type (might be due to invalid IL or missing references) //IL_0997: Unknown result type (might be due to invalid IL or missing references) //IL_099c: Unknown result type (might be due to invalid IL or missing references) //IL_09a0: Unknown result type (might be due to invalid IL or missing references) //IL_09a5: Unknown result type (might be due to invalid IL or missing references) //IL_09bc: Unknown result type (might be due to invalid IL or missing references) //IL_07a2: Unknown result type (might be due to invalid IL or missing references) //IL_09e0: Unknown result type (might be due to invalid IL or missing references) //IL_09e5: Unknown result type (might be due to invalid IL or missing references) //IL_09e9: Unknown result type (might be due to invalid IL or missing references) //IL_09ee: Unknown result type (might be due to invalid IL or missing references) //IL_0a05: Unknown result type (might be due to invalid IL or missing references) //IL_052b: Unknown result type (might be due to invalid IL or missing references) //IL_0535: Expected O, but got Unknown //IL_0bde: Unknown result type (might be due to invalid IL or missing references) //IL_0be8: Expected O, but got Unknown //IL_0709: Unknown result type (might be due to invalid IL or missing references) //IL_0713: Expected O, but got Unknown //IL_0bbe: Unknown result type (might be due to invalid IL or missing references) //IL_0b9d: Unknown result type (might be due to invalid IL or missing references) //IL_0bd3: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0598: Unknown result type (might be due to invalid IL or missing references) //IL_05a2: Expected O, but got Unknown int num = <>1__state; ObjectScreenshotTaker objectScreenshotTaker = <>4__this; Bounds val; float num2; Vector3 val2; Vector3 val3; float num3; float num4; switch (num) { default: return false; case 0: <>1__state = -1; if (!Directory.Exists(objectScreenshotTaker.SavePath + "/" + ssType)) { Directory.CreateDirectory(objectScreenshotTaker.SavePath + "/" + ssType); } 5__2 = false; <>7__wrap2 = modules; <>7__wrap3 = 0; goto IL_0c93; case 1: <>1__state = -1; 5__8 = false; 5__9 = objectScreenshotTaker.moduleObject; if (ssType == "Enemies") { Enemy componentInChildren = objectScreenshotTaker.moduleObject.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.Freeze(7f); } if (((Object)5__5).name == "Enemy - Bomb Thrower") { 5__9 = ((Component)componentInChildren.Rigidbody).gameObject; } else if (((Object)5__5).name == "Enemy - Elsa") { 5__9 = ((Component)((Component)componentInChildren).gameObject.GetComponent().visualsTransform).gameObject; } else if (((Object)5__5).name == "Enemy - Oogly") { 5__9 = ((Component)((Component)componentInChildren).gameObject.GetComponent().visualTransform).gameObject; } if (((Object)5__5).name != "Enemy - Beamer" && ((Object)5__5).name != "Enemy - Shadow" && ((Object)5__5).name != "Enemy - Slow Walker" && ((Object)5__5).name != "Enemy - Upscream") { 5__8 = true; } if (((Object)5__5).name == "Enemy - Bomb Thrower" || ((Object)5__5).name == "Enemy - Floater" || ((Object)5__5).name == "Enemy - Runner" || ((Object)5__5).name == "Enemy - Slow Walker" || ((Object)5__5).name == "Enemy - Tumbler") { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 2; return true; } if (((Object)5__5).name == "Enemy - Hidden" || ((Object)5__5).name == "Enemy - Hunter" || ((Object)5__5).name == "Enemy - Oogly") { <>2__current = (object)new WaitForSeconds(5f); <>1__state = 3; return true; } } else if (ssType == "Items") { Rigidbody component = objectScreenshotTaker.moduleObject.GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.useGravity = false; component.velocity = Vector3.zero; component.constraints = (RigidbodyConstraints)126; } PhysGrabObjectImpactDetector component2 = objectScreenshotTaker.moduleObject.GetComponent(); if (Object.op_Implicit((Object)(object)component2) && !component2.particleDisable) { component2.particleDisable = true; } if (((Object)5__5).name == "Item Cart Cannon" || ((Object)5__5).name == "Item Cart Laser") { ItemCartCannonMain component3 = objectScreenshotTaker.moduleObject.GetComponent(); if (component3 != null) { ItemBattery battery = component3.battery; if (battery != null) { BatteryVisualLogic batteryVisualLogic = battery.batteryVisualLogic; if (batteryVisualLogic != null) { ((Component)batteryVisualLogic).gameObject.SetActive(false); } } } } 5__8 = true; if (((Object)5__5).name == "Item Melee Baseball Bat" || ((Object)5__5).name == "Item Melee Frying Pan" || ((Object)5__5).name == "Item ReviveItem" || ((Object)5__5).name.StartsWith("Item Vehicle Semiscooter") || ((Object)5__5).name.StartsWith("Item WalkieTalkie")) { <>2__current = (object)new WaitForSeconds(1f); <>1__state = 4; return true; } } else if (ssType == "Modules") { PhysGrabObject[] array = Object.FindObjectsOfType(); foreach (PhysGrabObject val4 in array) { if (!val4.hasHinge) { val4.DestroyPhysGrabObject(); } } } else if (ssType == "Valuables") { Rigidbody component4 = objectScreenshotTaker.moduleObject.GetComponent(); if (Object.op_Implicit((Object)(object)component4)) { component4.useGravity = false; component4.velocity = Vector3.zero; component4.constraints = (RigidbodyConstraints)126; } PhysGrabObjectImpactDetector component5 = objectScreenshotTaker.moduleObject.GetComponent(); if (Object.op_Implicit((Object)(object)component5) && !component5.particleDisable) { component5.particleDisable = true; } if (((Object)5__5).name == "Valuable Gumball") { 5__8 = true; } } goto IL_07fa; case 2: <>1__state = -1; goto IL_07fa; case 3: <>1__state = -1; goto IL_07fa; case 4: <>1__state = -1; goto IL_07fa; case 5: { <>1__state = -1; objectScreenshotTaker.TakeScreenshot(5__7); PluginLoader.StaticLogger.LogDebug((object)("Screenshot saved: " + 5__6 + " (" + Path.GetFileName(5__7) + ")")); Object.Destroy((Object)(object)objectScreenshotTaker.moduleObject); if (Time.timeScale == 0f) { Time.timeScale = 1f; } 5__6 = null; 5__7 = null; 5__9 = null; 5__5 = null; goto IL_0c85; } IL_07fa: val = objectScreenshotTaker.CalculateBounds(5__9, 5__8); num2 = Mathf.Max(new float[3] { ((Bounds)(ref val)).size.x, ((Bounds)(ref val)).size.y, ((Bounds)(ref val)).size.z }); objectScreenshotTaker.ScreenshotCamera.orthographic = !((Object)5__5).name.StartsWith("Enemy Valuable - "); objectScreenshotTaker.ScreenshotCamera.orthographicSize = num2 * 0.8f; val2 = new Vector3(1f, 1f, -1f); val3 = ((Vector3)(ref val2)).normalized; if (ssType == "Enemies") { val3 = Vector3.forward; } else if (ssType == "Items") { if (((Object)5__5).name.StartsWith("Item Upgrade ") || ((Object)5__5).name.StartsWith("Item ReviveItem") || ((Object)5__5).name.StartsWith("Item WalkieTalkie")) { val2 = new Vector3(1f, 1f, 1f); val3 = ((Vector3)(ref val2)).normalized; } } else if (ssType == "Valuables") { val2 = new Vector3(1f, 1f, 1f); val3 = ((Vector3)(ref val2)).normalized; } num3 = 1f; if (ssType == "Items") { num3 = 0.75f; } num4 = num2 * num3; ((Component)objectScreenshotTaker.ScreenshotCamera).transform.position = ((Bounds)(ref val)).center + val3 * num4; ((Component)objectScreenshotTaker.ScreenshotCamera).transform.LookAt(((Bounds)(ref val)).center); if (Object.op_Implicit((Object)(object)objectScreenshotTaker.ScreenshotLight)) { ((Component)objectScreenshotTaker.ScreenshotLight).transform.position = ((Bounds)(ref val)).center + val3 * num4; ((Component)objectScreenshotTaker.ScreenshotLight).transform.LookAt(((Bounds)(ref val)).center); } if (ssType != "Modules") { if (Object.op_Implicit((Object)(object)objectScreenshotTaker.ScreenshotLight)) { if (ssType == "Valuables" && (((Object)5__5).name == "Valuable Goblet" || ((Object)5__5).name == "Valuable GoldFish" || ((Object)5__5).name == "Valuable GoldTooth" || ((Object)5__5).name == "Valuable Piano" || ((Object)5__5).name == "Valuable SilverFish" || ((Object)5__5).name == "Valuable Trophy" || ((Object)5__5).name == "Valuable Wizard Griffin Statue" || ((Object)5__5).name == "Valuable Wizard Master Potion" || ((Object)5__5).name == "Valuable Wizard Sword")) { ((Behaviour)objectScreenshotTaker.ScreenshotLight).enabled = true; } else { ((Behaviour)objectScreenshotTaker.ScreenshotLight).enabled = false; } } if ((ssType == "Enemies" && ((Object)5__5).name == "Enemy - Gnome") || (ssType == "Items" && ((Object)5__5).name == "Item Duck Bucket")) { objectScreenshotTaker.ambientLight = new Color(0.5f, 0.5f, 0.5f); } else { objectScreenshotTaker.ambientLight = new Color(1f, 1f, 1f); } RenderSettings.ambientLight = objectScreenshotTaker.ambientLight.Value; } <>2__current = (object)new WaitForEndOfFrame(); <>1__state = 5; return true; IL_0c93: if (<>7__wrap3 < <>7__wrap2.Length) { 5__5 = <>7__wrap2[<>7__wrap3]; if (Object.op_Implicit((Object)(object)5__5)) { 5__6 = ((Object)5__5).name; if (ssType == "Enemies") { 5__6 = ((Object)5__5).name.Replace("Enemy - ", ""); } else if (ssType == "Modules") { 5__6 = Regex.Replace(((Object)5__5).name, " - [0-9]+ - ", " - "); } 5__7 = objectScreenshotTaker.SavePath + "/" + ssType + "/" + 5__6 + ".png"; if (!File.Exists(5__7)) { if (!objectScreenshotTaker.nameGuids.ContainsKey(ssType)) { objectScreenshotTaker.nameGuids[ssType] = new Dictionary(); } if (objectScreenshotTaker.nameGuids[ssType].TryGetValue(5__6.ToLower(), out var value)) { string path = objectScreenshotTaker.SavePath + "/" + ssType + "/" + value + ".png"; if (File.Exists(path)) { goto IL_0c85; } 5__7 = path; } else if (SteamApps.CurrentBetaName == "tester") { string text = Guid.NewGuid().ToString(); string path2 = objectScreenshotTaker.SavePath + "/" + ssType + "/" + text + ".png"; while (File.Exists(path2)) { text = Guid.NewGuid().ToString(); path2 = objectScreenshotTaker.SavePath + "/" + ssType + "/" + text + ".png"; } 5__7 = path2; objectScreenshotTaker.nameGuids[ssType][5__6.ToLower()] = text; 5__2 = true; } if (ssType == "Valuables" && ((Object)5__5).name.StartsWith("Surplus Valuable - ")) { Time.timeScale = 0f; } objectScreenshotTaker.moduleObject = Object.Instantiate(5__5, Vector3.zero, Quaternion.identity); <>2__current = null; <>1__state = 1; return true; } } goto IL_0c85; } <>7__wrap2 = null; if (5__2) { string contents = JsonConvert.SerializeObject((object)objectScreenshotTaker.nameGuids, (Formatting)1); File.WriteAllText(Path.Combine(objectScreenshotTaker.SavePath, objectScreenshotTaker.ImageMapFileName), contents); } return false; IL_0c85: <>7__wrap3++; goto IL_0c93; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__17 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ObjectScreenshotTaker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__17(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown int num = <>1__state; ObjectScreenshotTaker objectScreenshotTaker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; objectScreenshotTaker.screenshotType = ScreenshotTypes.Enemies; objectScreenshotTaker.ScreenshotStart(); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: { <>1__state = -1; List source = (from x in (from x in EnemyDirector.instance.enemiesDifficulty1.Concat(EnemyDirector.instance.enemiesDifficulty2).Concat(EnemyDirector.instance.enemiesDifficulty3) where Object.op_Implicit((Object)(object)x) && !((Object)x).name.Contains("Enemy Group - ") select x).Select(delegate(EnemySetup x) { PrefabRef? obj = ((IEnumerable)x.spawnObjects).FirstOrDefault((Func)((PrefabRef o) => !o.PrefabName.Contains("Director"))); return (obj == null) ? null : obj.Prefab; }) where Object.op_Implicit((Object)(object)x) select x).ToList(); <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in source.Distinct() orderby ((Object)x).name select x).ToArray(), "Enemies", "Enemies")); <>1__state = 2; return true; } case 2: <>1__state = -1; objectScreenshotTaker.ScreenshotEnd(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__18 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ObjectScreenshotTaker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__18(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown int num = <>1__state; ObjectScreenshotTaker objectScreenshotTaker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; objectScreenshotTaker.screenshotType = ScreenshotTypes.Items; objectScreenshotTaker.ScreenshotStart(); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: { <>1__state = -1; List source = (from x in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)x) && Object.op_Implicit((Object)(object)x.prefab.Prefab) select x).ToList(); <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in source orderby ((Object)x).name select x.prefab.Prefab).Distinct().ToArray(), "Items", "Items")); <>1__state = 2; return true; } case 2: <>1__state = -1; objectScreenshotTaker.ScreenshotEnd(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__19 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ObjectScreenshotTaker <>4__this; private List 5__2; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__19(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; <>1__state = -2; } private bool MoveNext() { //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown int num = <>1__state; ObjectScreenshotTaker objectScreenshotTaker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; objectScreenshotTaker.screenshotType = ScreenshotTypes.Modules; objectScreenshotTaker.ScreenshotStart(); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: <>1__state = -1; 5__2 = (from x in Resources.FindObjectsOfTypeAll() where Object.op_Implicit((Object)(object)x) select x).ToList(); <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in (from x in 5__2.SelectMany((Level x) => x.StartRooms) select x.Prefab).Distinct() orderby ((Object)x).name select x).ToArray(), "StartRoom", "Modules")); <>1__state = 2; return true; case 2: <>1__state = -1; <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in (from x in 5__2.SelectMany((Level x) => x.ModulesNormal1.Concat(x.ModulesNormal2).Concat(x.ModulesNormal3)) select x.Prefab).Distinct() orderby ((Object)x).name select x).ToArray(), "Normal", "Modules")); <>1__state = 3; return true; case 3: <>1__state = -1; <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in (from x in 5__2.SelectMany((Level x) => x.ModulesPassage1.Concat(x.ModulesPassage2).Concat(x.ModulesPassage3)) select x.Prefab).Distinct() orderby ((Object)x).name select x).ToArray(), "Passage", "Modules")); <>1__state = 4; return true; case 4: <>1__state = -1; <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in (from x in 5__2.SelectMany((Level x) => x.ModulesDeadEnd1.Concat(x.ModulesDeadEnd2).Concat(x.ModulesDeadEnd3)) select x.Prefab).Distinct() orderby ((Object)x).name select x).ToArray(), "DeadEnd", "Modules")); <>1__state = 5; return true; case 5: <>1__state = -1; <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in (from x in 5__2.SelectMany((Level x) => x.ModulesExtraction1.Concat(x.ModulesExtraction2).Concat(x.ModulesExtraction3)) select x.Prefab).Distinct() orderby ((Object)x).name select x).ToArray(), "Extraction", "Modules")); <>1__state = 6; return true; case 6: <>1__state = -1; objectScreenshotTaker.ScreenshotEnd(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__20 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public ObjectScreenshotTaker <>4__this; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__20(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown int num = <>1__state; ObjectScreenshotTaker objectScreenshotTaker = <>4__this; switch (num) { default: return false; case 0: <>1__state = -1; objectScreenshotTaker.screenshotType = ScreenshotTypes.Valuables; objectScreenshotTaker.ScreenshotStart(); <>2__current = (object)new WaitForSeconds(2f); <>1__state = 1; return true; case 1: { <>1__state = -1; List source = (from x in (from x in RunManager.instance.levels.SelectMany((Level x) => x.ValuablePresets.SelectMany((LevelValuables p) => p.tiny.Concat(p.small).Concat(p.medium).Concat(p.big) .Concat(p.wide) .Concat(p.tall) .Concat(p.veryTall))) select x.Prefab.GetComponent()).Concat(from item in Resources.FindObjectsOfTypeAll() where ((Object)item).name.StartsWith("Enemy Valuable - ") || ((Object)item).name.StartsWith("Surplus Valuable - ") select item) where Object.op_Implicit((Object)(object)x) && Object.op_Implicit((Object)(object)((Component)x).gameObject) select x).ToList(); <>2__current = ((MonoBehaviour)objectScreenshotTaker).StartCoroutine(objectScreenshotTaker.TakeScreenshotsCoroutine((from x in source orderby ((Object)x).name select ((Component)x).gameObject).Distinct().ToArray(), "Valuables", "Valuables")); <>1__state = 2; return true; } case 2: <>1__state = -1; objectScreenshotTaker.ScreenshotEnd(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private readonly string SavePath = "Screenshots"; private readonly string ImageMapFileName = "images.json"; internal static ObjectScreenshotTaker instance; internal bool isTakingScreenshots; private Camera ScreenshotCamera; private Light ScreenshotLight; private GameObject moduleObject; private RenderTexture renderTexture; private Texture2D screenshot; private Color? ambientLight; private ScreenshotTypes screenshotType; private Dictionary> nameGuids = new Dictionary>(); private void Awake() { //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Expected O, but got Unknown //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)instance)) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } instance = this; if ((Object)(object)ScreenshotCamera == (Object)null) { ScreenshotCamera = ((Component)this).gameObject.AddComponent(); ScreenshotCamera.CopyFrom(Camera.main); ((Object)ScreenshotCamera).name = "ScreenshotCamera"; ScreenshotCamera.cullingMask = -4129; ScreenshotCamera.farClipPlane = 2000f; ((Behaviour)ScreenshotCamera).enabled = false; ScreenshotCamera.clearFlags = (CameraClearFlags)2; ScreenshotCamera.backgroundColor = new Color(0f, 0f, 0f, 0f); } if ((Object)(object)ScreenshotLight == (Object)null) { Light spotlight = PlayerAvatar.instance.flashlightController.spotlight; GameObject val = new GameObject("ScreenshotLight"); ScreenshotLight = val.AddComponent(); ScreenshotLight.type = spotlight.type; ScreenshotLight.color = spotlight.color; ScreenshotLight.intensity = spotlight.intensity; ScreenshotLight.range = 100f; ScreenshotLight.spotAngle = 100f; ScreenshotLight.shadows = spotlight.shadows; ScreenshotLight.cookie = spotlight.cookie; ScreenshotLight.cookieSize = spotlight.cookieSize; ScreenshotLight.renderMode = spotlight.renderMode; ((Behaviour)ScreenshotLight).enabled = false; } if (!Directory.Exists(SavePath)) { Directory.CreateDirectory(SavePath); } string path = Path.Combine(SavePath, ImageMapFileName); if (File.Exists(path)) { string text = File.ReadAllText(path); nameGuids = JsonConvert.DeserializeObject>>(text) ?? new Dictionary>(); } GameObject gameObject = ((Component)LevelGenerator.Instance.LevelParent.GetComponentInChildren()).gameObject; PhysGrabObject[] array = Object.FindObjectsOfType(); for (int i = 0; i < array.Length; i++) { array[i].DestroyPhysGrabObject(); } Light[] componentsInChildren = ((Component)gameObject.transform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = false; } Renderer[] componentsInChildren2 = ((Component)gameObject.transform).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].enabled = false; } Canvas[] componentsInChildren3 = ((Component)gameObject.transform.Find("Truck/Truck Run")).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren3.Length; i++) { ((Behaviour)componentsInChildren3[i]).enabled = false; } componentsInChildren = ((Component)PlayerAvatar.instance).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { ((Behaviour)componentsInChildren[i]).enabled = false; } componentsInChildren2 = ((Component)PlayerAvatar.instance).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren2.Length; i++) { componentsInChildren2[i].enabled = false; } } private void OnDestroy() { PluginLoader.StaticLogger.LogInfo((object)"[ModuleScreenshotTaker] Destroying..."); if (Object.op_Implicit((Object)(object)ScreenshotLight)) { Object.Destroy((Object)(object)((Component)ScreenshotLight).gameObject); } } private void ScreenshotStart() { isTakingScreenshots = true; PlayerAvatar.instance.flashlightController.hideFlashlight = true; PluginLoader.StaticLogger.LogInfo((object)"[ModuleScreenshotTaker] Starting"); } private void ScreenshotEnd() { if (Object.op_Implicit((Object)(object)ScreenshotLight)) { ((Behaviour)ScreenshotLight).enabled = false; } PlayerAvatar.instance.flashlightController.hideFlashlight = false; ambientLight = null; EnvironmentDirector.Instance.DarkAdaptationLerp = ((!FlashlightController.Instance.LightActive) ? 0.01f : 0.99f); isTakingScreenshots = false; PluginLoader.StaticLogger.LogInfo((object)"[ModuleScreenshotTaker] Finished"); if (Object.op_Implicit((Object)(object)ScreenshotLight)) { Object.Destroy((Object)(object)((Component)ScreenshotLight).gameObject); } Object.Destroy((Object)(object)((Component)this).gameObject); } [IteratorStateMachine(typeof(d__17))] internal IEnumerator TakeScreenshotsOfEnemies() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__17(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__18))] internal IEnumerator TakeScreenshotsOfItems() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__18(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__19))] internal IEnumerator TakeScreenshotsOfModules() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__19(0) { <>4__this = this }; } [IteratorStateMachine(typeof(d__20))] internal IEnumerator TakeScreenshotsOfValuables() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__20(0) { <>4__this = this }; } private Bounds CalculateBounds(GameObject go, bool useColliders = false) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_003b: 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_00aa: 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_004a: 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) if (useColliders) { Collider[] array = (from r in go.GetComponentsInChildren(true) where r.enabled && ((Component)r).gameObject.activeInHierarchy && !r.isTrigger select r).ToArray(); if (array.Length != 0) { Bounds bounds = array[0].bounds; for (int i = 1; i < array.Length; i++) { ((Bounds)(ref bounds)).Encapsulate(array[i].bounds); } return bounds; } } Renderer[] array2 = (from r in go.GetComponentsInChildren(true) where r.enabled && ((Component)r).gameObject.activeInHierarchy select r).ToArray(); if (array2.Length != 0) { Bounds bounds2 = array2[0].bounds; for (int j = 1; j < array2.Length; j++) { ((Bounds)(ref bounds2)).Encapsulate(array2[j].bounds); } return bounds2; } PluginLoader.StaticLogger.LogWarning((object)("No renderers found for " + ((Object)go).name)); return new Bounds(go.transform.position, Vector3.one); } [IteratorStateMachine(typeof(d__22))] private IEnumerator TakeScreenshotsCoroutine(GameObject[] modules, string category, string ssType) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__22(0) { <>4__this = this, modules = modules, ssType = ssType }; } private void TakeScreenshot(string filePath) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0062: Expected O, but got Unknown //IL_008a: Unknown result type (might be due to invalid IL or missing references) renderTexture = new RenderTexture(1920, 1920, 32, (RenderTextureFormat)0); ScreenshotCamera.targetTexture = renderTexture; ScreenshotCamera.Render(); RenderTexture.active = renderTexture; screenshot = new Texture2D(((Texture)renderTexture).width, ((Texture)renderTexture).height, (TextureFormat)4, false); screenshot.ReadPixels(new Rect(0f, 0f, (float)((Texture)renderTexture).width, (float)((Texture)renderTexture).height), 0, 0); screenshot.Apply(); byte[] bytes = ImageConversion.EncodeToPNG(screenshot); File.WriteAllBytes(filePath, bytes); ScreenshotCamera.targetTexture = null; RenderTexture.active = null; Object.Destroy((Object)(object)renderTexture); Object.Destroy((Object)(object)screenshot); } private void LateUpdate() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) if (isTakingScreenshots && ambientLight.HasValue) { RenderSettings.ambientLight = ambientLight.Value; } } } [BepInPlugin("uk.1a3.lobbyimprovements", "LobbyImprovements", "1.2.2")] [BepInDependency(/*Could not decode attribute arguments.*/)] internal class PluginLoader : BaseUnityPlugin { internal static List modDevSteamIDs = new List(2) { "76561198286895332", "76561199523762804" }; internal static Dictionary namePrefixMap = new Dictionary { { "developer", "[DEV] " }, { "tester", "[TESTER] " } }; internal static Dictionary nameSuffixMap = new Dictionary(); private readonly Harmony harmony = new Harmony("uk.1a3.lobbyimprovements"); private static bool initialized; internal static ConfigEntry debugConsole; internal static ConfigEntry debugConsoleKeybind; internal static ConfigEntry moonPhaseUIEnabled; internal static ConfigEntry splashScreenUIEnabled; internal static ConfigEntry singleplayerLobbyMenu; internal static ConfigEntry mainMenuOverhaulEnabled; internal static ConfigEntry playerNamePrefixSelected; internal static ConfigEntry saveDeleteEnabled; internal static ConfigEntry saveFileMaxAmount; internal static ConfigEntry savePublicEnabled; internal static ConfigEntry saveMatchmakingEnabled; internal static ConfigEntry testerOverlayEnabled; internal static bool mainMenuOverhaul; internal static ManualLogSource StaticLogger { get; private set; } internal static ConfigFile StaticConfig { get; private set; } private unsafe void Awake() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_01c1: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Expected O, but got Unknown //IL_0329: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Expected O, but got Unknown if (initialized) { return; } initialized = true; StaticLogger = ((BaseUnityPlugin)this).Logger; StaticConfig = ((BaseUnityPlugin)this).Config; debugConsole = StaticConfig.Bind("Debug Console", "Enabled", false, "Enables the vanilla debug console."); debugConsoleKeybind = StaticConfig.Bind("Debug Console", "Keybind", new KeyboardShortcut((KeyCode)96, Array.Empty()), (ConfigDescription)null); debugConsoleKeybind.SettingChanged += delegate { //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_003b->IL003b: Incompatible stack types: O vs I4 //IL_0029->IL003b: Incompatible stack types: I4 vs O //IL_0029->IL003b: Incompatible stack types: O vs I4 if (Object.op_Implicit((Object)(object)DebugConsoleUI.instance)) { object obj = DebugConsoleUI.instance; KeyboardShortcut value = debugConsoleKeybind.Value; int num; if ((int)((KeyboardShortcut)(ref value)).MainKey == 0) { num = 96; obj = num; num = (int)obj; } else { value = debugConsoleKeybind.Value; obj = ((KeyboardShortcut)(ref value)).MainKey; num = (int)obj; } Unsafe.Write(&((DebugConsoleUI)num).toggleKey, (KeyCode)obj); } }; moonPhaseUIEnabled = StaticConfig.Bind("Fast Startup", "Moon Phase", true, "Should the moon phase animation be shown?"); splashScreenUIEnabled = StaticConfig.Bind("Fast Startup", "Splash Screen", true, "Should the splash screen be shown?"); mainMenuOverhaulEnabled = StaticConfig.Bind("Main Menu", "Improved Layout", false, "Improved layout for the main menu to reduce clicks."); if (Chainloader.PluginInfos.ContainsKey("nickklmao.menulib")) { mainMenuOverhaulEnabled.SettingChanged += delegate { PublicLobbySaves.ToggleLobbyTypeSaving((LobbyTypes)1, savePublicEnabled.Value || mainMenuOverhaulEnabled.Value); PublicLobbySaves.ToggleLobbyTypeSaving((LobbyTypes)2, saveMatchmakingEnabled.Value || mainMenuOverhaulEnabled.Value); }; try { harmony.PatchAll(typeof(MenuPageV2)); } catch (Exception ex) { StaticLogger.LogError((object)("MenuPageV2 Patch Failed: " + ex)); } } else if (mainMenuOverhaulEnabled.Value) { StaticLogger.LogWarning((object)"The 'Improved Layout' of the main menu requires the MenuLib mod. Please install it if you wish to use that feature."); } saveDeleteEnabled = StaticConfig.Bind("Saves", "Deletion", true, "Should saves be automatically deleted when everyone dies?"); saveFileMaxAmount = StaticConfig.Bind("Saves", "Max Amount", 10, new ConfigDescription("What is the max amount of save files? 0 = Unlimited", (AcceptableValueBase)(object)new AcceptableValueRange(0, 100), Array.Empty())); savePublicEnabled = StaticConfig.Bind("Saves", "Public Lobbies", true, "Should public lobbies be saved?"); savePublicEnabled.SettingChanged += delegate { PublicLobbySaves.ToggleLobbyTypeSaving((LobbyTypes)1, savePublicEnabled.Value || mainMenuOverhaulEnabled.Value); }; saveMatchmakingEnabled = StaticConfig.Bind("Saves", "Random Lobbies", false, "Should random matchmaking lobbies be saved?"); saveMatchmakingEnabled.SettingChanged += delegate { PublicLobbySaves.ToggleLobbyTypeSaving((LobbyTypes)2, savePublicEnabled.Value || mainMenuOverhaulEnabled.Value); }; singleplayerLobbyMenu = StaticConfig.Bind("Singleplayer", "Lobby Menu", false, "Should the lobby menu be enabled in singleplayer?"); testerOverlayEnabled = StaticConfig.Bind("Tester Overlay", "Enabled", false, "Should the tester overlay be shown?"); testerOverlayEnabled.SettingChanged += delegate { if (!Debug.isDebugBuild && Object.op_Implicit((Object)(object)DebugCommandHandler.instance)) { DebugCommandHandler.instance.debugOverlay = testerOverlayEnabled.Value; } }; try { harmony.PatchAll(typeof(PlayerNamePrefix_SteamManager)); } catch (Exception ex2) { StaticLogger.LogError((object)("PlayerNamePrefix Patch Failed: " + ex2)); if (playerNamePrefixSelected == null) { playerNamePrefixSelected = StaticConfig.Bind("Name Prefix", "Selected", "none", new ConfigDescription("Which prefix would you like to use?", (AcceptableValueBase)null, Array.Empty())); playerNamePrefixSelected.SettingChanged += delegate { PlayerNamePrefix_SteamManager.WorldSpaceUIParent_UpdatePlayerName(PlayerAvatar.instance); if (GameManager.Multiplayer()) { PlayerNamePrefix_SemiFunc.PhotonSetCustomProperty(PhotonNetwork.LocalPlayer, "playerNamePrefix", playerNamePrefixSelected.Value); } }; } } try { harmony.PatchAll(typeof(ChatCommands)); } catch (Exception ex3) { StaticLogger.LogError((object)("ChatCommands Patch Failed: " + ex3)); } try { harmony.PatchAll(typeof(FastStartup)); } catch (Exception ex4) { StaticLogger.LogError((object)("FastStartup Patch Failed: " + ex4)); } try { harmony.PatchAll(typeof(MenuPageLobbySP)); } catch (Exception ex5) { StaticLogger.LogError((object)("MenuPageLobbySP Patch Failed: " + ex5)); } try { harmony.PatchAll(typeof(PublicLobbySaves)); } catch (Exception ex6) { StaticLogger.LogError((object)("PublicLobbySaves Patch Failed: " + ex6)); } try { harmony.PatchAll(typeof(ServerListSearch)); } catch (Exception ex7) { StaticLogger.LogError((object)("ServerListSearch Patch Failed: " + ex7)); } try { harmony.PatchAll(typeof(TesterOverlayPatches)); } catch (Exception ex8) { StaticLogger.LogError((object)("TesterOverlay Patch Failed: " + ex8)); } StaticLogger.LogInfo((object)"Patches Loaded"); } } internal static class MyPluginInfo { public const string PLUGIN_GUID = "uk.1a3.lobbyimprovements"; public const string PLUGIN_NAME = "LobbyImprovements"; public const string PLUGIN_VERSION = "1.2.2"; } } namespace LobbyImprovements.Patches { [HarmonyPatch] public class ChatCommands { [HarmonyPatch(typeof(DebugCommandHandler), "Start")] [HarmonyPostfix] [HarmonyWrapSafe] private static void DebugCommandHandler_Start() { //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Expected O, but got Unknown if (!Debug.isDebugBuild) { DebugCommandHandler.instance.debugOverlay = PluginLoader.testerOverlayEnabled.Value; } DebugCommandHandler.instance.Register(new ChatCommand("screenshot", "Screenshot all enemies, items, modules, or valuables in the current room.", (Action)delegate(bool isDebugConsole, string[] args) { //IL_0011: 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) if (!Object.op_Implicit((Object)(object)ObjectScreenshotTaker.instance)) { new GameObject("ObjectScreenshotTaker") { hideFlags = (HideFlags)61 }.AddComponent(); } switch (string.Join(' ', args).ToLower()) { case "enemies": if (!ObjectScreenshotTaker.instance.isTakingScreenshots) { ((MonoBehaviour)ObjectScreenshotTaker.instance).StartCoroutine(ObjectScreenshotTaker.instance.TakeScreenshotsOfEnemies()); DebugCommandHandler.instance.CommandSuccessEffect(); return; } break; case "items": if (!ObjectScreenshotTaker.instance.isTakingScreenshots) { ((MonoBehaviour)ObjectScreenshotTaker.instance).StartCoroutine(ObjectScreenshotTaker.instance.TakeScreenshotsOfItems()); DebugCommandHandler.instance.CommandSuccessEffect(); return; } break; case "modules": if (!ObjectScreenshotTaker.instance.isTakingScreenshots) { ((MonoBehaviour)ObjectScreenshotTaker.instance).StartCoroutine(ObjectScreenshotTaker.instance.TakeScreenshotsOfModules()); DebugCommandHandler.instance.CommandSuccessEffect(); return; } break; case "valuables": if (!ObjectScreenshotTaker.instance.isTakingScreenshots) { ((MonoBehaviour)ObjectScreenshotTaker.instance).StartCoroutine(ObjectScreenshotTaker.instance.TakeScreenshotsOfValuables()); DebugCommandHandler.instance.CommandSuccessEffect(); return; } break; } DebugCommandHandler.instance.CommandFailedEffect(); }, (Func>)delegate(bool isDebugConsole, string partial, string[] args) { List source = new List { "enemies", "items", "modules", "valuables" }; return (args.Length > 1) ? new List() : source.Where((string g) => args.Length == 0 || g.ToLower().StartsWith(args[0].ToLower())).ToList(); }, (Func)(() => SemiFunc.IsMasterClientOrSingleplayer() && SemiFunc.RunIsRecording()), true)); } [HarmonyPatch(typeof(SemiFunc), "DebugTester")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SemiFunc_DebugTester(ref bool __result) { if (PluginLoader.debugConsole.Value) { __result = true; } } [HarmonyPatch(typeof(DebugConsoleUI), "Awake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void DebugConsoleUI_Awake(DebugConsoleUI __instance) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: 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_0019: Invalid comparison between Unknown and I4 //IL_001c: 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) KeyboardShortcut value = PluginLoader.debugConsoleKeybind.Value; KeyCode mainKey = ((KeyboardShortcut)(ref value)).MainKey; if ((int)mainKey != 0 && (int)mainKey != 96) { __instance.toggleKey = mainKey; } } [HarmonyPatch(typeof(ItemWalkieBox), "OutOfStore")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool ItemWalkieBox_OutOfStore(ItemWalkieBox __instance) { if (Object.op_Implicit((Object)(object)ObjectScreenshotTaker.instance) && ObjectScreenshotTaker.instance.isTakingScreenshots) { __instance.walkiesSpawned = true; return false; } return true; } } [HarmonyPatch] public class FastStartup { [HarmonyPatch(typeof(MoonUI), "Check")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MoonUI_Check(MoonUI __instance) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Invalid comparison between Unknown and I4 if (!PluginLoader.moonPhaseUIEnabled.Value && (int)__instance.state > 0) { __instance.skip = true; __instance.SetState((State)8); } } [HarmonyPatch(typeof(SemiFunc), "SplashScreenSkip")] [HarmonyPrefix] [HarmonyWrapSafe] private static void SemiFunc_SplashScreenSkip(ref bool forceSkip) { if (!PluginLoader.splashScreenUIEnabled.Value) { forceSkip = true; } } } [HarmonyPatch] public class MenuPageLobbySP { [HarmonyPatch(typeof(DataDirector), "SaveDeleteCheck")] [HarmonyPrefix] [HarmonyPriority(800)] private static bool DataDirector_SaveDeleteCheck() { return PluginLoader.saveDeleteEnabled.Value; } [HarmonyPatch(typeof(RunManager), "ChangeLevel")] [HarmonyPrefix] [HarmonyWrapSafe] private static void RunManager_ChangeLevel_Prefix(RunManager __instance, bool _completedLevel, bool _levelFailed, ChangeLevelType _changeLevelType = 0) { if (PluginLoader.singleplayerLobbyMenu.Value && !SemiFunc.IsMultiplayer() && (SemiFunc.MenuLevel() || SemiFunc.IsMasterClientOrSingleplayer()) && !__instance.restarting && _levelFailed && __instance.levelArena.Contains(__instance.levelCurrent)) { __instance.debugLevel = __instance.levelLobbyMenu; PluginLoader.StaticLogger.LogInfo((object)"Setting debug level"); } } [HarmonyPatch(typeof(RunManager), "ChangeLevel")] [HarmonyPostfix] [HarmonyWrapSafe] private static void RunManager_ChangeLevel_Postfix(RunManager __instance, bool _completedLevel, bool _levelFailed, ChangeLevelType _changeLevelType = 0) { if (!SemiFunc.IsMultiplayer() && __instance.gameOver && (Object)(object)__instance.debugLevel == (Object)(object)__instance.levelLobbyMenu) { __instance.debugLevel = null; PluginLoader.StaticLogger.LogInfo((object)"Resetting debug level"); } } [HarmonyPatch(typeof(SemiFunc), "MenuActionSingleplayerGame")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool SemiFunc_MenuActionSingleplayerGame(string saveFileName, List saveFileBackups) { if (!PluginLoader.singleplayerLobbyMenu.Value) { return true; } RunManager.instance.ResetProgress(); GameManager.instance.SetConnectRandom(false); if (saveFileName != null) { PluginLoader.StaticLogger.LogInfo((object)"Loading save"); SemiFunc.SaveFileLoad(saveFileName, saveFileBackups); } else { SemiFunc.SaveFileCreate(); } RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)3); return false; } [HarmonyPatch(typeof(MenuPageLobby), "Awake")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageLobby_Awake(MenuPageLobby __instance) { if (SemiFunc.IsMultiplayer()) { return true; } MenuPageLobby.instance = __instance; __instance.menuPage = ((Component)__instance).GetComponent(); TextMeshProUGUI roomNameText = __instance.roomNameText; string cloudRegion = PhotonNetwork.CloudRegion; Room currentRoom = PhotonNetwork.CurrentRoom; ((TMP_Text)roomNameText).text = cloudRegion + " " + ((currentRoom != null) ? currentRoom.Name : null); ((TMP_Text)__instance.chatPromptText).text = InputManager.instance.InputDisplayReplaceTags("Press [chat] to use commands", "", ""); return false; } [HarmonyPatch(typeof(MenuPageLobby), "Start")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageLobby_Start(MenuPageLobby __instance) { if (SemiFunc.IsMultiplayer()) { return true; } ((Component)__instance.inviteButton).gameObject.SetActive(false); return false; } [HarmonyPatch(typeof(MenuPageLobby), "ButtonStart")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageLobby_ButtonStart(MenuPageLobby __instance) { if (SemiFunc.IsMultiplayer() || __instance.joiningPlayer) { return true; } SteamManager.instance.LockLobby(); DataDirector.instance.RunsPlayedAdd(); if (RunManager.instance.loadLevel == 0) { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)1); } else { RunManager.instance.ChangeLevel(true, false, (ChangeLevelType)5); } return false; } } [HarmonyPatch] public class MenuPageV2 { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static Action <>9__1_6; public static ScrollViewBuilderDelegate <>9__1_2; public static Action <>9__2_6; public static ScrollViewBuilderDelegate <>9__2_2; internal RectTransform b__1_2(Transform scrollView) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOButton("Public (Random)", (Action)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking((string)null, (List)null); }, scrollView, Vector2.zero)).rectTransform; } internal void b__1_6() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking((string)null, (List)null); } internal RectTransform b__2_2(Transform scrollView) { //IL_0025: Unknown result type (might be due to invalid IL or missing references) return ((REPOElement)MenuAPI.CreateREPOButton("Public (Random)", (Action)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking(StatsManager.instance.saveFileCurrent, (List)null); }, scrollView, Vector2.zero)).rectTransform; } internal void b__2_6() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking(StatsManager.instance.saveFileCurrent, (List)null); } } private static MenuPageIndex regionsPreviousPage = (MenuPageIndex)11; internal static void NewGame_Internal(MenuButton __instance) { //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Expected O, but got Unknown //IL_008c: 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_017c: Expected O, but got Unknown //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014c: Expected O, but got Unknown MenuPage parentPage = __instance.parentPage; object obj = ((parentPage != null) ? ((Component)parentPage).GetComponent() : null); if (obj == null) { MenuPage parentPage2 = __instance.parentPage; if (parentPage2 == null) { obj = null; } else { MenuPage pageUnderThisPage = parentPage2.pageUnderThisPage; obj = ((pageUnderThisPage != null) ? ((Component)pageUnderThisPage).GetComponent() : null); } } MenuPageSaves menuPageSaves = (MenuPageSaves)obj; if (Object.op_Implicit((Object)(object)menuPageSaves) && menuPageSaves.maxSaveFiles > 0 && menuPageSaves.saveFiles.Count >= menuPageSaves.maxSaveFiles) { MenuManager.instance.PageCloseAllAddedOnTop(); MenuManager.instance.PagePopUp("Save file limit reached", Color.red, $"You can only have {menuPageSaves.maxSaveFiles} save files at a time. Please delete some save files to make room for new ones.", "OK", true); return; } REPOPopupPage repoPage = MenuAPI.CreateREPOPopupPage(__instance.menuButtonPopUp?.headerText, false, true, 1.5f, (Vector2?)Vector2.zero); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Private", (Action)delegate { PublicLobbySaves.publicSavesMenuOpen = false; MenuPageSaves obj5 = menuPageSaves; if (obj5 != null) { obj5.OnNewGame(); } }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Public (Server List)", (Action)delegate { PublicLobbySaves.publicSavesMenuOpen = true; MenuPageSaves obj4 = menuPageSaves; if (obj4 != null) { obj4.OnNewGame(); } }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); REPOPopupPage obj2 = repoPage; object obj3 = <>c.<>9__1_2; if (obj3 == null) { ScrollViewBuilderDelegate val = (Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Public (Random)", (Action)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking((string)null, (List)null); }, scrollView, Vector2.zero)).rectTransform; <>c.<>9__1_2 = val; obj3 = (object)val; } obj2.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Back", (Action)delegate { repoPage.ClosePage(false); }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); repoPage.OpenPage(false); } internal static void LoadGame_Internal(MenuButton __instance) { //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Expected O, but got Unknown //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Expected O, but got Unknown MenuPage parentPage = __instance.parentPage; object obj = ((parentPage != null) ? ((Component)parentPage).GetComponent() : null); if (obj == null) { MenuPage parentPage2 = __instance.parentPage; if (parentPage2 == null) { obj = null; } else { MenuPage pageUnderThisPage = parentPage2.pageUnderThisPage; obj = ((pageUnderThisPage != null) ? ((Component)pageUnderThisPage).GetComponent() : null); } } MenuPageSaves menuPageSaves = (MenuPageSaves)obj; REPOPopupPage repoPage = MenuAPI.CreateREPOPopupPage(__instance.menuButtonPopUp?.headerText, false, true, 1.5f, (Vector2?)Vector2.zero); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Private", (Action)delegate { PublicLobbySaves.publicSavesMenuOpen = false; MenuPageSaves obj5 = menuPageSaves; if (obj5 != null) { obj5.OnLoadGame(); } }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Public (Server List)", (Action)delegate { PublicLobbySaves.publicSavesMenuOpen = true; MenuPageSaves obj4 = menuPageSaves; if (obj4 != null) { obj4.OnLoadGame(); } }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); REPOPopupPage obj2 = repoPage; object obj3 = <>c.<>9__2_2; if (obj3 == null) { ScrollViewBuilderDelegate val = (Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Public (Random)", (Action)delegate { //IL_000c: Unknown result type (might be due to invalid IL or missing references) PublicLobbySaves.publicSavesMenuOpen = false; GameManager.instance.matchmakingMode = (RandomMatchmakingModes)1; SemiFunc.MenuActionRandomMatchmaking(StatsManager.instance.saveFileCurrent, (List)null); }, scrollView, Vector2.zero)).rectTransform; <>c.<>9__2_2 = val; obj3 = (object)val; } obj2.AddElementToScrollView((ScrollViewBuilderDelegate)obj3, 0f, 0f); repoPage.AddElementToScrollView((ScrollViewBuilderDelegate)((Transform scrollView) => ((REPOElement)MenuAPI.CreateREPOButton("Back", (Action)delegate { repoPage.ClosePage(false); }, scrollView, Vector2.zero)).rectTransform), 0f, 0f); repoPage.OpenPage(false); } [HarmonyPatch(typeof(MenuPageMain), "Start")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuPageMain_Start(MenuPageMain __instance) { PluginLoader.mainMenuOverhaul = PluginLoader.mainMenuOverhaulEnabled.Value; if (PluginLoader.mainMenuOverhaul) { Transform obj = ((Component)__instance.rectTransform).transform.Find("Buttons/Menu Button - Private Game/ButtonText"); TextMeshProUGUI val = ((obj != null) ? ((Component)obj).GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).GetComponent()); ((TMP_Text)val).text = "Host Game"; } Transform obj2 = ((Component)__instance.rectTransform).transform.Find("Buttons/Menu Button - Public Game/ButtonText"); TextMeshProUGUI val2 = ((obj2 != null) ? ((Component)obj2).GetComponent() : null); if (Object.op_Implicit((Object)(object)val2)) { Object.Destroy((Object)(object)((Component)val2).GetComponent()); ((TMP_Text)val2).text = "Join Game"; } } } [HarmonyPatch(typeof(MenuPageMain), "ButtonEventHostGame")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageMain_ButtonEventHostGame() { if (!PluginLoader.mainMenuOverhaul) { return true; } SemiFunc.MainMenuSetMultiplayer(); MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)11, false); return false; } [HarmonyPatch(typeof(MenuPageMain), "ButtonEventPlayRandom")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageMain_ButtonEventPlayRandom() { if (!PluginLoader.mainMenuOverhaul) { return true; } MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)16, false); return false; } [HarmonyPatch(typeof(MenuManager), "PageOpen")] [HarmonyPrefix] [HarmonyWrapSafe] private static void MenuManager_PageOpen_Prefix(MenuManager __instance, MenuPage __result, MenuPageIndex menuPageIndex, bool addedPageOnTop = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_0017: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Invalid comparison between Unknown and I4 if (PluginLoader.mainMenuOverhaul && ((int)menuPageIndex == 11 || (int)menuPageIndex == 16 || (int)menuPageIndex == 14)) { regionsPreviousPage = menuPageIndex; } } [HarmonyPatch(typeof(MenuManager), "PageOpen")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuManager_PageOpen(MenuManager __instance, MenuPage __result, MenuPageIndex menuPageIndex, bool addedPageOnTop = false) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Invalid comparison between Unknown and I4 //IL_008b: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 //IL_0068: Unknown result type (might be due to invalid IL or missing references) if (!PluginLoader.mainMenuOverhaul) { return; } if ((int)menuPageIndex != 11) { if ((int)menuPageIndex != 14) { if ((int)menuPageIndex == 16) { Transform obj = ((Component)__result).transform.Find("Header/Text (TMP)"); TextMeshProUGUI val = ((obj != null) ? ((Component)obj).GetComponent() : null); if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val).GetComponent()); ((TMP_Text)val).text = "Join Game"; } AddRegionMenuButton(((Component)__result).transform, new Vector2(8f, 8f), (Type)1); } } else { AddRegionMenuButton(((Component)__result).transform, new Vector2(8f, 8f), (Type)1); } } else if (SemiFunc.MainMenuIsMultiplayer()) { AddRegionMenuButton(((Component)__result).transform, new Vector2(520f, 325f), (Type)0); } } private static void AddRegionMenuButton(Transform parent, Vector2 localPosition, Type pageType) { //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_0047: Unknown result type (might be due to invalid IL or missing references) DataDirector.instance.networkRegion = PlayerPrefs.GetString("PUNSelectedRegion", ""); ServerSettings.ResetBestRegionCodeInPreferences(); MenuAPI.CreateREPOButton(GetRegionDisplayName(DataDirector.instance.networkRegion), (Action)delegate { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) MenuManager.instance.PageCloseAll(); ((Component)MenuManager.instance.PageOpen((MenuPageIndex)13, false)).GetComponent().type = pageType; }, parent, localPosition); } private static string GetRegionDisplayName(string regionCode) { return (regionCode?.ToUpper() ?? "") switch { "" => "Best Region", "ASIA" => "Asia", "AU" => "Australia", "CAE" => "Canada East", "CN" => "Chinese Mainland", "EU" => "Europe", "HK" => "Hong Kong", "IN" => "India", "JP" => "Japan", "ZA" => "South Africa", "SA" => "South America", "KR" => "South Korea", "TR" => "Turkey", "UAE" => "United Arab Emirates", "US" => "USA East", "USW" => "USA West", "USSC" => "USA South Central", _ => regionCode?.ToUpper(), }; } private static void RefreshLobbies() { //IL_003d: Unknown result type (might be due to invalid IL or missing references) MenuPageServerList component = ((Component)MenuManager.instance.currentMenuPage).GetComponent(); if (!Object.op_Implicit((Object)(object)component) || !component.receivedList || component.searchInProgress) { return; } foreach (Transform item in component.serverElementParent) { Object.Destroy((Object)(object)((Component)item).gameObject); } component.loadingGraphics.Reset(); component.roomListSearched.Clear(); component.receivedList = false; component.pageMax = 0; component.buttonNext.HideSetInstant(); component.buttonPrevious.HideSetInstant(); ((MonoBehaviour)component).StartCoroutine(component.GetServerList()); } [HarmonyPatch(typeof(MenuPageServerList), "Start")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuPageServerList_Start(MenuPageServerList __instance) { if (PluginLoader.mainMenuOverhaul) { Transform obj = ((Component)__instance).transform.Find("Panel/Create New"); object obj2; if (obj == null) { obj2 = null; } else { Transform obj3 = obj.Find("Menu Button - CREATE NEW"); obj2 = ((obj3 != null) ? ((Component)obj3).GetComponent() : null); } MenuButton val = (MenuButton)obj2; if (Object.op_Implicit((Object)(object)val)) { Object.Destroy((Object)(object)((Component)val.buttonText).GetComponent()); ((TMP_Text)val.buttonText).text = "Refresh"; } } } [HarmonyPatch(typeof(MenuPageServerList), "OnDestroy")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageServerList_OnDestroy() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)MenuManager.instance)) { return (int)MenuManager.instance.currentMenuPageIndex != 13; } return true; } [HarmonyPatch(typeof(MenuPageServerList), "ButtonCreateNew")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageServerList_ButtonCreateNew() { if (!PluginLoader.mainMenuOverhaul) { return true; } RefreshLobbies(); return false; } [HarmonyPatch(typeof(MenuPagePublicGameChoice), "ButtonRandomMatchmaking")] [HarmonyPrefix] [HarmonyWrapSafe] private static void MenuPagePublicGameChoice_ButtonRandomMatchmaking() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) GameManager.instance.matchmakingMode = (RandomMatchmakingModes)((PluginLoader.mainMenuOverhaul && PluginLoader.saveMatchmakingEnabled.Value) ? 2 : 0); } [HarmonyPatch(typeof(MenuPagePublicGameChoice), "ExitPage")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPagePublicGameChoice_ExitPage() { if (!PluginLoader.mainMenuOverhaul) { return true; } MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)0, false); return false; } [HarmonyPatch(typeof(MenuPageRegions), "PickRegion")] [HarmonyPrefix] [HarmonyWrapSafe] [HarmonyPriority(800)] private static bool MenuPageRegions_PickRegion(MenuPageRegions __instance, string _region) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Invalid comparison between Unknown and I4 //IL_0033: Unknown result type (might be due to invalid IL or missing references) PlayerPrefs.SetString("PUNSelectedRegion", _region); PlayerPrefs.Save(); if ((int)regionsPreviousPage == 14) { DataDirector.instance.networkRegion = _region; MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen(regionsPreviousPage, false); return false; } return true; } [HarmonyPatch(typeof(MenuPageRegions), "ExitPage")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageRegions_ExitPage(MenuPageRegions __instance) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) if (!PluginLoader.mainMenuOverhaul) { return true; } MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen(regionsPreviousPage, false); return false; } [HarmonyPatch(typeof(MenuPageRegions), "OnDestroy")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageRegions_OnDestroy() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Invalid comparison between Unknown and I4 if (Object.op_Implicit((Object)(object)MenuManager.instance)) { return (int)MenuManager.instance.currentMenuPageIndex != 14; } return true; } [HarmonyPatch(typeof(NetworkManager), "OnDisconnected")] [HarmonyPostfix] [HarmonyWrapSafe] private static void NetworkManager_OnDisconnected(DisconnectCause cause) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Invalid comparison between Unknown and I4 if ((int)cause == 15) { PlayerPrefs.DeleteKey("PUNSelectedRegion"); PlayerPrefs.Save(); } } } [HarmonyPatch] public class PlayerNamePrefix_SteamManager { [CompilerGenerated] private sealed class d__13 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public MenuPageEsc __instance; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__13(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = null; <>1__state = 1; return true; case 1: <>1__state = -1; foreach (KeyValuePair playerMicGainSlider in __instance.playerMicGainSliders) { PlayerAvatar key = playerMicGainSlider.Key; TextMeshProUGUI elementNameText = playerMicGainSlider.Value.menuSlider.elementNameText; string prefixStringForPlayer = PlayerNamePrefix_SemiFunc.GetPrefixStringForPlayer(key); if (!string.IsNullOrWhiteSpace(prefixStringForPlayer)) { ((TMP_Text)elementNameText).richText = true; ((TMP_Text)elementNameText).text = prefixStringForPlayer; } else { ((TMP_Text)elementNameText).richText = false; ((TMP_Text)elementNameText).text = key.playerName; } } return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class d__4 : IEnumerator, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public string[] steamIds; public string logType; private string 5__2; private bool 5__3; private UnityWebRequest 5__4; object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public d__4(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { 5__2 = null; 5__4 = null; <>1__state = -2; } private bool MoveNext() { //IL_02fd: Expected O, but got Unknown //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Invalid comparison between Unknown and I4 //IL_037c: Unknown result type (might be due to invalid IL or missing references) //IL_0386: Expected O, but got Unknown //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) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; steamIds = (from x in steamIds where Regex.IsMatch(x, "^76[0-9]{15}$") orderby x select x).ToArray(); if (steamIds.Length == 0) { return false; } SteamId steamId = SteamClient.SteamId; 5__2 = ((object)(SteamId)(ref steamId)).ToString(); 5__3 = steamIds.Contains(5__2); string text2 = playerPrefixUrl + "?" + string.Join("&", steamIds.Select((string id) => "id=" + id)); 5__4 = UnityWebRequest.Get(text2); <>2__current = 5__4.SendWebRequest(); <>1__state = 1; return true; } case 1: { <>1__state = -1; AcceptableValueList val = null; if ((int)5__4.result == 1) { try { Dictionary> dictionary = JsonConvert.DeserializeObject>>(5__4.downloadHandler.text); string[] array = steamIds; foreach (string text in array) { List value2; if (text == 5__2) { if (dictionary.TryGetValue(text, out var value)) { localPrefixData = value; PluginLoader.StaticLogger.LogDebug((object)string.Format("[GetPlayerNamePrefixes | {0}] {1} has {2} prefixes: {3}", logType, text, value.Count, string.Join(", ", value))); } else { localPrefixData.Clear(); PluginLoader.StaticLogger.LogDebug((object)("[GetPlayerNamePrefixes | " + logType + "] " + text + " has 0 prefixes")); } } else if (dictionary.TryGetValue(text, out value2)) { playerPrefixData[text] = value2; PluginLoader.StaticLogger.LogDebug((object)string.Format("[GetPlayerNamePrefixes | {0}] {1} has {2} prefixes: {3}", logType, text, value2.Count, string.Join(", ", value2))); } else { playerPrefixData.Remove(text); PluginLoader.StaticLogger.LogDebug((object)("[GetPlayerNamePrefixes | " + logType + "] " + text + " has 0 prefixes")); } } if (5__3) { val = new AcceptableValueList(localPrefixData.Prepend("none").ToArray()); } } catch (JsonException val2) { JsonException val3 = val2; PluginLoader.StaticLogger.LogWarning((object)("[GetPlayerNamePrefixes | " + logType + "] Failed to parse prefixes: " + ((Exception)(object)val3).Message)); } } else { PluginLoader.StaticLogger.LogWarning((object)("[GetPlayerNamePrefixes | " + logType + "] Failed to fetch prefixes: " + 5__4.error)); } if (5__3) { fetchedLocalPlayer = true; PluginLoader.playerNamePrefixSelected = PluginLoader.StaticConfig.Bind("Name Prefix", "Selected", "none", new ConfigDescription("Which prefix would you like to use?", (AcceptableValueBase)(object)val, Array.Empty())); PluginLoader.playerNamePrefixSelected.SettingChanged += delegate { WorldSpaceUIParent_UpdatePlayerName(PlayerAvatar.instance); if (GameManager.Multiplayer()) { PlayerNamePrefix_SemiFunc.PhotonSetCustomProperty(PhotonNetwork.LocalPlayer, "playerNamePrefix", PluginLoader.playerNamePrefixSelected?.Value); } }; } return false; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } private static string playerPrefixUrl = "https://api.1a3.uk/srv1/repo/prefixes.json"; private static bool fetchedLocalPlayer; public static List localPrefixData = new List(); public static Dictionary> playerPrefixData = new Dictionary>(); [IteratorStateMachine(typeof(d__4))] private static IEnumerator GetPlayerNamePrefixes(string[] steamIds, string logType) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__4(0) { steamIds = steamIds, logType = logType }; } public static void WorldSpaceUIParent_UpdatePlayerName(PlayerAvatar _player) { if (Object.op_Implicit((Object)(object)_player?.worldSpaceUIPlayerName)) { string prefixStringForPlayer = PlayerNamePrefix_SemiFunc.GetPrefixStringForPlayer(_player); if (!string.IsNullOrWhiteSpace(prefixStringForPlayer)) { ((TMP_Text)_player.worldSpaceUIPlayerName.text).richText = true; ((TMP_Text)_player.worldSpaceUIPlayerName.text).text = prefixStringForPlayer; } else { ((TMP_Text)_player.worldSpaceUIPlayerName.text).richText = false; ((TMP_Text)_player.worldSpaceUIPlayerName.text).text = _player.playerName; } } } [HarmonyPatch(typeof(SteamManager), "Awake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_Awake(SteamManager __instance) { //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) if (SteamClient.IsValid && !fetchedLocalPlayer) { string[] array = new string[1]; SteamId steamId = SteamClient.SteamId; array[0] = ((object)(SteamId)(ref steamId)).ToString(); ((MonoBehaviour)__instance).StartCoroutine(GetPlayerNamePrefixes(array, "SteamManager_Awake")); } } [HarmonyPatch(typeof(SteamManager), "OnLobbyEntered")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_OnLobbyEntered(SteamManager __instance, Lobby _lobby) { string[] array = ((Lobby)(ref _lobby)).Members.Select((Friend x) => ((object)(SteamId)(ref x.Id)).ToString()).Where(delegate(string x) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) SteamId steamId = SteamClient.SteamId; return x != ((object)(SteamId)(ref steamId)).ToString(); }).ToArray(); if (array.Length != 0) { ((MonoBehaviour)__instance).StartCoroutine(GetPlayerNamePrefixes(array, "SteamManager_OnLobbyEntered")); } } [HarmonyPatch(typeof(SteamManager), "OnLobbyMemberJoined")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_OnLobbyMemberJoined(SteamManager __instance, Lobby _lobby, Friend _friend) { ((MonoBehaviour)__instance).StartCoroutine(GetPlayerNamePrefixes(new string[1] { ((object)(SteamId)(ref _friend.Id)).ToString() }, "SteamManager_OnLobbyMemberJoined")); } [HarmonyPatch(typeof(SteamManager), "OnLobbyMemberLeft")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_OnLobbyMemberLeft(Lobby _lobby, Friend _friend) { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) if (playerPrefixData.ContainsKey(((object)(SteamId)(ref _friend.Id)).ToString())) { PluginLoader.StaticLogger.LogDebug((object)$"[playerPrefixData | SteamManager_OnLobbyMemberLeft] Removing 1 player ({_friend.Id})"); playerPrefixData.Remove(((object)(SteamId)(ref _friend.Id)).ToString()); } } [HarmonyPatch(typeof(SteamManager), "LeaveLobby")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_LeaveLobby() { if (playerPrefixData.Count > 0) { PluginLoader.StaticLogger.LogDebug((object)$"[playerPrefixData | SteamManager_LeaveLobby] Removing {playerPrefixData.Count} players"); playerPrefixData.Clear(); } } [HarmonyPatch(typeof(PlayerAvatar), "Awake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void PlayerAvatar_Awake(PlayerAvatar __instance) { if (SemiFunc.IsMultiplayer() && __instance.isLocal) { PlayerNamePrefix_SemiFunc.PhotonSetCustomProperty(PhotonNetwork.LocalPlayer, "playerNamePrefix", PluginLoader.playerNamePrefixSelected?.Value); } } [HarmonyPatch(typeof(MenuPageLobby), "Update")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuPageLobby_Update(MenuPageLobby __instance) { foreach (GameObject listObject in __instance.listObjects) { MenuPlayerListed component = listObject.GetComponent(); PlayerAvatar playerAvatar = component.playerAvatar; if (Object.op_Implicit((Object)(object)playerAvatar)) { TextMeshProUGUI playerName = component.playerName; string prefixStringForPlayer = PlayerNamePrefix_SemiFunc.GetPrefixStringForPlayer(playerAvatar); if (!string.IsNullOrWhiteSpace(prefixStringForPlayer)) { ((TMP_Text)playerName).richText = true; ((TMP_Text)playerName).text = prefixStringForPlayer; } else { ((TMP_Text)playerName).richText = false; ((TMP_Text)playerName).text = playerAvatar.playerName; } } } } [IteratorStateMachine(typeof(d__13))] private static IEnumerator DelayedUpdatePauseMenuSliders(MenuPageEsc __instance) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new d__13(0) { __instance = __instance }; } [HarmonyPatch(typeof(MenuPageEsc), "PlayerGainSlidersUpdate")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuPageEsc_PlayerGainSlidersUpdate(MenuPageEsc __instance) { ((MonoBehaviour)__instance).StartCoroutine(DelayedUpdatePauseMenuSliders(__instance)); } [HarmonyPatch(typeof(WorldSpaceUIParent), "PlayerName")] [HarmonyPostfix] [HarmonyWrapSafe] private static void WorldSpaceUIParent_PlayerName(PlayerAvatar _player) { WorldSpaceUIParent_UpdatePlayerName(_player); } [HarmonyPatch(typeof(MonoBehaviourPunCallbacks), "OnPlayerPropertiesUpdate")] [HarmonyPostfix] [HarmonyWrapSafe] private static void OnPlayerPropertiesUpdate(Player targetPlayer, Hashtable changedProps) { if (!((Dictionary)(object)changedProps).ContainsKey((object)"playerNamePrefix")) { return; } foreach (PlayerAvatar player in GameDirector.instance.PlayerList) { if (player.photonView.Owner == targetPlayer) { WorldSpaceUIParent_UpdatePlayerName(player); break; } } } } public class PlayerNamePrefix_SemiFunc { public static List GetPrefixDataForSteamId(string steamId) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) SteamId steamId2 = SteamClient.SteamId; if (steamId == ((object)(SteamId)(ref steamId2)).ToString()) { return PlayerNamePrefix_SteamManager.localPrefixData; } if (PlayerNamePrefix_SteamManager.playerPrefixData.TryGetValue(steamId, out var value)) { return value; } return new List(); } public static string GetPrefixStringForPlayer(PlayerAvatar playerAvatar) { //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fd: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)playerAvatar)) { return null; } string value = ""; string value2 = ""; string text = null; if (playerAvatar.isLocal) { text = PluginLoader.playerNamePrefixSelected?.Value; } else if (((Dictionary)(object)playerAvatar.photonView.Owner.CustomProperties).ContainsKey((object)"playerNamePrefix")) { text = (string)playerAvatar.photonView.Owner.CustomProperties[(object)"playerNamePrefix"]; } List prefixDataForSteamId = GetPrefixDataForSteamId(playerAvatar.steamID); SteamId steamId; if (string.IsNullOrWhiteSpace(text) || !PluginLoader.namePrefixMap.TryGetValue(text, out value)) { List modDevSteamIDs = PluginLoader.modDevSteamIDs; steamId = SteamClient.SteamId; if (modDevSteamIDs.Contains(((object)(SteamId)(ref steamId)).ToString()) && prefixDataForSteamId.Count > 0 && PluginLoader.namePrefixMap.TryGetValue(prefixDataForSteamId.First(), out value)) { value += "[!] "; } } if (string.IsNullOrWhiteSpace(text) || !PluginLoader.nameSuffixMap.TryGetValue(text, out value2)) { List modDevSteamIDs2 = PluginLoader.modDevSteamIDs; steamId = SteamClient.SteamId; if (modDevSteamIDs2.Contains(((object)(SteamId)(ref steamId)).ToString()) && prefixDataForSteamId.Count > 0 && PluginLoader.nameSuffixMap.TryGetValue(prefixDataForSteamId.First(), out value2)) { value2 += " [!]"; } } if (!string.IsNullOrWhiteSpace(value) || !string.IsNullOrWhiteSpace(value2)) { return value + Regex.Replace(playerAvatar.playerName ?? "", "<.*?>", string.Empty) + value2; } return null; } public static void PhotonSetCustomProperty(Player photonPlayer, object key, object value) { //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Expected O, but got Unknown //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) Hashtable customProperties = PhotonNetwork.LocalPlayer.CustomProperties; Hashtable val = new Hashtable(); DictionaryEntryEnumerator enumerator = customProperties.GetEnumerator(); try { while (((DictionaryEntryEnumerator)(ref enumerator)).MoveNext()) { DictionaryEntry current = ((DictionaryEntryEnumerator)(ref enumerator)).Current; val[current.Key] = current.Value; } } finally { ((IDisposable)(DictionaryEntryEnumerator)(ref enumerator)).Dispose(); } val[key] = value; photonPlayer.SetCustomProperties(val, (Hashtable)null, (WebFlags)null); } } [HarmonyPatch] public class PublicLobbySaves { internal static bool publicSavesMenuOpen; public static void ToggleLobbyTypeSaving(LobbyTypes lobbyType, bool state) { //IL_001a: 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_002c: 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) if (Object.op_Implicit((Object)(object)StatsManager.instance)) { if (state && !StatsManager.instance.savedLobbyTypes.Contains(lobbyType)) { StatsManager.instance.savedLobbyTypes.Add(lobbyType); } else if (!state && StatsManager.instance.savedLobbyTypes.Contains(lobbyType)) { StatsManager.instance.savedLobbyTypes.Remove(lobbyType); } } } [HarmonyPatch(typeof(MenuPageServerList), "ButtonCreateNew")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageServerList_ButtonCreateNew(MenuPageServerList __instance) { if (!PluginLoader.savePublicEnabled.Value || PluginLoader.mainMenuOverhaul) { return true; } SemiFunc.MainMenuSetMultiplayer(); publicSavesMenuOpen = true; MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)11, false); return false; } [HarmonyPatch(typeof(MenuPageSaves), "Start")] [HarmonyPostfix] [HarmonyWrapSafe] private static void MenuPageSaves_Start(MenuPageSaves __instance) { if (SemiFunc.MainMenuIsMultiplayer() && !PluginLoader.mainMenuOverhaul) { ((TMP_Text)__instance.gameModeHeader).text = (publicSavesMenuOpen ? "Public Multiplayer" : "Private Multiplayer"); } else { publicSavesMenuOpen = false; } __instance.maxSaveFiles = PluginLoader.saveFileMaxAmount.Value; } [MethodImpl(MethodImplOptions.NoInlining)] [HarmonyPatch(typeof(MenuButton), "OnSelect")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuButton_OnSelect(MenuButton __instance) { if (__instance.menuButtonPopUp?.headerText == "New Game" && __instance.menuButtonPopUp?.bodyText == "Do you want to start a game?") { if (PluginLoader.mainMenuOverhaul && SemiFunc.MainMenuIsMultiplayer()) { MenuPageV2.NewGame_Internal(__instance); return false; } if (publicSavesMenuOpen) { MenuPage parentPage = __instance.parentPage; MenuPageSaves obj = ((parentPage != null) ? ((Component)parentPage).GetComponent() : null); if (obj != null) { obj.OnNewGame(); } return false; } } if (__instance.menuButtonPopUp?.headerText == "Load save?" && __instance.menuButtonPopUp?.bodyText == "Load this save file?") { if (PluginLoader.mainMenuOverhaul && SemiFunc.MainMenuIsMultiplayer()) { MenuPageV2.LoadGame_Internal(__instance); return false; } if (publicSavesMenuOpen) { MenuPage parentPage2 = __instance.parentPage; MenuPageSaves obj2 = ((parentPage2 != null) ? ((Component)parentPage2).GetComponent() : null); if (obj2 != null) { obj2.OnLoadGame(); } return false; } } return true; } [HarmonyPatch(typeof(MenuPageSaves), "OnNewGame")] [HarmonyPrefix] [HarmonyWrapSafe] [HarmonyPriority(800)] private static bool MenuPageSaves_OnNewGame(MenuPageSaves __instance) { if (!publicSavesMenuOpen || __instance.saveFiles.Count >= __instance.maxSaveFiles) { return true; } MenuPage currentMenuPage = MenuManager.instance.currentMenuPage; MenuPageServerListCreateNew component = ((Component)MenuManager.instance.PageOpenOnTop((MenuPageIndex)15)).GetComponent(); component.menuPageParent = currentMenuPage; component.menuTextInput.textCurrent = SteamClient.Name + "'s Lobby"; return false; } [HarmonyPatch(typeof(MenuPageSaves), "OnLoadGame")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageSaves_OnLoadGame(MenuPageSaves __instance) { if (!publicSavesMenuOpen) { return true; } MenuPage currentMenuPage = MenuManager.instance.currentMenuPage; MenuPageServerListCreateNew component = ((Component)MenuManager.instance.PageOpenOnTop((MenuPageIndex)15)).GetComponent(); component.menuPageParent = currentMenuPage; component.menuTextInput.textCurrent = SteamClient.Name + "'s Lobby"; component.saveFileName = __instance.currentSaveFileName; return false; } [HarmonyPatch(typeof(MenuPageServerListCreateNew), "ExitPage")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageServerListCreateNew_ExitPage(MenuPageServerListCreateNew __instance) { if (!publicSavesMenuOpen && !PluginLoader.mainMenuOverhaul) { return true; } MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)11, false); return false; } [HarmonyPatch(typeof(MenuPageSaves), "OnGoBack")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageSaves_OnGoBack(MenuPageSaves __instance) { if (!publicSavesMenuOpen) { return true; } publicSavesMenuOpen = false; MenuManager.instance.PageCloseAll(); MenuManager.instance.PageOpen((MenuPageIndex)14, false); return false; } [HarmonyPatch(typeof(StatsManager), "Awake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void StatsManager_Awake_Postfix(StatsManager __instance) { ToggleLobbyTypeSaving((LobbyTypes)1, PluginLoader.savePublicEnabled.Value || PluginLoader.mainMenuOverhaulEnabled.Value); ToggleLobbyTypeSaving((LobbyTypes)2, PluginLoader.saveMatchmakingEnabled.Value || PluginLoader.mainMenuOverhaulEnabled.Value); } } [HarmonyPatch] public class ServerListSearch { [HarmonyPatch(typeof(MenuPageServerListSearch), "Update")] [HarmonyPrefix] [HarmonyWrapSafe] private static void MenuPageServerListSearch_Update(MenuPageServerListSearch __instance) { if (Input.GetKey((KeyCode)306) && Input.GetKeyDown((KeyCode)118)) { string systemCopyBuffer = GUIUtility.systemCopyBuffer; Match match = Regex.Match(systemCopyBuffer, "steam://joinlobby/\\d+/(\\d+)/\\d+"); if (match.Success) { MenuTextInput menuTextInput = __instance.menuTextInput; menuTextInput.textCurrent += match.Groups[1].Value; } else { MenuTextInput menuTextInput2 = __instance.menuTextInput; menuTextInput2.textCurrent += systemCopyBuffer; } } } [HarmonyPatch(typeof(MenuPageServerList), "SetSearch")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool MenuPageServerList_SetSearch(string _searchString) { //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_005e: Unknown result type (might be due to invalid IL or missing references) if (!string.IsNullOrEmpty(_searchString) && Regex.IsMatch(_searchString, "^[0-9]{17,19}$") && ulong.TryParse(_searchString, out var result)) { if (SteamApps.BuildId <= 18995935) { MenuManager instance = MenuManager.instance; if (instance != null) { instance.PageCloseAll(); } MenuManager instance2 = MenuManager.instance; if (instance2 != null) { instance2.PageOpen((MenuPageIndex)0, false); } } SteamManager.instance.OnGameLobbyJoinRequested(new Lobby(SteamId.op_Implicit(result)), SteamClient.SteamId); return false; } return true; } } [HarmonyPatch] public class TesterOverlayPatches { [HarmonyPatch(typeof(DebugTesterUI), "Start")] [HarmonyPrefix] [HarmonyWrapSafe] private static bool DebugTesterUI_Start(DebugTesterUI __instance) { if (!Debug.isDebugBuild) { return SemiFunc.DebugDev(); } return true; } [HarmonyPatch(typeof(SteamManager), "Awake")] [HarmonyPostfix] [HarmonyWrapSafe] private static void SteamManager_Awake(SteamManager __instance) { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)SteamManager.instance != (Object)(object)__instance) && !__instance.developerMode && SteamClient.IsValid) { List modDevSteamIDs = PluginLoader.modDevSteamIDs; SteamId steamId = SteamClient.SteamId; if (modDevSteamIDs.Contains(((object)(SteamId)(ref steamId)).ToString())) { __instance.developerUser = (User)7; __instance.developerMode = true; Debug.Log((object)("DEVELOPER MODE: " + ((object)(User)(ref __instance.developerUser)).ToString().ToUpper() + " (MOD)")); } } } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }