Decompiled source of MoreWizards v1.5.4
plugins/MoreWizards.dll
Decompiled 14 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using BepInEx; using BepInEx.Configuration; using BepInEx.Core.Logging.Interpolation; using BepInEx.Logging; using BepInEx.Unity.IL2CPP; using Cinemachine; using HarmonyLib; using Il2CppInterop.Runtime; using Il2CppInterop.Runtime.InteropTypes; using Il2CppInterop.Runtime.InteropTypes.Arrays; using Il2CppSystem; using Il2CppSystem.Collections.Generic; using Il2CppSystem.Reflection; using Microsoft.CodeAnalysis; using TMPro; using Unity.Collections; using Unity.Netcode; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")] [assembly: AssemblyCompany("MoreWizards")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.5.3.0")] [assembly: AssemblyInformationalVersion("1.5.3+c2f569bb5639805a7e96b594c22437372ff57c92")] [assembly: AssemblyProduct("MoreWizards")] [assembly: AssemblyTitle("MoreWizards")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.5.3.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 MoreWizards { public class BossBars : MonoBehaviour { private sealed class Bar { public HealthContainer Health; public NetworkObject Obj; public RectTransform Root; public RectTransform Fill; public TextMeshProUGUI Label; public float Top; } private const float Width = 160f; private const float Height = 12f; private readonly Dictionary<IntPtr, Bar> bars = new Dictionary<IntPtr, Bar>(); private GameObject canvasGo; private EndBossObjective objective; private string bossName = ""; private bool multi; private float nextScan; private float nextErrorLog; public BossBars(IntPtr ptr) : base(ptr) { } private static bool Alive(Object o) { if (o != null && !((Il2CppObjectBase)o).WasCollected) { return o != (Object)null; } return false; } private void Update() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown try { if (!Plugin.OverheadHealthBars.Value) { ClearAll(); return; } if (Time.unscaledTime >= nextScan) { nextScan = Time.unscaledTime + 0.5f; Scan(); } if (bars.Count > 0) { Place(); } } catch (Exception ex) { if (!(Time.unscaledTime < nextErrorLog)) { nextErrorLog = Time.unscaledTime + 10f; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Boss bars: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } } private static NetworkObject OwnerObject(Component c) { try { return c.GetComponentInParent<NetworkObject>(); } catch { return null; } } private static string NameOf(Component c) { NetworkObject val = OwnerObject(c); try { return ((Object)(object)val == (Object)null) ? "" : ((Object)((Component)val).gameObject).name.Replace("(Clone)", "").Trim(); } catch { return ""; } } private static bool AliveBoss(HealthContainer c) { if (Alive((Object)(object)c) && ((Component)c).gameObject.activeInHierarchy) { return !c.IsHealthZero(); } return false; } private void Scan() { if (!Alive((Object)(object)objective)) { objective = Object.FindObjectOfType<EndBossObjective>(); if (!Alive((Object)(object)objective)) { ClearAll(); bossName = ""; multi = false; return; } } HealthContainer bossHealthContainer = objective.bossHealthContainer; if (Alive((Object)(object)bossHealthContainer)) { string value = NameOf((Component)(object)bossHealthContainer); if (!string.IsNullOrEmpty(value)) { bossName = value; } } if (string.IsNullOrEmpty(bossName)) { return; } List<EnemyHealthContainer> list = new List<EnemyHealthContainer>(); foreach (EnemyHealthContainer item in Object.FindObjectsOfType<EnemyHealthContainer>()) { if (AliveBoss((HealthContainer)(object)item) && NameOf((Component)(object)item) == bossName) { list.Add(item); } } if (list.Count >= 2) { multi = true; } if (list.Count == 0) { multi = false; } bool flag = multi || (Plugin.OverheadBarsForSingleBoss.Value && list.Count > 0); List<IntPtr> list2 = new List<IntPtr>(); foreach (KeyValuePair<IntPtr, Bar> kv in bars) { if (!flag || !AliveBoss(kv.Value.Health) || !list.Exists((EnemyHealthContainer l) => ((Il2CppObjectBase)l).Pointer == kv.Key)) { list2.Add(kv.Key); } } foreach (IntPtr item2 in list2) { if (Alive((Object)(object)bars[item2].Root)) { Object.Destroy((Object)(object)((Component)bars[item2].Root).gameObject); } bars.Remove(item2); } if (!flag) { return; } foreach (EnemyHealthContainer item3 in list) { if (!bars.ContainsKey(((Il2CppObjectBase)item3).Pointer)) { Create(item3); } } } private void EnsureCanvas() { //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Expected O, but got Unknown if (!Alive((Object)(object)canvasGo)) { canvasGo = new GameObject("MoreWizards_BossBars"); Object.DontDestroyOnLoad((Object)(object)canvasGo); Canvas obj = canvasGo.AddComponent<Canvas>(); obj.renderMode = (RenderMode)0; obj.sortingOrder = -1; } } private void Create(EnemyHealthContainer c) { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0195: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01cd: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //IL_021f: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) EnsureCanvas(); NetworkObject val = OwnerObject((Component)(object)c); if (!((Object)(object)val == (Object)null)) { RectTransform val2 = new GameObject("BossBar").AddComponent<RectTransform>(); ((Transform)val2).SetParent(canvasGo.transform, false); Vector2 val3 = (val2.anchorMin = (val2.anchorMax = Vector2.zero)); val2.pivot = new Vector2(0.5f, 0f); Image obj = ((Component)val2).gameObject.AddComponent<Image>(); ((Graphic)obj).color = new Color(0f, 0f, 0f, 0.65f); ((Graphic)obj).raycastTarget = false; RectTransform val5 = new GameObject("Fill").AddComponent<RectTransform>(); ((Transform)val5).SetParent((Transform)(object)val2, false); val5.anchorMin = new Vector2(0f, 0f); val5.anchorMax = new Vector2(0f, 1f); val5.pivot = new Vector2(0f, 0.5f); val5.offsetMin = new Vector2(2f, 2f); val5.offsetMax = new Vector2(2f, -2f); Image obj2 = ((Component)val5).gameObject.AddComponent<Image>(); ((Graphic)obj2).color = new Color(0.86f, 0.16f, 0.16f, 0.95f); ((Graphic)obj2).raycastTarget = false; TextMeshProUGUI val6 = null; TextMeshProUGUI val7 = Object.FindObjectOfType<TextMeshProUGUI>(); if ((Object)(object)val7 != (Object)null) { val6 = new GameObject("Name").AddComponent<TextMeshProUGUI>(); ((Transform)((TMP_Text)val6).rectTransform).SetParent((Transform)(object)val2, false); RectTransform rectTransform = ((TMP_Text)val6).rectTransform; RectTransform rectTransform2 = ((TMP_Text)val6).rectTransform; ((Vector2)(ref val3))..ctor(0.5f, 1f); rectTransform2.anchorMax = val3; rectTransform.anchorMin = val3; ((TMP_Text)val6).rectTransform.pivot = new Vector2(0.5f, 0f); ((TMP_Text)val6).rectTransform.anchoredPosition = new Vector2(0f, 2f); ((TMP_Text)val6).rectTransform.sizeDelta = new Vector2(320f, 24f); ((TMP_Text)val6).font = ((TMP_Text)val7).font; ((TMP_Text)val6).alignment = (TextAlignmentOptions)1026; ((TMP_Text)val6).textWrappingMode = (TextWrappingModes)0; ((TMP_Text)val6).overflowMode = (TextOverflowModes)0; ((Graphic)val6).raycastTarget = false; ((Graphic)val6).color = Color.white; ((TMP_Text)val6).outlineWidth = 0.2f; ((TMP_Text)val6).outlineColor = new Color32((byte)0, (byte)0, (byte)0, (byte)220); } bars[((Il2CppObjectBase)c).Pointer] = new Bar { Health = (HealthContainer)(object)c, Obj = val, Root = val2, Fill = val5, Label = val6, Top = HeadHeight(val) }; } } private static float HeadHeight(NetworkObject obj) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_006a: Unknown result type (might be due to invalid IL or missing references) float num = 4f; try { float y = ((Component)obj).transform.position.y; float num2 = float.MinValue; foreach (Renderer componentsInChild in ((Component)obj).GetComponentsInChildren<Renderer>()) { if ((Object)(object)componentsInChild != (Object)null && componentsInChild.enabled && !((MemberInfo)((Object)componentsInChild).GetIl2CppType()).Name.Contains("Particle")) { float num3 = num2; Bounds bounds = componentsInChild.bounds; num2 = Mathf.Max(num3, ((Bounds)(ref bounds)).max.y); } } if (num2 > y + 0.5f && num2 < y + 40f) { num = num2 - y; } } catch { } return num + Plugin.OverheadBarExtraHeight.Value; } private void Place() { //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_011e: 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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_014a: 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) Camera main = Camera.main; if ((Object)(object)main == (Object)null) { return; } float num = Mathf.Max(0.5f, (float)Screen.height / 1080f); foreach (Bar value in bars.Values) { if (!Alive((Object)(object)value.Root) || !Alive((Object)(object)value.Obj)) { continue; } Vector3 val = main.WorldToScreenPoint(((Component)value.Obj).transform.position + Vector3.up * value.Top); bool flag = val.z > 0f && val.x > -100f && val.x < (float)Screen.width + 100f && val.y > -100f && val.y < (float)Screen.height + 100f; if (((Component)value.Root).gameObject.activeSelf != flag) { ((Component)value.Root).gameObject.SetActive(flag); } if (!flag) { continue; } value.Root.anchoredPosition = new Vector2(val.x, val.y); value.Root.sizeDelta = new Vector2(160f * num, 12f * num); float num2 = 0f; float num3 = 0f; try { num2 = value.Health.MaxHealth; num3 = value.Health.CurrentHealth; } catch { } float num4 = ((num2 > 0f) ? Mathf.Clamp01(num3 / num2) : 0f); value.Fill.sizeDelta = new Vector2((160f * num - 4f) * num4, -4f); if ((Object)(object)value.Label != (Object)null) { ((TMP_Text)value.Label).fontSize = 15f * num; ((TMP_Text)value.Label).rectTransform.sizeDelta = new Vector2(320f * num, 24f * num); string text = $"{bossName} {Mathf.CeilToInt(num4 * 100f)}%"; if (((TMP_Text)value.Label).text != text) { ((TMP_Text)value.Label).text = text; } } } } private void ClearAll() { foreach (Bar value in bars.Values) { if (Alive((Object)(object)value.Root)) { Object.Destroy((Object)(object)((Component)value.Root).gameObject); } } bars.Clear(); } } [HarmonyPatch] internal static class DifficultyPatches { private static int cachedFrame = -1; private static int cachedCount = 1; private static GameplayPlayerManager cachedGpm; private static SessionManager cachedSession; private static float nextGpmFind; private static float nextSessionFind; private static int lastLoggedCount = -1; private static readonly Dictionary<IntPtr, int> baseCaps = new Dictionary<IntPtr, int>(); private static float HealthMult => S.FlatHealthMultiplier * (1f + (float)ExtraPlayers() * S.HealthPerExtraPlayer); private static float DamageMult => S.FlatDamageMultiplier * (1f + (float)ExtraPlayers() * S.DamagePerExtraPlayer); private static float SpawnMult => S.FlatSpawnMultiplier * (1f + (float)ExtraPlayers() * S.SpawnsPerExtraPlayer); private static float CapMult => S.FlatSpawnMultiplier * (1f + (float)ExtraPlayers() * S.EnemyCapPerExtraPlayer); internal static int PlayerCount() { int frameCount = Time.frameCount; if (frameCount == cachedFrame) { return cachedCount; } cachedFrame = frameCount; cachedCount = Math.Max(1, QueryPlayerCount()); return cachedCount; } private static T Resolve<T>(Func<T> singleton, ref T cache, ref float nextFind) where T : Object { try { T val = singleton(); if ((Object)(object)val != (Object)null) { return val; } } catch { } if ((Object)(object)cache != (Object)null && !((Il2CppObjectBase)cache).WasCollected) { return cache; } if (Time.unscaledTime < nextFind) { return default(T); } nextFind = Time.unscaledTime + 1f; try { cache = Object.FindObjectOfType<T>(); } catch { cache = default(T); } return cache; } internal static int QueryPlayerCount() { //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Expected O, but got Unknown int num = 0; string text = ""; try { GameplayPlayerManager obj = Resolve<GameplayPlayerManager>((Func<GameplayPlayerManager>)(() => Singleton<GameplayPlayerManager>.Instance), ref cachedGpm, ref nextGpmFind); List<GameplayPlayerIdentity> val = ((obj != null) ? obj.Identities : null); if (val != null && val.Count > 0) { num = val.Count; text = "in-run players"; } } catch { } if (num == 0) { try { SessionManager val2 = Resolve<SessionManager>((Func<SessionManager>)(() => SingletonPersistent<SessionManager>.Instance), ref cachedSession, ref nextSessionFind); if ((Object)(object)val2 != (Object)null) { num = val2.GetNumberOfPlayers(); text = "session"; } } catch { } } if (num <= 0) { num = 1; text = "fallback"; } if (num != lastLoggedCount) { lastLoggedCount = num; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Player count: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(text); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(")."); } log.LogInfo(val3); } return num; } internal static int ExtraPlayers() { if (!S.ScalingEnabled) { return 0; } return Math.Max(0, PlayerCount() - S.ScalingStartsAbove); } [HarmonyPatch(typeof(EnemyHealthContainer), "CalculateMaxHealth")] [HarmonyPostfix] private static void MaxHealth_Postfix(ref float __result) { float healthMult = HealthMult; if (healthMult != 1f && healthMult > 0f) { __result *= healthMult; } } [HarmonyPatch(typeof(EnemyDifficultyParameters), "GetAttackMultiplier")] [HarmonyPostfix] private static void Attack_Postfix(ref float __result) { float damageMult = DamageMult; if (damageMult != 1f && damageMult > 0f) { __result *= damageMult; } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void MinConcurrent_Postfix(ref int __result) { float spawnMult = SpawnMult; if (spawnMult != 1f && spawnMult > 0f) { __result = Mathf.Max(1, Mathf.RoundToInt((float)__result * spawnMult)); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void PerSpawn_Postfix(ref int __result) { float spawnMult = SpawnMult; if (spawnMult != 1f && spawnMult > 0f) { __result = Mathf.Max(1, Mathf.RoundToInt((float)__result * spawnMult)); } } [HarmonyPatch(/*Could not decode attribute arguments.*/)] [HarmonyPostfix] private static void Interval_Postfix(ref float __result) { float spawnMult = SpawnMult; if (spawnMult != 1f && spawnMult > 0f) { __result /= spawnMult; } } [HarmonyPatch(typeof(EnemySpawner), "Update")] [HarmonyPrefix] private static void Spawner_Update(EnemySpawner __instance) { try { IntPtr pointer = ((Il2CppObjectBase)__instance).Pointer; if (!baseCaps.TryGetValue(pointer, out var value)) { value = __instance.maxNumberOfConcurrentEnemies; if (baseCaps.Count > 64) { baseCaps.Clear(); } baseCaps[pointer] = value; } float capMult = CapMult; int num = ((capMult > 0f) ? Mathf.Max(1, Mathf.RoundToInt((float)value * capMult)) : value); if (__instance.maxNumberOfConcurrentEnemies != num) { __instance.maxNumberOfConcurrentEnemies = num; } } catch { } } } [HarmonyPatch] internal static class EnemyExtras { private static bool spawningExtraElites; private static EndBossObjective bossObjective; private static float addsTimer; private static float nextCheck; private static bool IsServer { get { try { return (Object)(object)NetworkManager.Singleton != (Object)null && NetworkManager.Singleton.IsServer; } catch { return false; } } } private static int RollCount(float amount) { if (amount <= 0f) { return 0; } int num = (int)Math.Floor(amount); return num + ((Random.value < amount - (float)num) ? 1 : 0); } [HarmonyPatch(typeof(EnemySpawner), "SpawnEliteEnemy")] [HarmonyPostfix] private static void SpawnElite_Postfix(EnemySpawner __instance, EliteEnemyConfiguration eliteEnemyConfig) { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Expected O, but got Unknown if (spawningExtraElites || !IsServer) { return; } int num = DifficultyPatches.ExtraPlayers(); int num2 = RollCount((float)num * Plugin.ElitesPerExtraPlayer.Value); if (num2 <= 0) { return; } spawningExtraElites = true; bool flag = default(bool); try { for (int i = 0; i < num2; i++) { __instance.SpawnEliteEnemy(eliteEnemyConfig); } ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(42, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Elite spawn: +"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" extra for "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" extra wizard(s)."); } log.LogInfo(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Extra elites: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } log2.LogError(val2); } finally { spawningExtraElites = false; } } [HarmonyPatch(typeof(RunManager), "SetHighestStrongerEnemiesCurseStacks")] [HarmonyPostfix] private static void CurseStacks_Postfix(RunManager __instance) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Expected O, but got Unknown bool flag = default(bool); try { int num = DifficultyPatches.ExtraPlayers(); int num2 = (int)Math.Floor((float)num * Plugin.StrongerEnemiesStacksPerExtraPlayer.Value); if (num2 > 0) { int highestStrongerEnemiesCurseStacks = __instance.highestStrongerEnemiesCurseStacks; __instance.highestStrongerEnemiesCurseStacks = highestStrongerEnemiesCurseStacks + num2; ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(49, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Stronger Enemies stacks: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(highestStrongerEnemiesCurseStacks); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(highestStrongerEnemiesCurseStacks + num2); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" extra wizard(s))."); } log.LogInfo(val); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Curse stacks: "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } log2.LogError(val2); } } [HarmonyPatch(typeof(BossPhase), "Awake")] [HarmonyPostfix] private static void BossPhase_Awake(BossPhase __instance) { //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Expected O, but got Unknown try { float num = 1f + (float)DifficultyPatches.ExtraPlayers() * S.BossAttackSpeedPerExtraPlayer; if (!(num <= 1.001f)) { __instance.timeBetweenAttacks /= num; __instance.delayBeforeFirstAttack /= num; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Boss attack speed: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(EndBossObjective), "OnNetworkSpawn")] [HarmonyPostfix] private static void BossObjective_Spawn(EndBossObjective __instance) { bossObjective = __instance; addsTimer = 0f; } [HarmonyPatch(typeof(RunManager), "Update")] [HarmonyPostfix] private static void Run_Update() { //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Expected O, but got Unknown //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Expected O, but got Unknown //IL_0197: Unknown result type (might be due to invalid IL or missing references) if (!Plugin.BossAddsEnabled.Value || (Object)(object)bossObjective == (Object)null) { return; } float time = Time.time; if (time < nextCheck) { return; } float num = 0.5f; nextCheck = time + num; bool flag = default(bool); try { if (((Il2CppObjectBase)bossObjective).WasCollected) { bossObjective = null; } else { if (!IsServer) { return; } HealthContainer bossHealthContainer = bossObjective.bossHealthContainer; if ((Object)(object)bossHealthContainer == (Object)null || ((Il2CppObjectBase)bossHealthContainer).WasCollected || bossHealthContainer.IsHealthZero()) { addsTimer = 0f; return; } int num2 = DifficultyPatches.ExtraPlayers(); if (num2 <= 0) { return; } addsTimer += num; if (addsTimer < Mathf.Max(5f, Plugin.BossAddsIntervalSeconds.Value)) { return; } addsTimer = 0f; int num3 = RollCount((float)num2 * Plugin.BossAddsPerExtraPlayer.Value); if (num3 <= 0) { return; } EnemySpawner val = null; try { val = Singleton<EnemySpawner>.Instance; } catch { } if ((Object)(object)val == (Object)null) { val = Object.FindObjectOfType<EnemySpawner>(); } if (!((Object)(object)val == (Object)null) && TryPickWaveEnemy(val, out var type)) { EnemyGroupSpawnConfig val2 = new EnemyGroupSpawnConfig(type, num3, ((Component)bossHealthContainer).transform, 6f, 12f, 0f, 1.5f, (EnemySpawnRotation)0); val.SpawnGroupAsync(val2); ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(15, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Boss adds: "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(num3); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" x "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<EnemyType>(type); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("."); } log.LogInfo(val3); } } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val4 = new BepInExErrorLogInterpolatedStringHandler(11, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Boss adds: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<Exception>(ex); } log2.LogError(val4); bossObjective = null; } } private static bool TryPickWaveEnemy(EnemySpawner spawner, out EnemyType type) { //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected I4, but got Unknown type = (EnemyType)0; WaveConfiguration currentWave = spawner.currentWave; if ((Object)(object)currentWave == (Object)null) { return false; } List<EnemyProbability> val = currentWave.EnemyProbabilitiesForSelectedWorld; if (val == null || val.Count == 0) { val = currentWave.EnemyProbabilities; } if (val == null || val.Count == 0) { return false; } float num = 0f; for (int i = 0; i < val.Count; i++) { num += Mathf.Max(0f, val[i].Probability); } float num2 = Random.value * ((num > 0f) ? num : 1f); for (int j = 0; j < val.Count; j++) { num2 -= Mathf.Max(0f, val[j].Probability); if (num2 <= 0f || j == val.Count - 1) { type = (EnemyType)(int)val[j].Type; return true; } } return false; } } [HarmonyPatch] internal static class ExtraBosses { private sealed class Extra { public NetworkObject Obj; public HealthContainer Health; public bool Dead { get { if (!((Object)(object)Obj == (Object)null) && !((Il2CppObjectBase)Obj).WasCollected && Obj.IsSpawned && !((Object)(object)Health == (Object)null) && !((Il2CppObjectBase)Health).WasCollected) { return Health.IsHealthZero(); } return true; } } public bool Gone { get { if (!((Object)(object)Obj == (Object)null) && !((Il2CppObjectBase)Obj).WasCollected) { return !Obj.IsSpawned; } return true; } } } private static readonly List<Extra> extras = new List<Extra>(); private static EndBossObjective objective; private static __c__DisplayClass27_0 heldClosure; private static bool heldDepleted; private static bool heldDespawn; private static bool releasing; private static bool firstBossDown; private static Extra barOn; private static float allDeadSince = -1f; private static float nextTick; private static bool Active => extras.Count > 0; private static bool AllExtrasDead { get { foreach (Extra extra in extras) { if (!extra.Dead) { return false; } } return true; } } private static bool AllExtrasGone { get { foreach (Extra extra in extras) { if (!extra.Gone) { return false; } } return true; } } private static void Reset() { extras.Clear(); objective = null; heldClosure = null; barOn = null; heldDepleted = (heldDespawn = (releasing = (firstBossDown = false))); allDeadSince = -1f; } [HarmonyPatch(typeof(EndBossObjective), "OnNetworkSpawn")] [HarmonyPostfix] private static void Objective_Spawn() { Reset(); } [HarmonyPatch(typeof(EndBossObjective), "SpawnBoss")] [HarmonyPostfix] private static void SpawnBoss_Postfix(EndBossObjective __instance) { //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Expected O, but got Unknown //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Expected O, but got Unknown //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_021d: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Expected O, but got Unknown //IL_0260: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0269: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0275: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_0289: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) //IL_0304: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02af: Expected O, but got Unknown bool flag = default(bool); try { NetworkManager singleton = NetworkManager.Singleton; if ((Object)(object)singleton == (Object)null || !singleton.IsServer || Active || !Plugin.ExtraBossesEnabled.Value) { return; } int num = DifficultyPatches.QueryPlayerCount(); int value = Plugin.ExtraBossMinPlayers.Value; BepInExInfoLogInterpolatedStringHandler val; if (num < value) { ManualLogSource log = Plugin.Log; val = new BepInExInfoLogInterpolatedStringHandler(32, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Extra bosses: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" wizard(s), need "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(value); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } log.LogInfo(val); return; } BossConfig bossConfigToSpawn = __instance.bossConfigToSpawn; NetworkObject val2 = ((bossConfigToSpawn != null) ? bossConfigToSpawn.BossPrefab : null); if ((Object)(object)val2 == (Object)null) { Plugin.Log.LogWarning((object)"Extra bosses: no boss prefab."); return; } int num2 = Math.Clamp(Plugin.ExtraBossCount.Value, 1, 5); List<string> list = new List<string>(); int num3 = 0; for (int i = 0; i < num2; i++) { float num4 = Mathf.Clamp(Plugin.ExtraBossChances[i].Value, 0f, 100f); bool flag2 = Random.value * 100f < num4; if (flag2) { num3++; } list.Add($"boss {i + 2}: {num4:0.#}% {(flag2 ? "yes" : "no")}"); } ManualLogSource log2 = Plugin.Log; val = new BepInExInfoLogInterpolatedStringHandler(26, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Extra bosses ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" wizards): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(string.Join(", ", list)); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("."); } log2.LogInfo(val); if (num3 == 0) { return; } Quaternion val3 = Quaternion.Euler(0f, 180f, 0f); Vector3 position = ((Component)__instance).transform.position; float value2 = Plugin.ExtraBossSpacing.Value; for (int j = 1; j <= num3; j++) { float num5 = ((j % 2 == 1) ? 1f : (-1f)) * value2 * (float)((j + 1) / 2); Vector3 val4 = position + val3 * Vector3.right * num5; NetworkObject val5 = singleton.SpawnManager.InstantiateAndSpawn(val2, 0uL, false, false, false, val4, val3); if ((Object)(object)val5 == (Object)null) { ManualLogSource log3 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val6 = new BepInExWarningLogInterpolatedStringHandler(29, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Extra bosses: spawn #"); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<int>(j); ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral(" failed."); } log3.LogWarning(val6); } else { extras.Add(new Extra { Obj = val5, Health = ((Component)val5).GetComponentInChildren<HealthContainer>() }); __instance.InvokeEnemySpawnedRpc(new NetworkObjectReference(val5)); } } if (extras.Count > 0) { objective = __instance; ManualLogSource log4 = Plugin.Log; val = new BepInExInfoLogInterpolatedStringHandler(28, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Extra bosses: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<BossType>(bossConfigToSpawn.BossType); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" x"); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(extras.Count + 1); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" this fight."); } log4.LogInfo(val); } } catch (Exception ex) { ManualLogSource log5 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val7 = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val7).AppendLiteral("Extra bosses (spawn): "); ((BepInExLogInterpolatedStringHandler)val7).AppendFormatted<Exception>(ex); } log5.LogError(val7); } } [HarmonyPatch(typeof(__c__DisplayClass27_0), "Method_Internal_Void_Boolean_DamageInfo_PDM_0")] [HarmonyPrefix] private static bool BossHealthDepleted_Prefix(__c__DisplayClass27_0 __instance) { if (releasing || !Active || AllExtrasDead) { return true; } heldClosure = __instance; heldDepleted = true; firstBossDown = true; MoveHealthBarToNextLivingBoss(); Plugin.Log.LogInfo((object)"Extra bosses: original boss down, more to go."); return false; } [HarmonyPatch(typeof(__c__DisplayClass27_0), "Method_Internal_Void_PDM_0")] [HarmonyPrefix] private static bool BossDespawnStarted_Prefix(__c__DisplayClass27_0 __instance) { if (releasing || !Active || AllExtrasDead) { return true; } heldClosure = __instance; heldDespawn = true; return false; } private static void MoveHealthBarToNextLivingBoss() { //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Expected O, but got Unknown //IL_0056: 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) try { if ((Object)(object)objective == (Object)null || ((Il2CppObjectBase)objective).WasCollected) { return; } foreach (Extra extra in extras) { if (!extra.Dead) { if (barOn != extra) { barOn = extra; objective.SetBossHealthContainerRpc(new NetworkObjectReference(extra.Obj), objective.bossConfigToSpawn.BossType); } break; } } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(27, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Extra bosses (health bar): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogWarning(val); } } [HarmonyPatch(typeof(__c__DisplayClass18_0), "Method_Internal_Void_Boolean_DamageInfo_PDM_0")] [HarmonyPrefix] private static bool PanelBossDied_Prefix(__c__DisplayClass18_0 __instance) { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Expected O, but got Unknown //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Expected O, but got Unknown bool flag = default(bool); try { EnemyHealthContainer healthContainer = __instance.healthContainer; ObjectiveDetailPanel_BossHealth _4__this = __instance.__4__this; if ((Object)(object)healthContainer == (Object)null || (Object)(object)_4__this == (Object)null) { return true; } EnemyHealthContainer val = OtherLivingBoss(healthContainer); if ((Object)(object)val == (Object)null) { return true; } NetworkObject val2 = OwnerObject((Component)(object)val); if ((Object)(object)val2 == (Object)null) { return true; } _4__this.InitializeUIEvents(val2); _4__this.InitializeHealthBar(val2); ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(56, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral("Extra bosses: health bar moved to the next boss ("); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(LivingBossCount(healthContainer)); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" left)."); } log.LogInfo(val3); return false; } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExWarningLogInterpolatedStringHandler val4 = new BepInExWarningLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Extra bosses (panel): "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(ex.Message); } log2.LogWarning(val4); return true; } } private static NetworkObject OwnerObject(Component c) { try { return c.GetComponentInParent<NetworkObject>(); } catch { return null; } } private static string BossName(Component c) { NetworkObject val = OwnerObject(c); try { return ((Object)(object)val == (Object)null) ? "" : ((Object)((Component)val).gameObject).name.Replace("(Clone)", "").Trim(); } catch { return ""; } } private static bool AliveBoss(EnemyHealthContainer c) { if (c != null && !((Il2CppObjectBase)c).WasCollected && (Object)(object)c != (Object)null && ((Component)c).gameObject.activeInHierarchy) { return !((HealthContainer)c).IsHealthZero(); } return false; } private static EnemyHealthContainer OtherLivingBoss(EnemyHealthContainer dead) { string text = BossName((Component)(object)dead); if (string.IsNullOrEmpty(text)) { return null; } NetworkObject val = OwnerObject((Component)(object)dead); foreach (EnemyHealthContainer item in Object.FindObjectsOfType<EnemyHealthContainer>()) { if (AliveBoss(item) && (Object)(object)OwnerObject((Component)(object)item) != (Object)(object)val && BossName((Component)(object)item) == text) { return item; } } return null; } private static int LivingBossCount(EnemyHealthContainer dead) { string text = BossName((Component)(object)dead); NetworkObject val = OwnerObject((Component)(object)dead); int num = 0; foreach (EnemyHealthContainer item in Object.FindObjectsOfType<EnemyHealthContainer>()) { if (AliveBoss(item) && (Object)(object)OwnerObject((Component)(object)item) != (Object)(object)val && BossName((Component)(object)item) == text) { num++; } } return num; } [HarmonyPatch(typeof(RunManager), "Update")] [HarmonyPostfix] private static void Run_Update() { //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown if (!Active) { return; } float time = Time.time; if (time < nextTick) { return; } nextTick = time + 0.25f; try { if (firstBossDown && barOn != null && barOn.Dead && !AllExtrasDead) { MoveHealthBarToNextLivingBoss(); } if (!AllExtrasDead) { allDeadSince = -1f; return; } if (allDeadSince < 0f) { allDeadSince = time; } bool flag = AllExtrasGone || time - allDeadSince > 10f; if (heldDepleted && heldClosure != null) { heldDepleted = false; releasing = true; try { heldClosure.Method_Internal_Void_Boolean_DamageInfo_PDM_0(false, (DamageInfo)null); } finally { releasing = false; } } if (heldDespawn && heldClosure != null && flag) { heldDespawn = false; releasing = true; try { heldClosure.Method_Internal_Void_PDM_0(); } finally { releasing = false; } } if (!heldDepleted && !heldDespawn && flag) { Plugin.Log.LogInfo((object)(firstBossDown ? "Extra bosses: all bosses defeated." : "Extra bosses: extras defeated, original boss remains.")); Reset(); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(24, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Extra bosses (release): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); Reset(); } } [HarmonyPatch(typeof(RunManager), "OnDestroy")] [HarmonyPostfix] private static void Run_Despawn() { Reset(); } } internal static class HostConfig { private static ConfigFile cfg; private static string messageName; private static string[] personal; private static Dictionary<string, string> whenHostLacksMod; private static Func<bool> active; private static HandleNamedMessageDelegate handler; private static IntPtr registeredOn; private static float nextSend; private static float joinedAt; private static string lastSent; private static string lastApplied; private static bool overriding; private static bool heardFromHost; private static bool warnedMissing; private static bool savedFlag; private static bool savingPersonal; private static readonly Dictionary<ConfigEntryBase, string> originals = new Dictionary<ConfigEntryBase, string>(); internal static bool FromHost { get { if (overriding) { return heardFromHost; } return false; } } internal static void Init(BasePlugin plugin, string guid, string[] personalKeys, Dictionary<string, string> offWithoutHost, Func<bool> isActive = null) { cfg = plugin.Config; messageName = guid + ".HostConfig"; personal = personalKeys ?? Array.Empty<string>(); whenHostLacksMod = offWithoutHost ?? new Dictionary<string, string>(); active = isActive; cfg.SettingChanged += OnSettingChanged; plugin.AddComponent<HostConfigRunner>(); } private static void OnSettingChanged(object sender, SettingChangedEventArgs e) { try { if (overriding && !savingPersonal && IsPersonal(e.ChangedSetting.Definition)) { SavePersonal(); } } catch { } } private static string Id(ConfigDefinition d) { return d.Section + "." + d.Key; } private static bool IsPersonal(ConfigDefinition d) { string[] array = personal; foreach (string text in array) { if (text.EndsWith(".*") ? (d.Section == text.Substring(0, text.Length - 2)) : (Id(d) == text)) { return true; } } return false; } internal static void Tick() { //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown try { NetworkManager singleton = NetworkManager.Singleton; bool flag = (Object)(object)singleton != (Object)null && singleton.IsListening; if (!flag || singleton.IsServer || (active != null && !active())) { if (overriding) { Restore(); } if (flag && singleton.IsServer) { HostTick(singleton); } if (!flag) { registeredOn = IntPtr.Zero; } } else { ClientTick(singleton); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag2 = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag2); if (flag2) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Host settings: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(ex.Message); } log.LogError(val); } } private static void HostTick(NetworkManager nm) { //IL_00e4: Unknown result type (might be due to invalid IL or missing references) if (Time.unscaledTime < nextSend || nm.CustomMessagingManager == null) { return; } nextSend = Time.unscaledTime + 1.5f; List<string> list = new List<string>(); foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in cfg) { if (!IsPersonal(item.Key)) { list.Add(item.Key.Section + "\u001f" + item.Key.Key + "\u001f" + item.Value.GetSerializedValue()); } } string text = string.Join("\u001e", list); FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(text.Length * 2 + 64, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe(text, false); nm.CustomMessagingManager.SendNamedMessageToAll(messageName, val, (NetworkDelivery)4); } finally { ((FastBufferWriter)(ref val)).Dispose(); } if (text != lastSent) { lastSent = text; Plugin.Log.LogInfo((object)"Sending this game's settings to all players."); } } private static void ClientTick(NetworkManager nm) { //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Expected O, but got Unknown CustomMessagingManager customMessagingManager = nm.CustomMessagingManager; if (customMessagingManager != null && registeredOn != ((Il2CppObjectBase)customMessagingManager).Pointer) { if (handler == null) { handler = DelegateSupport.ConvertDelegate<HandleNamedMessageDelegate>((Delegate)new Action<ulong, FastBufferReader>(OnReceived)); } customMessagingManager.RegisterNamedMessageHandler(messageName, handler); registeredOn = ((Il2CppObjectBase)customMessagingManager).Pointer; } if (!overriding) { Begin(); joinedAt = Time.unscaledTime; foreach (KeyValuePair<string, string> item in whenHostLacksMod) { Set(item.Key, item.Value); } } if (!heardFromHost && !warnedMissing && Time.unscaledTime - joinedAt > 15f) { warnedMissing = true; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExWarningLogInterpolatedStringHandler val = new BepInExWarningLogInterpolatedStringHandler(88, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("No settings from the host: the host doesn't seem to have "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>("MoreWizards"); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(", so it stays off in this game."); } log.LogWarning(val); } } private static void OnReceived(ulong sender, FastBufferReader reader) { //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Expected O, but got Unknown //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Expected O, but got Unknown bool flag = default(bool); try { string text = default(string); ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); if (!overriding) { Begin(); } heardFromHost = true; if (text == lastApplied) { return; } lastApplied = text; int num = 0; string[] array = text.Split('\u001e'); for (int i = 0; i < array.Length; i++) { string[] array2 = array[i].Split('\u001f'); if (array2.Length == 3) { ConfigDefinition d = new ConfigDefinition(array2[0], array2[1]); if (!IsPersonal(d) && Set(Id(d), array2[2])) { num++; } } } ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(36, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Using the host's settings ("); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<int>(num); ((BepInExLogInterpolatedStringHandler)val).AppendLiteral(" values)."); } log.LogInfo(val); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Host settings (receive): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<string>(ex.Message); } log2.LogError(val2); } } private static void Begin() { overriding = true; heardFromHost = false; warnedMissing = false; lastApplied = null; savedFlag = cfg.SaveOnConfigSet; cfg.SaveOnConfigSet = false; } private static bool Set(string id, string value) { foreach (KeyValuePair<ConfigDefinition, ConfigEntryBase> item in cfg) { if (!(Id(item.Key) != id)) { ConfigEntryBase value2 = item.Value; if (!originals.ContainsKey(value2)) { originals[value2] = value2.GetSerializedValue(); } if (value2.GetSerializedValue() != value) { value2.SetSerializedValue(value); } return true; } } return false; } private static void SavePersonal() { savingPersonal = true; Dictionary<ConfigEntryBase, string> dictionary = new Dictionary<ConfigEntryBase, string>(); try { foreach (KeyValuePair<ConfigEntryBase, string> original in originals) { dictionary[original.Key] = original.Key.GetSerializedValue(); original.Key.SetSerializedValue(original.Value); } cfg.Save(); } finally { foreach (KeyValuePair<ConfigEntryBase, string> item in dictionary) { try { item.Key.SetSerializedValue(item.Value); } catch { } } savingPersonal = false; } } private static void Restore() { foreach (KeyValuePair<ConfigEntryBase, string> original in originals) { try { original.Key.SetSerializedValue(original.Value); } catch { } } originals.Clear(); overriding = false; heardFromHost = false; lastApplied = null; cfg.SaveOnConfigSet = savedFlag; try { cfg.Save(); } catch { } Plugin.Log.LogInfo((object)"Left the game; back to this computer's own settings."); } } public class HostConfigRunner : MonoBehaviour { public HostConfigRunner(IntPtr ptr) : base(ptr) { } private void Update() { HostConfig.Tick(); } } internal static class S { private static Dictionary<string, string> synced; internal static bool IsSynced => synced != null; internal static bool ScalingEnabled => B("ScalingEnabled", Plugin.ScalingEnabled); internal static int ScalingStartsAbove => I("ScalingStartsAbove", Plugin.ScalingStartsAbove); internal static float HealthPerExtraPlayer => F("HealthPerExtraPlayer", Plugin.HealthPerExtraPlayer); internal static float DamagePerExtraPlayer => F("DamagePerExtraPlayer", Plugin.DamagePerExtraPlayer); internal static float SpawnsPerExtraPlayer => F("SpawnsPerExtraPlayer", Plugin.SpawnsPerExtraPlayer); internal static float EnemyCapPerExtraPlayer => F("EnemyCapPerExtraPlayer", Plugin.EnemyCapPerExtraPlayer); internal static float FlatHealthMultiplier => F("FlatHealthMultiplier", Plugin.FlatHealthMultiplier); internal static float FlatDamageMultiplier => F("FlatDamageMultiplier", Plugin.FlatDamageMultiplier); internal static float FlatSpawnMultiplier => F("FlatSpawnMultiplier", Plugin.FlatSpawnMultiplier); internal static float BossAttackSpeedPerExtraPlayer => F("BossAttackSpeedPerExtraPlayer", Plugin.BossAttackSpeedPerExtraPlayer); internal static float ShopTimeLimitSeconds => F("ShopTimeLimitSeconds", Plugin.ShopTimeLimitSeconds); private static float F(string key, ConfigEntry<float> local) { if (synced == null || !synced.TryGetValue(key, out var value) || !float.TryParse(value, NumberStyles.Float, CultureInfo.InvariantCulture, out var result)) { return local.Value; } return result; } private static int I(string key, ConfigEntry<int> local) { if (synced == null || !synced.TryGetValue(key, out var value) || !int.TryParse(value, NumberStyles.Integer, CultureInfo.InvariantCulture, out var result)) { return local.Value; } return result; } private static bool B(string key, ConfigEntry<bool> local) { if (synced == null || !synced.TryGetValue(key, out var value) || !bool.TryParse(value, out var result)) { return local.Value; } return result; } internal static string Serialize() { CultureInfo invariantCulture = CultureInfo.InvariantCulture; List<string> values = new List<string> { "Mod=1.5.4", "ScalingEnabled=" + Plugin.ScalingEnabled.Value, "ScalingStartsAbove=" + Plugin.ScalingStartsAbove.Value.ToString(invariantCulture), "HealthPerExtraPlayer=" + Plugin.HealthPerExtraPlayer.Value.ToString(invariantCulture), "DamagePerExtraPlayer=" + Plugin.DamagePerExtraPlayer.Value.ToString(invariantCulture), "SpawnsPerExtraPlayer=" + Plugin.SpawnsPerExtraPlayer.Value.ToString(invariantCulture), "EnemyCapPerExtraPlayer=" + Plugin.EnemyCapPerExtraPlayer.Value.ToString(invariantCulture), "FlatHealthMultiplier=" + Plugin.FlatHealthMultiplier.Value.ToString(invariantCulture), "FlatDamageMultiplier=" + Plugin.FlatDamageMultiplier.Value.ToString(invariantCulture), "FlatSpawnMultiplier=" + Plugin.FlatSpawnMultiplier.Value.ToString(invariantCulture), "BossAttackSpeedPerExtraPlayer=" + Plugin.BossAttackSpeedPerExtraPlayer.Value.ToString(invariantCulture), "ShopTimeLimitSeconds=" + Plugin.ShopTimeLimitSeconds.Value.ToString(invariantCulture) }; return string.Join(";", values); } internal static void Apply(string payload) { Dictionary<string, string> dictionary = new Dictionary<string, string>(); string[] array = payload.Split(';'); foreach (string text in array) { int num = text.IndexOf('='); if (num > 0) { dictionary[text.Substring(0, num)] = text.Substring(num + 1); } } synced = dictionary; NativePatcher.ApplyShopTimer(ShopTimeLimitSeconds); } internal static void Clear() { if (synced != null) { synced = null; NativePatcher.ApplyShopTimer(Plugin.ShopTimeLimitSeconds.Value); Plugin.Log.LogInfo((object)"Host settings cleared; using local config."); } } } [HarmonyPatch] internal static class HostSync { private const string MessageName = "girthy_mods.MoreWizards.Config"; private static HandleNamedMessageDelegate handler; [HarmonyPatch(typeof(RunManager), "OnNetworkSpawn")] [HarmonyPostfix] private static void RunManager_Spawn() { //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown try { NetworkManager singleton = NetworkManager.Singleton; if (!((Object)(object)singleton == (Object)null) && !singleton.IsServer && singleton.CustomMessagingManager != null) { if (handler == null) { handler = DelegateSupport.ConvertDelegate<HandleNamedMessageDelegate>((Delegate)new Action<ulong, FastBufferReader>(OnConfigReceived)); } singleton.CustomMessagingManager.RegisterNamedMessageHandler("girthy_mods.MoreWizards.Config", handler); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(20, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Host sync (listen): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } private static void OnConfigReceived(ulong sender, FastBufferReader reader) { //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Expected O, but got Unknown bool flag = default(bool); try { if (Plugin.SyncHostSettings.Value) { string text = default(string); ((FastBufferReader)(ref reader)).ReadValueSafe(ref text, false); S.Apply(text); ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val = new BepInExInfoLogInterpolatedStringHandler(34, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Using host settings for this run: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<string>(text); } log.LogInfo(val); } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Host sync (receive): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } log2.LogError(val2); } } [HarmonyPatch(typeof(RunManager), "StartRunOnServerRpc")] [HarmonyPrefix] private static void StartRun_Prefix(RunManager __instance, out bool __state) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Invalid comparison between Unknown and I4 __state = false; try { __state = (int)((NetworkBehaviour)__instance).__rpc_exec_stage == 1; } catch { } } [HarmonyPatch(typeof(RunManager), "StartRunOnServerRpc")] [HarmonyPostfix] private static void StartRun_Postfix(bool __state) { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) if (!__state) { return; } try { NetworkManager singleton = NetworkManager.Singleton; if (!((Object)(object)singleton == (Object)null) && singleton.IsServer && singleton.CustomMessagingManager != null) { string text = S.Serialize(); int num = Encoding.UTF8.GetByteCount(text) * 2 + 64; FastBufferWriter val = default(FastBufferWriter); ((FastBufferWriter)(ref val))..ctor(num, (Allocator)2, -1); try { ((FastBufferWriter)(ref val)).WriteValueSafe(text, false); singleton.CustomMessagingManager.SendNamedMessageToAll("girthy_mods.MoreWizards.Config", val, (NetworkDelivery)3); } finally { ((FastBufferWriter)(ref val)).Dispose(); } Plugin.Log.LogInfo((object)"Sent host settings to all clients."); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(18, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Host sync (send): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } log.LogError(val2); } } [HarmonyPatch(typeof(RunManager), "OnDestroy")] [HarmonyPostfix] private static void RunManager_Despawn() { S.Clear(); } } [HarmonyPatch] internal static class InviteCounter { private const string LabelName = "MoreWizards_InviteCounter"; private static TextMeshProUGUI label; private static readonly Color OpenColor = new Color(0.85f, 0.95f, 1f, 1f); private static readonly Color FullColor = new Color(1f, 0.7f, 0.25f, 1f); private static bool LabelAlive { get { if ((Object)(object)label != (Object)null) { return !((Il2CppObjectBase)label).WasCollected; } return false; } } [HarmonyPatch(typeof(InviteFriendsButton), "OnEnable")] [HarmonyPostfix] private static void InviteButton_OnEnable(InviteFriendsButton __instance) { //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Expected O, but got Unknown if (!Plugin.ShowInviteCounter.Value) { return; } try { EnsureLabel(__instance); Refresh(); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(25, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Invite counter (create): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(PlayerSeatUpdater), "UpdateSeats")] [HarmonyPostfix] private static void Seats_UpdateSeats(List<MainMenuPlayerData> playerData) { int hint = 0; try { if (playerData != null) { hint = playerData.Count; } } catch { } Refresh(hint); } [HarmonyPatch(typeof(PlayerSeatUpdater), "RefreshSeats")] [HarmonyPostfix] private static void Seats_Refresh() { Refresh(); } [HarmonyPatch(typeof(SessionManager), "AddPlayerData")] [HarmonyPostfix] private static void Session_Add() { Refresh(); } [HarmonyPatch(typeof(SessionManager), "RemovePlayerData")] [HarmonyPostfix] private static void Session_Remove() { Refresh(); } [HarmonyPatch(typeof(SessionManager), "StopSession")] [HarmonyPostfix] private static void Session_Stop() { Refresh(); } private static void EnsureLabel(InviteFriendsButton button) { //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: Expected O, but got Unknown Transform transform = ((Component)button).transform; Transform val = transform.Find("MoreWizards_InviteCounter"); if ((Object)(object)val != (Object)null) { label = ((Component)val).GetComponent<TextMeshProUGUI>(); if (LabelAlive) { return; } } TextMeshProUGUI val2 = ((Component)button).GetComponentInChildren<TextMeshProUGUI>(true); if ((Object)(object)val2 == (Object)null) { val2 = Object.FindObjectOfType<TextMeshProUGUI>(); } GameObject val3 = new GameObject("MoreWizards_InviteCounter") { layer = ((Component)button).gameObject.layer }; RectTransform obj = val3.AddComponent<RectTransform>(); ((Transform)obj).SetParent(transform, false); obj.anchorMin = new Vector2(0f, 0f); obj.anchorMax = new Vector2(1f, 0f); obj.pivot = new Vector2(0.5f, 1f); obj.anchoredPosition = new Vector2(0f, Plugin.InviteCounterOffsetY.Value); obj.sizeDelta = new Vector2(160f, 40f); val3.AddComponent<LayoutElement>().ignoreLayout = true; TextMeshProUGUI val4 = val3.AddComponent<TextMeshProUGUI>(); if ((Object)(object)val2 != (Object)null) { ((TMP_Text)val4).font = ((TMP_Text)val2).font; ((TMP_Text)val4).fontSharedMaterial = ((TMP_Text)val2).fontSharedMaterial; } else if ((Object)(object)TMP_Settings.defaultFontAsset != (Object)null) { ((TMP_Text)val4).font = TMP_Settings.defaultFontAsset; } float num = Plugin.InviteCounterFontSize.Value; if (num <= 0f) { num = (((Object)(object)val2 != (Object)null) ? Mathf.Clamp(((TMP_Text)val2).fontSize * 0.8f, 18f, 40f) : 26f); } ((TMP_Text)val4).fontSize = num; ((TMP_Text)val4).alignment = (TextAlignmentOptions)258; ((TMP_Text)val4).textWrappingMode = (TextWrappingModes)0; ((TMP_Text)val4).overflowMode = (TextOverflowModes)0; ((TMP_Text)val4).richText = true; ((Graphic)val4).raycastTarget = false; ((Graphic)val4).color = OpenColor; label = val4; ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val5 = new BepInExInfoLogInterpolatedStringHandler(30, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("Invite counter attached to '"); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<string>(((Object)((Component)button).gameObject).name); ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("'."); } log.LogInfo(val5); } private static void Refresh(int hint = 0) { //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Expected O, but got Unknown //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) if (!LabelAlive) { return; } try { if (!Plugin.ShowInviteCounter.Value) { ((Component)label).gameObject.SetActive(false); return; } int value = Plugin.MaxPlayers.Value; int num = DifficultyPatches.QueryPlayerCount(); if (num <= 0) { num = hint; } num = Mathf.Clamp(num, 1, value); int num2 = value - num; if (num2 > 0) { ((TMP_Text)label).text = $"<b>{num}/{value}</b> wizards • {num2} invite{((num2 == 1) ? "" : "s")} left"; ((Graphic)label).color = OpenColor; } else { ((TMP_Text)label).text = $"<b>{num}/{value}</b> wizards • lobby full"; ((Graphic)label).color = FullColor; } if (!((Component)label).gameObject.activeSelf) { ((Component)label).gameObject.SetActive(true); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(26, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Invite counter (refresh): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } } [HarmonyPatch] internal static class LobbyPatches { private static readonly Color[] ExtraColors = (Color[])(object)new Color[12] { new Color(1f, 0.55f, 0.1f), new Color(0.7f, 0.3f, 1f), new Color(0.1f, 0.9f, 0.85f), new Color(1f, 0.4f, 0.7f), new Color(0.6f, 1f, 0.2f), new Color(0.95f, 0.95f, 0.95f), new Color(0.55f, 0.35f, 0.2f), new Color(1f, 0.9f, 0.2f), new Color(0.3f, 0.45f, 1f), new Color(0.85f, 0.15f, 0.25f), new Color(0.4f, 0.75f, 0.45f), new Color(0.6f, 0.6f, 0.65f) }; private static int Max => Plugin.MaxPlayers.Value; private static void EnsureColors(SessionManager sm) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) List<Color> playerColors = sm.playerColors; if (playerColors != null) { int num = 0; while (playerColors.Count < Max) { playerColors.Add(ExtraColors[num % ExtraColors.Length]); num++; } } } [HarmonyPatch(typeof(SessionManager), "StartSession")] [HarmonyPrefix] private static void StartSession_Prefix(SessionManager __instance) { //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Expected O, but got Unknown try { EnsureColors(__instance); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(22, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("StartSession colours: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(SessionManager), "AddPlayerData")] [HarmonyPrefix] private static void AddPlayerData_Prefix(SessionManager __instance) { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_002e: Unknown result type (might be due to invalid IL or missing references) try { EnsureColors(__instance); List<Color> playerColorsPool = __instance.playerColorsPool; if (playerColorsPool != null && playerColorsPool.Count == 0) { int numberOfPlayers = __instance.GetNumberOfPlayers(); playerColorsPool.Add(ExtraColors[numberOfPlayers % ExtraColors.Length]); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(23, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("AddPlayerData colours: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(LevelStarter), "Awake")] [HarmonyPostfix] private static void LevelStarter_Awake(LevelStarter __instance) { //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Expected O, but got Unknown //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: 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_017a: Expected O, but got Unknown //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Expected O, but got Unknown //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: 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) bool flag = default(bool); try { List<Transform> spawnPoints = __instance.spawnPoints; if (spawnPoints == null || spawnPoints.Count == 0 || spawnPoints.Count >= Max) { return; } int count = spawnPoints.Count; Vector3 val = Vector3.zero; for (int i = 0; i < count; i++) { val += spawnPoints[i].position; } val /= (float)count; for (int j = count; j < Max; j++) { Transform val2 = spawnPoints[j % count]; Vector3 val3 = val2.position - val; val3.y = 0f; if (((Vector3)(ref val3)).sqrMagnitude < 0.01f) { val3 = Quaternion.Euler(0f, 360f * (float)j / (float)Max, 0f) * Vector3.forward; } int num = j / count; GameObject val4 = new GameObject($"MoreWizards_Spawn_{j + 1}"); val4.transform.SetParent(val2.parent, false); val4.transform.position = val2.position + ((Vector3)(ref val3)).normalized * (1.75f * (float)num); val4.transform.rotation = val2.rotation; spawnPoints.Add(val4.transform); } ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val5 = new BepInExInfoLogInterpolatedStringHandler(18, 2, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("Spawn points: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<int>(count); ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<int>(spawnPoints.Count); } log.LogInfo(val5); } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(27, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("LevelStarter spawn points: "); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<Exception>(ex); } log2.LogError(val6); } } [HarmonyPatch(typeof(PlayerSeatUpdater), "Awake")] [HarmonyPostfix] private static void PlayerSeatUpdater_Awake(PlayerSeatUpdater __instance) { //IL_01de: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Expected O, but got Unknown //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Expected O, but got Unknown bool flag = default(bool); try { Il2CppReferenceArray<PlayerSeat> seats = __instance.seats; if (seats != null && ((Il2CppArrayBase<PlayerSeat>)(object)seats).Length != 0 && ((Il2CppArrayBase<PlayerSeat>)(object)seats).Length < Max) { int length = ((Il2CppArrayBase<PlayerSeat>)(object)seats).Length; Transform[] array = (Transform[])(object)new Transform[length]; for (int i = 0; i < length; i++) { array[i] = ((Component)((Il2CppArrayBase<PlayerSeat>)(object)seats)[i]).transform; } SeatLayout.Plan(array, Max - length); Il2CppReferenceArray<PlayerSeat> val = new Il2CppReferenceArray<PlayerSeat>((long)Max); for (int j = 0; j < length; j++) { ((Il2CppArrayBase<PlayerSeat>)(object)val)[j] = ((Il2CppArrayBase<PlayerSeat>)(object)seats)[j]; } for (int k = length; k < Max; k++) { SeatLayout.Placement p = SeatLayout.Placements[k - length]; PlayerSeat val2 = ((Il2CppArrayBase<PlayerSeat>)(object)seats)[p.Source]; GameObject val3 = Object.Instantiate<GameObject>(((Component)val2).gameObject, ((Component)val2).transform.parent); ((Object)val3).name = $"{((Object)((Component)val2).gameObject).name}_MoreWizards_{k + 1}"; SeatLayout.Place(val3.transform, ((Component)val2).transform, p); ((Il2CppArrayBase<PlayerSeat>)(object)val)[k] = val3.GetComponent<PlayerSeat>(); } __instance.seats = val; ManualLogSource log = Plugin.Log; BepInExInfoLogInterpolatedStringHandler val4 = new BepInExInfoLogInterpolatedStringHandler(27, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral("Lobby seats: "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<int>(length); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<int>(Max); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" ("); ((BepInExLogInterpolatedStringHandler)val4).AppendFormatted<string>(SeatLayout.UsedLayout); ((BepInExLogInterpolatedStringHandler)val4).AppendLiteral(" layout)"); } log.LogInfo(val4); MainMenuCameraController val5 = Object.FindObjectOfType<MainMenuCameraController>(); if ((Object)(object)val5 != (Object)null) { SeatLayout.PlaceCameras(val5); } } } catch (Exception ex) { ManualLogSource log2 = Plugin.Log; BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Lobby seats: "); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<Exception>(ex); } log2.LogError(val6); } } [HarmonyPatch(typeof(MainMenuCameraController), "Awake")] [HarmonyPostfix] private static void MainMenuCameraController_Awake(MainMenuCameraController __instance) { //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Expected O, but got Unknown //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) try { Il2CppReferenceArray<CinemachineVirtualCamera> runOverviewCameras = __instance.runOverviewCameras; if (runOverviewCameras != null && ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)runOverviewCameras).Length > 0 && ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)runOverviewCameras).Length < Max) { Il2CppReferenceArray<CinemachineVirtualCamera> val = new Il2CppReferenceArray<CinemachineVirtualCamera>((long)Max); for (int i = 0; i < Max; i++) { ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)val)[i] = ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)runOverviewCameras)[Math.Min(i, ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)runOverviewCameras).Length - 1)]; } __instance.runOverviewCameras = val; } Il2CppReferenceArray<CinemachineVirtualCamera> seatCameras = __instance.seatCameras; if (seatCameras != null && ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras).Length > 0 && ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras).Length < Max) { int length = ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras).Length; Vector3 val2 = ((length >= 2) ? (((Component)((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras)[length - 1]).transform.position - ((Component)((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras)[length - 2]).transform.position) : Vector3.zero); Il2CppReferenceArray<CinemachineVirtualCamera> val3 = new Il2CppReferenceArray<CinemachineVirtualCamera>((long)Max); for (int j = 0; j < length; j++) { ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)val3)[j] = ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras)[j]; } CinemachineVirtualCamera val4 = ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)seatCameras)[length - 1]; for (int k = length; k < Max; k++) { GameObject val5 = Object.Instantiate<GameObject>(((Component)val4).gameObject, ((Component)val4).transform.parent); ((Object)val5).name = $"{((Object)((Component)val4).gameObject).name}_MoreWizards_{k + 1}"; val5.transform.position = ((Component)val4).transform.position + val2 * (float)(k - length + 1); val5.transform.rotation = ((Component)val4).transform.rotation; val5.SetActive(false); ((Il2CppArrayBase<CinemachineVirtualCamera>)(object)val3)[k] = val5.GetComponent<CinemachineVirtualCamera>(); } __instance.seatCameras = val3; SeatLayout.PlaceCameras(__instance); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val6 = new BepInExErrorLogInterpolatedStringHandler(14, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val6).AppendLiteral("Menu cameras: "); ((BepInExLogInterpolatedStringHandler)val6).AppendFormatted<Exception>(ex); } log.LogError(val6); } } private static void GrowUiList<T>(List<T> list, string what) where T : Component { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Expected O, but got Unknown if (list != null && list.Count != 0 && list.Count < Max) { int count = list.Count; T val = list[count - 1]; while (list.Count < Max) { GameObject val2 = Object.Instantiate<GameObject>(((Component)val).gameObject, ((Component)val).transform.parent); ((Object)val2).name = $"{((Object)((Component)val).gameObject).name}_MoreWizards_{list.Count + 1}"; list.Add(val2.GetComponent<T>()); } ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExInfoLogInterpolatedStringHandler val3 = new BepInExInfoLogInterpolatedStringHandler(6, 3, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<string>(what); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(": "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(count); ((BepInExLogInterpolatedStringHandler)val3).AppendLiteral(" -> "); ((BepInExLogInterpolatedStringHandler)val3).AppendFormatted<int>(list.Count); } log.LogInfo(val3); } } [HarmonyPatch(typeof(CharacterEntryGroup), "Show")] [HarmonyPrefix] private static void CharacterEntryGroup_Show(CharacterEntryGroup __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { GrowUiList<CharacterEntry>(__instance.entries, "Character entries"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Character entries: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(PlayerListPanel), "OnEnable")] [HarmonyPrefix] private static void PlayerListPanel_OnEnable(PlayerListPanel __instance) { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Expected O, but got Unknown try { GrowUiList<PlayerInfo>(__instance.playerInfos, "Player list"); } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(13, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Player list: "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } } [HarmonyPatch(typeof(HerdingObjectiveManager), "Awake")] [HarmonyPrefix] private static void Herding_Awake(HerdingObjectiveManager __instance) { //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Expected O, but got Unknown //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0061: 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_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) try { Il2CppStructArray<HerdTargetsForPlayerCount> herdTargetsForPlayerCounts = __instance.herdTargetsForPlayerCounts; if (herdTargetsForPlayerCounts == null || ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length == 0) { return; } int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; for (int i = 0; i < ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length; i++) { HerdTargetsForPlayerCount val = ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts)[i]; if (val._PlayerCount_k__BackingField > num) { num = val._PlayerCount_k__BackingField; num2 = val._HerdTargetCount_k__BackingField; } } for (int j = 0; j < ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length; j++) { HerdTargetsForPlayerCount val2 = ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts)[j]; if (val2._PlayerCount_k__BackingField < num && val2._PlayerCount_k__BackingField > num4) { num4 = val2._PlayerCount_k__BackingField; num3 = val2._HerdTargetCount_k__BackingField; } } if (num < Max) { int num5 = Math.Max(1, (num4 <= 0) ? 1 : (num2 - num3)); int num6 = Max - num; Il2CppStructArray<HerdTargetsForPlayerCount> val3 = new Il2CppStructArray<HerdTargetsForPlayerCount>((long)(((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length + num6)); for (int k = 0; k < ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length; k++) { ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)val3)[k] = ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts)[k]; } for (int l = 1; l <= num6; l++) { HerdTargetsForPlayerCount val4 = new HerdTargetsForPlayerCount { _PlayerCount_k__BackingField = num + l, _HerdTargetCount_k__BackingField = num2 + num5 * l }; ((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)val3)[((Il2CppArrayBase<HerdTargetsForPlayerCount>)(object)herdTargetsForPlayerCounts).Length + l - 1] = val4; } __instance.herdTargetsForPlayerCounts = val3; } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val5 = new BepInExErrorLogInterpolatedStringHandler(15, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val5).AppendLiteral("Herding table: "); ((BepInExLogInterpolatedStringHandler)val5).AppendFormatted<Exception>(ex); } log.LogError(val5); } } } [HarmonyPatch] internal static class ModHandshake { private const string MarkerPrefix = "|MoreWizards/"; [ThreadStatic] private static int hostCheckDepth; [ThreadStatic] private static bool inOriginalCheck; internal static string Marker => "|MoreWizards/1.5.4"; [HarmonyPatch(typeof(OnlineState), "SetConnectionPayload")] [HarmonyPostfix] private static void SetConnectionPayload_Postfix() { //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Expected O, but got Unknown try { NetworkManager singleton = NetworkManager.Singleton; NetworkConfig val = ((singleton != null) ? singleton.NetworkConfig : null); if (val == null || val.ConnectionData == null) { return; } string text = Encoding.UTF8.GetString(Il2CppArrayBase<byte>.op_Implicit((Il2CppArrayBase<byte>)(object)val.ConnectionData)); int num = text.IndexOf("\"Version\":\"", StringComparison.Ordinal); if (num < 0) { Plugin.Log.LogWarning((object)"Handshake: no Version in connection payload."); return; } num += "\"Version\":\"".Length; int num2 = text.IndexOf('"', num); if (num2 >= 0) { string text2 = StripMarker(text.Substring(num, num2 - num)); text = text.Substring(0, num) + text2 + Marker + text.Substring(num2); val.ConnectionData = new Il2CppStructArray<byte>(Encoding.UTF8.GetBytes(text)); } } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val2 = new BepInExErrorLogInterpolatedStringHandler(21, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val2).AppendLiteral("Handshake (payload): "); ((BepInExLogInterpolatedStringHandler)val2).AppendFormatted<Exception>(ex); } log.LogError(val2); } } [HarmonyPatch(typeof(HostState), "OnApprovalCheck")] [HarmonyPrefix] private static void Approval_Prefix() { hostCheckDepth++; } [HarmonyPatch(typeof(HostState), "OnApprovalCheck")] [HarmonyPostfix] private static void Approval_Postfix() { hostCheckDepth = Math.Max(0, hostCheckDepth - 1); } [HarmonyPatch(typeof(HostState), "GetConnectionStatus", new Type[] { typeof(ConnectionPayload) })] [HarmonyPrefix] private static void Status_Prefix() { hostCheckDepth++; } [HarmonyPatch(typeof(HostState), "GetConnectionStatus", new Type[] { typeof(ConnectionPayload) })] [HarmonyPostfix] private static void Status_Postfix() { hostCheckDepth = Math.Max(0, hostCheckDepth - 1); } [HarmonyPatch(typeof(BuildVersionProvider), "IsIncompatibleWith")] [HarmonyPrefix] private static bool IsIncompatibleWith_Prefix(string fullVersionToMatch, ref bool __result) { //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown if (inOriginalCheck) { return true; } try { string text = fullVersionToMatch ?? ""; int num = text.IndexOf("|MoreWizards/", StringComparison.Ordinal); string text2 = ((num >= 0) ? text.Substring(num + "|MoreWizards/".Length) : null); if (hostCheckDepth > 0 && Plugin.RequireModForJoiners.Value && text2 != "1.5.4") { __result = true; Plugin.Log.LogWarning((object)((text2 == null) ? "Rejected a player without MoreWizards." : $"Rejected a player on MoreWizards {text2} (host has {"1.5.4"}).")); return false; } if (num < 0) { return true; } inOriginalCheck = true; try { __result = BuildVersionProvider.IsIncompatibleWith(StripMarker(text)); } finally { inOriginalCheck = false; } return false; } catch (Exception ex) { ManualLogSource log = Plugin.Log; bool flag = default(bool); BepInExErrorLogInterpolatedStringHandler val = new BepInExErrorLogInterpolatedStringHandler(19, 1, ref flag); if (flag) { ((BepInExLogInterpolatedStringHandler)val).AppendLiteral("Handshake (check): "); ((BepInExLogInterpolatedStringHandler)val).AppendFormatted<Exception>(ex); } log.LogError(val); } return true; } private static string StripMarker(string v) { int num = v.IndexOf("|MoreWizards/", StringComparison.Ordinal); if (num < 0) { return v; } return v.Substring(0, num); } } internal static class NativePatcher { private sealed class Site { public string Description; public string Assembly; public string Class; public string Nested; public string Method; public int ArgCount; public byte[] Signature; public int ImmOffset; public int ImmSize; public int ScanLength; public byte[] Patch; } private static readonly List<Site> Sites = new List<Site> { new Site { Description = "Steam lobby size (CreateLobbyAsync(4))", Assembly = "Networking.Steam.dll", Class = "SteamLobbyService", Nested = "<InitializeAsHost>d__3", Method = "MoveNext", ArgCount = 0, Signature = Hex("B9 04 00 00 00 E8"), ImmOffset = 1, ImmSize = 4, ScanLength = 1280 }, new Site { Description = "EOS lobby size (host)", Assembly = "Networking.EOS.dll", Class = "EOSLobbyService", Nested = "<InitializeAsHost>d__24", Method = "MoveNext", ArgCount = 0, Signature = Hex("48 C7 44 24 68 04 00 00 00"), ImmOffset = 5, ImmSize = 4, ScanLength = 2560 }, new Site { Description = "EOS lobby size (CreateLobbyOptions)", Assembly = "Networking.EOS.dll", Class = "EOSLobbyService", Nested = null, Method = "CreateLobbyOptions", ArgCount = 0, Signature = Hex("48 C7 43 08 04 00 00 00"), ImmOffset = 4, ImmSize = 4, ScanLength = 384 }, new Site { Description = "EOS free-slot count (GetSlotsAvailable)", Assembly = "Networking.EOS.dll", Class = "EOSLobbySearcher", Nested = null, Method = "GetSlotsAvailable", ArgCount = 1, Signature = Hex("B9 04 00 00 00 2B C8"), ImmOffset = 1, ImmSize = 4, ScanLength = 96 }, new Site { Description = "EOS free-slot count (GetLobbies)", Assembly = "Networking.EOS.dll", Class = "EOSLobbySearcher", Nested = "<GetLobbies>d__8", Method = "MoveNext", ArgCount = 0, Signature = Hex("BE 04 00 00 00 2B F0"), ImmOffset = 1, ImmSize = 4, ScanLength = 2816 }, new Site { Description = "Matchmaking: lobby has places left", Assembly = "Runtime.dll", Class = "LobbyFiller", Nested = null, Method = "LobbyHasPlacesLeft", ArgCount = 0, Signature = Hex("83 F8 04 0F 9C C0"), ImmOffset = 2, ImmSize = 1, ScanLength = 160 }, new Site { Description = "Matchmaking: squad filling", Assembly = "Runtime.dll", Class = "LobbyFiller", Nested = "<TryToFillSquad>d__5", Method = "MoveNext", ArgCount = 0, Signature = Hex("83 F8 04 0F 8D"), ImmOffset = 2, ImmSize = 1, ScanLength = 3072