Decompiled source of LethalSlots v1.1.1

PartyRockers.LethalSlots.dll

Decompiled 10 months ago
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 System.Security;
using System.Security.Permissions;
using BepInEx;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using MonoMod.Utils;
using Nukka.Core;
using Nukka.Network;
using Nukka.Patches;
using TMPro;
using Unity.Netcode;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("PartyRockers.LethalSlots")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("The Ultimate Lethal Slots Mod from the Party Rockers")]
[assembly: AssemblyFileVersion("1.0.2.0")]
[assembly: AssemblyInformationalVersion("1.0.2")]
[assembly: AssemblyProduct("PartyRockers.LethalSlots")]
[assembly: AssemblyTitle("PartyRockers.LethalSlots")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
internal class <Module>
{
	static <Module>()
	{
	}
}
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace Nukka
{
	[BepInPlugin("PartyRockers.LethalSlots", "PartyRockers.LethalSlots", "1.0.2")]
	public class LethalSlotsPluginBase : BaseUnityPlugin
	{
		private readonly Harmony _harmony = new Harmony("PartyRockers.LethalSlots");

		internal static LethalSlotsPluginBase Instance;

		internal bool isDebug = false;

		private void Awake()
		{
			if (!((Object)(object)Instance != (Object)null))
			{
				Instance = this;
				Initialise();
				ApplyPatches();
				((BaseUnityPlugin)this).Logger.LogInfo((object)"Plugin PartyRockers.LethalSlots is loaded!");
			}
		}

		private void Initialise()
		{
			InitNetcodeWeaver();
			InitAssetBundleManager();
		}

		private void InitNetcodeWeaver()
		{
			Type[] types = Assembly.GetExecutingAssembly().GetTypes();
			Type[] array = types;
			foreach (Type type in array)
			{
				MethodInfo[] methods = type.GetMethods(BindingFlags.Instance | BindingFlags.Static | BindingFlags.NonPublic);
				MethodInfo[] array2 = methods;
				foreach (MethodInfo methodInfo in array2)
				{
					object[] customAttributes = methodInfo.GetCustomAttributes(typeof(RuntimeInitializeOnLoadMethodAttribute), inherit: false);
					if (customAttributes.Length != 0)
					{
						methodInfo.Invoke(null, null);
					}
				}
			}
		}

		private void InitAssetBundleManager()
		{
			AssetsManager.Instance.Initialise();
		}

		private void ApplyPatches()
		{
			_harmony.PatchAll(typeof(LethalSlotsPluginBase));
			_harmony.PatchAll(typeof(GameNetworkManagerPatch));
			_harmony.PatchAll(typeof(StartOfRoundPatch));
			_harmony.PatchAll(typeof(TerminalPatcher));
		}

		public void LogInfo(string info)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)info);
		}

		public void LogDebug(string info)
		{
			if (isDebug)
			{
				((BaseUnityPlugin)this).Logger.LogDebug((object)info);
			}
		}

		public void LogError(string error)
		{
			((BaseUnityPlugin)this).Logger.LogInfo((object)error);
		}
	}
	public static class PluginInfo
	{
		public const string PLUGIN_GUID = "PartyRockers.LethalSlots";

		public const string PLUGIN_NAME = "PartyRockers.LethalSlots";

		public const string PLUGIN_VERSION = "1.0.2";
	}
}
namespace Nukka.Patches
{
	[HarmonyPatch(typeof(GameNetworkManager))]
	internal class GameNetworkManagerPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void PostStart(ref GameNetworkManager __instance)
		{
			RegisterNetworkPrefabs(__instance);
		}

