Decompiled source of CustomMapLib v1.0.1

Mods/CustomMapLib.dll

Decompiled a day ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using CustomMapLib;
using CustomMapLib.Components;
using CustomMultiplayerMaps;
using HarmonyLib;
using Il2Cpp;
using Il2CppExitGames.Client.Photon;
using Il2CppInterop.Runtime.Injection;
using Il2CppInterop.Runtime.InteropTypes.Arrays;
using Il2CppPhoton.Pun;
using Il2CppRUMBLE.Environment.MatchFlow;
using Il2CppRUMBLE.Managers;
using Il2CppRUMBLE.MoveSystem;
using Il2CppRUMBLE.Networking.MatchFlow;
using Il2CppRUMBLE.Players;
using Il2CppRUMBLE.Utilities;
using Il2CppSystem;
using Il2CppSystem.Collections.Generic;
using MelonLoader;
using Microsoft.CodeAnalysis;
using RumbleModUI;
using RumbleModdingAPI;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyDescription("allows you to make more complex custom maps")]
[assembly: AssemblyCopyright("Created by elmish")]
[assembly: AssemblyTrademark(null)]
[assembly: MelonInfo(typeof(Map), "CustomMapLib", "1.0.1", "elmish", null)]
[assembly: MelonColor(255, 255, 0, 0)]
[assembly: MelonGame(null, null)]
[assembly: TargetFramework(".NETCoreApp,Version=v6.0", FrameworkDisplayName = ".NET 6.0")]
[assembly: AssemblyCompany("CustomMapLib")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+32d6fcf4ede932bde89026b98c7fa06120a227ff")]
[assembly: AssemblyProduct("CustomMapLib")]
[assembly: AssemblyTitle("CustomMapLib")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace CustomMapLib
{
	public static class BuildInfo
	{
		public const string Name = "CustomMapLib";

		public const string Description = "allows you to make more complex custom maps";

		public const string Author = "elmish";

		public const string Company = null;

		public const string Version = "1.0.1";

		public const string DownloadLink = null;
	}
	public class Map : MelonMod
	{
		public enum ObjectType
		{
			CombatFloor = 9,
			NonCombatFloor = 11,
			Wall = 1
		}

		public class PrimitivePhysicsMaterial
		{
			public float Bounciness = 0f;

			public float Friction = 0f;

			public Options options;
		}

		public enum Options
		{
			Bouncy,
			Friction,
			Both
		}

		public class _PedestalSequences
		{
			public class _InternalClientPedestal
			{
				public Map _instance;

				public void SetFirstSequence(Vector3 newPosition)
				{
					//IL_000c: 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)
					_instance.handler.ClientPedestalSequence1 = newPosition;
				}

				public void SetSecondSequence(Vector3 newPosition)
				{
					//IL_000c: 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)
					_instance.handler.ClientPedestalSequence2 = newPosition;
				}
			}

			public class _HostPedestal
			{
				public Map _instance;

				public void SetFirstSequence(Vector3 newPosition)
				{
					//IL_000c: 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)
					_instance.handler.HostPedestalSequence1 = newPosition;
				}

				public void SetSecondSequence(Vector3 newPosition)
				{
					//IL_000c: 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)
					_instance.handler.HostPedestalSequence2 = newPosition;
				}
			}
		}

		[HarmonyPatch(typeof(main), "PreLoadMaps")]
		public static class MapLoadPatch
		{
			public static void Postfix()
			{
				//IL_003f: Unknown result type (might be due to invalid IL or missing references)
				//IL_0049: Expected O, but got Unknown
				MelonLogger.Msg("adding custom maps from CustomMapLib");
				foreach (Map initializedMap in _InitializedMaps)
				{
					string text = initializedMap.mapName + " " + initializedMap.mapVersion;
					initializedMap.mapParent = new GameObject(text);
					initializedMap.mapParent.transform.SetParent(customMultiplayerMaps.mapsParent.transform);
					initializedMap.mapParent.SetActive(false);
					initializedMap.handler = initializedMap.mapParent.AddComponent<MapInternalHandler>();
					initializedMap.handler._map = initializedMap;
					initializedMap.OnMapCreation();
					MelonLogger.Msg("Loading " + initializedMap.mapName + " by " + initializedMap.creatorName);
				}
			}
		}

		[HarmonyPatch(typeof(MatchHandler), "ExecuteNextRound")]
		public static class RoundPatch
		{
			public static void Prefix()
			{
				foreach (Map initializedMap in _InitializedMaps)
				{
					if (initializedMap.handler.inMatch)
					{
						initializedMap.OnRoundStarted();
					}
				}
			}
		}

		[HarmonyPatch(typeof(main), "GetEnabledMapsString")]
		public static class MapListPatch
		{
			public static bool Prefix(ref string __result)
			{
				MelonLogger.Msg("GetEnabledMapsString was called");
				int num = 13;
				string text = "";
				if (Mods.doesOpponentHaveMod("CustomMapLib", "1.0.1", true))
				{
					MelonLogger.Msg("GetEnabledMapsString - Opponent has mod");
					foreach (Map initializedMap in _InitializedMaps)
					{
						num++;
					}
					for (int i = 4; i < num; i++)
					{
						string name = customMultiplayerMaps.CustomMultiplayerMaps.Settings[i].Name;
						if ((bool)customMultiplayerMaps.CustomMultiplayerMaps.Settings[i].Value)
						{
							text = text + name + "|";
						}
					}
					MelonLogger.Msg("GetEnabledMapsString - " + text);
					__result = text;
					return false;
				}
				MelonLogger.Msg("opponent does not have mod");
				return true;
			}
		}

		[HarmonyPatch(typeof(main), "ModsReceived")]
		public static class Patch2
		{
			public static bool Prefix()
			{
				//IL_0123: Unknown result type (might be due to invalid IL or missing references)
				MelonLogger.Msg("ModsReceived was called");
				if (Mods.doesOpponentHaveMod("CustomMapLib", "1.0.1", true))
				{
					MelonLogger.Msg("ModsReceived - both players have mod");
					MelonLogger.Msg($"{customMultiplayerMaps.enabled}, {customMultiplayerMaps.EventSent}, {PhotonNetwork.IsMasterClient}");
					if (customMultiplayerMaps.enabled && !customMultiplayerMaps.EventSent && !PhotonNetwork.IsMasterClient)
					{
						MelonLogger.Msg(customMultiplayerMaps.currentScene);
						if (customMultiplayerMaps.currentScene == "Map0" || customMultiplayerMaps.currentScene == "Map1")
						{
							MelonLogger.Msg("ModsReceived - raising event");
							PhotonNetwork.RaiseEvent(customMultiplayerMaps.myEventCode, Object.op_Implicit(customMultiplayerMaps.GetEnabledMapsString()), main.eventOptions, SendOptions.SendReliable);
						}
					}
					return false;
				}
				MelonLogger.Msg("ModsReceived - opponent does not have mod");
				return true;
			}
		}

		[HarmonyPatch(typeof(main), "OnEvent")]
		public static class NetworkEventRecievedPatch
		{
			public static bool Prefix(ref EventData eventData)
			{
				if (Mods.doesOpponentHaveMod("CustomMapLib", "1.0.1", true))
				{
					if (eventData.Code == customMultiplayerMaps.myEventCode)
					{
						MelonLogger.Msg("OnEvent - opponent has mod");
						MelonLogger.Msg("OnEvent - replacing event code 69");
						string[] array = eventData.CustomData.ToString().Split('|');
						MelonLogger.Msg("CustomMapLib || OnEvent intercepted successfully");
						customMultiplayerMaps.ProcessEventCode69(array);
						return false;
					}
					if (eventData.Code == customMultiplayerMaps.myEventCode2)
					{
						MelonLogger.Msg("OnEvent - opponent has mod");
						MelonLogger.Msg("OnEvent - replacing event code 70");
						string[] array2 = new string[1] { eventData.CustomData.ToString() };
						customMultiplayerMaps.ProcessEventCode70(array2);
						return false;
					}
				}
				return true;
			}
		}

		[HarmonyPatch(typeof(main), "ProcessEventCode69")]
		public static class ProcessPatch
		{
			public static bool Prefix(ref string[] processedString)
			{
				//IL_0049: Unknown result type (might be due to invalid IL or missing references)
				MelonLogger.Msg("ProcessEventCode69 called");
				if (Mods.doesOpponentHaveMod("CustomMapLib", "1.0.1", true))
				{
					MelonLogger.Msg("ProcessEventCode69 - opponent has mod");
					string text = SelectRandomMap(processedString);
					PhotonNetwork.RaiseEvent(customMultiplayerMaps.myEventCode2, Object.op_Implicit(text), main.eventOptions2, SendOptions.SendReliable);
				}
				return true;
			}

			private static string SelectRandomMap(string[] opponentMaps)
			{
				string[] array = customMultiplayerMaps.GetEnabledMapsString().Split('|');
				List<string> list = new List<string>();
				foreach (string text in opponentMaps)
				{
					string[] array2 = array;
					foreach (string text2 in array2)
					{
						if (text == text2)
						{
							list.Add(text2);
						}
					}
				}
				Random random = new Random();
				MelonLogger.Error($"FINAL CHOOSING MAP - list length: {list.Count}, maps: {list.ToString()}");
				string text3 = list[random.Next(0, list.Count - 2)];
				MelonLogger.Msg("map selected: " + text3);
				return text3;
			}
		}

		[HarmonyPatch(typeof(main), "ProcessEventCode70")]
		public static class SecondProcessPatch
		{
			public static bool Prefix(ref string[] processedString)
			{
				MelonLogger.Msg("ProcessEventCode70 called");
				if (Mods.doesOpponentHaveMod("CustomMapLib", "1.0.1", true))
				{
					MelonLogger.Msg("ProcessEventCode70 - both players have mod");
					if (customMultiplayerMaps.currentScene == "Map0")
					{
						customMultiplayerMaps.UnLoadMap0();
					}
					else if (customMultiplayerMaps.currentScene == "Map1")
					{
						customMultiplayerMaps.UnLoadMap1();
					}
					Singleton<PoolManager>.instance.ResetPools((AssetType)3);
					for (int i = 0; i < customMultiplayerMaps.mapsParent.transform.childCount; i++)
					{
						if (((Object)customMultiplayerMaps.mapsParent.transform.GetChild(i)).name == processedString[0])
						{
							((Component)customMultiplayerMaps.mapsParent.transform.GetChild(i)).gameObject.SetActive(true);
						}
					}
					return false;
				}
				return true;
			}
		}

		public string mapName;

		public string creatorName;

		public string mapVersion;

		public GameObject mapParent;

		public bool mapInitialized;

		public MapInternalHandler handler;

		private static List<Map> _InitializedMaps = new List<Map>();

		public static main customMultiplayerMaps;

		public static Shader urp_lit;

		private static bool _loaderInitialized;

		public _PedestalSequences._HostPedestal HostPedestal = new _PedestalSequences._HostPedestal();

		public _PedestalSequences._InternalClientPedestal ClientPedestal = new _PedestalSequences._InternalClientPedestal();

		private static GameObject physicMaterialHolder;

		private static Collider physicMaterialHolderCollider;

		public static string currentScene;

		public static string previousScene;

		private static GameObject ddolStaff;

		public bool inMatch => handler.inMatch;

		public void Initialize(string _mapName, string _mapVersion, string _creatorName, Map _instance)
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Expected O, but got Unknown
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Expected O, but got Unknown
			if (!mapInitialized)
			{
				mapName = _mapName;
				mapVersion = _mapVersion;
				creatorName = _creatorName;
				customMultiplayerMaps = (main)MelonBase.FindMelon("CustomMultiplayerMaps", "UlvakSkillz");
				string text = mapName + " " + mapVersion;
				customMultiplayerMaps.CustomMultiplayerMaps.AddToList(text, true, 0, "Enable or Disable " + mapName + " - " + creatorName, new Tags());
				HostPedestal._instance = _instance;
				ClientPedestal._instance = _instance;
				_InitializedMaps.Add(_instance);
				mapInitialized = true;
			}
		}

		public override void OnSceneWasInitialized(int buildIndex, string sceneName)
		{
			previousScene = currentScene;
			currentScene = sceneName;
			if (sceneName == "Gym" && previousScene == "Gym")
			{
				return;
			}
			try
			{
				if (_loaderInitialized && sceneName != "Gym")
				{
					MelonCoroutines.Start(coroutine());
				}
			}
			catch
			{
			}
			try
			{
				if (_loaderInitialized)
				{
					foreach (Map initializedMap in _InitializedMaps)
					{
						if ((Object)(object)initializedMap.handler != (Object)null)
						{
							initializedMap.handler.inMatch = false;
						}
					}
				}
			}
			catch
			{
				MelonLogger.Error("idk why it's erroring, please ping me on discord!");
			}
			if (sceneName == "Loader")
			{
				urp_lit = Shader.Find("Universal Render Pipeline/Lit");
				LoadPhysicsMaterial();
			}
			if (sceneName == "Gym" && !_loaderInitialized)
			{
				ClassInjector.RegisterTypeInIl2Cpp<MapInternalHandler>();
				CreateOriginal();
				_loaderInitialized = true;
			}
		}

		public GameObject CreatePrimitiveObject(PrimitiveType primitiveType, Vector3 position, Quaternion rotation, Vector3 scale, ObjectType type, PrimitivePhysicsMaterial primitivePhysicsMaterial = null)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: 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_0028: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = GameObject.CreatePrimitive(primitiveType);
			val.transform.position = position;
			val.transform.rotation = rotation;
			val.transform.localScale = scale;
			val.GetComponent<Renderer>().material.shader = urp_lit;
			Collider val2 = val.GetComponent<Collider>();
			if (type != ObjectType.Wall)
			{
				Object.Destroy((Object)(object)val2);
				val2 = (Collider)(object)val.AddComponent<MeshCollider>();
				val.layer = (int)type;
			}
			else
			{
				val.layer = 11;
			}
			GroundCollider val3 = val.AddComponent<GroundCollider>();
			val3.isMainGroundCollider = true;
			val3.collider = val2;
			val.transform.SetParent(mapParent.transform);
			if (primitivePhysicsMaterial != null)
			{
				PhysicMaterial physicsMaterial = GetPhysicsMaterial();
				if ((Object)(object)physicsMaterial != (Object)null)
				{
					val2.material = physicsMaterial;
					switch (primitivePhysicsMaterial.options)
					{
					case Options.Bouncy:
						val2.material.bounciness = primitivePhysicsMaterial.Bounciness;
						val2.material.bouncyness = primitivePhysicsMaterial.Bounciness;
						val2.material.bounceCombine = (PhysicMaterialCombine)3;
						break;
					case Options.Friction:
						val2.material.dynamicFriction = primitivePhysicsMaterial.Friction;
						val2.material.dynamicFriction2 = primitivePhysicsMaterial.Friction;
						val2.material.staticFriction = primitivePhysicsMaterial.Friction;
						val2.material.staticFriction2 = primitivePhysicsMaterial.Friction;
						val2.material.frictionCombine = (PhysicMaterialCombine)2;
						break;
					case Options.Both:
						val2.material.bounciness = primitivePhysicsMaterial.Bounciness;
						val2.material.bouncyness = primitivePhysicsMaterial.Bounciness;
						val2.material.dynamicFriction = primitivePhysicsMaterial.Friction;
						val2.material.dynamicFriction2 = primitivePhysicsMaterial.Friction;
						val2.material.staticFriction = primitivePhysicsMaterial.Friction;
						val2.material.staticFriction2 = primitivePhysicsMaterial.Friction;
						val2.material.frictionCombine = (PhysicMaterialCombine)2;
						break;
					default:
						MelonLogger.Error("what the fuck how, ping me with your code this should not be physically possible to get this error");
						break;
					}
				}
			}
			return val;
		}

		public PhysicMaterial GetPhysicsMaterial()
		{
			try
			{
				return Object.Instantiate<PhysicMaterial>(physicMaterialHolderCollider.material);
			}
			catch
			{
				MelonLogger.Msg("Physics material is null, please ping @elmishh on discord with your log file");
				LoadPhysicsMaterial();
			}
			return null;
		}

		public virtual void OnMapMatchLoad(bool amHost)
		{
		}

		public virtual void OnMapDisabled()
		{
		}

		public virtual void OnMapCreation()
		{
		}

		public virtual void OnRoundStarted()
		{
		}

		public void LoadPhysicsMaterial()
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			physicMaterialHolder = new GameObject();
			physicMaterialHolderCollider = (Collider)(object)physicMaterialHolder.AddComponent<BoxCollider>();
			Object.DontDestroyOnLoad((Object)(object)physicMaterialHolder);
			if ((Object)(object)physicMaterialHolderCollider.material == (Object)null)
			{
				using (Stream stream = ((MelonBase)this).MelonAssembly.Assembly.GetManifestResourceStream("CustomMapLib.Resources.physicsmaterial"))
				{
					byte[] array = new byte[stream.Length];
					stream.Read(array, 0, array.Length);
					Il2CppAssetBundle val = Il2CppAssetBundleManager.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array));
					physicMaterialHolderCollider.material = Object.Instantiate<PhysicMaterial>(val.LoadAsset<PhysicMaterial>("baseMaterial"));
				}
			}
		}

		private void CreateOriginal()
		{
			//IL_0067: Unknown result type (might be due to invalid IL or missing references)
			//IL_0071: Unknown result type (might be due to invalid IL or missing references)
			using Stream stream = ((MelonBase)this).MelonAssembly.Assembly.GetManifestResourceStream("CustomMapLib.Resources.asset");
			byte[] array = new byte[stream.Length];
			stream.Read(array, 0, array.Length);
			Il2CppAssetBundle val = Il2CppAssetBundleManager.LoadFromMemory(Il2CppStructArray<byte>.op_Implicit(array));
			ddolStaff = Object.Instantiate<GameObject>(val.LoadAsset<GameObject>("untitled2"));
			Object.DontDestroyOnLoad((Object)(object)ddolStaff);
			ddolStaff.transform.position = Vector3.one * 9999f;
		}

		private IEnumerator coroutine()
		{
			while (Singleton<PlayerManager>.instance.localPlayer == null)
			{
				yield return (object)new WaitForFixedUpdate();
			}
			for (int i = 0; i < 200; i++)
			{
				yield return (object)new WaitForFixedUpdate();
			}
			actualmethod();
		}

		private void actualmethod()
		{
			//IL_0108: 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_015d: Unknown result type (might be due to invalid IL or missing references)
			try
			{
				Enumerator<Player> enumerator = Singleton<PlayerManager>.instance.AllPlayers.GetEnumerator();
				while (enumerator.MoveNext())
				{
					Player current = enumerator.Current;
					if (current.Data.GeneralData.InternalUsername == "3F73EBEC8EDD260F")
					{
						GameObject val = null;
						if (((Component)current.Controller).transform.childCount == 11)
						{
							val = ((Component)((Component)current.Controller).gameObject.transform.GetChild(5).GetChild(7).GetChild(0)
								.GetChild(2)
								.GetChild(0)).gameObject;
						}
						else if (((Component)current.Controller).transform.childCount == 12)
						{
							val = ((Component)((Component)current.Controller).gameObject.transform.GetChild(6).GetChild(7).GetChild(0)
								.GetChild(2)
								.GetChild(0)).gameObject;
						}
						GameObject val2 = Object.Instantiate<GameObject>(ddolStaff);
						val2.transform.localScale = new Vector3(0.012f, 0.012f, 0.012f);
						val2.transform.SetParent(val.transform);
						val2.transform.localPosition = new Vector3(0f, 0.1f, -0.15f);
						val2.transform.localRotation = Quaternion.Euler(35f, 90f, 0f);
					}
				}
			}
			catch
			{
			}
		}
	}
}
namespace CustomMapLib.Components
{
	[RegisterTypeInIl2Cpp]
	public class MapInternalHandler : MonoBehaviour
	{
		public Map _map;

