using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Logging; using Extensions; using HarmonyLib; using Microsoft.CodeAnalysis; using Mirror; using TMPro; using UnityEngine; using UnityEngine.Events; using UnityEngine.InputSystem; using UnityEngine.InputSystem.Controls; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyVersion("0.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace VapuStats { internal static class DayStatsCalculator { public static List CalculateAllPlayersStats(PayoutTracker tracker, List players) { //IL_016d: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) List list = new List(); foreach (PlayerProfile player in players) { List playerRecords = tracker.GetPlayerRecords(player); PlayerDaySummary playerDaySummary = new PlayerDaySummary { playerName = player.playerName }; int num = 0; int num2 = 0; foreach (PayoutRecord item in playerRecords.OrderBy((PayoutRecord r) => r.timestamp)) { if (item.bet == 0L && item.payout == 0L) { continue; } playerDaySummary.totalBet += item.bet; playerDaySummary.totalPayout += item.payout; playerDaySummary.totalGames++; if (item.isWin) { playerDaySummary.wins++; } if (item.isLoss) { playerDaySummary.losses++; } if (!item.isWin && !item.isLoss) { playerDaySummary.pushes++; } if (item.isWin) { num++; num2 = 0; if (num > playerDaySummary.longestWinStreak) { playerDaySummary.longestWinStreak = num; } } else if (item.isLoss) { num2++; num = 0; if (num2 > playerDaySummary.longestLossStreak) { playerDaySummary.longestLossStreak = num2; } } if (!playerDaySummary.byGameType.TryGetValue(item.gameType, out GameTypeStats value)) { value = new GameTypeStats(); playerDaySummary.byGameType[item.gameType] = value; } value.totalBet += item.bet; value.totalPayout += item.payout; value.gameCount++; if (item.isWin) { value.winCount++; long num3 = item.payout - item.bet; if (num3 > value.biggestWin) { value.biggestWin = num3; } } } list.Add(playerDaySummary); } return list.OrderByDescending((PlayerDaySummary s) => s.NetProfit).ToList(); } public static List CalculateFromRecords(IEnumerable records) { //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01cb: Unknown result type (might be due to invalid IL or missing references) Dictionary dictionary = new Dictionary(); Dictionary dictionary2 = new Dictionary(); foreach (RunRecord item in records.OrderBy((RunRecord r) => r.timestamp)) { if (item.bet == 0L && item.payout == 0L) { continue; } string text = item.playerName ?? ""; if (!dictionary.TryGetValue(text, out var value)) { value = (dictionary[text] = new PlayerDaySummary { playerName = text }); dictionary2[text] = (0, 0); } value.totalBet += item.bet; value.totalPayout += item.payout; value.totalGames++; if (item.isWin) { value.wins++; } if (item.isLoss) { value.losses++; } if (!item.isWin && !item.isLoss) { value.pushes++; } var (num, num2) = dictionary2[text]; if (item.isWin) { num++; num2 = 0; if (num > value.longestWinStreak) { value.longestWinStreak = num; } } else if (item.isLoss) { num2++; num = 0; if (num2 > value.longestLossStreak) { value.longestLossStreak = num2; } } dictionary2[text] = (num, num2); CasinoGameType key = (CasinoGameType)item.gameType; if (!value.byGameType.TryGetValue(key, out GameTypeStats value2)) { value2 = new GameTypeStats(); value.byGameType[key] = value2; } value2.totalBet += item.bet; value2.totalPayout += item.payout; value2.gameCount++; if (item.isWin) { value2.winCount++; long num3 = item.payout - item.bet; if (num3 > value2.biggestWin) { value2.biggestWin = num3; } } } return dictionary.Values.OrderByDescending((PlayerDaySummary s) => s.NetProfit).ToList(); } } internal class FallbackInputHandler : MonoBehaviour { private void Update() { Keyboard current = Keyboard.current; if (current != null && (((ButtonControl)current.enterKey).wasPressedThisFrame || ((ButtonControl)current.numpadEnterKey).wasPressedThisFrame || ((ButtonControl)current.spaceKey).wasPressedThisFrame)) { FallbackRunOverModal.Close(); } } } internal static class FallbackRunOverModal { private static GameObject? _currentRoot; private static bool _savedCursorVisible; private static CursorLockMode _savedCursorLock; public static bool IsShowing => (Object)(object)_currentRoot != (Object)null; public static void Show(List stats) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_020f: Unknown result type (might be due to invalid IL or missing references) //IL_021e: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_02d1: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_0308: Unknown result type (might be due to invalid IL or missing references) //IL_030f: Expected O, but got Unknown //IL_0334: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_035e: Unknown result type (might be due to invalid IL or missing references) //IL_0373: Unknown result type (might be due to invalid IL or missing references) //IL_0387: Unknown result type (might be due to invalid IL or missing references) //IL_03bc: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) //IL_0413: Unknown result type (might be due to invalid IL or missing references) //IL_0433: Unknown result type (might be due to invalid IL or missing references) //IL_043e: Unknown result type (might be due to invalid IL or missing references) //IL_0451: Unknown result type (might be due to invalid IL or missing references) //IL_045b: Expected O, but got Unknown //IL_0460: Unknown result type (might be due to invalid IL or missing references) //IL_0465: Unknown result type (might be due to invalid IL or missing references) //IL_0478: Unknown result type (might be due to invalid IL or missing references) //IL_047f: Unknown result type (might be due to invalid IL or missing references) //IL_048a: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04db: 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_026c: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_currentRoot != (Object)null) { Plugin.Log.LogInfo((object)"[VapuStats] Fallback already showing, ignoring duplicate"); return; } TMP_FontAsset font = PanelHelpers.GetFont((MonoBehaviour?)(object)Plugin.Instance); _savedCursorVisible = Cursor.visible; _savedCursorLock = Cursor.lockState; Cursor.visible = true; Cursor.lockState = (CursorLockMode)0; GameObject val = new GameObject("VapuStats_FallbackModal"); Object.DontDestroyOnLoad((Object)(object)val); val.AddComponent(); Canvas obj = val.AddComponent(); obj.renderMode = (RenderMode)0; obj.sortingOrder = 32000; val.AddComponent().uiScaleMode = (ScaleMode)1; val.GetComponent().referenceResolution = new Vector2(1920f, 1080f); val.AddComponent(); GameObject val2 = new GameObject("Backdrop"); val2.transform.SetParent(val.transform, false); RectTransform obj2 = val2.AddComponent(); obj2.anchorMin = Vector2.zero; obj2.anchorMax = Vector2.one; obj2.offsetMin = Vector2.zero; obj2.offsetMax = Vector2.zero; Image obj3 = val2.AddComponent(); obj3.sprite = StatsModal.GetWhiteSprite(); ((Graphic)obj3).color = new Color(0f, 0f, 0f, 0.92f); ((Graphic)obj3).raycastTarget = true; GameObject val3 = new GameObject("Title"); val3.transform.SetParent(val.transform, false); RectTransform obj4 = val3.AddComponent(); obj4.anchorMin = new Vector2(0.5f, 1f); obj4.anchorMax = new Vector2(0.5f, 1f); obj4.pivot = new Vector2(0.5f, 1f); obj4.anchoredPosition = new Vector2(0f, -50f); obj4.sizeDelta = new Vector2(800f, 70f); TextMeshProUGUI val4 = val3.AddComponent(); if ((Object)(object)font != (Object)null) { ((TMP_Text)val4).font = font; } ((TMP_Text)val4).text = "RUN OVER"; ((TMP_Text)val4).fontSize = 44f; ((Graphic)val4).color = Color.white; ((TMP_Text)val4).alignment = (TextAlignmentOptions)514; ((Graphic)val4).raycastTarget = false; GameTypePanel.Build(val.transform, stats, (MonoBehaviour)(object)Plugin.Instance, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -140f)); HashSet hashSet = new HashSet(); foreach (PlayerDaySummary stat in stats) { foreach (CasinoGameType key in stat.byGameType.Keys) { hashSet.Add(key); } } float num = (float)hashSet.Count * 26f + 40f; PlayerStatsPanel.Build(val.transform, stats, (MonoBehaviour)(object)Plugin.Instance, new Vector2(0.5f, 1f), new Vector2(0.5f, 1f), new Vector2(0f, -140f - num - 30f)); GameObject val5 = new GameObject("ContinueButton"); val5.transform.SetParent(val.transform, false); RectTransform obj5 = val5.AddComponent(); obj5.anchorMin = new Vector2(0.5f, 0f); obj5.anchorMax = new Vector2(0.5f, 0f); obj5.pivot = new Vector2(0.5f, 0f); obj5.anchoredPosition = new Vector2(0f, 50f); obj5.sizeDelta = new Vector2(240f, 60f); Image val6 = val5.AddComponent(); val6.sprite = StatsModal.GetWhiteSprite(); ((Graphic)val6).color = new Color(0.2f, 0.55f, 0.3f, 1f); Button obj6 = val5.AddComponent