		private static void RegisterNetworkPrefabs(GameNetworkManager __instance)
		{
			foreach (KeyValuePair<string, GameObject> networkPrefab in AssetsManager.Instance.networkPrefabs)
			{
				((Component)__instance).GetComponent<NetworkManager>().AddNetworkPrefab(networkPrefab.Value);
			}
		}
	}
	[HarmonyPatch(typeof(StartOfRound))]
	internal class StartOfRoundPatch
	{
		[HarmonyPostfix]
		[HarmonyPatch("Awake")]
		private static void PostAwake(ref StartOfRound __instance)
		{
			RegisterUnlockables(__instance);
			InitSpawnNetworkHandler();
		}

		private static void InitSpawnNetworkHandler()
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0045: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				if (((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().IsHost || ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().IsServer)
				{
					GameObject val = AssetsManager.Instance.networkPrefabs["spawn_network_handler"];
					GameObject val2 = Object.Instantiate<GameObject>(val, Vector3.zero, Quaternion.identity);
					val2.GetComponent<NetworkObject>().Spawn(false);
				}
			}
			catch (Exception ex)
			{
				LethalSlotsPluginBase.Instance.LogError("Error occured in StartOfRoundPatch_InitNetworkHandler: " + ex.Message);
			}
		}

		private static void RegisterUnlockables(StartOfRound __instance)
		{
			foreach (UnlockableItem unlockable in AssetsManager.Instance.unlockablesList.unlockables)
			{
				if (__instance.unlockablesList.unlockables.Any((UnlockableItem x) => x.unlockableName == unlockable.unlockableName))
				{
					LethalSlotsPluginBase.Instance.LogDebug("Unlockable " + unlockable.unlockableName + " already exists in unlockables list, skipping");
					continue;
				}
				if ((Object)(object)unlockable.prefabObject != (Object)null)
				{
					PlaceableShipObject componentInChildren = unlockable.prefabObject.GetComponentInChildren<PlaceableShipObject>();
					if ((Object)(object)componentInChildren != (Object)null)
					{
						componentInChildren.unlockableID = __instance.unlockablesList.unlockables.Count;
					}
				}
				__instance.unlockablesList.unlockables.Add(unlockable);
			}
		}
	}
	[HarmonyPatch(typeof(Terminal))]
	internal class TerminalPatcher
	{
		[HarmonyPostfix]
		[HarmonyPatch("Start")]
		private static void PostStart(ref Terminal __instance)
		{
			RegisterUnlockablesKeywords(__instance);
		}

		private static void RegisterUnlockablesKeywords(Terminal __instance)
		{
			//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_0214: Expected O, but got Unknown
			if ((Object)(object)StartOfRound.Instance == (Object)null)
			{
				return;
			}
			foreach (UnlockableItem resgisteredUnlockable in AssetsManager.Instance.unlockablesList.unlockables)
			{
				string unlockableName = resgisteredUnlockable.unlockableName;
				TerminalKeyword val = __instance.terminalNodes.allKeywords.First((TerminalKeyword keyword) => keyword.word == "buy");
				TerminalKeyword keyword2 = CreateTerminalKeyword(unlockableName.ToLowerInvariant(), isVerb: false, null, null, val);
				if (__instance.terminalNodes.allKeywords.Any((TerminalKeyword kw) => kw.word == keyword2.word))
				{
					LethalSlotsPluginBase.Instance.LogInfo("Keyword: " + keyword2.word + " already registered, skipping.");
					continue;
				}
				int shipUnlockableID = StartOfRound.Instance.unlockablesList.unlockables.FindIndex((UnlockableItem unlockable) => unlockable.unlockableName == resgisteredUnlockable.unlockableName);
				TerminalNode val2 = ScriptableObject.CreateInstance<TerminalNode>();
				((Object)val2).name = unlockableName + "ReturnNode";
				val2.displayText = "Lethal Slot Machine\r\n\r\n";
				val2.clearPreviousText = true;
				val2.maxCharactersToType = 15;
				val2.buyItemIndex = -1;
				val2.shipUnlockableID = shipUnlockableID;
				val2.returnFromStorage = true;
				val2.creatureName = unlockableName;
				val2.isConfirmationNode = false;
				val2.itemCost = 0;
				val2.playSyncedClip = 0;
				resgisteredUnlockable.shopSelectionNode = val2;
				List<TerminalKeyword> list = __instance.terminalNodes.allKeywords.ToList();
				list.Add(keyword2);
				__instance.terminalNodes.allKeywords = list.ToArray();
				LethalSlotsPluginBase.Instance.LogDebug("Keyword: " + keyword2.word + " was registered.");
				List<CompatibleNoun> list2 = val.compatibleNouns.ToList();
				list2.Add(new CompatibleNoun
				{
					noun = keyword2,
					result = val2
				});
				val.compatibleNouns = list2.ToArray();
			}
		}

		public static TerminalKeyword CreateTerminalKeyword(string word, bool isVerb = false, CompatibleNoun[] compatibleNouns = null, TerminalNode specialKeywordResult = null, TerminalKeyword defaultVerb = null, bool accessTerminalObjects = false)
		{
			TerminalKeyword val = ScriptableObject.CreateInstance<TerminalKeyword>();
			((Object)val).name = word;
			val.word = word;
			val.isVerb = isVerb;
			val.compatibleNouns = compatibleNouns;
			val.specialKeywordResult = specialKeywordResult;
			val.defaultVerb = defaultVerb;
			val.accessTerminalObjects = accessTerminalObjects;
			return val;
		}
	}
}
namespace Nukka.Network
{
	internal class SlotMachineNetworkHandler : NetworkBehaviour
	{
		private enum WinMultipliers
		{
			Win10,
			Win5,
			Win3,
			Win2,
			Win0
		}

		internal static SlotMachineNetworkHandler Instance;

		private NetworkManager _networkManager;

		private Terminal _terminal;

		private NetworkObjectReference _slotMachineNetworkObjectReference;

		private InteractTrigger _slotMachinePlayScriptInteractTrigger;

		private InteractTrigger _slotMachineRaiseBidScriptInteractTrigger;

		private InteractTrigger _slotMachineLowerBidScriptInteractTrigger;

		private TextMeshProUGUI _creditsTextMesh;

		private SlotMachineScript _slotMachineScript;

		private AudioSource _slotMachinePlayAudioSource;

		private readonly int[] _bids = new int[7] { 1, 5, 10, 15, 25, 50, 100 };

		private int _currentBidIndex = 0;

		private float _updateCreditsTextInterval = 0f;