		public bool inMatch;

		public Pedestal clientPedestal;

		public Vector3 ClientPedestalSequence1 = new Vector3(0f, 0f, -3f);

		public Vector3 ClientPedestalSequence2 = new Vector3(0f, -1f, 0f);

		public Pedestal hostPedestal;

		public Vector3 HostPedestalSequence1 = new Vector3(0f, 0f, 3f);

		public Vector3 HostPedestalSequence2 = new Vector3(0f, -1f, 0f);

		private string currentScene;

		public MapInternalHandler(IntPtr ptr)
			: base(ptr)
		{
		}//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_002a: 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_0044: Unknown result type (might be due to invalid IL or missing references)
		//IL_0049: Unknown result type (might be due to invalid IL or missing references)
		//IL_005e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0063: Unknown result type (might be due to invalid IL or missing references)


		public void OnEnable()
		{
			inMatch = true;
			_map.OnMapMatchLoad(PhotonNetwork.IsMasterClient);
			currentScene = Map.customMultiplayerMaps.currentScene;
			MelonCoroutines.Start(GetPedestals());
		}

		public void OnDisable()
		{
			inMatch = false;
			_map.OnMapDisabled();
		}

		private IEnumerator GetPedestals()
		{
			yield return (object)new WaitForSeconds(1f);
			PedestalManager manager = null;
			if (currentScene == "Map0")
			{
				manager = Pedestals.GetGameObject().GetComponent<PedestalManager>();
			}
			else if (currentScene == "Map1")
			{
				manager = Pedestals.GetGameObject().GetComponent<PedestalManager>();
			}
			foreach (Pedestal pedestal in (Il2CppArrayBase<Pedestal>)(object)manager.Pedestals)
			{
				foreach (MoveOffsetOverDuration moveSequence in (Il2CppArrayBase<MoveOffsetOverDuration>)(object)pedestal.CurrentMoveSequence)
				{
					if (moveSequence.offset == new Vector3(0f, 0f, 3f))
					{
						hostPedestal = pedestal;
					}
					else if (moveSequence.offset == new Vector3(0f, 0f, -3f))
					{
						clientPedestal = pedestal;
					}
				}
			}
			MelonCoroutines.Start(coroutine());
		}

