using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
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.Core.Logging.Interpolation;
using BepInEx.IL2CPP;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using SemanticVersioning;
using SteamworksNative;
using TMPro;
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: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.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 ModList
{
public static class Api
{
public static bool AddMod(string guid, bool required = false)
{
if (ModList.Instance.sharedMods.ContainsKey(guid) || !((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(guid))
{
return false;
}
ModList.Instance.sharedMods.Add(guid, required);
return true;
}
public static bool IsModShared(string guid)
{
return ModList.Instance.sharedMods.ContainsKey(guid);
}
public static bool IsModRequired(string guid)
{
if (ModList.Instance.sharedMods.ContainsKey(guid))
{
return ModList.Instance.sharedMods[guid];
}
return false;
}
}
internal static class Patches
{
[HarmonyPatch(typeof(MonoBehaviourPublicGataInefObInUnique), "Method_Private_Void_GameObject_Boolean_Vector3_Quaternion_0")]
[HarmonyPatch(typeof(MonoBehaviourPublicCSDi2UIInstObUIloDiUnique), "Method_Private_Void_0")]
[HarmonyPrefix]
internal static bool PreBepinexDetection()
{
return false;
}
[HarmonyPatch(typeof(MonoBehaviourPublicCSDi2UIInstObUIloDiUnique), "StartLobby")]
[HarmonyPostfix]
internal static void PostLobbyManagerStartLobby()
{
ModList.Instance.OnStartLobby();
}
[HarmonyPatch(typeof(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique), "Awake")]
[HarmonyPostfix]
internal static void PostSteamManagerAwake(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique __instance)
{
ModList.Instance.LogMods(__instance);
}
[HarmonyPatch(typeof(MonoBehaviourPublicGaprTrmomaTrTehegaGaUnique), "Awake")]
[HarmonyPostfix]
internal static void PostDeobf_MenuUiServerListingGameModesAndMapsInfoAwake()
{
ModList.Instance.CreateModListGameObject();
}
[HarmonyPatch(typeof(MonoBehaviourPublicRaprTetiplTelovemiTeUnique), "Method_Private_Void_1")]
[HarmonyPostfix]
internal static void PostSerevrUIPrefabCheckModified(MonoBehaviourPublicRaprTetiplTelovemiTeUnique __instance)
{
ModList.Instance.CheckModded(__instance);
}
[HarmonyPatch(typeof(MonoBehaviourPublicIPointerEnterHandlerIEventSystemHandlerIPointerExitHandlerObseStStUnique), "OnPointerEnter")]
[HarmonyPrefix]
internal static void PreDeobf_MenuUiServerListingGameModesAndMapsHoverOnPointerEnter()
{
ModList.Instance.ClearModList();
}
[HarmonyPatch(typeof(MonoBehaviourPublicIPointerEnterHandlerIEventSystemHandlerIPointerExitHandlerObseStStUnique), "OnPointerEnter")]
[HarmonyPostfix]
internal static void PostMenuUiServerListingGameModesAndMapsOnPointerEnter(MonoBehaviourPublicIPointerEnterHandlerIEventSystemHandlerIPointerExitHandlerObseStStUnique __instance)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
ModList.Instance.FillModList(__instance.serverUi.field_Private_CSteamID_0);
}
[HarmonyPatch(typeof(MonoBehaviourPublicIPointerEnterHandlerIEventSystemHandlerIPointerExitHandlerObseStStUnique), "OnPointerExit")]
[HarmonyPostfix]
internal static void PostMenuUiServerListingGameModesAndMapsOnPointerExit()
{
ModList.Instance.HideModList();
}
[HarmonyPatch(typeof(MonoBehaviourPublicGaseliGaVibuToclmiToUnique), "OnEnable")]
[HarmonyPostfix]
internal static void PostMenuUiServerListOnEnable(MonoBehaviourPublicGaseliGaVibuToclmiToUnique __instance)
{
ModList.Instance.PreventMainMenuSoftlock(((Component)__instance).GetComponent<MonoBehaviourPublicBubaUnique>());
}
[HarmonyPatch(typeof(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique), "JoinLobby")]
[HarmonyPostfix]
internal static void PostSteamManagerJoinLobby(CSteamID param_1)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
ModList.Instance.JoiningLobby(param_1);
}
[HarmonyPatch(typeof(SteamMatchmaking), "AddRequestLobbyListFilterSlotsAvailable")]
[HarmonyPrefix]
internal static bool PreSteamMatchmakingAddRequestLobbyListFilterSlotsAvailable()
{
return false;
}
}
[BepInPlugin("lammas123.ModList", "ModList", "1.2.0")]
public class ModList : BasePlugin
{
internal enum CrabGameModState
{
ModNotOnHost,
ModNotOnClient,
RequiredModNotOnClient,
ModVersionMismatch,
BothHaveMod
}
internal struct CrabGameMod
{
internal string guid;
internal string version;
internal CrabGameModState state;
internal string name;
public CrabGameMod(string guid, string version, CrabGameModState state = CrabGameModState.ModNotOnHost)
{
name = null;
this.guid = guid;
this.version = version;
this.state = state;
}
internal readonly string GetDisplayName()
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
string text;
switch (state)
{
case CrabGameModState.ModVersionMismatch:
case CrabGameModState.BothHaveMod:
text = Instance.ServerListingInstance.blueCol;
break;
case CrabGameModState.RequiredModNotOnClient:
text = "#" + ColorUtility.ToHtmlStringRGB(Color.yellow);
break;
case CrabGameModState.ModNotOnClient:
text = "#" + ColorUtility.ToHtmlStringRGB(Color.green);
break;
default:
text = Instance.ServerListingInstance.redCol;
break;
}
string text2 = (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(guid) ? ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[guid].Metadata.Name : name);
if (state == CrabGameModState.ModVersionMismatch)
{
text2 = text2 + "<color=#" + ColorUtility.ToHtmlStringRGB(Color.yellow) + ">";
}
return "<color=" + text + ">" + text2 + "<size=75%> v" + version;
}
}
internal static ModList Instance;
internal MonoBehaviourPublicGaprTrmomaTrTehegaGaUnique ServerListingInstance;
internal Dictionary<string, bool> sharedMods = new Dictionary<string, bool>();
public override void Load()
{
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Expected O, but got Unknown
CultureInfo.CurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.CurrentUICulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentCulture = CultureInfo.InvariantCulture;
CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.InvariantCulture;
Instance = this;
string path = Path.Combine(Paths.ConfigPath, "lammas123.ModList.SharedMods.txt");
if (File.Exists(path))
{
string[] array = File.ReadAllLines(path);
for (int i = 0; i < array.Length; i++)
{
string text = array[i].Trim();
if (text.Length == 0 || text.StartsWith("#"))
{
continue;
}
string[] array2 = text.Split('=', StringSplitOptions.RemoveEmptyEntries);
if (array2.Length != 0 && !sharedMods.ContainsKey(array2[0].Trim()))
{
if (array2.Length == 1)
{
sharedMods.Add(array2[0].Trim(), value: false);
}
else
{
sharedMods.Add(array2[0].Trim(), array2[1].Trim() == "1");
}
}
}
}
else
{
File.WriteAllLines(path, new string[10] { "# The list of additional mods you want to show to clients with the ModList mod, or to have show up in your mod list whether the host has that mod or not.", "# Format: ModGuid=Required", "# Example: lammas123.FloatingPlayerPatch=0", "", "# ModList will assume that the mod is not required if the equals sign is not included or if any value besides '1' for required is present.", "# Adding mods like FloatingPlayerPatch here is not required as FloatingPlayerPatch soft depends on ModList, and thus will add itself to the list automatically if ModList is installed.", "# However, if you want to make FloatingPlayerPatch appear to be required, as it is not marked as so by default, then you can add that line with a '1' for required.", "# If you need a mod's guid, ModList will log the guids, names, and versions of every enabled mod you have in your BepInEx/plugins folder on startup to make finding them easier.", "", "" });
}
Harmony.CreateAndPatchAll(typeof(Patches), (string)null);
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(15, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Initialized [");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("ModList");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("1.2.0");
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("]");
}
log.LogInfo(val);
}
internal void OnStartLobby()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
SteamMatchmaking.SetLobbyData(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby, "Modded", "1");
SteamMatchmaking.SetLobbyData(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby, "ModListVersion", "1.2.0");
foreach (string key in sharedMods.Keys)
{
if (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(key))
{
SteamMatchmaking.SetLobbyData(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby, string.Format("Mod:{0}:{1}:{2}:{3}", key, ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[key].Metadata.Name, ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[key].Metadata.Version, sharedMods[key] ? "1" : "0"), "1");
}
}
}
internal void LogMods(MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique steamManager)
{
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
//IL_01be: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Expected O, but got Unknown
//IL_0113: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: Expected O, but got Unknown
if ((Object)(object)steamManager != (Object)(object)MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance)
{
return;
}
((BasePlugin)this).Log.LogInfo((object)"Enabled Mods:");
bool flag = default(bool);
foreach (PluginInfo value in ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.Values)
{
ManualLogSource log = ((BasePlugin)this).Log;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(6, 3, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("- ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value.Metadata.GUID);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value.Metadata.Name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Version>(value.Metadata.Version);
}
log.LogInfo(val);
}
((BasePlugin)this).Log.LogInfo((object)"Shared Mods:");
foreach (string key in sharedMods.Keys)
{
if (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(key))
{
ManualLogSource log2 = ((BasePlugin)this).Log;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(6, 4, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("- ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(key);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[key].Metadata.Name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Version>(((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[key].Metadata.Version);
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(sharedMods[key] ? " (Required)" : "");
}
log2.LogInfo(val);
}
else
{
ManualLogSource log3 = ((BasePlugin)this).Log;
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(19, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("- ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(key);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": Mod Not Enabled");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(sharedMods[key] ? " (Required)" : "");
}
log3.LogInfo(val);
}
}
}
internal void CreateModListGameObject()
{
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: 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)
ServerListingInstance = MonoBehaviourPublicGaprTrmomaTrTehegaGaUnique.Instance;
if (((Component)ServerListingInstance).transform.childCount == 1)
{
Transform transform = Object.Instantiate<GameObject>(ServerListingInstance.parent, ((Component)ServerListingInstance).transform).transform;
((Object)transform).name = "Mod List";
transform.localPosition *= -1f;
Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(0)).gameObject);
Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(2)).gameObject);
Object.DestroyImmediate((Object)(object)((Component)transform.GetChild(2)).gameObject);
Transform child = transform.GetChild(0);
((Object)child).name = "Mod List Text";
((TMP_Text)((Component)child).GetComponent<TextMeshProUGUI>()).text = "Mod List<size=75%> v1.2.0";
Transform child2 = transform.GetChild(1);
((Object)child2).name = "Mod List Container";
((Component)child2).GetComponent<GridLayoutGroup>().cellSize = new Vector2(390f, 18f);
}
}
internal void CheckModded(MonoBehaviourPublicRaprTetiplTelovemiTeUnique listing)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
if (!(SteamMatchmaking.GetLobbyData(listing.field_Private_CSteamID_0, "Modded") != "1"))
{
((TMP_Text)listing.modifiedText).text = "Modded\n<size=60%>(Hover for info)";
((Graphic)listing.modifiedImg).color = new Color(0f, 0.5f, 1f);
}
}
internal void ClearModList()
{
Transform child = ((Component)ServerListingInstance).transform.GetChild(1).GetChild(1);
foreach (Transform componentsInChild in ((Component)child).GetComponentsInChildren<Transform>())
{
if ((Object)(object)componentsInChild != (Object)(object)child)
{
Object.DestroyImmediate((Object)(object)((Component)componentsInChild).gameObject);
}
}
}
internal void FillModList(CSteamID lobbyId)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: 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_00bf: Unknown result type (might be due to invalid IL or missing references)
Transform child = ((Component)ServerListingInstance).transform.GetChild(1);
((Component)child).gameObject.SetActive(true);
string text = SteamMatchmaking.GetLobbyData(lobbyId, "ModListVersion");
if (string.IsNullOrWhiteSpace(text))
{
text = "1.0.0";
}
((TMP_Text)((Component)child.GetChild(0)).GetComponent<TextMeshProUGUI>()).text = ((!(SteamMatchmaking.GetLobbyData(lobbyId, "Modded") == "1")) ? ("<color=" + ServerListingInstance.redCol + ">Mod List<size=75%> v1.2.0") : ((text == "1.2.0") ? "Mod List<size=75%> v1.2.0" : ("Mod List<color=#" + ColorUtility.ToHtmlStringRGB(Color.yellow) + "><size=75%> v" + text)));
int lobbyDataCount = SteamMatchmaking.GetLobbyDataCount(lobbyId);
Dictionary<string, CrabGameMod> dictionary = new Dictionary<string, CrabGameMod>();
string text2 = default(string);
string text3 = default(string);
for (int i = 0; i < lobbyDataCount; i++)
{
SteamMatchmaking.GetLobbyDataByIndex(lobbyId, i, ref text2, 255, ref text3, 255);
if (text3 != "1")
{
continue;
}
try
{
string[] array = text2.Split(':', StringSplitOptions.RemoveEmptyEntries);
if (array.Length < 5 || array[0] != "Mod" || array[1] == "lammas123.ModList" || dictionary.ContainsKey(array[1]))
{
continue;
}
CrabGameMod value = new CrabGameMod(array[1], array[3]);
if (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(value.guid))
{
if (((object)((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[value.guid].Metadata.Version).ToString() == value.version)
{
value.state = CrabGameModState.BothHaveMod;
}
else
{
value.state = CrabGameModState.ModVersionMismatch;
}
}
else
{
value.name = array[2];
if (array[4] == "1")
{
value.state = CrabGameModState.RequiredModNotOnClient;
}
else
{
value.state = CrabGameModState.ModNotOnClient;
}
}
dictionary.Add(array[1], value);
}
catch (Exception)
{
}
}
foreach (string key in sharedMods.Keys)
{
if (key != "lammas123.ModList" && !dictionary.ContainsKey(key) && ((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(key))
{
dictionary.Add(key, new CrabGameMod(key, ((object)((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[key].Metadata.Version).ToString()));
}
}
Transform child2 = child.GetChild(1);
foreach (CrabGameMod value2 in dictionary.Values)
{
((TMP_Text)Object.Instantiate<GameObject>(ServerListingInstance.prefabText, child2).GetComponent<TextMeshProUGUI>()).text = value2.GetDisplayName();
}
}
internal void HideModList()
{
((Component)((Component)ServerListingInstance).transform.GetChild(1)).gameObject.SetActive(false);
}
internal void PreventMainMenuSoftlock(MonoBehaviourPublicBubaUnique back)
{
//IL_003a: 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)
//IL_004b: 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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Expected O, but got Unknown
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Expected O, but got Unknown
if (((UnityEventBase)back.backBtn.onClick).m_PersistentCalls.m_Calls.Count == 2)
{
PersistentCall val = ((UnityEventBase)back.backBtn.onClick).m_PersistentCalls.m_Calls[0];
PersistentCall val2 = new PersistentCall
{
m_Arguments = val.m_Arguments,
m_CallState = val.m_CallState,
m_MethodName = val.m_MethodName,
m_Mode = val.m_Mode,
m_Target = (Object)(object)ServerListingInstance.parent,
m_TargetAssemblyTypeName = val.m_TargetAssemblyTypeName
};
((UnityEventBase)back.backBtn.onClick).m_PersistentCalls.m_Calls.Add(val2);
PersistentCall val3 = new PersistentCall
{
m_Arguments = val.m_Arguments,
m_CallState = val.m_CallState,
m_MethodName = val.m_MethodName,
m_Mode = val.m_Mode,
m_Target = (Object)(object)((Component)((Component)ServerListingInstance).transform.GetChild(1)).gameObject,
m_TargetAssemblyTypeName = val.m_TargetAssemblyTypeName
};
((UnityEventBase)back.backBtn.onClick).m_PersistentCalls.m_Calls.Add(val3);
}
}
internal void JoiningLobby(CSteamID lobbyId)
{
//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_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Expected O, but got Unknown
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f2: Expected O, but got Unknown
if (MonoBehaviourPublicObInUIgaStCSBoStcuCSUnique.Instance.currentLobby != lobbyId || SteamMatchmaking.GetLobbyData(lobbyId, "Modded") != "1")
{
return;
}
string text = SteamMatchmaking.GetLobbyData(lobbyId, "ModListVersion");
if (string.IsNullOrWhiteSpace(text))
{
text = "1.0.0";
}
ManualLogSource log = ((BasePlugin)this).Log;
bool flag = default(bool);
BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(47, 2, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Joined Lobby '");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(SteamMatchmaking.GetLobbyData(lobbyId, "LobbyName"));
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("' with ModList, Host's ModList: v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text);
}
log.LogInfo(val);
int lobbyDataCount = SteamMatchmaking.GetLobbyDataCount(lobbyId);
Dictionary<string, CrabGameMod> dictionary = new Dictionary<string, CrabGameMod>();
string text2 = default(string);
string text3 = default(string);
for (int i = 0; i < lobbyDataCount; i++)
{
SteamMatchmaking.GetLobbyDataByIndex(lobbyId, i, ref text2, 255, ref text3, 255);
if (text3 != "1")
{
continue;
}
try
{
string[] array = text2.Split(':', StringSplitOptions.RemoveEmptyEntries);
if (array.Length < 5 || array[0] != "Mod" || array[1] == "lammas123.ModList" || dictionary.ContainsKey(array[1]))
{
continue;
}
CrabGameMod value = new CrabGameMod(array[1], array[3]);
if (((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins.ContainsKey(value.guid))
{
if (((object)((BaseChainloader<BasePlugin>)(object)IL2CPPChainloader.Instance).Plugins[value.guid].Metadata.Version).ToString() == value.version)
{
value.state = CrabGameModState.BothHaveMod;
}
else
{
value.state = CrabGameModState.ModVersionMismatch;
}
}
else
{
value.name = array[2];
if (array[4] == "1")
{
value.state = CrabGameModState.RequiredModNotOnClient;
}
else
{
value.state = CrabGameModState.ModNotOnClient;
}
}
dictionary.Add(array[1], value);
}
catch (Exception)
{
}
}
foreach (CrabGameMod value2 in dictionary.Values)
{
ManualLogSource log2 = ((BasePlugin)this).Log;
val = new BepInExInfoLogInterpolatedStringHandler(6, 3, ref flag);
if (flag)
{
((BepInExLogInterpolatedStringHandler)val).AppendLiteral("- ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value2.guid);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(": ");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value2.name);
((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" v");
((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(value2.version);
}
log2.LogInfo(val);
}
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "lammas123.ModList";
public const string PLUGIN_NAME = "ModList";
public const string PLUGIN_VERSION = "1.2.0";
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}