		public override void OnNetworkSpawn()
		{
			_networkManager = ((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>();
			_terminal = Object.FindObjectOfType<Terminal>();
			if ((_networkManager.IsHost || _networkManager.IsServer) && (Object)(object)Instance != (Object)null)
			{
				((Component)this).gameObject.GetComponent<NetworkObject>().Despawn(true);
			}
			Instance = this;
			if (_networkManager.IsHost || _networkManager.IsServer)
			{
				SpawnSlotMachine();
			}
			else
			{
				SyncDataRpc();
			}
			((NetworkBehaviour)this).OnNetworkSpawn();
		}

		private void SpawnSlotMachine()
		{
			//IL_0091: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			foreach (UnlockableItem unlockable in StartOfRound.Instance.unlockablesList.unlockables)
			{
				if (unlockable.unlockableName == "Lethal Slot Machine")
				{
					LethalSlotsPluginBase.Instance.LogDebug("Spawning " + ((Object)unlockable.prefabObject).name);
					GameObject val = GameObject.Find("HangarShip");
					GameObject val2 = Object.Instantiate<GameObject>(unlockable.prefabObject, val.transform);
					val2.transform.localPosition = new Vector3(-0.19f, 0f, -5.5f);
					val2.transform.localRotation = Quaternion.Euler(0f, 180f, 0f);
					val2.GetComponent<NetworkObject>().Spawn(true);
					SetSlotMachineNetworkObjectReferences(NetworkObjectReference.op_Implicit(val2.GetComponent<NetworkObject>()));
				}
			}
		}

		private void SyncDataRpc()
		{
			if (!((NetworkBehaviour)this).IsOwner)
			{
				SyncDataServerRpc();
			}
		}

		[ClientRpc]
		private void SyncDataClientRpc(int groupCredits, NetworkObjectReference slotMachineNetworkObjectReference, bool isSlotMachinePlayScriptInteractTriggerInteractable, bool isSlotMachineRaiseBidScriptInteractTriggerInteractable, bool isSlotMachineLowerBidScriptInteractTriggerInteractable, int bidIndex)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: 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_008a: 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_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: 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_00c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00db: 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_00ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_014f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
				{
					ClientRpcParams val = default(ClientRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(4088973756u, val, (RpcDelivery)0);
					BytePacker.WriteValueBitPacked(val2, groupCredits);
					((FastBufferWriter)(ref val2)).WriteValueSafe<NetworkObjectReference>(ref slotMachineNetworkObjectReference, default(ForNetworkSerializable));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isSlotMachinePlayScriptInteractTriggerInteractable, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isSlotMachineRaiseBidScriptInteractTriggerInteractable, default(ForPrimitives));
					((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref isSlotMachineLowerBidScriptInteractTriggerInteractable, default(ForPrimitives));
					BytePacker.WriteValueBitPacked(val2, bidIndex);
					((NetworkBehaviour)this).__endSendClientRpc(ref val2, 4088973756u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
				{
					_terminal.groupCredits = groupCredits;
					SetSlotMachineNetworkObjectReferences(slotMachineNetworkObjectReference);
					_slotMachinePlayScriptInteractTrigger.interactable = isSlotMachinePlayScriptInteractTriggerInteractable;
					_slotMachineRaiseBidScriptInteractTrigger.interactable = isSlotMachineRaiseBidScriptInteractTriggerInteractable;
					_slotMachineLowerBidScriptInteractTrigger.interactable = isSlotMachineLowerBidScriptInteractTriggerInteractable;
					_currentBidIndex = bidIndex;
					LethalSlotsPluginBase.Instance.LogDebug("Synced client data.");
				}
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void SyncDataServerRpc()
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
				{
					ServerRpcParams val = default(ServerRpcParams);
					FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2387126756u, val, (RpcDelivery)0);
					((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2387126756u, val, (RpcDelivery)0);
				}
				if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
				{
					SyncDataClientRpc(_terminal.groupCredits, _slotMachineNetworkObjectReference, _slotMachinePlayScriptInteractTrigger.interactable, _slotMachineRaiseBidScriptInteractTrigger.interactable, _slotMachineLowerBidScriptInteractTrigger.interactable, _currentBidIndex);
				}
			}
		}

		private void SetSlotMachineNetworkObjectReferences(NetworkObjectReference slotMachineNetworkObjectReference)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			_slotMachineNetworkObjectReference = slotMachineNetworkObjectReference;
			NetworkObject val = NetworkObjectReference.Resolve(_slotMachineNetworkObjectReference, _networkManager);
			Transform child = ((Component)val).transform.GetChild(3);
			_slotMachinePlayScriptInteractTrigger = ((Component)child).gameObject.GetComponent<InteractTrigger>();
			Transform child2 = ((Component)val).transform.GetChild(4);
			_slotMachineRaiseBidScriptInteractTrigger = ((Component)child2).gameObject.GetComponent<InteractTrigger>();
			Transform child3 = ((Component)val).transform.GetChild(5);
			_slotMachineLowerBidScriptInteractTrigger = ((Component)child3).gameObject.GetComponent<InteractTrigger>();
			Transform child4 = ((Component)val).transform.GetChild(6);
			Transform child5 = ((Component)child4).transform.GetChild(0);
			_creditsTextMesh = ((Component)child5).gameObject.GetComponent<TextMeshProUGUI>();
			Transform child6 = ((Component)val).transform.GetChild(7);
			_slotMachineScript = ((Component)child6).GetComponentInChildren<SlotMachineScript>();
			Transform child7 = ((Component)val).transform.GetChild(8);
			_slotMachinePlayAudioSource = ((Component)child7).gameObject.GetComponent<AudioSource>();
		}

		private void Update()
		{
			_updateCreditsTextInterval += Time.deltaTime;
			if (_updateCreditsTextInterval > 1f)
			{
				_updateCreditsTextInterval = 0f;
				UpdateCreditsText();
			}
		}

		internal void PlayRpc(string playerUsername)
		{
			LethalSlotsPluginBase.Instance.LogDebug($"Bid: {_bids[_currentBidIndex]}, Credits: {_terminal.groupCredits}.");
			if (_bids[_currentBidIndex] <= _terminal.groupCredits)
			{
				if (((NetworkBehaviour)this).IsOwner)
				{
					LethalSlotsPluginBase.Instance.LogDebug("Called from server.");
					WinMultipliers winMultiplier = ComputeWinMultiplier();
					Dictionary<string, float> dictionary = ComputeReelPositions(winMultiplier);
					PlayClientRpc(playerUsername, winMultiplier, dictionary["reel_1_magic_7_ball"], dictionary["reel_1_cash_register"], dictionary["reel_1_bell"], dictionary["reel_1_gift_box"], dictionary["reel_1_clown_horn"], dictionary["reel_1_comedy_mask"], dictionary["reel_2_magic_7_ball"], dictionary["reel_2_cash_register"], dictionary["reel_2_bell"], dictionary["reel_2_gift_box"], dictionary["reel_2_clown_horn"], dictionary["reel_2_comedy_mask"], dictionary["reel_3_magic_7_ball"], dictionary["reel_3_cash_register"], dictionary["reel_3_bell"], dictionary["reel_3_gift_box"], dictionary["reel_3_clown_horn"], dictionary["reel_3_comedy_mask"]);
				}
				else
				{
					LethalSlotsPluginBase.Instance.LogDebug("Called from client.");
					PlayServerRpc(playerUsername);
				}
			}
		}

		[ClientRpc]
		private void PlayClientRpc(string playerUsername, WinMultipliers winMultiplier, float reel1Magic7BallPosition, float reel1CashRegisterPosition, float reel1BellPosition, float reel1GiftBoxPosition, float reel1ClownHornPosition, float reel1ComedyMaskPosition, float reel2Magic7BallPosition, float reel2CashRegisterPosition, float reel2BellPosition, float reel2GiftBoxPosition, float reel2ClownHornPosition, float reel2ComedyMaskPosition, float reel3Magic7BallPosition, float reel3CashRegisterPosition, float reel3BellPosition, float reel3GiftBoxPosition, float reel3ClownHornPosition, float reel3ComedyMaskPosition)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_02cb: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d5: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d6: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_010c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0127: 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_0142: Unknown result type (might be due to invalid IL or missing references)
			//IL_0148: Unknown result type (might be due to invalid IL or missing references)
			//IL_015d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0163: 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_017e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0193: Unknown result type (might be due to invalid IL or missing references)
			//IL_0199: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ae: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_021a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0220: Unknown result type (might be due to invalid IL or missing references)
			//IL_0235: Unknown result type (might be due to invalid IL or missing references)
			//IL_023b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0250: Unknown result type (might be due to invalid IL or missing references)
			//IL_0256: Unknown result type (might be due to invalid IL or missing references)
			//IL_026b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0271: Unknown result type (might be due to invalid IL or missing references)
			//IL_0286: Unknown result type (might be due to invalid IL or missing references)
			//IL_028c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02bb: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3141908120u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((FastBufferWriter)(ref val2)).WriteValueSafe<WinMultipliers>(ref winMultiplier, default(ForEnums));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1Magic7BallPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1CashRegisterPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1BellPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1GiftBoxPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1ClownHornPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel1ComedyMaskPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2Magic7BallPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2CashRegisterPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2BellPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2GiftBoxPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2ClownHornPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel2ComedyMaskPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3Magic7BallPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3CashRegisterPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3BellPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3GiftBoxPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3ClownHornPosition, default(ForPrimitives));
				((FastBufferWriter)(ref val2)).WriteValueSafe<float>(ref reel3ComedyMaskPosition, default(ForPrimitives));
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3141908120u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				LethalSlotsPluginBase.Instance.LogDebug($"PlayClientRpc called by {playerUsername} and got WinMultiplier: {winMultiplier}.");
				Dictionary<string, float> dictionary = new Dictionary<string, float>();
				dictionary.Add("reel_1_magic_7_ball", reel1Magic7BallPosition);
				dictionary.Add("reel_1_cash_register", reel1CashRegisterPosition);
				dictionary.Add("reel_1_bell", reel1BellPosition);
				dictionary.Add("reel_1_gift_box", reel1GiftBoxPosition);
				dictionary.Add("reel_1_clown_horn", reel1ClownHornPosition);
				dictionary.Add("reel_1_comedy_mask", reel1ComedyMaskPosition);
				dictionary.Add("reel_2_magic_7_ball", reel2Magic7BallPosition);
				dictionary.Add("reel_2_cash_register", reel2CashRegisterPosition);
				dictionary.Add("reel_2_bell", reel2BellPosition);
				dictionary.Add("reel_2_gift_box", reel2GiftBoxPosition);
				dictionary.Add("reel_2_clown_horn", reel2ClownHornPosition);
				dictionary.Add("reel_2_comedy_mask", reel2ComedyMaskPosition);
				dictionary.Add("reel_3_magic_7_ball", reel3Magic7BallPosition);
				dictionary.Add("reel_3_cash_register", reel3CashRegisterPosition);
				dictionary.Add("reel_3_bell", reel3BellPosition);
				dictionary.Add("reel_3_gift_box", reel3GiftBoxPosition);
				dictionary.Add("reel_3_clown_horn", reel3ClownHornPosition);
				dictionary.Add("reel_3_comedy_mask", reel3ComedyMaskPosition);
				((MonoBehaviour)this).StartCoroutine(ExecutePlayLogic(winMultiplier, dictionary));
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void PlayServerRpc(string playerUsername)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(2892188890u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 2892188890u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				WinMultipliers winMultiplier = ComputeWinMultiplier();
				Dictionary<string, float> dictionary = ComputeReelPositions(winMultiplier);
				PlayClientRpc(playerUsername, winMultiplier, dictionary["reel_1_magic_7_ball"], dictionary["reel_1_cash_register"], dictionary["reel_1_bell"], dictionary["reel_1_gift_box"], dictionary["reel_1_clown_horn"], dictionary["reel_1_comedy_mask"], dictionary["reel_2_magic_7_ball"], dictionary["reel_2_cash_register"], dictionary["reel_2_bell"], dictionary["reel_2_gift_box"], dictionary["reel_2_clown_horn"], dictionary["reel_2_comedy_mask"], dictionary["reel_3_magic_7_ball"], dictionary["reel_3_cash_register"], dictionary["reel_3_bell"], dictionary["reel_3_gift_box"], dictionary["reel_3_clown_horn"], dictionary["reel_3_comedy_mask"]);
				((MonoBehaviour)this).StartCoroutine(DelayedSyncDataRpc());
			}
		}

		private IEnumerator ExecutePlayLogic(WinMultipliers winMultiplier, Dictionary<string, float> reelPositions)
		{
			Terminal terminal = _terminal;
			terminal.groupCredits -= _bids[_currentBidIndex];
			UpdateCreditsText();
			_slotMachinePlayScriptInteractTrigger.interactable = false;
			_slotMachineRaiseBidScriptInteractTrigger.interactable = false;
			_slotMachineLowerBidScriptInteractTrigger.interactable = false;
			_slotMachinePlayAudioSource.Play();
			yield return _slotMachineScript.PlaySlots(reelPositions);
			Terminal terminal2 = _terminal;
			terminal2.groupCredits += _bids[_currentBidIndex] * GetWinMultiplierInt(winMultiplier);
			UpdateCreditsText();
			LethalSlotsPluginBase.Instance.LogDebug($"New credits: {_terminal.groupCredits}.");
			_slotMachinePlayScriptInteractTrigger.interactable = true;
			_slotMachineRaiseBidScriptInteractTrigger.interactable = true;
			_slotMachineLowerBidScriptInteractTrigger.interactable = true;
			yield return null;
		}

		private IEnumerator DelayedSyncDataRpc()
		{
			yield return (object)new WaitForSeconds(3.5f);
			SyncDataRpc();
		}

		private WinMultipliers ComputeWinMultiplier()
		{
			Random random = new Random();
			int num = random.Next(1, 101);
			if (num < 20)
			{
				if (num < 2)
				{
					return WinMultipliers.Win10;
				}
				if (num < 5)
				{
					return WinMultipliers.Win5;
				}
				if (num < 11)
				{
					return WinMultipliers.Win3;
				}
				return WinMultipliers.Win2;
			}
			return WinMultipliers.Win0;
		}

		private int GetWinMultiplierInt(WinMultipliers winMultiplier)
		{
			return winMultiplier switch
			{
				WinMultipliers.Win10 => 10, 
				WinMultipliers.Win5 => 5, 
				WinMultipliers.Win3 => 3, 
				WinMultipliers.Win2 => 2, 
				_ => 0, 
			};
		}

		private Dictionary<string, float> ComputeReelPositions(WinMultipliers winMultiplier)
		{
			if (winMultiplier == WinMultipliers.Win0)
			{
				Dictionary<string, float> dictionary = new Dictionary<string, float>();
				Dictionary<string, float> dictionary2 = ComputeLosingReelPositions("reel_1");
				string text = "";
				foreach (KeyValuePair<string, float> item in dictionary2)
				{
					if (item.Value == 0f)
					{
						text = item.Key;
					}
				}
				Dictionary<string, float> dictionary3 = ComputeLosingReelPositions("reel_2");
				string text2 = "";
				foreach (KeyValuePair<string, float> item2 in dictionary3)
				{
					if (item2.Value == 0f)
					{
						text2 = item2.Key;
					}
				}
				Dictionary<string, float> dictionary4 = ComputeLosingReelPositions("reel_3");
				string text3 = "";
				string key = "";
				foreach (KeyValuePair<string, float> item3 in dictionary4)
				{
					if (item3.Value == 0f)
					{
						text3 = item3.Key;
					}
					if (item3.Value == 0.24f)
					{
						key = item3.Key;
					}
				}
				if (text == text2 && text == text3)
				{
					dictionary4.Remove(text3);
					dictionary4.Remove(key);
					dictionary4.Add(text3, 0.24f);
					dictionary4.Add(key, 0f);
				}
				Extensions.AddRange<string, float>(dictionary, dictionary2);
				Extensions.AddRange<string, float>(dictionary, dictionary3);
				Extensions.AddRange<string, float>(dictionary, dictionary4);
				return dictionary;
			}
			Dictionary<string, float> dictionary5 = new Dictionary<string, float>();
			Dictionary<string, float> dictionary6 = ComputeWinningReelPositions("reel_1", winMultiplier);
			Dictionary<string, float> dictionary7 = ComputeWinningReelPositions("reel_2", winMultiplier);
			Dictionary<string, float> dictionary8 = ComputeWinningReelPositions("reel_3", winMultiplier);
			Extensions.AddRange<string, float>(dictionary5, dictionary6);
			Extensions.AddRange<string, float>(dictionary5, dictionary7);
			Extensions.AddRange<string, float>(dictionary5, dictionary8);
			return dictionary5;
		}

		private Dictionary<string, float> ComputeLosingReelPositions(string reelName)
		{
			List<string> list = new List<string>
			{
				reelName + "_magic_7_ball",
				reelName + "_cash_register",
				reelName + "_bell",
				reelName + "_gift_box",
				reelName + "_clown_horn",
				reelName + "_comedy_mask"
			};
			List<float> list2 = new List<float> { 0.24f, 0.12f, 0f, -0.12f, -0.24f, -0.36f };
			Dictionary<string, float> dictionary = new Dictionary<string, float>();
			foreach (string item in list)
			{
				int index = Random.Range(0, list2.Count);
				dictionary.Add(item, list2[index]);
				list2.RemoveAt(index);
			}
			return dictionary;
		}

		private Dictionary<string, float> ComputeWinningReelPositions(string reelName, WinMultipliers winMultiplier)
		{
			List<string> list = new List<string>
			{
				reelName + "_magic_7_ball",
				reelName + "_cash_register",
				reelName + "_bell",
				reelName + "_gift_box",
				reelName + "_clown_horn",
				reelName + "_comedy_mask"
			};
			List<float> list2 = new List<float> { 0.24f, 0.12f, -0.12f, -0.24f, -0.36f };
			string key = "";
			switch (winMultiplier)
			{
			case WinMultipliers.Win10:
				list.Remove(reelName + "_magic_7_ball");
				key = reelName + "_magic_7_ball";
				break;
			case WinMultipliers.Win5:
				list.Remove(reelName + "_cash_register");
				key = reelName + "_cash_register";
				break;
			case WinMultipliers.Win3:
				list.Remove(reelName + "_bell");
				key = reelName + "_bell";
				break;
			case WinMultipliers.Win2:
				list.Remove(reelName + "_gift_box");
				key = reelName + "_gift_box";
				break;
			}
			Dictionary<string, float> dictionary = new Dictionary<string, float>();
			dictionary.Add(key, 0f);
			foreach (string item in list)
			{
				int index = Random.Range(0, list2.Count);
				dictionary.Add(item, list2[index]);
				list2.RemoveAt(index);
			}
			return dictionary;
		}

		internal void RaiseBidRpc(string playerUsername)
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				RaiseBidRpcClientRpc(playerUsername);
			}
			else
			{
				RaiseBidRpcServerRpc(playerUsername);
			}
		}

