using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using Microsoft.CodeAnalysis;
using PEAKLib.UI;
using PEAKLib.UI.Elements;
using Steamworks;
using TMPro;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PEAKLobbyBrowser")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.1.0.0")]
[assembly: AssemblyInformationalVersion("0.1.0+898cb54225f19553009959f1ce97214bdb5a369d")]
[assembly: AssemblyProduct("PEAKLobbyBrowser")]
[assembly: AssemblyTitle("LobbyBrowser")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.1.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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace PEAKLobbyBrowser
{
public enum LobbyVisibility
{
Public,
FriendsOnly,
Private
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("PEAKLobbyBrowser", "PEAK Lobby Browser", "1.4.0")]
public class PEAKLobbyBrowser : BaseUnityPlugin
{
public struct LobbyDetails
{
public CSteamID Lobby_ID;
public string Host_Name;
public int Member_Count;
public int Max_Members;
public string Lobby_Name;
public string Languagee;
public string Descriptionn;
public string Modpack_Id;
}
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static Func<bool> <>9__33_0;
public static UnityAction <>9__42_4;
public static UnityAction <>9__43_1;
public static UnityAction <>9__43_3;
public static UnityAction <>9__43_4;
public static Func<LobbyDetails, bool> <>9__44_0;
internal bool <ShowPluginDetectNotification>b__33_0()
{
return (Object)(object)GameObject.Find("MainMenu/Canvas/MainPage") != (Object)null;
}
internal void <CreateLobbyBrowserPage>b__42_4()
{
((MenuWindow)lobby_BrowserPage).Hide();
}
internal void <CreateLobbySettingsPage>b__43_1()
{
//IL_0022: 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)
CSteamID val = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val))
{
currentJoinable = !currentJoinable;
SteamMatchmaking.SetLobbyJoinable(val, currentJoinable);
SteamMatchmaking.SetLobbyData(val, "joinable", currentJoinable ? "true" : "false");
if ((Object)(object)joinableButton != (Object)null && (Object)(object)joinableButton.Text != (Object)null && (Object)(object)joinableButton.Text.TextMesh != (Object)null)
{
((TMP_Text)joinableButton.Text.TextMesh).text = (currentJoinable ? "Lobby Lock: Unlocked" : "Lobby Lock: Locked");
}
}
}
internal void <CreateLobbySettingsPage>b__43_3()
{
((MenuWindow)lobby_SettingsPage).Hide();
}
internal void <CreateLobbySettingsPage>b__43_4()
{
//IL_0017: 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)
CSteamID val = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val))
{
string text2 = (GUIUtility.systemCopyBuffer = $"steam://joinlobby/3527290/{val.m_SteamID}/{SteamUser.GetSteamID().m_SteamID}");
Log.LogInfo((object)("Copied Steam Lobby Link to Clipboard: " + text2));
}
else
{
Log.LogWarning((object)"Could not Copy Lobby Link: Not currently in a Steam Lobby.");
}
}
internal bool <GetFilteredLobbies>b__44_0(LobbyDetails lobby)
{
return (lobby.Lobby_Name != null && lobby.Lobby_Name.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Host_Name != null && lobby.Host_Name.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Languagee != null && lobby.Languagee.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Modpack_Id != null && lobby.Modpack_Id.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0);
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass35_0
{
public string buttonsContainerPath;
internal bool <CreateButtonWhenMenuIsReady>b__0()
{
return (Object)(object)GameObject.Find(buttonsContainerPath) != (Object)null;
}
}
[CompilerGenerated]
private sealed class <CreateButtonWhenMenuIsReady>d__35 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PEAKLobbyBrowser <>4__this;
private <>c__DisplayClass35_0 <>8__1;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <CreateButtonWhenMenuIsReady>d__35(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Expected O, but got Unknown
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>8__1 = new <>c__DisplayClass35_0();
if (<>4__this.isDisabled)
{
return false;
}
if ((Object)(object)GameObject.Find("Button_LobbyBrowser") != (Object)null)
{
return false;
}
<>8__1.buttonsContainerPath = "MainMenu/Canvas/MainPage/Menu/Buttons";
<>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)GameObject.Find(<>8__1.buttonsContainerPath) != (Object)null));
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(3f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
<>4__this.LobbyBrowserMainMenuButton();
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 <ModifyLobbyBrowserButton>d__40 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public GameObject buttonObject;
public PEAKLobbyBrowser <>4__this;
private GameObject <nextLevelUI>5__1;
private RectTransform <buttonRect>5__2;
private RectTransform <nextLevelRect>5__3;
private float <verticalOffset>5__4;
private Vector2 <fineTuneOffset>5__5;
private TextMeshProUGUI <buttonText>5__6;
private Button <buttonComponent>5__7;
private LocalizedText <oldLocalization>5__8;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ModifyLobbyBrowserButton>d__40(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<nextLevelUI>5__1 = null;
<buttonRect>5__2 = null;
<nextLevelRect>5__3 = null;
<buttonText>5__6 = null;
<buttonComponent>5__7 = null;
<oldLocalization>5__8 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_014b: Unknown result type (might be due to invalid IL or missing references)
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_026a: Unknown result type (might be due to invalid IL or missing references)
//IL_0274: Expected O, but got Unknown
//IL_020b: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
if (<>4__this.isDisabled)
{
return false;
}
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 1;
return true;
case 1:
{
<>1__state = -1;
((Object)buttonObject).name = "Button_LobbyBrowser";
<nextLevelUI>5__1 = GameObject.Find("MainMenu/Canvas/MainPage/NextLevelUI");
if ((Object)(object)<nextLevelUI>5__1 == (Object)null)
{
Log.LogFatal((object)"Could not find NextLevelUI to position the lobby browser button.");
return false;
}
<buttonRect>5__2 = buttonObject.GetComponent<RectTransform>();
<nextLevelRect>5__3 = <nextLevelUI>5__1.GetComponent<RectTransform>();
<buttonRect>5__2.anchorMin = <nextLevelRect>5__3.anchorMin;
<buttonRect>5__2.anchorMax = <nextLevelRect>5__3.anchorMax;
<buttonRect>5__2.pivot = new Vector2(0.5f, 0.5f);
Rect rect = <nextLevelRect>5__3.rect;
<verticalOffset>5__4 = ((Rect)(ref rect)).height + 15f;
<fineTuneOffset>5__5 = new Vector2(-180f, 40f);
<buttonRect>5__2.anchoredPosition = <nextLevelRect>5__3.anchoredPosition - new Vector2(0f, <verticalOffset>5__4) + <fineTuneOffset>5__5;
buttonObject.transform.localScale = new Vector3(-1f, 1.3f, 1f);
<buttonText>5__6 = buttonObject.GetComponentInChildren<TextMeshProUGUI>();
if ((Object)(object)<buttonText>5__6 != (Object)null)
{
<oldLocalization>5__8 = ((Component)<buttonText>5__6).GetComponent<LocalizedText>();
if ((Object)(object)<oldLocalization>5__8 != (Object)null)
{
Object.Destroy((Object)(object)<oldLocalization>5__8);
}
((TMP_Text)<buttonText>5__6).text = "LOBBY BROWSER";
((TMP_Text)<buttonText>5__6).transform.localScale = new Vector3(-0.9f, 0.7f, 0.9f);
<oldLocalization>5__8 = null;
}
<buttonComponent>5__7 = buttonObject.GetComponentInChildren<Button>();
if ((Object)(object)<buttonComponent>5__7 != (Object)null)
{
((UnityEventBase)<buttonComponent>5__7.onClick).RemoveAllListeners();
((UnityEvent)<buttonComponent>5__7.onClick).AddListener((UnityAction)delegate
{
<>4__this.OpenLobbyBrowserPage();
});
}
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 <ShowPageAfterCreation>d__37 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PeakCustomPage page;
public PEAKLobbyBrowser <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ShowPageAfterCreation>d__37(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitForEndOfFrame();
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
if ((Object)(object)page != (Object)null)
{
((MenuWindow)page).Show();
}
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 <ShowPluginDetectNotification>d__33 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public PEAKLobbyBrowser <>4__this;
private Transform <canvas>5__1;
private GameObject <notificationPanel>5__2;
private RectTransform <panelRect>5__3;
private Image <panelImage>5__4;
private string <pluginList>5__5;
private int <timerDuration>5__6;
private PeakText <notificationText>5__7;
private int <i>5__8;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ShowPluginDetectNotification>d__33(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<canvas>5__1 = null;
<notificationPanel>5__2 = null;
<panelRect>5__3 = null;
<panelImage>5__4 = null;
<pluginList>5__5 = null;
<notificationText>5__7 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b3: Expected O, but got Unknown
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_01e6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_020e: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Expected O, but got Unknown
//IL_024a: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)GameObject.Find("MainMenu/Canvas/MainPage") != (Object)null));
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
<canvas>5__1 = GameObject.Find("MainMenu/Canvas").transform;
<notificationPanel>5__2 = new GameObject("CheatNotificationPanel");
<notificationPanel>5__2.transform.SetParent(<canvas>5__1, false);
<panelRect>5__3 = <notificationPanel>5__2.AddComponent<RectTransform>();
<panelRect>5__3.anchorMin = new Vector2(0.5f, 1f);
<panelRect>5__3.anchorMax = new Vector2(0.5f, 1f);
<panelRect>5__3.pivot = new Vector2(0.5f, 1f);
<panelRect>5__3.anchoredPosition = new Vector2(0f, -30f);
<panelImage>5__4 = <notificationPanel>5__2.AddComponent<Image>();
((Graphic)<panelImage>5__4).color = new Color(0f, 0f, 0f, 0.7f);
<pluginList>5__5 = string.Join("\n- ", <>4__this.detectedPlugins);
<timerDuration>5__6 = 45;
<notificationText>5__7 = ElementExtensions.SetPosition<PeakText>(ElementExtensions.SetPivot<PeakText>(ElementExtensions.SetAnchorMinMax<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText($"<color=yellow>PEAK Lobby Browser Disabled!</color>\n\n<color=red>Please disable the following plugins:</color>\n- {<pluginList>5__5}\n\nDisappearing in: {<timerDuration>5__6} seconds").SetFontSize(22f), <notificationPanel>5__2.transform), new Vector2(0.5f, 0.5f)), new Vector2(0.5f, 0.5f)), new Vector2(0f, 0f));
<>4__this.UpdatePanelSize(<panelRect>5__3, <notificationText>5__7);
<i>5__8 = <timerDuration>5__6;
break;
case 3:
<>1__state = -1;
<notificationText>5__7.SetText($"<color=yellow>PEAK Lobby Browser Disabled!</color>\n\n<color=red>Please disable the following plugins:</color>\n- {<pluginList>5__5}\n\nDisappearing in: {<i>5__8} seconds");
<>4__this.UpdatePanelSize(<panelRect>5__3, <notificationText>5__7);
<i>5__8--;
break;
}
if (<i>5__8 > 0)
{
<>2__current = (object)new WaitForSeconds(1f);
<>1__state = 3;
return true;
}
Object.Destroy((Object)(object)<notificationPanel>5__2);
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();
}
}
internal static ManualLogSource Log = null;
private bool isSearchingForLobbies = false;
private List<LobbyDetails> publicLobbies = new List<LobbyDetails>();
protected Callback<LobbyMatchList_t> m_LobbyMatchList = null;
private static PeakCustomPage? lobby_BrowserPage;
private static PeakScrollableContent? lobby_ListContainer;
private static PeakCustomPage? lobby_SettingsPage;
private static PeakTextInput? lobby_NameInput;
private static PeakTextInput? lobby_LanguageInput;
private static PeakTextInput? lobby_DescriptionInput;
private static PeakTextInput? modpack_IdInput;
private static PeakButton? visibilityButton;
private static PeakButton? joinableButton;
private static bool currentJoinable = true;
private static LobbyVisibility currentVisibility = LobbyVisibility.Public;
private static PeakTextInput? searchInput;
private const string LobbyBrowserPosition = "TopMidLeftRight";
private static string currentSearchTerm = "";
private static int currentPage = 0;
private const int LobbiesPerPage = 5;
private static PeakText? pageInfoText;
private static PeakMenuButton? previousButton;
private static PeakMenuButton? nextButton;
private bool isDisabled = false;
private List<string> detectedPlugins = new List<string>();
public static PEAKLobbyBrowser Instance { get; private set; } = null;
private void Awake()
{
Instance = this;
Log = Logger.CreateLogSource("PEAKLobbyBrowser");
m_LobbyMatchList = Callback<LobbyMatchList_t>.Create((DispatchDelegate<LobbyMatchList_t>)OnLobbyMatchList);
InitializeInGameUI();
SceneManager.sceneLoaded += OnSceneLoaded;
Log.LogInfo((object)"PEAK Lobby Browser Plugin Initialized!");
}
private void Start()
{
detectedPlugins = LoserCheck();
if (detectedPlugins.Count > 0)
{
string text = string.Join(", ", detectedPlugins);
Log.LogFatal((object)("!@!@! Disabling mod due to detected cheating plugin(s) !@!@! Please remove or disable the following plugins to use LobbyBrowser: " + text));
isDisabled = true;
}
}
private void OnDestroy()
{
SceneManager.sceneLoaded -= OnSceneLoaded;
if (m_LobbyMatchList != null)
{
m_LobbyMatchList.Dispose();
}
}
private void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (((Scene)(ref scene)).name == "Title")
{
if (isDisabled && detectedPlugins.Count > 0)
{
((MonoBehaviour)this).StartCoroutine(ShowPluginDetectNotification());
}
else if (!isDisabled)
{
((MonoBehaviour)this).StartCoroutine(CreateButtonWhenMenuIsReady());
}
}
}
[IteratorStateMachine(typeof(<ShowPluginDetectNotification>d__33))]
private IEnumerator ShowPluginDetectNotification()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ShowPluginDetectNotification>d__33(0)
{
<>4__this = this
};
}
private void UpdatePanelSize(RectTransform panelRect, PeakText notificationText)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
Vector2 preferredValues = ((TMP_Text)notificationText.TextMesh).GetPreferredValues();
panelRect.sizeDelta = new Vector2(preferredValues.x + 20f, preferredValues.y + 20f);
}
[IteratorStateMachine(typeof(<CreateButtonWhenMenuIsReady>d__35))]
private IEnumerator CreateButtonWhenMenuIsReady()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <CreateButtonWhenMenuIsReady>d__35(0)
{
<>4__this = this
};
}
private void InitializeInGameUI()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Expected O, but got Unknown
if (isDisabled)
{
return;
}
try
{
MenuAPI.AddToSettingsMenu((BuilderDelegate)delegate(Transform parent)
{
CreateLobbySettingsButton(parent);
});
}
catch (Exception ex)
{
Log.LogFatal((object)("Could not initialize PEAKLib.UI buttons: " + ex.Message));
}
}
[IteratorStateMachine(typeof(<ShowPageAfterCreation>d__37))]
private IEnumerator ShowPageAfterCreation(PeakCustomPage page)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ShowPageAfterCreation>d__37(0)
{
<>4__this = this,
page = page
};
}
private List<string> LoserCheck()
{
List<string> list = new List<string>();
List<string> list2 = new List<string>
{
"tony4twentys.So_Fly", "FlyMod", "com.lamia.flymod", "com.keklick1337.peak.advancedconsole", "com.quackandcheese.ItemSpawner", "PEAKGaming", "synq.peak.atlas", "com.github.enderspearl184.peakpseudonym", "Everything", "Cherry.Cherry",
"com.onigremlin.peakaio", "com.you.InjectZorroConsole", "TropicalFrog3.SpeedMod", "com.github.Fremplton.CantCatchMe", "StaminaAdjuster", "com.mathis.infinitestamina", "nexor.InstantRestoreStamina", "com.vandermoore.peak.spawnermenu", "com.vandermoore.peak.infinitestamina", "BingBongMod"
};
foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos)
{
if (list2.Contains(pluginInfo.Value.Metadata.GUID) || list2.Contains(pluginInfo.Value.Metadata.Name))
{
list.Add(pluginInfo.Value.Metadata.Name + " (" + pluginInfo.Value.Metadata.GUID + ")");
}
}
return list;
}
private void LobbyBrowserMainMenuButton()
{
if (isDisabled)
{
return;
}
try
{
GameObject val = GameObject.Find("MainMenu/Canvas/MainPage/Menu/Buttons/Button_PlaySolo");
GameObject val2 = GameObject.Find("MainMenu/Canvas/MainPage");
if ((Object)(object)val == (Object)null || (Object)(object)val2 == (Object)null)
{
Log.LogFatal((object)"Could not find the original button or the new parent transform.");
return;
}
GameObject val3 = Object.Instantiate<GameObject>(val, val2.transform);
val3.SetActive(true);
Animator component = val3.GetComponent<Animator>();
if ((Object)(object)component != (Object)null)
{
component.Play("Normal");
}
((MonoBehaviour)this).StartCoroutine(ModifyLobbyBrowserButton(val3));
}
catch (Exception ex)
{
Log.LogFatal((object)("Failed to build lobby browser main menu button: " + ex.Message));
}
}
[IteratorStateMachine(typeof(<ModifyLobbyBrowserButton>d__40))]
private IEnumerator ModifyLobbyBrowserButton(GameObject buttonObject)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ModifyLobbyBrowserButton>d__40(0)
{
<>4__this = this,
buttonObject = buttonObject
};
}
private void CreateLobbySettingsButton(Transform parent)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
CSteamID val = default(CSteamID);
if (!GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val) || !(SteamMatchmaking.GetLobbyOwner(val) == SteamUser.GetSteamID()))
{
return;
}
try
{
PeakMenuButton val2 = MenuAPI.CreatePauseMenuButton("LOBBY SETTINGS");
ElementExtensions.ParentTo<PeakMenuButton>(val2, parent);
ElementExtensions.SetPosition<PeakMenuButton>(val2, new Vector2(171f, -300f));
val2.OnClick((UnityAction)delegate
{
UIInputHandler.SetSelectedObject((GameObject)null);
OpenLobbySettingsPage();
});
((Object)((Component)val2).gameObject).name = "Button_LobbySettings";
}
catch (Exception ex)
{
Log.LogFatal((object)("Failed to create Lobby Settings button: " + ex.Message));
}
}
private void CreateLobbyBrowserPage()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0185: Expected O, but got Unknown
//IL_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01d1: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_0268: Unknown result type (might be due to invalid IL or missing references)
//IL_0283: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Expected O, but got Unknown
//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0302: Expected O, but got Unknown
//IL_032a: Unknown result type (might be due to invalid IL or missing references)
//IL_033e: Unknown result type (might be due to invalid IL or missing references)
//IL_0352: Unknown result type (might be due to invalid IL or missing references)
//IL_036d: Unknown result type (might be due to invalid IL or missing references)
//IL_0377: Expected O, but got Unknown
//IL_039b: Unknown result type (might be due to invalid IL or missing references)
//IL_03af: Unknown result type (might be due to invalid IL or missing references)
//IL_03c3: Unknown result type (might be due to invalid IL or missing references)
//IL_041f: Unknown result type (might be due to invalid IL or missing references)
//IL_0433: Unknown result type (might be due to invalid IL or missing references)
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_0462: Unknown result type (might be due to invalid IL or missing references)
//IL_046c: Expected O, but got Unknown
//IL_0490: Unknown result type (might be due to invalid IL or missing references)
//IL_04a4: Unknown result type (might be due to invalid IL or missing references)
//IL_04b8: Unknown result type (might be due to invalid IL or missing references)
//IL_03eb: Unknown result type (might be due to invalid IL or missing references)
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_03f6: Expected O, but got Unknown
if (isDisabled || (Object)(object)lobby_BrowserPage != (Object)null)
{
return;
}
lobby_BrowserPage = MenuAPI.CreatePageWithBackground("Lobby Browser Page");
ElementExtensions.SetPosition<PeakText>(ElementExtensions.SetPivot<PeakText>(ElementExtensions.SetAnchorMinMax<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Public Lobbies").SetFontSize(48f), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 1f)), new Vector2(0.5f, 1f)), new Vector2(0f, -50f));
searchInput = ElementExtensions.SetSize<PeakTextInput>(ElementExtensions.SetPosition<PeakTextInput>(ElementExtensions.SetPivot<PeakTextInput>(ElementExtensions.SetAnchorMinMax<PeakTextInput>(ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("SearchInput"), ((Component)lobby_BrowserPage).transform).SetPlaceholder("Search for Lobby Name, Host, Language or Modpack....."), new Vector2(0.5f, 1f)), new Vector2(0.5f, 1f)), new Vector2(-75f, -120f)), new Vector2(650f, 50f));
ElementExtensions.SetSize<PeakMenuButton>(ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Search"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 1f)), new Vector2(0.5f, 1f)), new Vector2(325f, -120f)), new Vector2(150f, 50f)).OnClick((UnityAction)delegate
{
if (!((Object)(object)searchInput == (Object)null))
{
currentPage = 0;
currentSearchTerm = searchInput.InputField.text;
PopulateLobbyPage();
}
});
lobby_ListContainer = ElementExtensions.SetSize<PeakScrollableContent>(ElementExtensions.SetPosition<PeakScrollableContent>(ElementExtensions.SetPivot<PeakScrollableContent>(ElementExtensions.SetAnchorMinMax<PeakScrollableContent>(ElementExtensions.ParentTo<PeakScrollableContent>(MenuAPI.CreateScrollableContent("LobbyList"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 1f)), new Vector2(0.5f, 1f)), new Vector2(0f, -180f)), new Vector2(800f, 625f));
VerticalLayoutGroup component = ((Component)lobby_ListContainer.Content).GetComponent<VerticalLayoutGroup>();
if ((Object)(object)component != (Object)null)
{
((HorizontalOrVerticalLayoutGroup)component).spacing = 5f;
}
previousButton = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("<< Previous"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(2.2f, 0f)), new Vector2(0f, 100f)).SetWidth(200f).OnClick((UnityAction)delegate
{
GoToPreviousPage();
});
nextButton = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Next >>"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(-1.2f, 0f)), new Vector2(0f, 100f)).SetWidth(200f).OnClick((UnityAction)delegate
{
GoToNextPage();
});
ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Refresh"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(1.1f, 0f)), new Vector2(0f, 100f)).SetWidth(200f).OnClick((UnityAction)delegate
{
if ((Object)(object)searchInput != (Object)null)
{
searchInput.InputField.text = "";
}
currentSearchTerm = "";
currentPage = 0;
RefreshLobbyList();
});
PeakMenuButton obj = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Close"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(-0.1f, 0f)), new Vector2(0f, 100f)).SetWidth(200f);
object obj2 = <>c.<>9__42_4;
if (obj2 == null)
{
UnityAction val = delegate
{
((MenuWindow)lobby_BrowserPage).Hide();
};
<>c.<>9__42_4 = val;
obj2 = (object)val;
}
obj.OnClick((UnityAction)obj2);
ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Join from Clipboard"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(0.5f, 0f)), new Vector2(0f, 165f)).SetWidth(280f).OnClick((UnityAction)delegate
{
ParseAndJoinLobby(GUIUtility.systemCopyBuffer);
});
pageInfoText = ElementExtensions.SetPosition<PeakText>(ElementExtensions.SetPivot<PeakText>(ElementExtensions.SetAnchorMinMax<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Page 1 / 1"), ((Component)lobby_BrowserPage).transform), new Vector2(0.5f, 0f)), new Vector2(0.5f, 0f)), new Vector2(0f, 70f)).SetFontSize(24f);
}
private void CreateLobbySettingsPage()
{
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: Expected O, but got Unknown
//IL_0310: Unknown result type (might be due to invalid IL or missing references)
//IL_0324: Unknown result type (might be due to invalid IL or missing references)
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_035d: Expected O, but got Unknown
//IL_0381: Unknown result type (might be due to invalid IL or missing references)
//IL_0395: Unknown result type (might be due to invalid IL or missing references)
//IL_03a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02dd: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Expected O, but got Unknown
//IL_0405: Unknown result type (might be due to invalid IL or missing references)
//IL_0419: Unknown result type (might be due to invalid IL or missing references)
//IL_042d: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03d6: Unknown result type (might be due to invalid IL or missing references)
//IL_03dc: Expected O, but got Unknown
//IL_0455: Unknown result type (might be due to invalid IL or missing references)
//IL_045a: Unknown result type (might be due to invalid IL or missing references)
//IL_0460: Expected O, but got Unknown
if (isDisabled || (Object)(object)lobby_SettingsPage != (Object)null)
{
return;
}
lobby_SettingsPage = MenuAPI.CreatePageWithBackground("Lobby Settings Page");
Canvas component = ((Component)lobby_SettingsPage).GetComponent<Canvas>();
if ((Object)(object)component != (Object)null)
{
component.overrideSorting = true;
component.sortingOrder = 999;
}
ElementExtensions.SetPosition<PeakText>(ElementExtensions.SetPivot<PeakText>(ElementExtensions.SetAnchorMinMax<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Lobby Settings").SetFontSize(48f), ((Component)lobby_SettingsPage).transform), new Vector2(0.5f, 1f)), new Vector2(0.5f, 1f)), new Vector2(0f, -50f));
PeakScrollableContent val = ElementExtensions.SetSize<PeakScrollableContent>(ElementExtensions.SetPivot<PeakScrollableContent>(ElementExtensions.SetAnchorMinMax<PeakScrollableContent>(ElementExtensions.ParentTo<PeakScrollableContent>(MenuAPI.CreateScrollableContent("SettingsContainer"), ((Component)lobby_SettingsPage).transform), new Vector2(0.5f, 0.5f)), new Vector2(0.5f, 0.5f)), new Vector2(600f, 600f));
RectTransform content = val.Content;
ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Lobby Name:"), (Transform)(object)content).SetFontSize(24f);
lobby_NameInput = ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("Lobby_NameInput"), (Transform)(object)content);
if ((Object)(object)lobby_NameInput != (Object)null)
{
lobby_NameInput.InputField.characterLimit = 40;
}
ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Language:"), (Transform)(object)content).SetFontSize(24f);
lobby_LanguageInput = ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("Lobby_LanguageInput"), (Transform)(object)content);
if ((Object)(object)lobby_LanguageInput != (Object)null)
{
lobby_LanguageInput.InputField.characterLimit = 10;
}
ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Description:"), (Transform)(object)content).SetFontSize(22f);
lobby_DescriptionInput = ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("Lobby_DescriptionInput"), (Transform)(object)content);
if ((Object)(object)lobby_DescriptionInput != (Object)null)
{
lobby_DescriptionInput.InputField.characterLimit = 60;
}
ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText("Modpack:"), (Transform)(object)content).SetFontSize(18f);
modpack_IdInput = ElementExtensions.ParentTo<PeakTextInput>(MenuAPI.CreateTextInput("Modpack_IdInput"), (Transform)(object)content);
if ((Object)(object)modpack_IdInput != (Object)null)
{
modpack_IdInput.InputField.characterLimit = 44;
}
visibilityButton = ElementExtensions.ParentTo<PeakButton>(MenuAPI.CreateButton("Visibility: Public"), (Transform)(object)content).SetHeight(75f).OnClick((UnityAction)delegate
{
CycleLobbyVisibility();
});
PeakButton obj = ElementExtensions.ParentTo<PeakButton>(MenuAPI.CreateButton(currentJoinable ? "Lobby Lock: Unlocked" : "Lobby Lock: Locked"), (Transform)(object)content).SetHeight(60f);
object obj2 = <>c.<>9__43_1;
if (obj2 == null)
{
UnityAction val2 = delegate
{
//IL_0022: 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)
CSteamID val6 = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val6))
{
currentJoinable = !currentJoinable;
SteamMatchmaking.SetLobbyJoinable(val6, currentJoinable);
SteamMatchmaking.SetLobbyData(val6, "joinable", currentJoinable ? "true" : "false");
if ((Object)(object)joinableButton != (Object)null && (Object)(object)joinableButton.Text != (Object)null && (Object)(object)joinableButton.Text.TextMesh != (Object)null)
{
((TMP_Text)joinableButton.Text.TextMesh).text = (currentJoinable ? "Lobby Lock: Unlocked" : "Lobby Lock: Locked");
}
}
};
<>c.<>9__43_1 = val2;
obj2 = (object)val2;
}
joinableButton = obj.OnClick((UnityAction)obj2);
ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Create/Apply"), ((Component)lobby_SettingsPage).transform), new Vector2(0.5f, 0f)), new Vector2(1.1f, 0f)), new Vector2(0f, 100f)).SetWidth(200f).OnClick((UnityAction)delegate
{
ApplyLobbySettings();
});
PeakMenuButton obj3 = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Close"), ((Component)lobby_SettingsPage).transform), new Vector2(0.5f, 0f)), new Vector2(-0.1f, 0f)), new Vector2(0f, 100f)).SetWidth(200f);
object obj4 = <>c.<>9__43_3;
if (obj4 == null)
{
UnityAction val3 = delegate
{
((MenuWindow)lobby_SettingsPage).Hide();
};
<>c.<>9__43_3 = val3;
obj4 = (object)val3;
}
obj3.OnClick((UnityAction)obj4);
PeakMenuButton obj5 = ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Copy Lobby Link"), ((Component)lobby_SettingsPage).transform), new Vector2(0.5f, 0f)), new Vector2(0.5f, 0f)), new Vector2(0f, 170f)).SetWidth(250f);
object obj6 = <>c.<>9__43_4;
if (obj6 == null)
{
UnityAction val4 = delegate
{
//IL_0017: 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)
CSteamID val5 = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val5))
{
string text2 = (GUIUtility.systemCopyBuffer = $"steam://joinlobby/3527290/{val5.m_SteamID}/{SteamUser.GetSteamID().m_SteamID}");
Log.LogInfo((object)("Copied Steam Lobby Link to Clipboard: " + text2));
}
else
{
Log.LogWarning((object)"Could not Copy Lobby Link: Not currently in a Steam Lobby.");
}
};
<>c.<>9__43_4 = val4;
obj6 = (object)val4;
}
obj5.OnClick((UnityAction)obj6);
}
private List<LobbyDetails> GetFilteredLobbies()
{
if (string.IsNullOrWhiteSpace(currentSearchTerm))
{
return publicLobbies;
}
return publicLobbies.Where((LobbyDetails lobby) => (lobby.Lobby_Name != null && lobby.Lobby_Name.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Host_Name != null && lobby.Host_Name.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Languagee != null && lobby.Languagee.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0) || (lobby.Modpack_Id != null && lobby.Modpack_Id.IndexOf(currentSearchTerm, StringComparison.OrdinalIgnoreCase) >= 0)).ToList();
}
private void PopulateLobbyPage()
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Expected O, but got Unknown
//IL_018e: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Unknown result type (might be due to invalid IL or missing references)
//IL_0210: Expected O, but got Unknown
//IL_0330: Unknown result type (might be due to invalid IL or missing references)
//IL_0344: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_038d: Unknown result type (might be due to invalid IL or missing references)
//IL_03a1: Unknown result type (might be due to invalid IL or missing references)
//IL_03b5: Unknown result type (might be due to invalid IL or missing references)
//IL_03d1: Unknown result type (might be due to invalid IL or missing references)
//IL_03db: Expected O, but got Unknown
if (isDisabled || (Object)(object)lobby_ListContainer == (Object)null)
{
return;
}
foreach (Transform item in (Transform)lobby_ListContainer.Content)
{
Transform val = item;
Object.Destroy((Object)(object)((Component)val).gameObject);
}
List<LobbyDetails> filteredLobbies = GetFilteredLobbies();
int count = filteredLobbies.Count;
int num = (int)Math.Ceiling((double)count / 5.0);
if (num == 0)
{
num = 1;
}
IEnumerable<LobbyDetails> enumerable = filteredLobbies.Skip(currentPage * 5).Take(5);
if ((Object)(object)pageInfoText != (Object)null)
{
((TMP_Text)pageInfoText.TextMesh).text = $"Page {currentPage + 1} / {num}";
}
if ((Object)(object)previousButton != (Object)null)
{
((Selectable)previousButton.Button).interactable = currentPage > 0;
}
if ((Object)(object)nextButton != (Object)null)
{
((Selectable)nextButton.Button).interactable = currentPage < num - 1;
}
if (!enumerable.Any())
{
ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText(isSearchingForLobbies ? "Searching..." : "No matching lobbies could be found."), (Transform)(object)lobby_ListContainer.Content).SetFontSize(28f).SetColor(Color.yellow);
return;
}
foreach (LobbyDetails lobby in enumerable)
{
PeakButton val2 = ElementExtensions.ParentTo<PeakButton>(MenuAPI.CreateButton("Entry_" + lobby.Host_Name), (Transform)(object)lobby_ListContainer.Content).SetHeight(120f).OnClick((UnityAction)delegate
{
if (!string.IsNullOrEmpty(lobby.Modpack_Id))
{
GUIUtility.systemCopyBuffer = lobby.Modpack_Id;
Log.LogInfo((object)("Copied Modpack ID to clipboard: " + lobby.Modpack_Id));
}
});
if ((Object)(object)val2.Text != (Object)null && (Object)(object)val2.Text.TextMesh != (Object)null)
{
((TMP_Text)val2.Text.TextMesh).text = "";
}
string text = lobby.Lobby_Name + "\n<color=grey><i>" + lobby.Descriptionn + "</i></color>";
if (!string.IsNullOrEmpty(lobby.Modpack_Id))
{
text = text + "\n<color=yellow>Modpack:</color> " + lobby.Modpack_Id;
}
text += $"\n<color=orange>Host:</color> {lobby.Host_Name} | <color=orange>Language:</color> {lobby.Languagee} | <color=orange>Players:</color> {lobby.Member_Count}/{lobby.Max_Members}";
ElementExtensions.SetPosition<PeakText>(ElementExtensions.SetPivot<PeakText>(ElementExtensions.SetAnchorMinMax<PeakText>(ElementExtensions.ParentTo<PeakText>(MenuAPI.CreateText(text), ((Component)val2).transform), new Vector2(0f, 0.5f)), new Vector2(0f, 0.5f)), new Vector2(20f, 0f)).SetFontSize(20f);
ElementExtensions.SetPosition<PeakMenuButton>(ElementExtensions.SetPivot<PeakMenuButton>(ElementExtensions.SetAnchorMinMax<PeakMenuButton>(ElementExtensions.ParentTo<PeakMenuButton>(MenuAPI.CreateMenuButton("Join"), ((Component)val2).transform), new Vector2(1f, 0.5f)), new Vector2(1f, 0.5f)), new Vector2(-20f, 0f)).SetWidth(150f).OnClick((UnityAction)delegate
{
//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)
PEAKLobbyBrowser pEAKLobbyBrowser = this;
CSteamID lobby_ID = lobby.Lobby_ID;
pEAKLobbyBrowser.AttemptToJoinLobby(((object)(CSteamID)(ref lobby_ID)).ToString());
if ((Object)(object)lobby_BrowserPage != (Object)null)
{
((MenuWindow)lobby_BrowserPage).Hide();
}
});
}
}
private void GoToNextPage()
{
List<LobbyDetails> filteredLobbies = GetFilteredLobbies();
int num = (int)Math.Ceiling((double)filteredLobbies.Count / 5.0);
if (currentPage < num - 1)
{
currentPage++;
PopulateLobbyPage();
}
}
private void GoToPreviousPage()
{
if (currentPage > 0)
{
currentPage--;
PopulateLobbyPage();
}
}
private void OpenLobbyBrowserPage()
{
if (isDisabled)
{
return;
}
CreateLobbyBrowserPage();
if ((Object)(object)lobby_BrowserPage != (Object)null)
{
((MonoBehaviour)this).StartCoroutine(ShowPageAfterCreation(lobby_BrowserPage));
if ((Object)(object)searchInput != (Object)null)
{
searchInput.InputField.text = "";
}
currentSearchTerm = "";
currentPage = 0;
((MenuWindow)lobby_BrowserPage).Show();
RefreshLobbyList();
}
}
private void CycleLobbyVisibility()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
currentVisibility = (LobbyVisibility)((int)(currentVisibility + 1) % 3);
UpdateVisibilityButtonText();
CSteamID val = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val))
{
string lobbyData = SteamMatchmaking.GetLobbyData(val, "joinable");
currentJoinable = !string.Equals(lobbyData, "false", StringComparison.OrdinalIgnoreCase);
if ((Object)(object)joinableButton != (Object)null && (Object)(object)joinableButton.Text != (Object)null && (Object)(object)joinableButton.Text.TextMesh != (Object)null)
{
((TMP_Text)joinableButton.Text.TextMesh).text = (currentJoinable ? "Lobby Lock: Unlocked" : "Lobby Lock: Locked");
}
}
}
private void UpdateVisibilityButtonText()
{
if ((Object)(object)visibilityButton != (Object)null && (Object)(object)visibilityButton.Text != (Object)null && (Object)(object)visibilityButton.Text.TextMesh != (Object)null)
{
((TMP_Text)visibilityButton.Text.TextMesh).text = $"Visibility: {currentVisibility}";
}
}
private void OpenLobbySettingsPage()
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
if (isDisabled)
{
return;
}
CreateLobbySettingsPage();
if (!((Object)(object)lobby_SettingsPage != (Object)null))
{
return;
}
((MonoBehaviour)this).StartCoroutine(ShowPageAfterCreation(lobby_SettingsPage));
if ((Object)(object)lobby_NameInput != (Object)null)
{
lobby_NameInput.InputField.text = SteamFriends.GetPersonaName() + "'s Lobby";
}
CSteamID val = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val))
{
string lobbyData = SteamMatchmaking.GetLobbyData(val, "lobby_Name");
if ((Object)(object)lobby_NameInput != (Object)null && !string.IsNullOrWhiteSpace(lobbyData))
{
lobby_NameInput.InputField.text = lobbyData;
}
if ((Object)(object)lobby_LanguageInput != (Object)null)
{
lobby_LanguageInput.InputField.text = SteamMatchmaking.GetLobbyData(val, "languagee");
}
if ((Object)(object)lobby_DescriptionInput != (Object)null)
{
lobby_DescriptionInput.InputField.text = SteamMatchmaking.GetLobbyData(val, "descriptionn");
}
if ((Object)(object)modpack_IdInput != (Object)null)
{
modpack_IdInput.InputField.text = SteamMatchmaking.GetLobbyData(val, "modpack_Id");
}
if ((Object)(object)lobby_LanguageInput != (Object)null && string.IsNullOrWhiteSpace(lobby_LanguageInput.InputField.text))
{
string text = SteamApps.GetCurrentGameLanguage();
if (!string.IsNullOrEmpty(text))
{
text = char.ToUpper(text[0]) + text.Substring(1);
}
lobby_LanguageInput.InputField.text = text;
}
string lobbyData2 = SteamMatchmaking.GetLobbyData(val, "visibility");
if (!string.IsNullOrEmpty(lobbyData2))
{
if (lobbyData2.Equals("Public", StringComparison.OrdinalIgnoreCase))
{
currentVisibility = LobbyVisibility.Public;
}
else if (lobbyData2.Equals("FriendsOnly", StringComparison.OrdinalIgnoreCase) || lobbyData2.Equals("Friends", StringComparison.OrdinalIgnoreCase))
{
currentVisibility = LobbyVisibility.FriendsOnly;
}
else
{
currentVisibility = LobbyVisibility.Private;
}
}
else
{
currentVisibility = LobbyVisibility.FriendsOnly;
}
UpdateVisibilityButtonText();
}
((MenuWindow)lobby_SettingsPage).Show();
}
private void ApplyLobbySettings()
{
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_010f: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
CSteamID val = default(CSteamID);
if (GameHandler.GetService<SteamLobbyHandler>().InSteamLobby(ref val) && (Object)(object)lobby_NameInput != (Object)null && (Object)(object)lobby_LanguageInput != (Object)null && (Object)(object)lobby_DescriptionInput != (Object)null && (Object)(object)modpack_IdInput != (Object)null)
{
Log.LogInfo((object)$"Applying new lobby settings. Visibility: {currentVisibility}");
SteamMatchmaking.SetLobbyData(val, "host_Name", SteamFriends.GetPersonaName());
SteamMatchmaking.SetLobbyData(val, "lobby_Name", lobby_NameInput.InputField.text);
SteamMatchmaking.SetLobbyData(val, "languagee", lobby_LanguageInput.InputField.text);
SteamMatchmaking.SetLobbyData(val, "descriptionn", lobby_DescriptionInput.InputField.text);
SteamMatchmaking.SetLobbyData(val, "modpack_Id", modpack_IdInput.InputField.text);
switch (currentVisibility)
{
case LobbyVisibility.Public:
SteamMatchmaking.SetLobbyType(val, (ELobbyType)2);
SteamMatchmaking.SetLobbyData(val, "visibility", "Public");
SteamMatchmaking.SetLobbyData(val, "TopMidLeftRight", "true");
break;
case LobbyVisibility.FriendsOnly:
SteamMatchmaking.SetLobbyType(val, (ELobbyType)1);
SteamMatchmaking.SetLobbyData(val, "visibility", "FriendsOnly");
SteamMatchmaking.SetLobbyData(val, "TopMidLeftRight", "false");
break;
case LobbyVisibility.Private:
SteamMatchmaking.SetLobbyData(val, "visibility", "Private");
SteamMatchmaking.SetLobbyType(val, (ELobbyType)0);
SteamMatchmaking.SetLobbyData(val, "TopMidLeftRight", "false");
break;
}
}
else
{
Log.LogWarning((object)"Could not Apply Settings, not in a Steam Lobby.");
}
if ((Object)(object)lobby_SettingsPage != (Object)null)
{
((MenuWindow)lobby_SettingsPage).Hide();
}
}
public void ParseAndJoinLobby(string clipboardContent)
{
if (isDisabled || string.IsNullOrWhiteSpace(clipboardContent))
{
return;
}
string lobbyInput = clipboardContent;
string text = "steam://joinlobby/";
if (clipboardContent.StartsWith(text))
{
string[] array = clipboardContent.Substring(text.Length).Split('/');
if (array.Length >= 2)
{
lobbyInput = array[1];
}
}
AttemptToJoinLobby(lobbyInput);
}
public void RefreshLobbyList()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
if (!isSearchingForLobbies)
{
Log.LogInfo((object)"Requesting public lobby list...");
isSearchingForLobbies = true;
publicLobbies.Clear();
PopulateLobbyPage();
SteamMatchmaking.AddRequestLobbyListDistanceFilter((ELobbyDistanceFilter)3);
SteamMatchmaking.AddRequestLobbyListStringFilter("TopMidLeftRight", "true", (ELobbyComparison)0);
SteamMatchmaking.RequestLobbyList();
}
}
private void OnLobbyMatchList(LobbyMatchList_t pCallback)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_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_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
Log.LogInfo((object)$"Found {pCallback.m_nLobbiesMatching} public lobbies.");
publicLobbies.Clear();
for (int i = 0; i < pCallback.m_nLobbiesMatching; i++)
{
CSteamID lobbyByIndex = SteamMatchmaking.GetLobbyByIndex(i);
publicLobbies.Add(new LobbyDetails
{
Lobby_ID = lobbyByIndex,
Host_Name = SteamMatchmaking.GetLobbyData(lobbyByIndex, "host_Name"),
Member_Count = SteamMatchmaking.GetNumLobbyMembers(lobbyByIndex),
Max_Members = SteamMatchmaking.GetLobbyMemberLimit(lobbyByIndex),
Lobby_Name = SteamMatchmaking.GetLobbyData(lobbyByIndex, "lobby_Name"),
Languagee = SteamMatchmaking.GetLobbyData(lobbyByIndex, "languagee"),
Descriptionn = SteamMatchmaking.GetLobbyData(lobbyByIndex, "descriptionn"),
Modpack_Id = SteamMatchmaking.GetLobbyData(lobbyByIndex, "modpack_Id")
});
}
isSearchingForLobbies = false;
currentPage = 0;
PopulateLobbyPage();
}
public void AttemptToJoinLobby(string lobbyInput)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
if (!isDisabled)
{
ulong result;
if (string.IsNullOrWhiteSpace(lobbyInput))
{
Log.LogError((object)"Lobby ID field is empty.");
}
else if (ulong.TryParse(lobbyInput.Trim(), out result))
{
Log.LogInfo((object)$"Attempting to join lobby by ID: {result}");
CSteamID val = default(CSteamID);
((CSteamID)(ref val))..ctor(result);
GameHandler.GetService<SteamLobbyHandler>().TryJoinLobby(val);
}
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}