using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.NetworkInformation; using System.Net.Sockets; using System.Reflection; using System.Reflection.Emit; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; 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 BepInEx.Logging; using GameNetcodeStuff; using HarmonyLib; using LobbyCompatibility.Behaviours; using LobbyCompatibility.Enums; using LobbyCompatibility.Features; using LobbyImprovements.Compatibility; using LobbyImprovements.LANDiscovery; using Microsoft.CodeAnalysis; using MoreCompany; using Newtonsoft.Json; using Steamworks; using Steamworks.Data; using TMPro; using Unity.Collections; using Unity.Netcode; using Unity.Netcode.Transports.UTP; using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; [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("BMX.LobbyCompatibility")] [assembly: AssemblyCompany("uk.1a3.lobbyimprovements")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.4.0")] [assembly: AssemblyInformationalVersion("1.1.4+abb567611f184bfc95824107592d17c25bdb47ef")] [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] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 { [HarmonyPatch] public class AdditionalSaves { } [HarmonyPatch] public class HostingUI { public static GameObject hostPanel; internal static ulong protectedLobbyId; internal static string protectedLobbyPassword; [HarmonyPatch(typeof(MenuManager), "Awake")] [HarmonyPostfix] private static void MenuManager_Awake(MenuManager __instance) { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: 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_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_0309: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_037f: Unknown result type (might be due to invalid IL or missing references) //IL_0394: Unknown result type (might be due to invalid IL or missing references) //IL_03a8: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) //IL_0ae9: Unknown result type (might be due to invalid IL or missing references) //IL_0b0d: Unknown result type (might be due to invalid IL or missing references) //IL_0b31: Unknown result type (might be due to invalid IL or missing references) //IL_0b55: Unknown result type (might be due to invalid IL or missing references) //IL_0b7e: Unknown result type (might be due to invalid IL or missing references) //IL_0ba7: Unknown result type (might be due to invalid IL or missing references) //IL_061b: Unknown result type (might be due to invalid IL or missing references) //IL_0630: Unknown result type (might be due to invalid IL or missing references) //IL_0645: Unknown result type (might be due to invalid IL or missing references) //IL_0659: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0697: Unknown result type (might be due to invalid IL or missing references) //IL_053c: Unknown result type (might be due to invalid IL or missing references) //IL_055b: Unknown result type (might be due to invalid IL or missing references) //IL_07b6: Unknown result type (might be due to invalid IL or missing references) //IL_07cb: Unknown result type (might be due to invalid IL or missing references) //IL_07e0: Unknown result type (might be due to invalid IL or missing references) //IL_07f4: Unknown result type (might be due to invalid IL or missing references) //IL_0814: Unknown result type (might be due to invalid IL or missing references) //IL_0834: Unknown result type (might be due to invalid IL or missing references) //IL_0855: Unknown result type (might be due to invalid IL or missing references) //IL_0874: Unknown result type (might be due to invalid IL or missing references) //IL_04a8: Unknown result type (might be due to invalid IL or missing references) //IL_071c: Unknown result type (might be due to invalid IL or missing references) //IL_0726: Expected O, but got Unknown //IL_08cb: Unknown result type (might be due to invalid IL or missing references) //IL_08d5: Expected O, but got Unknown //IL_08e2: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Expected O, but got Unknown //IL_0985: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0a3c: Unknown result type (might be due to invalid IL or missing references) if (__instance.isInitScene) { return; } Transform val = __instance.HostSettingsScreen.transform.Find("HostSettingsContainer"); Transform val2 = ((val != null) ? val.Find("LobbyHostOptions") : null); if (!((Object)(object)val2 != (Object)null)) { return; } Transform val3 = __instance.HostSettingsScreen.transform.Find("FilesPanel"); GameObject val4 = Object.Instantiate(((Component)val3).gameObject, val3.parent); ((Object)val4).name = "LIPanel_Host"; hostPanel = val4; TextMeshProUGUI component = ((Component)val4.transform.Find("EnterAName")).gameObject.GetComponent(); ((TMP_Text)component).transform.localPosition = new Vector3(0f, 100f, 0f); ((TMP_Text)component).fontSize = 14f; ((TMP_Text)component).text = "LobbyImprovements"; val4.transform.localPosition = new Vector3(-252.0869f, -5.648f, -2.785f); for (int num = val4.transform.childCount - 1; num >= 0; num--) { Transform child = val4.transform.GetChild(num); if (((Object)child).name != "EnterAName" && ((Object)child).name != "Darken" && ((Object)child).name != "Outline") { Object.Destroy((Object)(object)((Component)child).gameObject); } } Transform obj = val2.Find("OptionsNormal/EnterAName"); GameObject val5 = ((obj != null) ? ((Component)obj).gameObject : null); if ((Object)(object)val5 != (Object)null) { RectTransform component2 = val5.GetComponent(); component2.anchorMin = new Vector2(0.5f, 0.5f); component2.anchorMax = new Vector2(0.5f, 0.5f); component2.pivot = new Vector2(0.5f, 0.5f); val5.transform.localScale = new Vector3(0.8f, 0.8f, 0.8f); val5.transform.localPosition = new Vector3(0f, 30f, 0f); ((TMP_Text)val5.GetComponent()).text = "Server Name:"; GameObject obj2 = Object.Instantiate(val5.gameObject, val5.transform.parent); ((Object)obj2).name = "EnterAccess"; obj2.transform.localPosition = new Vector3(0f, 70f, 0f); ((TMP_Text)obj2.GetComponent()).text = "Server Access:"; GameObject obj3 = Object.Instantiate(val5.gameObject, val5.transform.parent); ((Object)obj3).name = "EnterATag"; obj3.transform.localPosition = new Vector3(0f, -10f, 0f); ((TMP_Text)obj3.GetComponent()).text = "Server Tag:"; GameObject obj4 = Object.Instantiate(val5.gameObject, val4.transform); ((Object)obj4).name = "EnterAPassword"; obj4.transform.localPosition = new Vector3(0f, 70f, 0f); ((TMP_Text)obj4.GetComponent()).fontSize = 12f; ((TMP_Text)obj4.GetComponent()).text = "Server Password:"; } Transform obj5 = val2.Find("OptionsNormal/ServerTagInputField"); GameObject val6 = ((obj5 != null) ? ((Component)obj5).gameObject : null); if ((Object)(object)val6 != (Object)null) { RectTransform component3 = val6.GetComponent(); component3.sizeDelta = new Vector2(310.55f, 30f); component3.anchorMin = new Vector2(0.5f, 0.5f); component3.anchorMax = new Vector2(0.5f, 0.5f); component3.pivot = new Vector2(0.5f, 0.5f); val6.transform.localPosition = new Vector3(0f, -30f, 0f); ((TMP_Text)((Component)val6.transform.Find("Text Area/Placeholder")).GetComponent()).fontSize = 16f; ((TMP_Text)((Component)val6.transform.Find("Text Area/Text")).GetComponent()).fontSize = 16f; __instance.lobbyTagInputField = val6.GetComponent(); if ((Object)(object)val6.transform.parent.Find("ServerNameField") != (Object)null) { Transform obj6 = val6.transform.parent.Find("ServerNameField"); Object.Destroy((Object)(object)((obj6 != null) ? ((Component)obj6).gameObject : null)); GameObject val7 = Object.Instantiate(val6.gameObject, val6.transform.parent); ((Object)val7).name = "ServerNameField"; val7.transform.localPosition = new Vector3(0f, 10f, 0f); ((TMP_Text)((Component)val7.transform.Find("Text Area/Placeholder")).GetComponent()).text = "Enter a name..."; val7.GetComponent().characterLimit = 40; __instance.lobbyNameInputField = val7.GetComponent(); } if ((Object)(object)val4.transform.Find("ServerPasswordField") == (Object)null) { GameObject obj7 = Object.Instantiate(val6.gameObject, val4.transform); ((Object)obj7).name = "ServerPasswordField"; obj7.GetComponent().sizeDelta = new Vector2(200f, 30f); obj7.transform.localPosition = new Vector3(0f, 50f, 0f); TextMeshProUGUI component4 = ((Component)obj7.transform.Find("Text Area/Placeholder")).GetComponent(); ((TMP_Text)component4).text = "None"; ((TMP_Text)component4).horizontalAlignment = (HorizontalAlignmentOptions)2; ((TMP_Text)((Component)obj7.transform.Find("Text Area/Text")).GetComponent()).horizontalAlignment = (HorizontalAlignmentOptions)2; obj7.GetComponent().contentType = (ContentType)7; obj7.GetComponent().characterLimit = 18; } } GameObject val8 = GameObject.Find("Canvas/MenuContainer/LobbyList/ListPanel/Dropdown"); if ((Object)(object)val8 != (Object)null && (Object)(object)val2.Find("OptionsNormal/ServerAccessDropdown") == (Object)null) { GameObject obj8 = Object.Instantiate(val8, val2.Find("OptionsNormal")); ((Object)obj8).name = "ServerAccessDropdown"; RectTransform component5 = obj8.GetComponent(); component5.sizeDelta = new Vector2(310.55f, 30f); component5.anchorMin = new Vector2(0.5f, 0.5f); component5.anchorMax = new Vector2(0.5f, 0.5f); component5.pivot = new Vector2(0.5f, 0.5f); obj8.transform.localScale = new Vector3(0.7172f, 0.7172f, 0.7172f); obj8.transform.localPosition = new Vector3(0f, 50f, 0f); TMP_Dropdown component6 = obj8.GetComponent(); component6.ClearOptions(); if (GameNetworkManager.Instance.disableSteam) { component6.AddOptions(new List(3) { "Public", "IP-only", "Localhost" }); } else { component6.AddOptions(new List(3) { "Public", "Friends-only", "Invite-only" }); } component6.onValueChanged = new DropdownEvent(); component6.value = 0; ((UnityEvent)(object)component6.onValueChanged).AddListener((UnityAction)delegate(int index) { PluginLoader.setInviteOnly = false; if (GameNetworkManager.Instance.disableSteam) { switch (index) { case 1: PluginLoader.setInviteOnly = true; __instance.HostSetLobbyPublic(true); break; case 2: __instance.HostSetLobbyPublic(false); break; default: __instance.HostSetLobbyPublic(true); break; } } else { switch (index) { case 1: __instance.HostSetLobbyPublic(false); break; case 2: PluginLoader.setInviteOnly = true; __instance.HostSetLobbyPublic(false); break; default: __instance.HostSetLobbyPublic(true); break; } } }); obj8.SetActive(true); } GameObject val9 = GameObject.Find("Canvas/MenuContainer/LobbyList/ListPanel/ToggleChallengeSort"); if ((Object)(object)val9 != (Object)null && (Object)(object)val4.transform.Find("ServerSecureToggle") == (Object)null) { GameObject val10 = Object.Instantiate(val9, val4.transform); ((Object)val10).name = "ServerSecureToggle"; RectTransform component7 = val10.GetComponent(); component7.sizeDelta = new Vector2(200f, 30f); component7.anchorMin = new Vector2(0.5f, 0.5f); component7.anchorMax = new Vector2(0.5f, 0.5f); component7.pivot = new Vector2(0.5f, 0.5f); val10.transform.localScale = new Vector3(0.7172f, 0.7172f, 0.7172f); val10.transform.localPosition = new Vector3(0f, 20f, 0f); TextMeshProUGUI componentInChildren = val10.GetComponentInChildren(); ((Component)componentInChildren).GetComponent().sizeDelta = new Vector2(175f, 30f); ((TMP_Text)componentInChildren).transform.localPosition = new Vector3(-4f, 0f, 0f); ((TMP_Text)componentInChildren).fontSize = 12f; ((TMP_Text)componentInChildren).text = (GameNetworkManager.Instance.disableSteam ? "Validate Clients:" : "Validate Steam Sessions:"); Image secureToggleIcon = ((Component)val10.transform.Find("Arrow (1)")).GetComponentInChildren(); Button componentInChildren2 = val10.GetComponentInChildren