		[ClientRpc]
		private void RaiseBidRpcClientRpc(string playerUsername)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(1098736734u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 1098736734u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				LethalSlotsPluginBase.Instance.LogDebug("RaiseBidRpc called by " + playerUsername);
				if (_currentBidIndex + 1 < _bids.Length)
				{
					_currentBidIndex++;
					UpdateCreditsText();
				}
				LethalSlotsPluginBase.Instance.LogDebug($"Bid raised to: {_bids[_currentBidIndex]}");
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void RaiseBidRpcServerRpc(string playerUsername)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(751434624u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 751434624u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				RaiseBidRpcClientRpc(playerUsername);
			}
		}

		internal void LowerBidRpc(string playerUsername)
		{
			if (((NetworkBehaviour)this).IsOwner)
			{
				LowerBidRpcClientRpc(playerUsername);
			}
			else
			{
				LowerBidRpcServerRpc(playerUsername);
			}
		}

		[ClientRpc]
		private void LowerBidRpcClientRpc(string playerUsername)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 2 && (networkManager.IsServer || networkManager.IsHost))
			{
				ClientRpcParams val = default(ClientRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendClientRpc(3998870354u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((NetworkBehaviour)this).__endSendClientRpc(ref val2, 3998870354u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 2 && (networkManager.IsClient || networkManager.IsHost))
			{
				LethalSlotsPluginBase.Instance.LogDebug("LowerBidRpc called by " + playerUsername);
				if (_currentBidIndex > 0)
				{
					_currentBidIndex--;
					UpdateCreditsText();
				}
				LethalSlotsPluginBase.Instance.LogDebug($"Bid lowered to: {_bids[_currentBidIndex]}");
			}
		}

		[ServerRpc(RequireOwnership = false)]
		private void LowerBidRpcServerRpc(string playerUsername)
		{
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d4: Invalid comparison between Unknown and I4
			//IL_005f: 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_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_008e: 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)
			NetworkManager networkManager = ((NetworkBehaviour)this).NetworkManager;
			if (networkManager == null || !networkManager.IsListening)
			{
				return;
			}
			if ((int)base.__rpc_exec_stage != 1 && (networkManager.IsClient || networkManager.IsHost))
			{
				ServerRpcParams val = default(ServerRpcParams);
				FastBufferWriter val2 = ((NetworkBehaviour)this).__beginSendServerRpc(482982740u, val, (RpcDelivery)0);
				bool flag = playerUsername != null;
				((FastBufferWriter)(ref val2)).WriteValueSafe<bool>(ref flag, default(ForPrimitives));
				if (flag)
				{
					((FastBufferWriter)(ref val2)).WriteValueSafe(playerUsername, false);
				}
				((NetworkBehaviour)this).__endSendServerRpc(ref val2, 482982740u, val, (RpcDelivery)0);
			}
			if ((int)base.__rpc_exec_stage == 1 && (networkManager.IsServer || networkManager.IsHost))
			{
				LowerBidRpcClientRpc(playerUsername);
			}
		}

		private void UpdateCreditsText()
		{
			((TMP_Text)_creditsTextMesh).text = $"Credits: {_terminal.groupCredits} Bid: {_bids[_currentBidIndex]}";
		}

		protected override void __initializeVariables()
		{
			((NetworkBehaviour)this).__initializeVariables();
		}

		[RuntimeInitializeOnLoadMethod]
		internal static void InitializeRPCS_SlotMachineNetworkHandler()
		{
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0087: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			//IL_00b3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bd: Expected O, but got Unknown
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Expected O, but got Unknown
			NetworkManager.__rpc_func_table.Add(4088973756u, new RpcReceiveHandler(__rpc_handler_4088973756));
			NetworkManager.__rpc_func_table.Add(2387126756u, new RpcReceiveHandler(__rpc_handler_2387126756));
			NetworkManager.__rpc_func_table.Add(3141908120u, new RpcReceiveHandler(__rpc_handler_3141908120));
			NetworkManager.__rpc_func_table.Add(2892188890u, new RpcReceiveHandler(__rpc_handler_2892188890));
			NetworkManager.__rpc_func_table.Add(1098736734u, new RpcReceiveHandler(__rpc_handler_1098736734));
			NetworkManager.__rpc_func_table.Add(751434624u, new RpcReceiveHandler(__rpc_handler_751434624));
			NetworkManager.__rpc_func_table.Add(3998870354u, new RpcReceiveHandler(__rpc_handler_3998870354));
			NetworkManager.__rpc_func_table.Add(482982740u, new RpcReceiveHandler(__rpc_handler_482982740));
		}

		private static void __rpc_handler_4088973756(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: 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_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0093: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00af: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				int groupCredits = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref groupCredits);
				NetworkObjectReference slotMachineNetworkObjectReference = default(NetworkObjectReference);
				((FastBufferReader)(ref reader)).ReadValueSafe<NetworkObjectReference>(ref slotMachineNetworkObjectReference, default(ForNetworkSerializable));
				bool isSlotMachinePlayScriptInteractTriggerInteractable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isSlotMachinePlayScriptInteractTriggerInteractable, default(ForPrimitives));
				bool isSlotMachineRaiseBidScriptInteractTriggerInteractable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isSlotMachineRaiseBidScriptInteractTriggerInteractable, default(ForPrimitives));
				bool isSlotMachineLowerBidScriptInteractTriggerInteractable = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref isSlotMachineLowerBidScriptInteractTriggerInteractable, default(ForPrimitives));
				int bidIndex = default(int);
				ByteUnpacker.ReadValueBitPacked(reader, ref bidIndex);
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SlotMachineNetworkHandler)(object)target).SyncDataClientRpc(groupCredits, slotMachineNetworkObjectReference, isSlotMachinePlayScriptInteractTriggerInteractable, isSlotMachineRaiseBidScriptInteractTriggerInteractable, isSlotMachineLowerBidScriptInteractTriggerInteractable, bidIndex);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2387126756(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_0029: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SlotMachineNetworkHandler)(object)target).SyncDataServerRpc();
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3141908120(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_006d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Unknown result type (might be due to invalid IL or missing references)
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_009d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0109: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0124: Unknown result type (might be due to invalid IL or missing references)
			//IL_012a: Unknown result type (might be due to invalid IL or missing references)
			//IL_013f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0145: Unknown result type (might be due to invalid IL or missing references)
			//IL_015a: 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_0175: Unknown result type (might be due to invalid IL or missing references)
			//IL_017b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0190: Unknown result type (might be due to invalid IL or missing references)
			//IL_0196: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c6: Unknown result type (might be due to invalid IL or missing references)
			//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e1: 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_01fc: Unknown result type (might be due to invalid IL or missing references)
			//IL_0202: Unknown result type (might be due to invalid IL or missing references)
			//IL_0217: 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_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_024d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0253: 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_02c8: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				WinMultipliers winMultiplier = default(WinMultipliers);
				((FastBufferReader)(ref reader)).ReadValueSafe<WinMultipliers>(ref winMultiplier, default(ForEnums));
				float reel1Magic7BallPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1Magic7BallPosition, default(ForPrimitives));
				float reel1CashRegisterPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1CashRegisterPosition, default(ForPrimitives));
				float reel1BellPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1BellPosition, default(ForPrimitives));
				float reel1GiftBoxPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1GiftBoxPosition, default(ForPrimitives));
				float reel1ClownHornPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1ClownHornPosition, default(ForPrimitives));
				float reel1ComedyMaskPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel1ComedyMaskPosition, default(ForPrimitives));
				float reel2Magic7BallPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2Magic7BallPosition, default(ForPrimitives));
				float reel2CashRegisterPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2CashRegisterPosition, default(ForPrimitives));
				float reel2BellPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2BellPosition, default(ForPrimitives));
				float reel2GiftBoxPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2GiftBoxPosition, default(ForPrimitives));
				float reel2ClownHornPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2ClownHornPosition, default(ForPrimitives));
				float reel2ComedyMaskPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel2ComedyMaskPosition, default(ForPrimitives));
				float reel3Magic7BallPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3Magic7BallPosition, default(ForPrimitives));
				float reel3CashRegisterPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3CashRegisterPosition, default(ForPrimitives));
				float reel3BellPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3BellPosition, default(ForPrimitives));
				float reel3GiftBoxPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3GiftBoxPosition, default(ForPrimitives));
				float reel3ClownHornPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3ClownHornPosition, default(ForPrimitives));
				float reel3ComedyMaskPosition = default(float);
				((FastBufferReader)(ref reader)).ReadValueSafe<float>(ref reel3ComedyMaskPosition, default(ForPrimitives));
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SlotMachineNetworkHandler)(object)target).PlayClientRpc(playerUsername, winMultiplier, reel1Magic7BallPosition, reel1CashRegisterPosition, reel1BellPosition, reel1GiftBoxPosition, reel1ClownHornPosition, reel1ComedyMaskPosition, reel2Magic7BallPosition, reel2CashRegisterPosition, reel2BellPosition, reel2GiftBoxPosition, reel2ClownHornPosition, reel2ComedyMaskPosition, reel3Magic7BallPosition, reel3CashRegisterPosition, reel3BellPosition, reel3GiftBoxPosition, reel3ClownHornPosition, reel3ComedyMaskPosition);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_2892188890(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SlotMachineNetworkHandler)(object)target).PlayServerRpc(playerUsername);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_1098736734(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SlotMachineNetworkHandler)(object)target).RaiseBidRpcClientRpc(playerUsername);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_751434624(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SlotMachineNetworkHandler)(object)target).RaiseBidRpcServerRpc(playerUsername);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_3998870354(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)2;
				((SlotMachineNetworkHandler)(object)target).LowerBidRpcClientRpc(playerUsername);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		private static void __rpc_handler_482982740(NetworkBehaviour target, FastBufferReader reader, __RpcParams rpcParams)
		{
			//IL_002f: 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_0061: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			NetworkManager networkManager = target.NetworkManager;
			if (networkManager != null && networkManager.IsListening)
			{
				bool flag = default(bool);
				((FastBufferReader)(ref reader)).ReadValueSafe<bool>(ref flag, default(ForPrimitives));
				string playerUsername = null;
				if (flag)
				{
					((FastBufferReader)(ref reader)).ReadValueSafe(ref playerUsername, false);
				}
				target.__rpc_exec_stage = (__RpcExecStage)1;
				((SlotMachineNetworkHandler)(object)target).LowerBidRpcServerRpc(playerUsername);
				target.__rpc_exec_stage = (__RpcExecStage)0;
			}
		}

		protected internal override string __getTypeName()
		{
			return "SlotMachineNetworkHandler";
		}
	}
}
namespace Nukka.Core
{
	internal class AssetsManager
	{
		internal Dictionary<string, GameObject> networkPrefabs = new Dictionary<string, GameObject>();

