Decompiled source of UpdatedRoundsWithFriends v1.0.0

plugins\UpdatedRoundsWithFriends.dll

Decompiled 8 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.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Serialization.Formatters.Binary;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using ExitGames.Client.Photon;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using Landfall.Network;
using On;
using Photon.Pun;
using Photon.Pun.UtilityScripts;
using Photon.Realtime;
using RWF.Algorithms;
using RWF.GameModes;
using RWF.Patches;
using RWF.UI;
using Sonigon;
using Sonigon.Internal;
using SoundImplementation;
using Steamworks;
using TMPro;
using UnboundLib;
using UnboundLib.Extensions;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Localization;
using UnityEngine.Localization.Tables;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using UnityEngine.UI.ProceduralImage;
using UnityEngine.Video;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyFileVersion("1.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.6.2", FrameworkDisplayName = ".NET Framework 4.6.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace MapEditor.Patches
{
	[HarmonyPatch(typeof(ListMenu), "SelectButton")]
	public class ListMenu_Patch_SelectButton
	{
		private static void Prefix(ListMenuButton buttonToSelect)
		{
			//IL_0086: 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_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: 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)
			if ((Object)(object)buttonToSelect != (Object)null && ((Object)((Component)buttonToSelect).gameObject).name.Contains("(short)"))
			{
				ListMenu.instance.bar.transform.localScale = new Vector3(((Component)buttonToSelect).GetComponent<RectTransform>().sizeDelta.x, ListMenu.instance.bar.transform.localScale.y);
			}
			else
			{
				ListMenu.instance.bar.transform.localScale = new Vector3(4000f, ListMenu.instance.bar.transform.localScale.y);
			}
		}
	}
}
namespace RWF
{
	internal class WindowGUIBuilder
	{
		private float x;

		private float y;

		private Rect elementRect;

		private float rowHeight;

		private float rowY;

		public WindowGUIBuilder()
		{
			x = 0f;
			y = GUI.skin.window.border.top;
		}

		public void NextRow(float height, float verticalPadding = 0f)
		{
			NextRow(height, verticalPadding, verticalPadding);
		}

		public void NextRow(float height, float verticalPaddingTop, float verticalPaddingBottom)
		{
			x = 0f;
			y += verticalPaddingTop;
			rowY = y;
			rowHeight = height - verticalPaddingTop - verticalPaddingBottom;
			y += rowHeight - verticalPaddingTop;
		}

		public WindowGUIBuilder NextElement(float width, float horizontalPadding = 0f)
		{
			return NextElement(width, horizontalPadding, horizontalPadding);
		}

		public WindowGUIBuilder NextElement(float width, float horizontalPaddingLeft, float horizontalPaddingRight)
		{
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			x += horizontalPaddingLeft;
			elementRect = new Rect(x, rowY, width - horizontalPaddingLeft - horizontalPaddingRight, rowHeight);
			x += width - horizontalPaddingLeft;
			return this;
		}

		public void Label(string text, TextAnchor alignment = 3)
		{
			//IL_000a: 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)
			GUI.skin.label.alignment = alignment;
			GUI.Label(new Rect(((Rect)(ref elementRect)).x, rowY, ((Rect)(ref elementRect)).width, ((Rect)(ref elementRect)).height), text);
		}

		public float HorizontalSlider(float value, float min, float max)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			GUILayout.BeginArea(elementRect);
			GUILayout.BeginVertical(Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			float result = GUILayout.HorizontalSlider(value, min, max, Array.Empty<GUILayoutOption>());
			GUILayout.FlexibleSpace();
			GUILayout.EndVertical();
			GUILayout.EndArea();
			return result;
		}

		public bool Button(string text)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			return GUI.Button(elementRect, text);
		}
	}
	public class DebugWindow : MonoBehaviour
	{
		private Rect windowRect = new Rect(10f, 10f, 260f, 160f);

		public void OnGUI()
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Expected O, but got Unknown
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Expected O, but got Unknown
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Expected O, but got Unknown
			//IL_0049: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			GUI.skin.label.margin = new RectOffset(0, 0, 0, 0);
			GUI.skin.label.padding = new RectOffset(0, 0, 0, 0);
			windowRect = GUI.Window(0, windowRect, new WindowFunction(WindowFunction), "RWF Debug");
		}

		public void WindowFunction(int windowID)
		{
			//IL_0283: Unknown result type (might be due to invalid IL or missing references)
			WindowGUIBuilder windowGUIBuilder = new WindowGUIBuilder();
			windowGUIBuilder.NextRow(35f, 10f, 0f);
			windowGUIBuilder.NextElement(70f, 10f, 0f).Label("points", (TextAnchor)3);
			float num = windowGUIBuilder.NextElement(150f, 10f).HorizontalSlider(RWFMod.instance.debugOptions.points, 1f, 5f);
			windowGUIBuilder.NextElement(40f, 10f, 12f).Label($"{RWFMod.instance.debugOptions.points}", (TextAnchor)5);
			windowGUIBuilder.NextRow(35f, 10f, 0f);
			windowGUIBuilder.NextElement(70f, 10f, 0f).Label("rounds", (TextAnchor)3);
			float num2 = windowGUIBuilder.NextElement(150f, 10f).HorizontalSlider(RWFMod.instance.debugOptions.rounds, 1f, 5f);
			windowGUIBuilder.NextElement(40f, 10f, 12f).Label($"{RWFMod.instance.debugOptions.rounds}", (TextAnchor)5);
			windowGUIBuilder.NextRow(60f, 20f, 10f);
			bool flag = windowGUIBuilder.NextElement(260f, 10f).Button("Lag Tester");
			windowGUIBuilder.NextRow(60f, 20f, 10f);
			if (windowGUIBuilder.NextElement(260f, 10f).Button("Show Spawn Mesh"))
			{
				RWFMod.instance.debugOptions.showSpawns = !RWFMod.instance.debugOptions.showSpawns;
			}
			if (flag)
			{
				PhotonLagSimulationGui component = ((Component)RWFMod.instance).gameObject.GetComponent<PhotonLagSimulationGui>();
				((Behaviour)component).enabled = !((Behaviour)component).enabled;
			}
			if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient || PhotonNetwork.CurrentRoom == null)
			{
				if (Mathf.RoundToInt(num) != RWFMod.instance.debugOptions.points)
				{
					RWFMod.instance.debugOptions.points = Mathf.RoundToInt(num);
					RWFMod.instance.SyncDebugOptions();
				}
				if (Mathf.RoundToInt(num2) != RWFMod.instance.debugOptions.rounds)
				{
					RWFMod.instance.debugOptions.rounds = Mathf.RoundToInt(num2);
					RWFMod.instance.SyncDebugOptions();
				}
			}
			GUI.DragWindow(new Rect(0f, 0f, ((Rect)(ref windowRect)).width, ((Rect)(ref windowRect)).height));
		}
	}
	internal static class CameraExtensions
	{
		private static float correction => (float)(Screen.width - FixedScreen.fixedWidth) / 2f;

		internal static Vector3 FixedWorldToScreenPoint(this Camera camera, Vector3 worldPoint)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0023: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: 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_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0011: Unknown result type (might be due to invalid IL or missing references)
			Vector3 val = camera.WorldToScreenPoint(worldPoint);
			if (!FixedScreen.isUltraWide)
			{
				return camera.WorldToScreenPoint(worldPoint);
			}
			return new Vector3(val.x - correction, val.y, val.z);
		}

		internal static Vector3 FixedScreenToWorldPoint(this Camera camera, Vector3 fixedScreenPoint)
		{
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: 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)
			if (!FixedScreen.isUltraWide)
			{
				return camera.ScreenToWorldPoint(fixedScreenPoint);
			}
			return new Vector3(fixedScreenPoint.x + correction, fixedScreenPoint.y, fixedScreenPoint.z);
		}
	}
	internal static class FixedScreen
	{
		private const float ratio = 1.7777778f;

		private const float eps = 0.1f;

		internal static bool isUltraWide => (float)Screen.width / (float)Screen.height - 1.7777778f >= 0.1f;

		internal static int fixedWidth
		{
			get
			{
				if (!isUltraWide)
				{
					return Screen.width;
				}
				return Mathf.RoundToInt((float)Screen.height * 1.7777778f);
			}
		}
	}
	public static class CardBarHandlerExtensions
	{
		public static void Rebuild(this CardBarHandler instance)
		{
			//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_012e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: 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)
			while (((Component)instance).transform.childCount > 3)
			{
				Object.DestroyImmediate((Object)(object)((Component)((Component)instance).transform.GetChild(3)).gameObject);
			}
			int count = PlayerManager.instance.players.Count;
			GameObject gameObject = ((Component)((Component)instance).transform.GetChild(0)).gameObject;
			int num = -50;
			List<CardBar> list = new List<CardBar>();
			int i;
			for (i = 0; i < count; i++)
			{
				GameObject val = Object.Instantiate<GameObject>(gameObject, ((Component)instance).transform);
				val.SetActive(true);
				((Object)val).name = "Bar" + (i + 1);
				val.transform.localScale = Vector3.one;
				val.transform.localPosition = gameObject.transform.localPosition + new Vector3(0f, (float)(num * i), 0f);
				Color backgroundColor = PlayerSkinBank.GetPlayerSkinColors(PlayerExtensions.colorID(PlayerManager.instance.players.Find((Player p) => p.PlayerID == i))).backgroundColor;
				((Graphic)((Component)val.transform.GetChild(0).GetChild(0)).gameObject.GetComponent<ProceduralImage>()).color = new Color(backgroundColor.r, backgroundColor.g, backgroundColor.b, 0.9f);
				list.Add(val.GetComponent<CardBar>());
			}
			gameObject.SetActive(false);
			((Component)((Component)instance).transform.GetChild(1)).gameObject.SetActive(false);
			ExtensionMethods.SetFieldValue((object)instance, "cardBars", (object)list.ToArray());
		}
	}
	public class CharacterCreatorAdditionalData
	{
		public List<GameObject> objectsToEnable;
	}
	public static class CharacterCreatorExtensions
	{
		private static readonly ConditionalWeakTable<CharacterCreator, CharacterCreatorAdditionalData> additionalData = new ConditionalWeakTable<CharacterCreator, CharacterCreatorAdditionalData>();

		public static CharacterCreatorAdditionalData GetData(this CharacterCreator instance)
		{
			return additionalData.GetOrCreateValue(instance);
		}

		public static void SetObjectsToEnable(this CharacterCreator instance, List<GameObject> objects)
		{
			instance.GetData().objectsToEnable = objects;
		}

		public static List<GameObject> GetObjectsToEnable(this CharacterCreator instance)
		{
			return instance.GetData().objectsToEnable ?? new List<GameObject>();
		}
	}
	public static class CodeInstructionExtensions
	{
		public static bool GetsProperty(this CodeInstruction code, PropertyInfo property)
		{
			if ((object)property == null)
			{
				throw new ArgumentNullException("property");
			}
			return CodeInstructionExtensions.Calls(code, property.GetMethod);
		}

		public static bool SetsProperty(this CodeInstruction code, PropertyInfo property)
		{
			if ((object)property == null)
			{
				throw new ArgumentNullException("property");
			}
			return CodeInstructionExtensions.Calls(code, property.SetMethod);
		}
	}
	public static class Collider2DExtensions
	{
		internal static List<Vector2> GetVertices(this Collider2D collider, float offset = 0f)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
			//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
			//IL_0205: Unknown result type (might be due to invalid IL or missing references)
			//IL_020a: 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_0220: 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_0228: Unknown result type (might be due to invalid IL or missing references)
			//IL_023f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0244: Unknown result type (might be due to invalid IL or missing references)
			//IL_0247: Unknown result type (might be due to invalid IL or missing references)
			//IL_0258: 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_026e: 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_0288: Unknown result type (might be due to invalid IL or missing references)
			//IL_028d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0290: 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_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_007e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: Unknown result type (might be due to invalid IL or missing references)
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			//IL_009b: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: 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_00b0: 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_00c6: 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_00e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: 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_00f3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: 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_0132: Unknown result type (might be due to invalid IL or missing references)
			//IL_0137: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0141: 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_0158: Unknown result type (might be due to invalid IL or missing references)
			//IL_016e: 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_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			//IL_0186: Unknown result type (might be due to invalid IL or missing references)
			//IL_018b: Unknown result type (might be due to invalid IL or missing references)
			//IL_019e: Unknown result type (might be due to invalid IL or missing references)
			//IL_01a3: Unknown result type (might be due to invalid IL or missing references)
			if (collider is PolygonCollider2D)
			{
				return ((PolygonCollider2D)collider).points.Select((Vector2 p) => Vector2.op_Implicit(((Component)collider).transform.TransformPoint(Vector2.op_Implicit(p)))).Select(delegate(Vector2 p)
				{
					//IL_0000: Unknown result type (might be due to invalid IL or missing references)
					//IL_0001: Unknown result type (might be due to invalid IL or missing references)
					//IL_0008: Unknown result type (might be due to invalid IL or missing references)
					//IL_000d: Unknown result type (might be due to invalid IL or missing references)
					//IL_0010: Unknown result type (might be due to invalid IL or missing references)
					//IL_0015: Unknown result type (might be due to invalid IL or missing references)
					//IL_001a: Unknown result type (might be due to invalid IL or missing references)
					//IL_001f: Unknown result type (might be due to invalid IL or missing references)
					//IL_0022: 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_0032: Unknown result type (might be due to invalid IL or missing references)
					Bounds bounds2 = collider.bounds;
					Vector2 val2 = p - Vector2.op_Implicit(((Bounds)(ref bounds2)).center);
					return p + ((Vector2)(ref val2)).normalized * offset;
				}).ToList();
			}
			if (collider is BoxCollider2D)
			{
				Vector2 val = ((BoxCollider2D)collider).size * 0.5f;
				return new List<Vector2>
				{
					Vector2.op_Implicit(((Component)collider).transform.TransformPoint(Vector2.op_Implicit(new Vector2(val.x, val.y)))) + new Vector2(offset, offset),
					Vector2.op_Implicit(((Component)collider).transform.TransformPoint(Vector2.op_Implicit(new Vector2(val.x, 0f - val.y)))) + new Vector2(offset, 0f - offset),
					Vector2.op_Implicit(((Component)collider).transform.TransformPoint(Vector2.op_Implicit(new Vector2(0f - val.x, val.y)))) + new Vector2(0f - offset, offset),
					Vector2.op_Implicit(((Component)collider).transform.TransformPoint(Vector2.op_Implicit(new Vector2(0f - val.x, 0f - val.y)))) + new Vector2(0f - offset, 0f - offset)
				};
			}
			List<Vector2> list = new List<Vector2>();
			Bounds bounds = collider.bounds;
			list.Add(Vector2.op_Implicit(((Bounds)(ref bounds)).min) - offset * Vector2.one);
			bounds = collider.bounds;
			list.Add(Vector2.op_Implicit(((Bounds)(ref bounds)).max) + offset * Vector2.one);
			bounds = collider.bounds;
			float num = ((Bounds)(ref bounds)).min.x - offset;
			bounds = collider.bounds;
			list.Add(new Vector2(num, ((Bounds)(ref bounds)).max.y + offset));
			bounds = collider.bounds;
			float num2 = ((Bounds)(ref bounds)).max.x + offset;
			bounds = collider.bounds;
			list.Add(new Vector2(num2, ((Bounds)(ref bounds)).min.y - offset));
			return list;
		}
	}
	public static class ArmsRaceExtensions
	{
		public static void SetPlayersNeededToStart(this GM_ArmsRace instance, int num)
		{
			ExtensionMethods.SetFieldValue((object)instance, "playersNeededToStart", (object)num);
		}

		public static int GetPlayersNeededToStart(this GM_ArmsRace instance)
		{
			return (int)ExtensionMethods.GetFieldValue((object)instance, "playersNeededToStart");
		}
	}
	public static class ObjectExtensions
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0
		{
			public string methodName;

			public int[] actors;

			internal bool <SyncMethodCoroutine>b__1(Tuple<int, string> r)
			{
				return r.Item2 == methodName;
			}

			internal bool <SyncMethodCoroutine>b__2(Tuple<int, string> r)
			{
				return actors.Contains(r.Item1);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass7_0
		{
			public string handlerID;

			public Action action;
		}

		[CompilerGenerated]
		private sealed class <SyncMethodCoroutine>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public string methodName;

			public int[] actors;

			public MonoBehaviour instance;

			public object[] data;

			private <>c__DisplayClass3_0 <>8__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <SyncMethodCoroutine>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass3_0();
					<>8__1.methodName = methodName;
					<>8__1.actors = actors;
					if (PhotonNetwork.OfflineMode || PhotonNetwork.CurrentRoom == null)
					{
						NetworkingManager.RPC(((object)instance).GetType(), <>8__1.methodName, data);
						return false;
					}
					if (<>8__1.actors == null)
					{
						<>8__1.actors = (from p in PhotonNetwork.CurrentRoom.Players.Values.ToList()
							select p.ActorNumber).ToArray();
					}
					int[] array = <>8__1.actors;
					foreach (int item in array)
					{
						instance.GetPendingRequests().Add(new Tuple<int, string>(item, <>8__1.methodName));
					}
					NetworkingManager.RPC(((object)instance).GetType(), <>8__1.methodName, data);
					break;
				}
				case 1:
					<>1__state = -1;
					break;
				}
				if ((from r in instance.GetPendingRequests()
					where r.Item2 == <>8__1.methodName
					select r).Any((Tuple<int, string> r) => <>8__1.actors.Contains(r.Item1)))
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static readonly ConditionalWeakTable<MonoBehaviour, HashSet<Tuple<int, string>>> pendingRequests = new ConditionalWeakTable<MonoBehaviour, HashSet<Tuple<int, string>>>();

		public static Coroutine SyncMethod(this MonoBehaviour instance, string methodName, int[] actors, params object[] data)
		{
			return instance.StartCoroutine(instance.SyncMethodCoroutine(methodName, actors, data));
		}

		public static Coroutine SyncMethod(this MonoBehaviour instance, string methodName, int actor, params object[] data)
		{
			return instance.SyncMethod(methodName, new int[1] { actor }, data);
		}

		[IteratorStateMachine(typeof(<SyncMethodCoroutine>d__3))]
		private static IEnumerator SyncMethodCoroutine(this MonoBehaviour instance, string methodName, int[] actors, params object[] data)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SyncMethodCoroutine>d__3(0)
			{
				instance = instance,
				methodName = methodName,
				actors = actors,
				data = data
			};
		}

		public static HashSet<Tuple<int, string>> GetPendingRequests(this MonoBehaviour instance)
		{
			return pendingRequests.GetOrCreateValue(instance);
		}

		public static void ClearPendingRequests(this MonoBehaviour instance, int actor)
		{
			HashSet<Tuple<int, string>> orCreateValue = pendingRequests.GetOrCreateValue(instance);
			foreach (Tuple<int, string> item in from t in orCreateValue.ToList()
				where t.Item1 == actor
				select t)
			{
				orCreateValue.Remove(new Tuple<int, string>(actor, item.Item2));
			}
		}

		public static void RemovePendingRequest(this MonoBehaviour instance, int actor, string methodName)
		{
			pendingRequests.GetOrCreateValue(instance).Remove(new Tuple<int, string>(actor, methodName));
		}

		public static void ExecuteAfterGameModeInitialized(this MonoBehaviour instance, string handlerID, Action action)
		{
			<>c__DisplayClass7_0 CS$<>8__locals0 = new <>c__DisplayClass7_0();
			CS$<>8__locals0.handlerID = handlerID;
			CS$<>8__locals0.action = action;
			instance.StartCoroutine(ExecuteAfter());
			[IteratorStateMachine(typeof(<>c__DisplayClass7_0.<<ExecuteAfterGameModeInitialized>g__ExecuteAfter|0>d))]
			IEnumerator ExecuteAfter()
			{
				//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
				return new <>c__DisplayClass7_0.<<ExecuteAfterGameModeInitialized>g__ExecuteAfter|0>d(0)
				{
					<>4__this = CS$<>8__locals0
				};
			}
		}
	}
	public static class NetworkConnectionHandlerExtensions
	{
		public static void SetSearchingQuickMatch(this NetworkConnectionHandler instance, bool value)
		{
			ExtensionMethods.SetFieldValue((object)instance, "m_SearchingQuickMatch", (object)value);
		}

		public static bool IsSearchingQuickMatch(this NetworkConnectionHandler instance)
		{
			return (bool)ExtensionMethods.GetFieldValue((object)instance, "m_SearchingQuickMatch");
		}

		public static void SetSearchingTwitch(this NetworkConnectionHandler instance, bool value)
		{
			ExtensionMethods.SetFieldValue((object)instance, "m_SearchingTwitch", (object)value);
		}

		public static bool IsSearchingTwitch(this NetworkConnectionHandler instance)
		{
			return (bool)ExtensionMethods.GetFieldValue((object)instance, "m_SearchingTwitch");
		}

		public static void SetForceRegion(this NetworkConnectionHandler instance, bool value)
		{
			ExtensionMethods.SetFieldValue((object)instance, "m_ForceRegion", (object)value);
		}

		public static void HostPrivate(this NetworkConnectionHandler instance)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			instance.SetSearchingQuickMatch(value: false);
			instance.SetSearchingTwitch(value: false);
			TimeHandler.instance.gameStartTime = 1f;
			RoomOptions options = new RoomOptions();
			options.MaxPlayers = (byte)RWFMod.instance.MaxPlayers;
			options.IsOpen = true;
			options.IsVisible = false;
			Action action = delegate
			{
				ExtensionMethods.InvokeMethod((object)instance, "CreateRoom", new object[1] { options });
			};
			((MonoBehaviour)instance).StartCoroutine((IEnumerator)ExtensionMethods.InvokeMethod((object)instance, "DoActionWhenConnected", new object[1] { action }));
		}
	}
	public static class PhotonPlayerExtensions
	{
		private static readonly string charkey = RWFMod.GetCustomPropertyKey("characters");

		public static void SetProperty(this Player instance, string key, object value)
		{
			string customPropertyKey = RWFMod.GetCustomPropertyKey(key);
			Hashtable customProperties = instance.CustomProperties;
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)customPropertyKey))
			{
				((Dictionary<object, object>)(object)customProperties).Add((object)customPropertyKey, value);
			}
			else
			{
				customProperties[(object)customPropertyKey] = value;
			}
			instance.SetCustomProperties(customProperties, (Hashtable)null, (WebFlags)null);
		}

		public static T GetProperty<T>(this Player instance, string key)
		{
			string customPropertyKey = RWFMod.GetCustomPropertyKey(key);
			Hashtable customProperties = instance.CustomProperties;
			if (!((Dictionary<object, object>)(object)customProperties).ContainsKey((object)customPropertyKey))
			{
				return default(T);
			}
			return (T)customProperties[(object)customPropertyKey];
		}

		public static void SetModded(this Player instance)
		{
			instance.SetProperty("modded", true);
		}

		public static bool IsModded(this Player instance)
		{
			return instance.GetProperty<bool>("modded");
		}

		public static LobbyCharacter[] GetCharacters(this Player instance)
		{
			return instance.GetProperty<LobbyCharacter[]>(charkey);
		}

		public static LobbyCharacter GetCharacter(this Player instance, int localID)
		{
			if (instance.GetCharacters().Length > localID)
			{
				return instance.GetCharacters()[localID];
			}
			return null;
		}

		public static void SetCharacters(this Player instance, LobbyCharacter[] characters)
		{
			instance.SetProperty(charkey, characters);
		}

		public static void SetCharacter(this Player instance, LobbyCharacter character)
		{
			if (!((Dictionary<object, object>)(object)instance.CustomProperties).ContainsKey((object)charkey))
			{
				instance.SetProperty(charkey, new LobbyCharacter[2]);
			}
			LobbyCharacter[] characters = instance.GetCharacters();
			characters[character.localID] = character;
			instance.SetCharacters(characters);
		}
	}
	[Serializable]
	public class PlayerAdditionalData
	{
		public int localID;

		private int uniqueID;

		public LobbyCharacter character;

		public PlayerAdditionalData()
		{
			localID = 0;
			uniqueID = 1;
			character = null;
		}
	}
	public static class PlayerExtensions
	{
		public static readonly ConditionalWeakTable<Player, PlayerAdditionalData> data = new ConditionalWeakTable<Player, PlayerAdditionalData>();

		public static PlayerAdditionalData GetAdditionalData(this Player player)
		{
			return data.GetOrCreateValue(player);
		}

		public static void AddData(this Player player, PlayerAdditionalData value)
		{
			try
			{
				data.Add(player, value);
			}
			catch (Exception)
			{
			}
		}

		public static void AssignCharacter(this Player instance, LobbyCharacter character, int playerID)
		{
			instance.GetAdditionalData().character = character;
			PhotonNetwork.LocalPlayer.SetCharacter(character);
			instance.AssignLocalID(character.localID);
			instance.AssignUniqueID(character.uniqueID);
			PlayerExtensions.AssignColorID(instance, character.colorID);
			instance.AssignTeamID(character.teamID);
			instance.AssignPlayerID(playerID);
			PlayerManager.instance.PlayerJoined(instance);
		}

		public static void AssignUniqueID(this Player instance, int uniqueID)
		{
			ExtensionMethods.SetFieldValue((object)instance.GetAdditionalData(), "uniqueID", (object)uniqueID);
		}

		public static int GetUniqueID(this Player instance)
		{
			int num = (int)ExtensionMethods.GetFieldValue((object)instance.GetAdditionalData(), "uniqueID");
			if (num >= 0)
			{
				return instance.data.view.ControllerActorNr;
			}
			return num;
		}

		public static void AssignLocalID(this Player instance, int localID)
		{
			instance.GetAdditionalData().localID = localID;
		}
	}
	[Serializable]
	public class PlayerActionsAdditionalData
	{
		public PlayerAction increaseColorID;

		public PlayerAction decreaseColorID;

		public PlayerActionsAdditionalData()
		{
			increaseColorID = null;
			decreaseColorID = null;
		}
	}
	public static class PlayerActionsExtension
	{
		public static readonly ConditionalWeakTable<PlayerActions, PlayerActionsAdditionalData> data = new ConditionalWeakTable<PlayerActions, PlayerActionsAdditionalData>();

		public static PlayerActionsAdditionalData GetAdditionalData(this PlayerActions playerActions)
		{
			return data.GetOrCreateValue(playerActions);
		}

		public static void AddData(this PlayerActions playerActions, PlayerActionsAdditionalData value)
		{
			try
			{
				data.Add(playerActions, value);
			}
			catch (Exception)
			{
			}
		}
	}
	public static class PlayerAssignerExtensions
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass2_0
		{
			public int viewID;

			internal bool <AssignCharacterCoroutine>b__0()
			{
				if ((Object)(object)PhotonView.Find(viewID) != (Object)null)
				{
					return (Object)(object)((Component)PhotonView.Find(viewID)).GetComponent<Player>() != (Object)null;
				}
				return false;
			}
		}

		[CompilerGenerated]
		private sealed class <AssignCharacterCoroutine>d__2 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public int viewID;

			private <>c__DisplayClass2_0 <>8__1;

			public LobbyCharacter character;

			public int playerID;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <AssignCharacterCoroutine>d__2(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0045: Unknown result type (might be due to invalid IL or missing references)
				//IL_004f: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass2_0();
					<>8__1.viewID = viewID;
					<>2__current = (object)new WaitUntil((Func<bool>)(() => (Object)(object)PhotonView.Find(<>8__1.viewID) != (Object)null && (Object)(object)((Component)PhotonView.Find(<>8__1.viewID)).GetComponent<Player>() != (Object)null));
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					((Component)PhotonView.Find(<>8__1.viewID)).GetComponent<Player>().AssignCharacter(character, playerID);
					NetworkingManager.RPC(typeof(PlayerAssignerExtensions), "CreatePlayerResponse", new object[2]
					{
						PhotonNetwork.LocalPlayer.ActorNumber,
						character
					});
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <CreatePlayer>d__0 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PlayerAssigner instance;

			public LobbyCharacter character;

			public InputDevice inputDevice;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <CreatePlayer>d__0(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0182: 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_0191: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a2: Unknown result type (might be due to invalid IL or missing references)
				//IL_01a3: 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_01c4: Unknown result type (might be due to invalid IL or missing references)
				Vector3 val;
				CharacterData component;
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					if ((bool)ExtensionMethods.GetFieldValue((object)instance, "waitingForRegisterResponse"))
					{
						return false;
					}
					if (instance.players.Count < instance.maxPlayers)
					{
						if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
						{
							((Component)instance).GetComponent<PhotonView>().RPC("RPCM_RequestTeamAndPlayerID", (RpcTarget)2, new object[1] { PhotonNetwork.LocalPlayer.ActorNumber });
							ExtensionMethods.SetFieldValue((object)instance, "waitingForRegisterResponse", (object)true);
						}
						goto IL_00c6;
					}
					return false;
				case 1:
					<>1__state = -1;
					goto IL_00c6;
				case 2:
					{
						<>1__state = -1;
						return false;
					}
					IL_00c6:
					if ((bool)ExtensionMethods.GetFieldValue((object)instance, "waitingForRegisterResponse"))
					{
						<>2__current = null;
						<>1__state = 1;
						return true;
					}
					if (!PhotonNetwork.OfflineMode)
					{
						if (PhotonNetwork.IsMasterClient)
						{
							ExtensionMethods.SetFieldValue((object)instance, "playerIDToSet", (object)PlayerManager.instance.players.Count);
							ExtensionMethods.SetFieldValue((object)instance, "teamIDToSet", (object)character.teamID);
						}
					}
					else
					{
						ExtensionMethods.SetFieldValue((object)instance, "playerIDToSet", (object)PlayerManager.instance.players.Count);
						ExtensionMethods.SetFieldValue((object)instance, "teamIDToSet", (object)character.teamID);
					}
					SoundPlayerStatic.Instance.PlayPlayerAdded();
					val = Vector3.up * 100f;
					component = PhotonNetwork.Instantiate(((Object)instance.playerPrefab).name, val, Quaternion.identity, (byte)0, (object[])null).GetComponent<CharacterData>();
					if (inputDevice != null)
					{
						component.input.inputType = (InputType)0;
						component.playerActions = PlayerActions.CreateWithControllerBindings();
					}
					else
					{
						component.input.inputType = (InputType)1;
						component.playerActions = PlayerActions.CreateWithKeyboardBindings();
					}
					((PlayerActionSet)component.playerActions).Device = inputDevice;
					instance.players.Add(component);
					PlayerManager.RegisterPlayer(component.player, -1);
					<>2__current = SyncMethodStatic.SyncMethod(typeof(PlayerAssignerExtensions), "RPCA_AssignCharacter", null, component.view.ViewID, character, (int)ExtensionMethods.GetFieldValue((object)instance, "playerIDToSet"));
					<>1__state = 2;
					return true;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[IteratorStateMachine(typeof(<CreatePlayer>d__0))]
		public static IEnumerator CreatePlayer(this PlayerAssigner instance, LobbyCharacter character, InputDevice inputDevice)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <CreatePlayer>d__0(0)
			{
				instance = instance,
				character = character,
				inputDevice = inputDevice
			};
		}

		[UnboundRPC]
		private static void RPCA_AssignCharacter(int viewID, LobbyCharacter character, int playerID)
		{
			((MonoBehaviour)PlayerAssigner.instance).StartCoroutine(AssignCharacterCoroutine(viewID, character, playerID));
		}

		[IteratorStateMachine(typeof(<AssignCharacterCoroutine>d__2))]
		private static IEnumerator AssignCharacterCoroutine(int viewID, LobbyCharacter character, int playerID)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <AssignCharacterCoroutine>d__2(0)
			{
				viewID = viewID,
				character = character,
				playerID = playerID
			};
		}

		[UnboundRPC]
		public static void CreatePlayerResponse(int respondingPlayer, LobbyCharacter targetedCharacter)
		{
			if (targetedCharacter.IsMine)
			{
				SyncMethodStatic.RemovePendingRequest(typeof(PlayerAssignerExtensions), respondingPlayer, "RPCA_AssignCharacter");
			}
		}
	}
	[Serializable]
	public class PlayerManagerAdditionalData
	{
		public PickOrder pickOrder;

		public PlayerManagerAdditionalData()
		{
			pickOrder = null;
		}
	}
	public static class PlayerManagerExtensions
	{
		public static readonly ConditionalWeakTable<PlayerManager, PlayerManagerAdditionalData> data = new ConditionalWeakTable<PlayerManager, PlayerManagerAdditionalData>();

		public static PlayerManagerAdditionalData GetAdditionalData(this PlayerManager playerManager)
		{
			return data.GetOrCreateValue(playerManager);
		}

		public static void AddData(this PlayerManager playerManager, PlayerManagerAdditionalData value)
		{
			try
			{
				data.Add(playerManager, value);
			}
			catch (Exception)
			{
			}
		}

		public static void SetPlayersKinematic(this PlayerManager playerManager, bool kinematic)
		{
			foreach (Player player in playerManager.players)
			{
				ExtensionMethods.SetFieldValue((object)player.data.playerVel, "isKinematic", (object)kinematic);
			}
		}

		public static void ResetPickOrder(this PlayerManager playerManager)
		{
			playerManager.GetAdditionalData().pickOrder = new PickOrder(playerManager.players);
		}

		public static List<Player> GetPickOrder(this PlayerManager playerManager, int[] winningTeamIDs = null)
		{
			return playerManager.GetAdditionalData().pickOrder.GetPickOrder(winningTeamIDs ?? new int[0]);
		}

		public static Player GetPlayerWithUniqueID(this PlayerManager instance, int uniqueID)
		{
			for (int i = 0; i < instance.players.Count; i++)
			{
				if (instance.players[i].GetUniqueID() == uniqueID)
				{
					return instance.players[i];
				}
			}
			return null;
		}

		public static void AddPlayerJoinedAction(this PlayerManager instance, Action<Player> action)
		{
			ExtensionMethods.SetPropertyValue((object)instance, "PlayerJoinedAction", (object)Delegate.Combine(instance.PlayerJoinedAction, action));
		}

		public static Player GetClosestPlayerInOtherTeam(this PlayerManager instance, Vector3 position, int team, bool needVision = false)
		{
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Unknown result type (might be due to invalid IL or missing references)
			//IL_0083: 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)
			float num = float.MaxValue;
			List<Player> list = (from p in instance.players
				where p.TeamID != team
				where !p.data.dead
				select p).ToList();
			Player result = null;
			for (int i = 0; i < list.Count; i++)
			{
				float num2 = Vector2.Distance(Vector2.op_Implicit(position), Vector2.op_Implicit(((Component)list[i]).transform.position));
				if ((!needVision || instance.CanSeePlayer(Vector2.op_Implicit(position), list[i]).canSee) && num2 < num)
				{
					num = num2;
					result = list[i];
				}
			}
			return result;
		}
	}
	public static class PointVisualizerExtensions
	{
		public class PointVisualizerAdditionalData
		{
			public Dictionary<int, Vector3> teamBallVelocity;

			public Dictionary<int, GameObject> teamBall;
		}

		[CompilerGenerated]
		private sealed class <DoSequence>d__10 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PointVisualizer instance;

			public Dictionary<int, int> teamPoints;

			public int[] winnerTeamIDs;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DoSequence>d__10(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Expected O, but got Unknown
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Expected O, but got Unknown
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Expected O, but got Unknown
				//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.45f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					SoundManager.Instance.Play(instance.soundWinRound, ((Component)instance).transform);
					instance.ResetBalls(teamPoints.Count);
					instance.bg.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Orange")).gameObject.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Blue")).gameObject.SetActive(true);
					for (int j = 0; j < teamPoints.Count; j++)
					{
						((Component)((Component)instance).transform.GetChild(1).GetChild(j)).gameObject.SetActive(true);
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.1f);
					instance.DoShowPoints(teamPoints, winnerTeamIDs);
					<>2__current = (object)new WaitForSecondsRealtime(1.8f);
					<>1__state = 3;
					return true;
				case 3:
				{
					<>1__state = -1;
					for (int i = 0; i < teamPoints.Count; i++)
					{
						instance.GetData().teamBall[i].GetComponent<CurveAnimation>().PlayOut();
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.25f);
					<>1__state = 4;
					return true;
				}
				case 4:
					<>1__state = -1;
					ExtensionMethods.InvokeMethod((object)instance, "Close", Array.Empty<object>());
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DoSequence>d__7 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PointVisualizer instance;

			public Dictionary<int, int> teamPoints;

			public int winnerTeamID;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DoSequence>d__7(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0030: Unknown result type (might be due to invalid IL or missing references)
				//IL_003a: Expected O, but got Unknown
				//IL_0166: Unknown result type (might be due to invalid IL or missing references)
				//IL_0170: Expected O, but got Unknown
				//IL_011b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0125: Expected O, but got Unknown
				//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c6: Expected O, but got Unknown
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.45f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					SoundManager.Instance.Play(instance.soundWinRound, ((Component)instance).transform);
					instance.ResetBalls(teamPoints.Count);
					instance.bg.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Orange")).gameObject.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Blue")).gameObject.SetActive(true);
					for (int j = 0; j < teamPoints.Count; j++)
					{
						((Component)((Component)instance).transform.GetChild(1).GetChild(j)).gameObject.SetActive(true);
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.1f);
					instance.DoShowPoints(teamPoints, winnerTeamID);
					<>2__current = (object)new WaitForSecondsRealtime(1.8f);
					<>1__state = 3;
					return true;
				case 3:
				{
					<>1__state = -1;
					for (int i = 0; i < teamPoints.Count; i++)
					{
						instance.GetData().teamBall[i].GetComponent<CurveAnimation>().PlayOut();
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.25f);
					<>1__state = 4;
					return true;
				}
				case 4:
					<>1__state = -1;
					ExtensionMethods.InvokeMethod((object)instance, "Close", Array.Empty<object>());
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DoWinSequence>d__6 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PointVisualizer instance;

			public Dictionary<int, int> teamPoints;

			public int winnerTeamID;

			public Dictionary<int, int> teamRounds;

			private int <teamCount>5__2;

			private Vector3 <pointPos>5__3;

			private float <c>5__4;

			private float <ballSmallSize>5__5;

			private float <bigBallScale>5__6;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DoWinSequence>d__6(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_00c2: 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_01be: Unknown result type (might be due to invalid IL or missing references)
				//IL_01c8: Expected O, but got Unknown
				//IL_0173: Unknown result type (might be due to invalid IL or missing references)
				//IL_017d: Expected O, but got Unknown
				//IL_025f: 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_026f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0296: Unknown result type (might be due to invalid IL or missing references)
				//IL_02eb: Unknown result type (might be due to invalid IL or missing references)
				//IL_02f5: Expected O, but got Unknown
				//IL_0336: Unknown result type (might be due to invalid IL or missing references)
				//IL_033c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0363: Unknown result type (might be due to invalid IL or missing references)
				//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
				//IL_0403: Unknown result type (might be due to invalid IL or missing references)
				//IL_040d: Expected O, but got Unknown
				//IL_0537: Unknown result type (might be due to invalid IL or missing references)
				//IL_0541: Expected O, but got Unknown
				//IL_0456: 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_048c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0514: Unknown result type (might be due to invalid IL or missing references)
				//IL_058e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0593: Unknown result type (might be due to invalid IL or missing references)
				//IL_059e: Unknown result type (might be due to invalid IL or missing references)
				//IL_05c5: Unknown result type (might be due to invalid IL or missing references)
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.35f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					SoundManager.Instance.Play(instance.soundWinRound, ((Component)instance).transform.GetChild(1));
					<teamCount>5__2 = teamPoints.Count;
					<pointPos>5__3 = (Vector3)ExtensionMethods.InvokeMethod((object)UIHandler.instance.roundCounterSmall, "GetPointPos", new object[1] { winnerTeamID });
					instance.ResetBalls(<teamCount>5__2);
					instance.bg.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Orange")).gameObject.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Blue")).gameObject.SetActive(true);
					for (int k = 0; k < <teamCount>5__2; k++)
					{
						((Component)((Component)instance).transform.GetChild(1).GetChild(k)).gameObject.SetActive(true);
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.1f);
					instance.DoShowPoints(teamPoints, winnerTeamID);
					<>2__current = (object)new WaitForSecondsRealtime(0.35f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					SoundManager.Instance.Play(instance.sound_UI_Arms_Race_A_Ball_Shrink_Go_To_Left_Corner, ((Component)instance).transform);
					<c>5__4 = 0f;
					<ballSmallSize>5__5 = (float)ExtensionMethods.GetFieldValue((object)instance, "ballSmallSize");
					<bigBallScale>5__6 = (float)ExtensionMethods.GetFieldValue((object)instance, "bigBallScale");
					goto IL_02c9;
				case 4:
					<>1__state = -1;
					goto IL_02c9;
				case 5:
					<>1__state = -1;
					<c>5__4 = 0f;
					goto IL_0396;
				case 6:
					<>1__state = -1;
					goto IL_0396;
				case 7:
					<>1__state = -1;
					<c>5__4 = 0f;
					goto IL_04cc;
				case 8:
					<>1__state = -1;
					goto IL_04cc;
				case 9:
					<>1__state = -1;
					<c>5__4 = 0f;
					break;
				case 10:
					{
						<>1__state = -1;
						break;
					}
					IL_04cc:
					if (<c>5__4 < instance.timeToMove)
					{
						for (int i = 0; i < <teamCount>5__2; i++)
						{
							if (i != winnerTeamID)
							{
								Transform transform = instance.GetData().teamBall[i].transform;
								transform.position = Vector3.LerpUnclamped(transform.position, ((Component)CardChoiceVisuals.instance).transform.position, instance.scaleCurve.Evaluate(<c>5__4 / instance.timeToMove));
							}
						}
						<c>5__4 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 8;
						return true;
					}
					for (int j = 0; j < <teamCount>5__2; j++)
					{
						if (j != winnerTeamID)
						{
							instance.GetData().teamBall[j].transform.position = ((Component)CardChoiceVisuals.instance).transform.position;
						}
					}
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 9;
					return true;
					IL_02c9:
					if (<c>5__4 < instance.timeToScale)
					{
						RectTransform component = instance.GetData().teamBall[winnerTeamID].GetComponent<RectTransform>();
						component.sizeDelta = Vector2.LerpUnclamped(component.sizeDelta, Vector2.one * <ballSmallSize>5__5, instance.scaleCurve.Evaluate(<c>5__4 / instance.timeToScale));
						<c>5__4 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 4;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 5;
					return true;
					IL_0396:
					if (<c>5__4 < instance.timeToMove)
					{
						Transform transform2 = instance.GetData().teamBall[winnerTeamID].transform;
						transform2.position = Vector3.LerpUnclamped(transform2.position, <pointPos>5__3, instance.scaleCurve.Evaluate(<c>5__4 / instance.timeToMove));
						<c>5__4 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 6;
						return true;
					}
					SoundManager.Instance.Play(instance.sound_UI_Arms_Race_B_Ball_Go_Down_Then_Expand, ((Component)instance).transform);
					instance.GetData().teamBall[winnerTeamID].transform.position = <pointPos>5__3;
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 7;
					return true;
				}
				if (<c>5__4 < instance.timeToScale)
				{
					for (int l = 0; l < <teamCount>5__2; l++)
					{
						if (l != winnerTeamID)
						{
							RectTransform component2 = instance.GetData().teamBall[l].GetComponent<RectTransform>();
							component2.sizeDelta = Vector2.LerpUnclamped(component2.sizeDelta, Vector2.one * <bigBallScale>5__6, instance.scaleCurve.Evaluate(<c>5__4 / instance.timeToScale));
						}
					}
					<c>5__4 += Time.unscaledDeltaTime;
					<>2__current = null;
					<>1__state = 10;
					return true;
				}
				SoundManager.Instance.Play(instance.sound_UI_Arms_Race_C_Ball_Pop_Shake, ((Component)instance).transform);
				GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.2f);
				UIHandler.instance.roundCounterSmall.UpdateRounds(teamRounds);
				UIHandler.instance.roundCounterSmall.UpdatePoints(teamPoints);
				for (int m = 0; m < teamPoints.Count; m++)
				{
					((Image)((Component)instance.GetData().teamBall[m].transform.Find("Fill")).GetComponent<ProceduralImage>()).fillAmount = 0f;
				}
				ExtensionMethods.InvokeMethod((object)instance, "Close", Array.Empty<object>());
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <DoWinSequence>d__9 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PointVisualizer instance;

			public Dictionary<int, int> teamPoints;

			public int[] winnerTeamIDs;

			public Dictionary<int, int> teamRounds;

			private int <teamCount>5__2;

			private float <c>5__3;

			private float <ballSmallSize>5__4;

			private float <bigBallScale>5__5;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <DoWinSequence>d__9(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0052: Expected O, but got Unknown
				//IL_018b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0195: Expected O, but got Unknown
				//IL_0140: Unknown result type (might be due to invalid IL or missing references)
				//IL_014a: Expected O, but got Unknown
				//IL_02ce: Unknown result type (might be due to invalid IL or missing references)
				//IL_02d8: Expected O, but got Unknown
				//IL_0238: 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)
				//IL_0248: Unknown result type (might be due to invalid IL or missing references)
				//IL_026f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0328: Unknown result type (might be due to invalid IL or missing references)
				//IL_0351: Unknown result type (might be due to invalid IL or missing references)
				//IL_0378: 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_045e: Unknown result type (might be due to invalid IL or missing references)
				//IL_0468: Expected O, but got Unknown
				//IL_05a8: Unknown result type (might be due to invalid IL or missing references)
				//IL_05b2: Expected O, but got Unknown
				//IL_04b9: Unknown result type (might be due to invalid IL or missing references)
				//IL_04c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_04ef: Unknown result type (might be due to invalid IL or missing references)
				//IL_0582: Unknown result type (might be due to invalid IL or missing references)
				//IL_0604: Unknown result type (might be due to invalid IL or missing references)
				//IL_0609: Unknown result type (might be due to invalid IL or missing references)
				//IL_0614: Unknown result type (might be due to invalid IL or missing references)
				//IL_063b: Unknown result type (might be due to invalid IL or missing references)
				int[] array;
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					<>2__current = (object)new WaitForSecondsRealtime(0.35f);
					<>1__state = 1;
					return true;
				case 1:
				{
					<>1__state = -1;
					SoundManager.Instance.Play(instance.soundWinRound, ((Component)instance).transform.GetChild(1));
					<teamCount>5__2 = teamPoints.Count;
					instance.ResetBalls(<teamCount>5__2);
					instance.bg.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Orange")).gameObject.SetActive(true);
					((Component)((Component)instance).transform.GetChild(1).Find("Blue")).gameObject.SetActive(true);
					for (int l = 0; l < <teamCount>5__2; l++)
					{
						((Component)((Component)instance).transform.GetChild(1).GetChild(l)).gameObject.SetActive(true);
					}
					<>2__current = (object)new WaitForSecondsRealtime(0.2f);
					<>1__state = 2;
					return true;
				}
				case 2:
					<>1__state = -1;
					GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.1f);
					instance.DoShowPoints(teamPoints, winnerTeamIDs);
					<>2__current = (object)new WaitForSecondsRealtime(0.35f);
					<>1__state = 3;
					return true;
				case 3:
					<>1__state = -1;
					SoundManager.Instance.Play(instance.sound_UI_Arms_Race_A_Ball_Shrink_Go_To_Left_Corner, ((Component)instance).transform);
					<c>5__3 = 0f;
					<ballSmallSize>5__4 = (float)ExtensionMethods.GetFieldValue((object)instance, "ballSmallSize");
					<bigBallScale>5__5 = (float)ExtensionMethods.GetFieldValue((object)instance, "bigBallScale");
					goto IL_02ac;
				case 4:
					<>1__state = -1;
					goto IL_02ac;
				case 5:
					<>1__state = -1;
					<c>5__3 = 0f;
					goto IL_03b8;
				case 6:
					<>1__state = -1;
					goto IL_03b8;
				case 7:
					<>1__state = -1;
					<c>5__3 = 0f;
					goto IL_0532;
				case 8:
					<>1__state = -1;
					goto IL_0532;
				case 9:
					<>1__state = -1;
					<c>5__3 = 0f;
					break;
				case 10:
					{
						<>1__state = -1;
						break;
					}
					IL_0532:
					if (<c>5__3 < instance.timeToMove)
					{
						for (int i = 0; i < <teamCount>5__2; i++)
						{
							if (!winnerTeamIDs.Contains(i))
							{
								Transform transform = instance.GetData().teamBall[i].transform;
								transform.position = Vector3.LerpUnclamped(transform.position, ((Component)CardChoiceVisuals.instance).transform.position, instance.scaleCurve.Evaluate(<c>5__3 / instance.timeToMove));
							}
						}
						<c>5__3 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 8;
						return true;
					}
					for (int j = 0; j < <teamCount>5__2; j++)
					{
						if (!winnerTeamIDs.Contains(j))
						{
							instance.GetData().teamBall[j].transform.position = ((Component)CardChoiceVisuals.instance).transform.position;
						}
					}
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 9;
					return true;
					IL_02ac:
					if (<c>5__3 < instance.timeToScale)
					{
						array = winnerTeamIDs;
						foreach (int key in array)
						{
							RectTransform component = instance.GetData().teamBall[key].GetComponent<RectTransform>();
							component.sizeDelta = Vector2.LerpUnclamped(component.sizeDelta, Vector2.one * <ballSmallSize>5__4, instance.scaleCurve.Evaluate(<c>5__3 / instance.timeToScale));
						}
						<c>5__3 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 4;
						return true;
					}
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 5;
					return true;
					IL_03b8:
					if (<c>5__3 < instance.timeToMove)
					{
						array = winnerTeamIDs;
						foreach (int num in array)
						{
							Transform transform2 = instance.GetData().teamBall[num].transform;
							transform2.position = Vector3.LerpUnclamped(transform2.position, (Vector3)ExtensionMethods.InvokeMethod((object)UIHandler.instance.roundCounterSmall, "GetPointPos", new object[1] { num }), instance.scaleCurve.Evaluate(<c>5__3 / instance.timeToMove));
						}
						<c>5__3 += Time.unscaledDeltaTime;
						<>2__current = null;
						<>1__state = 6;
						return true;
					}
					SoundManager.Instance.Play(instance.sound_UI_Arms_Race_B_Ball_Go_Down_Then_Expand, ((Component)instance).transform);
					array = winnerTeamIDs;
					foreach (int num2 in array)
					{
						instance.GetData().teamBall[num2].transform.position = (Vector3)ExtensionMethods.InvokeMethod((object)UIHandler.instance.roundCounterSmall, "GetPointPos", new object[1] { num2 });
					}
					<>2__current = (object)new WaitForSecondsRealtime(instance.timeBetween);
					<>1__state = 7;
					return true;
				}
				if (<c>5__3 < instance.timeToScale)
				{
					for (int m = 0; m < <teamCount>5__2; m++)
					{
						if (!winnerTeamIDs.Contains(m))
						{
							RectTransform component2 = instance.GetData().teamBall[m].GetComponent<RectTransform>();
							component2.sizeDelta = Vector2.LerpUnclamped(component2.sizeDelta, Vector2.one * <bigBallScale>5__5, instance.scaleCurve.Evaluate(<c>5__3 / instance.timeToScale));
						}
					}
					<c>5__3 += Time.unscaledDeltaTime;
					<>2__current = null;
					<>1__state = 10;
					return true;
				}
				SoundManager.Instance.Play(instance.sound_UI_Arms_Race_C_Ball_Pop_Shake, ((Component)instance).transform);
				GamefeelManager.instance.AddUIGameFeelOverTime(10f, 0.2f);
				UIHandler.instance.roundCounterSmall.UpdateRounds(teamRounds);
				UIHandler.instance.roundCounterSmall.UpdatePoints(teamPoints);
				for (int n = 0; n < teamPoints.Count; n++)
				{
					((Image)((Component)instance.GetData().teamBall[n].transform.Find("Fill")).GetComponent<ProceduralImage>()).fillAmount = 0f;
				}
				ExtensionMethods.InvokeMethod((object)instance, "Close", Array.Empty<object>());
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static readonly FieldInfo localizedTextField = AccessTools.Field(typeof(PointVisualizer), "m_localizedText");

		private static readonly ConditionalWeakTable<PointVisualizer, PointVisualizerAdditionalData> additionalData = new ConditionalWeakTable<PointVisualizer, PointVisualizerAdditionalData>();

		public static PointVisualizerAdditionalData GetData(this PointVisualizer instance)
		{
			return additionalData.GetOrCreateValue(instance);
		}

		private static TextMeshProUGUI GetTextComponent(PointVisualizer instance)
		{
			object? obj = localizedTextField?.GetValue(instance);
			object? obj2 = ((obj is UILocalizedString) ? obj : null);
			if (obj2 == null)
			{
				return null;
			}
			return ((UILocalizedString)obj2).Text;
		}

		public static void ResetBalls(this PointVisualizer instance, int numTeams)
		{
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f6: 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_0129: Unknown result type (might be due to invalid IL or missing references)
			//IL_014c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0151: Unknown result type (might be due to invalid IL or missing references)
			//IL_01ed: Unknown result type (might be due to invalid IL or missing references)
			//IL_01f2: 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_0262: Unknown result type (might be due to invalid IL or missing references)
			//IL_0197: Unknown result type (might be due to invalid IL or missing references)
			//IL_01be: Unknown result type (might be due to invalid IL or missing references)
			//IL_01c3: Unknown result type (might be due to invalid IL or missing references)
			while (((Component)instance).transform.GetChild(1).childCount > 2)
			{
				Object.DestroyImmediate((Object)(object)((Component)((Component)instance).transform.GetChild(1).GetChild(2)).gameObject);
			}
			PointVisualizerAdditionalData data = instance.GetData();
			data.teamBallVelocity = new Dictionary<int, Vector3>();
			data.teamBall = new Dictionary<int, GameObject>();
			for (int i = 0; i < numTeams; i++)
			{
				data.teamBallVelocity.Add(i, Vector3.zero);
			}
			GameObject gameObject = ((Component)((Component)instance).transform.GetChild(1).Find("Orange")).gameObject;
			GameObject gameObject2 = ((Component)((Component)instance).transform.GetChild(1).Find("Blue")).gameObject;
			data.teamBall.Add(0, gameObject);
			data.teamBall.Add(1, gameObject2);
			float num = (float)ExtensionMethods.GetFieldValue((object)instance, "ballBaseSize");
			gameObject.GetComponent<RectTransform>().sizeDelta = Vector2.one * num;
			gameObject2.GetComponent<RectTransform>().sizeDelta = Vector2.one * num;
			int num2 = -150 - 150 * (numTeams - 2);
			gameObject.GetComponent<RectTransform>().anchoredPosition = Vector2.op_Implicit(new Vector3((float)num2, 0f, 0f));
			gameObject2.GetComponent<RectTransform>().anchoredPosition = Vector2.op_Implicit(new Vector3((float)(num2 + 300), 0f, 0f));
			for (int j = 0; j < numTeams; j++)
			{
				GameObject val = null;
				if (j <= 1)
				{
					val = ((j == 0) ? gameObject : gameObject2);
				}
				else if (j > 1)
				{
					val = Object.Instantiate<GameObject>(gameObject, ((Component)instance).transform.GetChild(1));
					val.transform.localScale = Vector3.one;
					val.GetComponent<RectTransform>().anchoredPosition = Vector2.op_Implicit(new Vector3((float)(num2 + 300 * j), 0f, 0f));
				}
				val.transform.Find("Fill").localRotation = Quaternion.Euler(new Vector3(0f, 0f, 180f));
				((Graphic)((Component)val.transform.Find("Fill")).GetComponent<ProceduralImage>()).color = PlayerSkinBank.GetPlayerSkinColors(PlayerExtensions.colorID(PlayerManager.instance.GetPlayersInTeam(j)[0])).color;
				((Graphic)((Component)val.transform.Find("Border")).GetComponent<ProceduralImage>()).color = PlayerSkinBank.GetPlayerSkinColors(PlayerExtensions.colorID(PlayerManager.instance.GetPlayersInTeam(j)[0])).color;
				((Behaviour)((Component)val.transform.Find("Mid")).GetComponent<ProceduralImage>()).enabled = false;
				if (j > 1)
				{
					data.teamBall.Add(j, val);
				}
			}
			ExtensionMethods.GetOrAddComponent<GridLayoutGroup>(((Component)((Component)instance).transform.GetChild(1)).gameObject, false).constraintCount = Mathf.Clamp(numTeams, 1, 8);
		}

		[IteratorStateMachine(typeof(<DoWinSequence>d__6))]
		public static IEnumerator DoWinSequence(this PointVisualizer instance, Dictionary<int, int> teamPoints, Dictionary<int, int> teamRounds, int winnerTeamID)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoWinSequence>d__6(0)
			{
				instance = instance,
				teamPoints = teamPoints,
				teamRounds = teamRounds,
				winnerTeamID = winnerTeamID
			};
		}

		[IteratorStateMachine(typeof(<DoSequence>d__7))]
		public static IEnumerator DoSequence(this PointVisualizer instance, Dictionary<int, int> teamPoints, Dictionary<int, int> teamRounds, int winnerTeamID)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoSequence>d__7(0)
			{
				instance = instance,
				teamPoints = teamPoints,
				winnerTeamID = winnerTeamID
			};
		}

		public static void DoShowPoints(this PointVisualizer instance, Dictionary<int, int> teamPoints, int winnerTeamID)
		{
			//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < teamPoints.Count; i++)
			{
				ProceduralImage component = ((Component)instance.GetData().teamBall[i].transform.Find("Fill")).GetComponent<ProceduralImage>();
				((Image)component).fillMethod = (FillMethod)4;
				if (i == winnerTeamID)
				{
					((Image)component).fillAmount = ((teamPoints[i] == 0) ? 1f : ((float)teamPoints[i] / (float)(int)GameModeManager.CurrentHandler.Settings["pointsToWinRound"]));
				}
				else
				{
					((Image)component).fillAmount = (float)teamPoints[i] / (float)(int)GameModeManager.CurrentHandler.Settings["pointsToWinRound"];
				}
			}
			TextMeshProUGUI textComponent = GetTextComponent(instance);
			if ((Object)(object)textComponent != (Object)null)
			{
				((Graphic)textComponent).color = PlayerSkinBank.GetPlayerSkinColors(PlayerExtensions.colorID(PlayerManager.instance.GetPlayersInTeam(winnerTeamID)[0])).winText;
				((TMP_Text)textComponent).text = "POINT TO " + (GameModeManager.CurrentHandler.AllowTeams ? "TEAM " : "") + ExtraPlayerSkins.GetTeamColorName(PlayerExtensions.colorID(PlayerManager.instance.GetPlayersInTeam(winnerTeamID)[0])).ToUpper();
			}
		}

		[IteratorStateMachine(typeof(<DoWinSequence>d__9))]
		public static IEnumerator DoWinSequence(this PointVisualizer instance, Dictionary<int, int> teamPoints, Dictionary<int, int> teamRounds, int[] winnerTeamIDs)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoWinSequence>d__9(0)
			{
				instance = instance,
				teamPoints = teamPoints,
				teamRounds = teamRounds,
				winnerTeamIDs = winnerTeamIDs
			};
		}

		[IteratorStateMachine(typeof(<DoSequence>d__10))]
		public static IEnumerator DoSequence(this PointVisualizer instance, Dictionary<int, int> teamPoints, Dictionary<int, int> teamRounds, int[] winnerTeamIDs)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <DoSequence>d__10(0)
			{
				instance = instance,
				teamPoints = teamPoints,
				winnerTeamIDs = winnerTeamIDs
			};
		}

		public static void DoShowPoints(this PointVisualizer instance, Dictionary<int, int> teamPoints, int[] winnerTeamIDs)
		{
			//IL_00d2: 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_00dc: 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_018a: Unknown result type (might be due to invalid IL or missing references)
			for (int i = 0; i < teamPoints.Count; i++)
			{
				ProceduralImage component = ((Component)instance.GetData().teamBall[i].transform.Find("Fill")).GetComponent<ProceduralImage>();
				((Image)component).fillMethod = (FillMethod)4;
				if (winnerTeamIDs.Contains(i))
				{
					((Image)component).fillAmount = ((teamPoints[i] == 0) ? 1f : ((float)teamPoints[i] / (float)(int)GameModeManager.CurrentHandler.Settings["pointsToWinRound"]));
				}
				else
				{
					((Image)component).fillAmount = (float)teamPoints[i] / (float)(int)GameModeManager.CurrentHandler.Settings["pointsToWinRound"];
				}
			}
			Color color = Color32.op_Implicit(new Color32((byte)230, (byte)230, (byte)230, byte.MaxValue));
			string text = "TIE\nNO POINTS";
			if (winnerTeamIDs.Count() > 0)
			{
				text = "POINT TO" + (GameModeManager.CurrentHandler.AllowTeams ? (" TEAM" + ((winnerTeamIDs.Count() > 1) ? "S" : "")) : "");
				for (int j = 0; j < winnerTeamIDs.Count(); j++)
				{
					if (winnerTeamIDs.Count() > 1 && j == winnerTeamIDs.Count() - 1)
					{
						text += "\n<size=50%><voffset=0.5em>AND</voffset></size>";
					}
					int num = PlayerExtensions.colorID(PlayerManager.instance.GetPlayersInTeam(winnerTeamIDs[j]).First());
					text = text + "\n<color=#" + ColorUtility.ToHtmlStringRGBA(ExtraPlayerSkins.GetPlayerSkinColors(num).color) + ">" + ExtraPlayerSkins.GetTeamColorName(num).ToUpper() + "</color>";
				}
			}
			float fontSize = ((winnerTeamIDs.Count() > 2) ? (100f / (float)(winnerTeamIDs.Count() - 1)) : 100f);
			TextMeshProUGUI textComponent = GetTextComponent(instance);
			if ((Object)(object)textComponent != (Object)null)
			{
				((Graphic)textComponent).color = color;
				((TMP_Text)textComponent).text = text;
				((TMP_Text)textComponent).fontSize = fontSize;
			}
		}
	}
	public class RoundCounterAdditionalData
	{
		public Dictionary<int, int> teamPoints;

		public Dictionary<int, int> teamRounds;
	}
	public static class RoundCounterExtensions
	{
		private static readonly ConditionalWeakTable<RoundCounter, RoundCounterAdditionalData> additionalData = new ConditionalWeakTable<RoundCounter, RoundCounterAdditionalData>();

		public static RoundCounterAdditionalData GetData(this RoundCounter instance)
		{
			return additionalData.GetOrCreateValue(instance);
		}

		public static void UpdatePoints(this RoundCounter instance, Dictionary<int, int> teamPoints)
		{
			if (teamPoints.ContainsKey(0))
			{
				instance.p1Points = teamPoints[0];
			}
			if (teamPoints.ContainsKey(1))
			{
				instance.p2Points = teamPoints[1];
			}
			instance.GetData().teamPoints = teamPoints.ToDictionary((KeyValuePair<int, int> e) => e.Key, (KeyValuePair<int, int> e) => e.Value);
			ExtensionMethods.InvokeMethod((object)instance, "ReDraw", Array.Empty<object>());
		}

		public static void UpdateRounds(this RoundCounter instance, Dictionary<int, int> teamRounds)
		{
			if (teamRounds.ContainsKey(0))
			{
				instance.p1Rounds = teamRounds[0];
			}
			if (teamRounds.ContainsKey(1))
			{
				instance.p2Rounds = teamRounds[1];
			}
			instance.GetData().teamRounds = teamRounds.ToDictionary((KeyValuePair<int, int> e) => e.Key, (KeyValuePair<int, int> e) => e.Value);
			ExtensionMethods.InvokeMethod((object)instance, "ReDraw", Array.Empty<object>());
		}
	}
	public static class TransformExtension
	{
		public static string GetPath(this Transform current)
		{
			if ((Object)(object)current.parent == (Object)null)
			{
				return "/" + ((Object)current).name;
			}
			return current.parent.GetPath() + "/" + ((Object)current).name;
		}
	}
	public class UIHandlerAdditionalData
	{
		public bool disableTexts;
	}
	public static class UIHandlerExtensions
	{
		private static readonly ConditionalWeakTable<UIHandler, UIHandlerAdditionalData> additionalData = new ConditionalWeakTable<UIHandler, UIHandlerAdditionalData>();

		public static UIHandlerAdditionalData GetData(this UIHandler instance)
		{
			return additionalData.GetOrCreateValue(instance);
		}

		public static void ShowRoundCounterSmall(this UIHandler instance, Dictionary<int, int> teamPoints, Dictionary<int, int> teamRounds)
		{
			//IL_002f: Unknown result type (might be due to invalid IL or missing references)
			((Component)instance.roundCounterSmall).gameObject.SetActive(true);
			instance.roundCounterSmall.UpdateRounds(teamRounds);
			instance.roundCounterSmall.UpdatePoints(teamPoints);
			if ((int)instance.roundCounterAnimSmall.currentState != 0)
			{
				instance.roundCounterAnimSmall.PlayIn();
			}
		}

		public static void DisplayRoundStartText(this UIHandler instance, string text)
		{
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			Transform obj = ((Component)GameObject.Find("/Game/UI").transform.Find("UI_Game").Find("Canvas")).gameObject.transform.Find("RoundStartText");
			GeneralParticleSystem componentInChildren = ((Component)obj).GetComponentInChildren<GeneralParticleSystem>();
			TextMeshProUGUI component = ((Component)obj).GetComponent<TextMeshProUGUI>();
			ScalePulse component2 = ((Component)obj).GetComponent<ScalePulse>();
			componentInChildren.particleSettings.color = Color.white;
			componentInChildren.duration = 60f;
			componentInChildren.loop = true;
			componentInChildren.Play();
			((TMP_Text)component).text = text;
			((MonoBehaviour)instance).StopAllCoroutines();
			((MonoBehaviour)instance).StartCoroutine(component2.StartPulse());
		}

		public static void HideRoundStartText(this UIHandler instance)
		{
			Transform obj = ((Component)GameObject.Find("/Game/UI").transform.Find("UI_Game").Find("Canvas")).gameObject.transform.Find("RoundStartText");
			GeneralParticleSystem componentInChildren = ((Component)obj).GetComponentInChildren<GeneralParticleSystem>();
			((Component)obj).GetComponent<ScalePulse>();
			componentInChildren.loop = false;
		}

		public static void DisableTexts(this UIHandler instance, float duration)
		{
			instance.GetData().disableTexts = true;
			ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)instance, duration, (Action)delegate
			{
				instance.GetData().disableTexts = false;
			});
		}
	}
	public class LobbyCharacter
	{
		public Player networkPlayer;

		public int colorID;

		public int teamID;

		public int faceID;

		public bool ready;

		public int localID;

		public int uniqueID => -(actorID * RWFMod.instance.MaxCharactersPerClient + localID) - 1;

		public string NickName
		{
			get
			{
				if (localID != 0)
				{
					return networkPlayer.NickName + $" {localID + 1}";
				}
				return networkPlayer.NickName;
			}
		}

		public int actorID => networkPlayer.ActorNumber;

		public bool IsMine => actorID == PhotonNetwork.LocalPlayer.ActorNumber;

		public static LobbyCharacter GetLobbyCharacter(int uniqueID)
		{
			return (from p in PhotonNetwork.CurrentRoom.Players.Values.Select((Player p) => p.GetProperty<LobbyCharacter[]>("players")).SelectMany((LobbyCharacter[] p) => p)
				where p != null && p.uniqueID == uniqueID
				select p).FirstOrDefault();
		}

		public static object Deserialize(byte[] data)
		{
			if (PhotonNetwork.CurrentRoom == null || data == null || data[6] == 1 || !PhotonNetwork.CurrentRoom.Players.ContainsKey(data[0]))
			{
				return null;
			}
			return new LobbyCharacter(PhotonNetwork.CurrentRoom.Players[data[0]], data[1], data[2])
			{
				teamID = data[3],
				ready = (data[5] == 1),
				faceID = data[4]
			};
		}

		public static byte[] Serialize(object lobbyCharacter)
		{
			if (lobbyCharacter != null)
			{
				LobbyCharacter lobbyCharacter2 = (LobbyCharacter)lobbyCharacter;
				return new byte[7]
				{
					(byte)lobbyCharacter2.actorID,
					(byte)lobbyCharacter2.colorID,
					(byte)lobbyCharacter2.localID,
					(byte)lobbyCharacter2.teamID,
					(byte)lobbyCharacter2.faceID,
					lobbyCharacter2.ready ? ((byte)1) : ((byte)0),
					0
				};
			}
			return new byte[7] { 0, 0, 0, 0, 0, 0, 1 };
		}

		public LobbyCharacter(Player networkPlayer, int colorID, int localID)
		{
			this.networkPlayer = networkPlayer;
			this.colorID = colorID;
			this.localID = localID;
			faceID = PlayerPrefs.GetInt("SelectedFace" + localID);
		}

		public void SetReady(bool ready)
		{
			this.ready = ready;
		}
	}
	public static class SyncMethodStatic
	{
		[CompilerGenerated]
		private sealed class <>c__DisplayClass3_0
		{
			public string methodName;

			public int[] actors;

			internal bool <SyncMethodCoroutine>b__1(Tuple<int, string> r)
			{
				return r.Item2 == methodName;
			}

			internal bool <SyncMethodCoroutine>b__2(Tuple<int, string> r)
			{
				return actors.Contains(r.Item1);
			}
		}

		[CompilerGenerated]
		private sealed class <SyncMethodCoroutine>d__3 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public string methodName;

			public int[] actors;

			public Type staticType;

			public object[] data;

			private <>c__DisplayClass3_0 <>8__1;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <SyncMethodCoroutine>d__3(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>8__1 = null;
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				switch (<>1__state)
				{
				default:
					return false;
				case 0:
				{
					<>1__state = -1;
					<>8__1 = new <>c__DisplayClass3_0();
					<>8__1.methodName = methodName;
					<>8__1.actors = actors;
					if (PhotonNetwork.OfflineMode || PhotonNetwork.CurrentRoom == null)
					{
						NetworkingManager.RPC(staticType, <>8__1.methodName, data);
						return false;
					}
					if (<>8__1.actors == null)
					{
						<>8__1.actors = (from p in PhotonNetwork.CurrentRoom.Players.Values.ToList()
							select p.ActorNumber).ToArray();
					}
					int[] array = <>8__1.actors;
					foreach (int item in array)
					{
						GetPendingRequests(staticType).Add(new Tuple<int, string>(item, <>8__1.methodName));
					}
					NetworkingManager.RPC(staticType, <>8__1.methodName, data);
					break;
				}
				case 1:
					<>1__state = -1;
					break;
				}
				if ((from r in GetPendingRequests(staticType)
					where r.Item2 == <>8__1.methodName
					select r).Any((Tuple<int, string> r) => <>8__1.actors.Contains(r.Item1)))
				{
					<>2__current = null;
					<>1__state = 1;
					return true;
				}
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		private static readonly ConditionalWeakTable<Type, HashSet<Tuple<int, string>>> pendingRequests = new ConditionalWeakTable<Type, HashSet<Tuple<int, string>>>();

		public static Coroutine SyncMethod(Type staticType, string methodName, int[] actors, params object[] data)
		{
			return ((MonoBehaviour)RWFMod.instance).StartCoroutine(SyncMethodCoroutine(staticType, methodName, actors, data));
		}

		public static Coroutine SyncMethod(Type staticType, string methodName, int actor, params object[] data)
		{
			return SyncMethod(staticType, methodName, new int[1] { actor }, data);
		}

		[IteratorStateMachine(typeof(<SyncMethodCoroutine>d__3))]
		private static IEnumerator SyncMethodCoroutine(Type staticType, string methodName, int[] actors, params object[] data)
		{
			//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
			return new <SyncMethodCoroutine>d__3(0)
			{
				staticType = staticType,
				methodName = methodName,
				actors = actors,
				data = data
			};
		}

		public static HashSet<Tuple<int, string>> GetPendingRequests(Type staticType)
		{
			return pendingRequests.GetOrCreateValue(staticType);
		}

		public static void ClearPendingRequests(Type staticType, int actor)
		{
			HashSet<Tuple<int, string>> orCreateValue = pendingRequests.GetOrCreateValue(staticType);
			foreach (Tuple<int, string> item in from t in orCreateValue.ToList()
				where t.Item1 == actor
				select t)
			{
				orCreateValue.Remove(new Tuple<int, string>(actor, item.Item2));
			}
		}

		public static void RemovePendingRequest(Type staticType, int actor, string methodName)
		{
			pendingRequests.GetOrCreateValue(staticType).Remove(new Tuple<int, string>(actor, methodName));
		}
	}
	public static class PrivateRoomPrefabs
	{
		private static GameObject _PrivateRoomCharacterSelectionInstance;

		public static GameObject PrivateRoomCharacterSelectionInstance
		{
			get
			{
				//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c2: 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_00e3: Unknown result type (might be due to invalid IL or missing references)
				//IL_00f8: 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_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				//IL_014b: Unknown result type (might be due to invalid IL or missing references)
				//IL_0150: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)_PrivateRoomCharacterSelectionInstance != (Object)null)
				{
					return _PrivateRoomCharacterSelectionInstance;
				}
				GameObject val = Object.Instantiate<GameObject>(((Component)GameObject.Find("Game/UI/UI_MainMenu/Canvas/ListSelector/CharacterSelect/Group").transform.GetChild(0)).gameObject);
				Object.DontDestroyOnLoad((Object)(object)val);
				val.SetActive(true);
				((Object)val).name = "PrivateRoomCharacterSelector";
				ExtensionMethods.GetOrAddComponent<RectTransform>(val, false);
				ExtensionMethods.GetOrAddComponent<PhotonView>(val, false);
				ExtensionMethods.GetOrAddComponent<ContentSizeFitter>(val, false).horizontalFit = (FitMode)2;
				Object.Destroy((Object)(object)val.GetComponent<CharacterSelectionInstance>());
				PrivateRoomCharacterSelectionInstance orAddComponent = ExtensionMethods.GetOrAddComponent<PrivateRoomCharacterSelectionInstance>(val, false);
				Object.Destroy((Object)(object)((Component)((Component)orAddComponent).transform.GetChild(2)).gameObject);
				Object.Destroy((Object)(object)((Component)((Component)orAddComponent).transform.GetChild(1)).gameObject);
				GameObject val2 = new GameObject("PlayerName", new Type[1] { typeof(TextMeshProUGUI) });
				val2.transform.SetParent(val.transform);
				val2.transform.localScale = Vector3.one;
				val2.transform.localPosition = new Vector3(0f, 80f, 0f);
				((Graphic)val2.GetComponent<TextMeshProUGUI>()).color = new Color(0.556f, 0.556f, 0.556f, 1f);
				((TMP_Text)val2.GetComponent<TextMeshProUGUI>()).fontSize = 25f;
				((TMP_Text)val2.GetComponent<TextMeshProUGUI>()).alignment = (TextAlignmentOptions)514;
				val.transform.localPosition = Vector2.op_Implicit(Vector2.zero);
				PhotonNetwork.PrefabPool.RegisterPrefab(((Object)val).name, val);
				_PrivateRoomCharacterSelectionInstance = val;
				return _PrivateRoomCharacterSelectionInstance;
			}
			private set
			{
			}
		}
	}
	internal class PrivateRoomHandler : MonoBehaviourPunCallbacks
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static Func<LobbyCharacter, bool> <>9__29_0;

			public static Func<Player, LobbyCharacter[]> <>9__31_0;

			public static Func<LobbyCharacter[], IEnumerable<LobbyCharacter>> <>9__31_1;

			public static Func<LobbyCharacter, bool> <>9__31_2;

			public static Func<KeyValuePair<int, InputDevice>, int> <>9__34_1;

			public static Func<LobbyCharacter, int> <>9__38_0;

			public static Func<LobbyCharacter, int> <>9__38_1;

			public static UnityAction <>9__45_0;

			public static UnityAction <>9__45_1;

			public static Func<LobbyCharacter, int> <>9__46_0;

			public static Func<LobbyCharacter, int> <>9__46_1;

			public static Func<LobbyCharacter, int> <>9__51_0;

			public static Func<LobbyCharacter, bool> <>9__57_1;

			public static Func<LobbyCharacter, int> <>9__57_3;

			public static Func<LobbyCharacter, int> <>9__57_4;

			public static Func<LobbyCharacter, int> <>9__58_0;

			public static Func<LobbyCharacter, bool> <>9__63_0;

			public static Func<LobbyCharacter, float> <>9__67_0;

			public static Func<LobbyCharacter, int> <>9__67_1;

			public static Func<LobbyCharacter, float> <>9__67_2;

			internal bool <get_NumCharactersReady>b__29_0(LobbyCharacter p)
			{
				return p.ready;
			}

			internal LobbyCharacter[] <get_PrivateRoomCharacters>b__31_0(Player p)
			{
				return p.GetProperty<LobbyCharacter[]>("players");
			}

			internal IEnumerable<LobbyCharacter> <get_PrivateRoomCharacters>b__31_1(LobbyCharacter[] p)
			{
				return p;
			}

			internal bool <get_PrivateRoomCharacters>b__31_2(LobbyCharacter p)
			{
				return p != null;
			}

			internal int <FindLobbyCharacter>b__34_1(KeyValuePair<int, InputDevice> kv)
			{
				return kv.Key;
			}

			internal int <get_GameCanStart>b__38_0(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal int <get_GameCanStart>b__38_1(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal void <BuildUI>b__45_0()
			{
			}

			internal void <BuildUI>b__45_1()
			{
				//IL_0024: Unknown result type (might be due to invalid IL or missing references)
				if (PhotonNetwork.CurrentRoom != null)
				{
					((ClientSteamLobby)typeof(NetworkConnectionHandler).GetField("m_SteamLobby", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ShowInviteScreenWhenConnected();
				}
			}

			internal int <HandleTeamRules>b__46_0(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal int <HandleTeamRules>b__46_1(LobbyCharacter p)
			{
				return p.uniqueID;
			}

			internal int <Update>b__51_0(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal bool <ToggleReady>b__57_1(LobbyCharacter p)
			{
				return p != null;
			}

			internal int <ToggleReady>b__57_3(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal int <ToggleReady>b__57_4(LobbyCharacter p)
			{
				return p.colorID;
			}

			internal int <UnreadyAllPlayers>b__58_0(LobbyCharacter p)
			{
				return p.actorID;
			}

			internal bool <StartGameCountdown>b__63_0(LobbyCharacter p)
			{
				return p.ready;
			}

			internal float <StartGamePreparation>b__67_0(LobbyCharacter _)
			{
				return Random.Range(0f, 1f);
			}

			internal int <StartGamePreparation>b__67_1(LobbyCharacter p)
			{
				return p.teamID;
			}

			internal float <StartGamePreparation>b__67_2(LobbyCharacter _)
			{
				return Random.Range(0f, 1f);
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass57_0
		{
			public InputDevice deviceReadied;

			public LobbyCharacter[] localCharacters;

			public PrivateRoomHandler <>4__this;

			internal bool <ToggleReady>b__0(KeyValuePair<int, InputDevice> kv)
			{
				return kv.Value == deviceReadied;
			}

			internal bool <ToggleReady>b__2(int i)
			{
				return localCharacters[i] == null;
			}

			internal bool <ToggleReady>b__6(int i)
			{
				return <>4__this.devicesToUse[i] == deviceReadied;
			}

			internal bool <ToggleReady>b__7(int i)
			{
				return <>4__this.devicesToUse[i] == deviceReadied;
			}
		}

		[CompilerGenerated]
		private sealed class <>c__DisplayClass57_1
		{
			public int colorID;

			internal int <ToggleReady>b__5(int c)
			{
				return Mathf.Abs(c - colorID);
			}
		}

		[CompilerGenerated]
		private sealed class <CreatePlayerCoroutine>d__70 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public PrivateRoomHandler <>4__this;

			public LobbyCharacter lobbyCharacter;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <CreatePlayerCoroutine>d__70(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				PrivateRoomHandler privateRoomHandler = <>4__this;
				switch (num)
				{
				default:
					return false;
				case 0:
					<>1__state = -1;
					privateRoomHandler.MainPage.Close();
					MainMenuHandler.instance.Close();
					RWFMod.instance.SetSoundEnabled("PlayerAdded", enabled: false);
					<>2__current = PlayerAssigner.instance.CreatePlayer(lobbyCharacter, privateRoomHandler.devicesToUse[lobbyCharacter.localID]);
					<>1__state = 1;
					return true;
				case 1:
					<>1__state = -1;
					RWFMod.instance.SetSoundEnabled("PlayerAdded", enabled: true);
					NetworkingManager.RPC(typeof(PrivateRoomHandler), "CreatePlayerResponse", new object[1] { PhotonNetwork.LocalPlayer.ActorNumber });
					return false;
				}
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				throw new NotSupportedException();
			}
		}

		[CompilerGenerated]
		private sealed class <RemovePlayer>d__56 : IEnumerator<object>, IDisposable, IEnumerator
		{
			private int <>1__state;

			private object <>2__current;

			public LobbyCharacter character;

			public PrivateRoomHandler <>4__this;

			object IEnumerator<object>.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			object IEnumerator.Current
			{
				[DebuggerHidden]
				get
				{
					return <>2__current;
				}
			}

			[DebuggerHidden]
			public <RemovePlayer>d__56(int <>1__state)
			{
				this.<>1__state = <>1__state;
			}

			[DebuggerHidden]
			void IDisposable.Dispose()
			{
				<>1__state = -2;
			}

			private bool MoveNext()
			{
				int num = <>1__state;
				PrivateRoomHandler privateRoomHandler = <>4__this;
				if (num != 0)
				{
					return false;
				}
				<>1__state = -1;
				LobbyCharacter[] property = PhotonNetwork.LocalPlayer.GetProperty<LobbyCharacter[]>("players");
				property[character.localID] = null;
				PhotonNetwork.LocalPlayer.SetProperty("players", property);
				privateRoomHandler.devicesToUse.Remove(character.localID);
				SoundPlayerStatic.Instance.PlayPlayerBallDisappear();
				return false;
			}

			bool IEnumerator.MoveNext()
			{
				//ILSpy generated this explicit interface implementation from .override directive in MoveNext
				return this.MoveNext();
			}

			[DebuggerHidden]
			void IEnumerator.Reset()
			{
				th