		private IEnumerator coroutine()
		{
			yield return (object)new WaitForSeconds(2f);
			if (inMatch && (currentScene == "Map0" || currentScene == "Map1"))
			{
				((Il2CppArrayBase<MoveOffsetOverDuration>)(object)clientPedestal.CurrentMoveSequence)[0].offset = ClientPedestalSequence1;
				((Il2CppArrayBase<MoveOffsetOverDuration>)(object)clientPedestal.CurrentMoveSequence)[1].offset = ClientPedestalSequence2;
				((Il2CppArrayBase<MoveOffsetOverDuration>)(object)hostPedestal.CurrentMoveSequence)[0].offset = HostPedestalSequence1;
				((Il2CppArrayBase<MoveOffsetOverDuration>)(object)hostPedestal.CurrentMoveSequence)[1].offset = HostPedestalSequence2;
			}
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.firstRoundConfig.MoveOffsetSequencePedestalOne)[0].offset = HostPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.firstRoundConfig.MoveOffsetSequencePedestalOne)[1].offset = HostPedestalSequence2;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.firstRoundConfig.MoveOffsetSequencePedestalTwo)[0].offset = ClientPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.firstRoundConfig.MoveOffsetSequencePedestalTwo)[1].offset = ClientPedestalSequence2;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.repeatingRoundConfig.MoveOffsetSequencePedestalOne)[0].offset = HostPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.repeatingRoundConfig.MoveOffsetSequencePedestalOne)[1].offset = HostPedestalSequence2;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.repeatingRoundConfig.MoveOffsetSequencePedestalTwo)[0].offset = ClientPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.repeatingRoundConfig.MoveOffsetSequencePedestalTwo)[1].offset = ClientPedestalSequence2;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.finalRoundConfig.MoveOffsetSequencePedestalOne)[0].offset = HostPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.finalRoundConfig.MoveOffsetSequencePedestalOne)[1].offset = HostPedestalSequence2;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.finalRoundConfig.MoveOffsetSequencePedestalTwo)[0].offset = ClientPedestalSequence1;
			((Il2CppArrayBase<MoveOffsetOverDuration>)(object)Singleton<MatchHandler>.instance.finalRoundConfig.MoveOffsetSequencePedestalTwo)[1].offset = ClientPedestalSequence2;
		}
	}
}