		internal UnlockablesList unlockablesList = new UnlockablesList();

		private readonly string _assetPath;

		private bool _assetsLoaded;

		private static readonly Lazy<AssetsManager> lazy = new Lazy<AssetsManager>(() => new AssetsManager());

		public static AssetsManager Instance => lazy.Value;

		private AssetsManager()
		{
			//IL_000c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0016: Expected O, but got Unknown
			_assetPath = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "partyrockers.lethalslots.prefabs");
		}

		internal void Initialise()
		{
			if (!_assetsLoaded)
			{
				LoadAssets();
			}
		}

		private void LoadAssets()
		{
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0117: Expected O, but got Unknown
			try
			{
				AssetBundle val = AssetBundle.LoadFromFile(_assetPath);
				GameObject val2 = val.LoadAsset<GameObject>("assets/prefabs/spawn_network_handler.prefab");
				val2.AddComponent<SlotMachineNetworkHandler>();
				networkPrefabs.Add("spawn_network_handler", val2);
				unlockablesList = val.LoadAsset<UnlockablesList>("assets/prefabs/unlockables_list.asset");
				Transform child = unlockablesList.unlockables[0].prefabObject.transform.GetChild(3);
				((Component)child).gameObject.AddComponent<SlotMachinePlayInteractionScript>();
				Transform child2 = unlockablesList.unlockables[0].prefabObject.transform.GetChild(4);
				((Component)child2).gameObject.AddComponent<SlotMachineLowerBidInteractionScript>();
				Transform child3 = unlockablesList.unlockables[0].prefabObject.transform.GetChild(5);
				((Component)child3).gameObject.AddComponent<SlotMachineRaiseBidInteractionScript>();
				Transform child4 = unlockablesList.unlockables[0].prefabObject.transform.GetChild(7);
				SlotMachineScript slotMachineScript = null;
				List<SlotMachineReelScript> list = new List<SlotMachineReelScript>();
				foreach (Transform item2 in child4)
				{
					Transform val3 = item2;
					if (((Object)val3).name.Contains("reel"))
					{
						SlotMachineReelScript item = ((Component)val3).gameObject.AddComponent<SlotMachineReelScript>();
						list.Add(item);
					}
					if (((Object)val3).name.Contains("slot_script"))
					{
						slotMachineScript = ((Component)val3).gameObject.AddComponent<SlotMachineScript>();
					}
				}
				foreach (SlotMachineReelScript item3 in list)
				{
					slotMachineScript?.slotMachineReelScripts.Add(item3);
				}
				unlockablesList.unlockables[0].prefabObject.AddComponent<AutoParentToHangarShip>();
				networkPrefabs.Add("slot_machine", unlockablesList.unlockables[0].prefabObject);
				_assetsLoaded = true;
				LethalSlotsPluginBase.Instance.LogInfo("Assets loaded successfully.");
				val.Unload(false);
			}
			catch (Exception ex)
			{
				LethalSlotsPluginBase.Instance.LogError("Error occured: " + ex.Message);
			}
		}
	}
	internal class AutoParentToHangarShip : MonoBehaviour
	{
		private void Awake()
		{
			SetParent();
		}

		private void SetParent()
		{
			if (!((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().IsHost && !((Component)GameNetworkManager.Instance).GetComponent<NetworkManager>().IsServer)
			{
				GameObject val = GameObject.Find("HangarShip");
				if ((Object)(object)val != (Object)null)
				{
					((Component)this).transform.SetParent(val.transform);
				}
			}
		}
	}
	internal class SlotMachineLowerBidInteractionScript : MonoBehaviour
	{
		private void Awake()
		{
			InitTrigger();
		}

		private void InitTrigger()
		{
			InteractTrigger component = ((Component)this).gameObject.GetComponent<InteractTrigger>();
			((UnityEvent<PlayerControllerB>)(object)component.onInteract).AddListener((UnityAction<PlayerControllerB>)OnInteract);
		}

		private void OnInteract(PlayerControllerB playerControllerB)
		{
			SlotMachineNetworkHandler.Instance.LowerBidRpc(playerControllerB.playerUsername);
		}
	}
	internal class SlotMachinePlayInteractionScript : MonoBehaviour
	{
		private void Awake()
		{
			InitTrigger();
		}

		private void InitTrigger()
		{
			InteractTrigger component = ((Component)this).gameObject.GetComponent<InteractTrigger>();
			((UnityEvent<PlayerControllerB>)(object)component.onInteract).AddListener((UnityAction<PlayerControllerB>)OnInteract);
		}

		private void OnInteract(PlayerControllerB playerControllerB)
		{
			SlotMachineNetworkHandler.Instance.PlayRpc(playerControllerB.playerUsername);
		}
	}
	internal class SlotMachineRaiseBidInteractionScript : MonoBehaviour
	{
		private void Awake()
		{
			InitTrigger();
		}

		private void InitTrigger()
		{
			InteractTrigger component = ((Component)this).gameObject.GetComponent<InteractTrigger>();
			((UnityEvent<PlayerControllerB>)(object)component.onInteract).AddListener((UnityAction<PlayerControllerB>)OnInteract);
		}

		private void OnInteract(PlayerControllerB playerControllerB)
		{
			SlotMachineNetworkHandler.Instance.RaiseBidRpc(playerControllerB.playerUsername);
		}
	}
	internal class SlotMachineReelScript : MonoBehaviour
	{
		private bool _isSpinning;

		private float _speed = 2f;

		private AudioSource _reelAudioSource;

		private void Awake()
		{
			_reelAudioSource = ((Component)this).gameObject.GetComponent<AudioSource>();
		}

		private void Update()
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002d: Expected O, but got Unknown
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: 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_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: 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)
			if (!_isSpinning)
			{
				return;
			}
			foreach (Transform item in ((Component)this).transform)
			{
				Transform val = item;
				float num = -1f * Time.smoothDeltaTime * _speed;
				((Component)val).transform.localPosition = new Vector3(((Component)val).transform.localPosition.x, ((Component)val).transform.localPosition.y + num, ((Component)val).transform.localPosition.z);
				if (((Component)val).transform.localPosition.y <= -0.36f)
				{
					((Component)val).transform.localPosition = new Vector3(((Component)val).transform.localPosition.x, ((Component)val).transform.localPosition.y + 0.7f, ((Component)val).transform.localPosition.z);
				}
			}
		}

		public void IsReelSpinning(bool isSpinning)
		{
			_isSpinning = isSpinning;
			if (!_isSpinning)
			{
				_reelAudioSource.Play();
			}
		}

		public void SetReelPositions(Dictionary<string, float> reelPositions)
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			//IL_0029: 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_0064: Unknown result type (might be due to invalid IL or missing references)
			foreach (Transform item in ((Component)this).transform)
			{
				Transform val = item;
				((Component)val).transform.localPosition = new Vector3(((Component)val).transform.localPosition.x, reelPositions[((Object)((Component)this).gameObject).name + "_" + ((Object)val).name], ((Component)val).transform.localPosition.z);
			}
		}
	}
	internal class SlotMachineScript : MonoBehaviour
	{
		public List<SlotMachineReelScript> slotMachineReelScripts = new List<SlotMachineReelScript>();

		internal IEnumerator PlaySlots(Dictionary<string, float> reelPositions)
		{
			foreach (SlotMachineReelScript slotMachineReelScript in slotMachineReelScripts)
			{
				slotMachineReelScript.IsReelSpinning(isSpinning: true);
			}
			for (int i = 0; i < slotMachineReelScripts.Count; i++)
			{
				yield return (object)new WaitForSeconds(1f);
				slotMachineReelScripts[i].IsReelSpinning(isSpinning: false);
				slotMachineReelScripts[i].SetReelPositions(reelPositions);
			}
		}
	}
}