Decompiled source of Appearance Offsets v1.0.1

Atlyss.AppearanceOffsets.dll

Decompiled 3 days ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.IO.Compression;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using Atlyss.AppearanceOffsets.SoftDependencies;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using CodeTalker;
using CodeTalker.Networking;
using CodeTalker.Packets;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Mirror;
using Nessie.ATLYSS.EasySettings;
using Nessie.ATLYSS.EasySettings.UIElements;
using UnityEngine;
using UnityEngine.Events;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Atlyss.AppearanceOffsets")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("Atlyss.AppearanceOffsets")]
[assembly: AssemblyTitle("Atlyss.AppearanceOffsets")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[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;
		}
	}
}
namespace Atlyss.AppearanceOffsets
{
	[DefaultExecutionOrder(3000)]
	public static class BoneAdjuster
	{
		public static UnityEvent OnOffsetsChanged { get; } = new UnityEvent();

		public static void SetBoobPosition(Vector3 newPos)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.boobPositionOffset = newPos;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetBoobScale(Vector3 newScale)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.boobScaleOffset = newScale;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetButtPosition(Vector3 newPos)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.buttPositionOffset = newPos;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetButtScale(Vector3 newScale)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.buttScaleOffset = newScale;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetBellyPosition(Vector3 newPos)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.bellyPositionOffset = newPos;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetBellyScale(Vector3 newScale)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.bellyScaleOffset = newScale;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetTailPosition(Vector3 newPos)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.tailPositionOffset = newPos;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static void SetTailScale(Vector3 newScale)
		{
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				BodyOffsetStruct offsetStruct = Mod.Instance.Players[0].OffsetStruct;
				offsetStruct.tailScaleOffset = newScale;
				Mod.Instance.Players[0].OffsetStruct = offsetStruct;
			}
		}

		public static Vector3 GetTailScale()
		{
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_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)
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				return Mod.Instance.Players[0].OffsetStruct.tailScaleOffset;
			}
			return Vector3.one;
		}

		public static Vector3 GetBaseTailScale()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: 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)
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				return Mod.Instance.Players[0].tailScale;
			}
			return Vector3.one;
		}

		public static Vector3 SetBaseTailScale(Vector3 newScale)
		{
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_003a: 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)
			//IL_0029: 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_002b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			if (Mod.Instance.Players.Count != 0)
			{
				return Mod.Instance.Players[0].tailScale = newScale;
			}
			return Vector3.one;
		}

		public static void AdjustBoobPosition(Vector3 targetPos, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.boobPositionOffset, targetPos, Mod.Instance.Players[0].boobPVelocity, duration));
			}
		}

		public static void AdjustBoobScale(Vector3 targetScale, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.boobScaleOffset, targetScale, Mod.Instance.Players[0].boobSVelocity, duration));
			}
		}

		public static void AdjustButtPosition(Vector3 targetPos, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.buttPositionOffset, targetPos, Mod.Instance.Players[0].buttPVelocity, duration));
			}
		}

		public static void AdjustButtScale(Vector3 targetScale, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.buttScaleOffset, targetScale, Mod.Instance.Players[0].buttSVelocity, duration));
			}
		}

		public static void AdjustBellyPosition(Vector3 targetPos, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.bellyPositionOffset, targetPos, Mod.Instance.Players[0].bellyPVelocity, duration));
			}
		}

		public static void AdjustBellyScale(Vector3 targetScale, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.bellyScaleOffset, targetScale, Mod.Instance.Players[0].bellySVelocity, duration));
			}
		}

		public static void AdjustTailPosition(Vector3 targetPos, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.tailPositionOffset, targetPos, Mod.Instance.Players[0].tailPVelocity, duration));
			}
		}

		public static void AdjustTailScale(Vector3 targetScale, float duration)
		{
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0038: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0]._offsetStruct.tailScaleOffset, targetScale, Mod.Instance.Players[0].tailSVelocity, duration));
			}
		}

		public static void AdjustBaseTailScale(Vector3 targetScale, float duration)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: 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)
			if (Mod.Instance.Players.Count != 0)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.AdjustOffset(0, Mod.Instance.Players[0].tailScale, targetScale, Mod.Instance.Players[0].tailSVelocity, duration));
			}
		}
	}
	public static class DebugHelper
	{
		public static float debugFloat { get; set; }

		public static Vector3 debugVector { get; set; }

		public static void ListAllChildTransforms(Transform transform, int indentAmount)
		{
			string text = "   ";
			string text2 = "";
			for (int i = 0; i < indentAmount; i++)
			{
				text2 += text;
			}
			for (int j = 0; j < transform.childCount; j++)
			{
				Mod.Log.LogInfo((object)(text2 + "Transform: " + ((Object)transform.GetChild(j)).name));
				if (transform.GetChild(j).childCount > 0)
				{
					ListAllChildTransforms(transform.GetChild(j), indentAmount + 1);
				}
			}
		}

		public static void ListAllComponents(GameObject gameObject)
		{
			Component[] componentsInChildren = gameObject.GetComponentsInChildren(typeof(Component));
			Component[] array = componentsInChildren;
			foreach (Component val in array)
			{
				Mod.Log.LogInfo((object)("Component: " + ((object)val).ToString()));
			}
		}

		public static void ListAllColliders(GameObject gameObject)
		{
			Component[] componentsInChildren = gameObject.GetComponentsInChildren(typeof(Collider));
			Component[] array = componentsInChildren;
			foreach (Component val in array)
			{
				Mod.Log.LogInfo((object)("Collider: " + ((object)val).ToString()));
			}
		}
	}
	public static class HelperFunctions
	{
		public static float[] Vector3ToFloats(Vector3 v3)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: 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)
			return new float[3] { v3.x, v3.y, v3.z };
		}

		public static Vector3 FloatsToVector3(float[] fs)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: 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_0013: 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)
			if (fs.Length != 3)
			{
				return Vector3.zero;
			}
			return new Vector3(fs[0], fs[1], fs[2]);
		}

		public static BodyOffsetStruct OffsetFileToStruct(OffsetFile oFile)
		{
			//IL_001e: 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_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_0042: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_008a: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			return new BodyOffsetStruct
			{
				name = oFile.name,
				boobPositionOffset = FloatsToVector3(oFile.boobPosition),
				boobScaleOffset = FloatsToVector3(oFile.boobScale),
				buttPositionOffset = FloatsToVector3(oFile.buttPosition),
				buttScaleOffset = FloatsToVector3(oFile.buttScale),
				bellyPositionOffset = FloatsToVector3(oFile.bellyPosition),
				bellyScaleOffset = FloatsToVector3(oFile.bellyScale),
				tailPositionOffset = FloatsToVector3(oFile.tailPosition),
				tailScaleOffset = FloatsToVector3(oFile.tailScale)
			};
		}

		public static OffsetFile StructToOffsetFile(BodyOffsetStruct bStruct)
		{
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_008c: Unknown result type (might be due to invalid IL or missing references)
			OffsetFile offsetFile = new OffsetFile();
			offsetFile.name = bStruct.name;
			offsetFile.boobPosition = Vector3ToFloats(bStruct.boobPositionOffset);
			offsetFile.boobScale = Vector3ToFloats(bStruct.boobScaleOffset);
			offsetFile.buttPosition = Vector3ToFloats(bStruct.buttPositionOffset);
			offsetFile.buttScale = Vector3ToFloats(bStruct.buttScaleOffset);
			offsetFile.bellyPosition = Vector3ToFloats(bStruct.bellyPositionOffset);
			offsetFile.bellyScale = Vector3ToFloats(bStruct.bellyScaleOffset);
			offsetFile.tailPosition = Vector3ToFloats(bStruct.tailPositionOffset);
			offsetFile.tailScale = Vector3ToFloats(bStruct.tailScaleOffset);
			return offsetFile;
		}

		public static BodyOffsetStruct DefaultOffsetStruct()
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_0028: 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_0034: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			//IL_0047: Unknown result type (might be due to invalid IL or missing references)
			//IL_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			return new BodyOffsetStruct
			{
				name = "",
				boobPositionOffset = Vector3.zero,
				boobScaleOffset = Vector3.zero,
				buttPositionOffset = Vector3.zero,
				buttScaleOffset = Vector3.zero,
				bellyPositionOffset = Vector3.zero,
				bellyScaleOffset = Vector3.zero,
				tailPositionOffset = Vector3.zero,
				tailScaleOffset = Vector3.zero
			};
		}

		public static bool OffsetStructChanged(BodyOffsetStruct oldBos, BodyOffsetStruct newBos)
		{
			//IL_0002: 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_0020: Unknown result type (might be due to invalid IL or missing references)
			//IL_0026: Unknown result type (might be due to invalid IL or missing references)
			//IL_003e: 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_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Unknown result type (might be due to invalid IL or missing references)
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			bool flag = oldBos.boobPositionOffset != newBos.boobPositionOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.boobScaleOffset != newBos.boobScaleOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.buttPositionOffset != newBos.buttPositionOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.buttScaleOffset != newBos.buttScaleOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.bellyPositionOffset != newBos.bellyPositionOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.bellyScaleOffset != newBos.bellyPositionOffset;
			if (flag)
			{
				return flag;
			}
			flag = oldBos.tailPositionOffset != newBos.tailPositionOffset;
			if (flag)
			{
				return flag;
			}
			return oldBos.tailScaleOffset != newBos.tailScaleOffset;
		}
	}
	[Serializable]
	public class OffsetFile
	{
		public string name;

		public float[] boobPosition;

		public float[] boobScale;

		public float[] buttPosition;

		public float[] buttScale;

		public float[] bellyPosition;

		public float[] bellyScale;

		public float[] tailPosition;

		public float[] tailScale;
	}
	public class OffsetProfileManager
	{
		public OffsetFile offsetFile;

		private static string filePrefix = "atl_offsets_";

		private string savePath = string.Empty;

		public OffsetProfileManager(string dataPath)
		{
			savePath = dataPath + "/AppearanceOffsets/";
		}

		public BodyOffsetStruct LoadOffsets(int index)
		{
			string text = filePrefix + index;
			string path = savePath + text;
			try
			{
				if (!File.Exists(path))
				{
					return HelperFunctions.DefaultOffsetStruct();
				}
				offsetFile = JsonUtility.FromJson<OffsetFile>(File.ReadAllText(path));
				return HelperFunctions.OffsetFileToStruct(offsetFile);
			}
			catch (Exception ex)
			{
				Mod.Log.LogWarning((object)"Could not load offset file properly. Either save a new file or fix the formatting and reload your character \nUsing default values...");
				Mod.Log.LogWarning((object)ex.ToString());
				return HelperFunctions.DefaultOffsetStruct();
			}
		}

		public void SaveOffsets(BodyOffsetStruct oStruct)
		{
			if (!Directory.Exists(savePath))
			{
				Directory.CreateDirectory(savePath);
			}
			offsetFile = HelperFunctions.StructToOffsetFile(oStruct);
			string contents = JsonUtility.ToJson((object)offsetFile, true);
			File.WriteAllText(savePath + filePrefix + ProfileDataManager._current.SelectedFileIndex, contents);
		}
	}
	public struct BodyOffsetStruct
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)]
		public string name;

		public Vector3 boobPositionOffset;

		public Vector3 boobScaleOffset;

		public Vector3 buttPositionOffset;

		public Vector3 buttScaleOffset;

		public Vector3 bellyPositionOffset;

		public Vector3 bellyScaleOffset;

		public Vector3 tailPositionOffset;

		public Vector3 tailScaleOffset;
	}
	[DefaultExecutionOrder(3000)]
	public class PlayerOffsets
	{
		public BodyOffsetStruct _offsetStruct = HelperFunctions.DefaultOffsetStruct();

		public Vector3 boobPVelocity = Vector3.zero;

		public Vector3 boobSVelocity = Vector3.zero;

		public Vector3 buttPVelocity = Vector3.zero;

		public Vector3 buttSVelocity = Vector3.zero;

		public Vector3 bellyPVelocity = Vector3.zero;

		public Vector3 bellySVelocity = Vector3.zero;

		public Vector3 tailPVelocity = Vector3.zero;

		public Vector3 tailSVelocity = Vector3.zero;

		private bool hasTail = false;

		public Player player;

		private string id;

		public string name;

		private Vector3 tailPosition;

		public Vector3 tailScale = Vector3.one;

		public BodyOffsetStruct OffsetStruct
		{
			get
			{
				return _offsetStruct;
			}
			set
			{
				if ((Object)(object)player == (Object)(object)Player._mainPlayer)
				{
					BoneAdjuster.OnOffsetsChanged.Invoke();
				}
				_offsetStruct = value;
			}
		}

		public PlayerOffsets(Player newPlayer)
		{
			//IL_000c: 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)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: 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_0027: 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)
			//IL_0038: Unknown result type (might be due to invalid IL or missing references)
			//IL_003d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0043: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0053: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: 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_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_0110: Unknown result type (might be due to invalid IL or missing references)
			//IL_0115: 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_014d: Unknown result type (might be due to invalid IL or missing references)
			player = newPlayer;
			id = newPlayer.Network_steamID;
			name = newPlayer.Network_nickname;
			BodyOffsetStruct offsetStruct = _offsetStruct;
			offsetStruct.name = newPlayer.Network_nickname;
			_offsetStruct = offsetStruct;
			try
			{
				tailPosition = newPlayer._pVisual._playerRaceModel._tailDisplays[newPlayer._pVisual._playerRaceModel.SetTailIndex].rootBone.localPosition;
				tailScale = newPlayer._pVisual._playerRaceModel._tailDisplays[newPlayer._pVisual._playerRaceModel.SetTailIndex].rootBone.localScale;
				hasTail = true;
				if ((Object)(object)player == (Object)(object)Player._mainPlayer)
				{
					Mod.Instance.originalTailPos = tailPosition;
					Mod.Instance.originalTailScale = tailScale;
				}
			}
			catch (Exception)
			{
				hasTail = false;
				Mod.Log.LogInfo((object)(name + " has no tail"));
			}
			Mod.Log.LogInfo((object)(name + " is ready for Offsets"));
		}

		public void AdjustBones()
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Invalid comparison between Unknown and I4
			//IL_0088: Unknown result type (might be due to invalid IL or missing references)
			//IL_0092: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009e: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: 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_00e4: 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_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0100: Unknown result type (might be due to invalid IL or missing references)
			//IL_0108: Unknown result type (might be due to invalid IL or missing references)
			//IL_010d: 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_01c0: Unknown result type (might be due to invalid IL or missing references)
			//IL_0218: Unknown result type (might be due to invalid IL or missing references)
			//IL_0219: Unknown result type (might be due to invalid IL or missing references)
			//IL_01d8: 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_01e2: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
			//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0200: 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_0207: Unknown result type (might be due to invalid IL or missing references)
			//IL_020c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027c: Unknown result type (might be due to invalid IL or missing references)
			//IL_027e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0232: Unknown result type (might be due to invalid IL or missing references)
			//IL_0237: Unknown result type (might be due to invalid IL or missing references)
			//IL_0238: Unknown result type (might be due to invalid IL or missing references)
			//IL_024a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0251: Unknown result type (might be due to invalid IL or missing references)
			//IL_0257: Unknown result type (might be due to invalid IL or missing references)
			//IL_026a: 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_0270: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d6: Unknown result type (might be due to invalid IL or missing references)
			//IL_02d7: 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_029b: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a2: Unknown result type (might be due to invalid IL or missing references)
			//IL_02a7: Unknown result type (might be due to invalid IL or missing references)
			//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
			//IL_02be: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_02c5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02ca: Unknown result type (might be due to invalid IL or missing references)
			//IL_033a: Unknown result type (might be due to invalid IL or missing references)
			//IL_033c: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f0: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f5: Unknown result type (might be due to invalid IL or missing references)
			//IL_02f6: Unknown result type (might be due to invalid IL or missing references)
			//IL_0308: Unknown result type (might be due to invalid IL or missing references)
			//IL_030f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0315: 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_032d: Unknown result type (might be due to invalid IL or missing references)
			//IL_032e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0371: Unknown result type (might be due to invalid IL or missing references)
			//IL_0372: Unknown result type (might be due to invalid IL or missing references)
			//IL_0354: Unknown result type (might be due to invalid IL or missing references)
			//IL_0359: Unknown result type (might be due to invalid IL or missing references)
			//IL_035e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0360: Unknown result type (might be due to invalid IL or missing references)
			//IL_0365: Unknown result type (might be due to invalid IL or missing references)
			//IL_038b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0390: Unknown result type (might be due to invalid IL or missing references)
			//IL_0391: Unknown result type (might be due to invalid IL or missing references)
			//IL_03de: Unknown result type (might be due to invalid IL or missing references)
			//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_040d: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f4: Unknown result type (might be due to invalid IL or missing references)
			//IL_03f9: Unknown result type (might be due to invalid IL or missing references)
			//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
			//IL_0419: Unknown result type (might be due to invalid IL or missing references)
			//IL_041b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0448: Unknown result type (might be due to invalid IL or missing references)
			//IL_042f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0434: Unknown result type (might be due to invalid IL or missing references)
			//IL_0436: Unknown result type (might be due to invalid IL or missing references)
			if ((Object)(object)player == (Object)null || (int)player.Network_currentGameCondition != 1 || (Object)(object)player._pVisual == (Object)null || (Object)(object)player._pVisual._playerRaceModel == (Object)null)
			{
				return;
			}
			PlayerRaceModel playerRaceModel = player._pVisual._playerRaceModel;
			Vector3 val = _offsetStruct.boobPositionOffset / 100f;
			Vector3 val2 = _offsetStruct.buttPositionOffset / 100f;
			Vector3 val3 = _offsetStruct.bellyPositionOffset / 100f;
			Vector3 boobScaleOffset = _offsetStruct.boobScaleOffset;
			Vector3 buttScaleOffset = _offsetStruct.buttScaleOffset;
			Vector3 bellyScaleOffset = _offsetStruct.bellyScaleOffset;
			Vector3 val4 = _offsetStruct.tailPositionOffset / 100f;
			Vector3 tailScaleOffset = _offsetStruct.tailScaleOffset;
			DynamicBone val5 = playerRaceModel._boobDynamicBones[0];
			DynamicBone val6 = playerRaceModel._boobDynamicBones[1];
			DynamicBone val7 = playerRaceModel._assDynamicBones[0];
			DynamicBone val8 = playerRaceModel._assDynamicBones[1];
			DynamicBone val9 = playerRaceModel._bellyDynamicBone[0];
			((Behaviour)val5).enabled = true;
			val5.m_DistantDisable = false;
			val5.m_DisableByCameraFunc = false;
			((Behaviour)val6).enabled = true;
			val6.m_DistantDisable = false;
			val6.m_DisableByCameraFunc = false;
			((Behaviour)val7).enabled = true;
			val7.m_DistantDisable = false;
			val7.m_DisableByCameraFunc = false;
			((Behaviour)val8).enabled = true;
			val8.m_DistantDisable = false;
			val8.m_DisableByCameraFunc = false;
			((Behaviour)val9).enabled = true;
			val9.m_DistantDisable = false;
			val9.m_DisableByCameraFunc = false;
			if (boobScaleOffset != Vector3.zero)
			{
				val5.m_Root.localScale = Vector3.Scale(Vector3.one, Vector3.one + boobScaleOffset);
				val6.m_Root.localScale = Vector3.Scale(Vector3.one, Vector3.one + boobScaleOffset);
			}
			if (val != Vector3.zero)
			{
				Transform root = val5.m_Root;
				root.localPosition += val;
				((Vector3)(ref val))..ctor(-1f * val.x, val.y, val.z);
				Transform root2 = val6.m_Root;
				root2.localPosition += val;
			}
			if (buttScaleOffset != Vector3.zero)
			{
				val7.m_Root.localScale = Vector3.Scale(Vector3.one, Vector3.one + buttScaleOffset);
				val8.m_Root.localScale = Vector3.Scale(Vector3.one, Vector3.one + buttScaleOffset);
			}
			if (val2 != Vector3.zero)
			{
				Transform root3 = val7.m_Root;
				root3.localPosition += val2;
				((Vector3)(ref val2))..ctor(-1f * val2.x, val2.y, val2.z);
				Transform root4 = val8.m_Root;
				root4.localPosition += val2;
			}
			if (bellyScaleOffset != Vector3.zero)
			{
				val9.m_Root.localScale = Vector3.Scale(Vector3.one, Vector3.one + bellyScaleOffset);
			}
			if (val3 != Vector3.zero)
			{
				Transform root5 = val9.m_Root;
				root5.localPosition += val3;
			}
			if ((Object)(object)playerRaceModel._tailDisplays[playerRaceModel.SetTailIndex].rootBone != (Object)null && hasTail)
			{
				Transform rootBone = playerRaceModel._tailDisplays[playerRaceModel.SetTailIndex].rootBone;
				if (tailScaleOffset != Vector3.zero)
				{
					rootBone.localScale = tailScale + tailScaleOffset;
				}
				else
				{
					rootBone.localScale = tailScale;
				}
				if (val4 != Vector3.zero)
				{
					rootBone.localPosition = tailPosition + val4;
				}
				else
				{
					rootBone.localPosition = tailPosition;
				}
			}
		}
	}
	[BepInPlugin("ATLYSS.AppearanceOffsets", "Appearance Offsets", "1.0.1")]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public sealed class Mod : BaseUnityPlugin
	{
		[Serializable]
		[CompilerGenerated]
		private sealed class <>c
		{
			public static readonly <>c <>9 = new <>c();

			public static UnityAction <>9__73_1;

			internal void <GetPlayerData>b__73_1()
			{
				if (Instance.Players.Count > 0)
				{
					Instance.offsetProfile.SaveOffsets(Instance.Players[0].OffsetStruct);
				}
				if (!AtlyssNetworkManager._current._soloMode)
				{
					CodeYapper.SendPing();
				}
			}
		}

		private const string modGUID = "ATLYSS.AppearanceOffsets";

		private const string modName = "Appearance Offsets";

		private const string modVersion = "1.0.1";

		private bool openOffsetWindow = false;

		private string oldBoobPX = "0.0";

		private string oldBoobPY = "0.0";

		private string oldBoobPZ = "0.0";

		private string oldBoobSX = "0.0";

		private string oldBoobSY = "0.0";

		private string oldBoobSZ = "0.0";

		private string oldButtPX = "0.0";

		private string oldButtPY = "0.0";

		private string oldButtPZ = "0.0";

		private string oldButtSX = "0.0";

		private string oldButtSY = "0.0";

		private string oldButtSZ = "0.0";

		private string oldBellyPX = "0.0";

		private string oldBellyPY = "0.0";

		private string oldBellyPZ = "0.0";

		private string oldBellySX = "0.0";

		private string oldBellySY = "0.0";

		private string oldBellySZ = "0.0";

		private string oldTailPX = "0.0";

		private string oldTailPY = "0.0";

		private string oldTailPZ = "0.0";

		private string oldTailSX = "0.0";

		private string oldTailSY = "0.0";

		private string oldTailSZ = "0.0";

		private Rect offsetRect = new Rect(10f, 10f, 300f, 900f);

		private readonly int offsetId = new Random().Next(300, 399);

		private Vector2 scrollPosition = Vector2.zero;

		private static readonly Harmony harmony = new Harmony("ATLYSS.AppearanceOffsets");

		public static ManualLogSource Log = new ManualLogSource("Appearance Offsets");

		public static Mod Instance;

		private ConfigEntry<bool> AutoApply { get; set; }

		private ConfigEntry<KeyCode> OffsetMenuHotKey { get; set; }

		public List<Player> waitForPing { get; set; } = new List<Player>();

		public List<PlayerOffsets> Players { get; set; } = new List<PlayerOffsets>();

		public OffsetProfileManager offsetProfile { get; set; }

		public BodyOffsetStruct originalOffsets { get; set; }

		public Vector3 originalTailPos { get; set; }

		public Vector3 originalTailScale { get; set; }

		public void Awake()
		{
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Expected O, but got Unknown
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Expected O, but got Unknown
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b5: Expected O, but got Unknown
			//IL_00c2: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cc: Expected O, but got Unknown
			//IL_00df: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Expected O, but got Unknown
			//IL_00f1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fb: Expected O, but got Unknown
			if ((Object)(object)Instance == (Object)null)
			{
				Instance = this;
			}
			Log = Logger.CreateLogSource("ATLYSS.AppearanceOffsets");
			Log.LogInfo((object)"Now loading Appearance Offsets...");
			AutoApply = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Auto Apply Offsets", false, new ConfigDescription("Will automatically apply offsets and update them to server", (AcceptableValueBase)null, Array.Empty<object>()));
			OffsetMenuHotKey = ((BaseUnityPlugin)this).Config.Bind<KeyCode>("General", "Offset Menu Hotkey", (KeyCode)290, new ConfigDescription("The button that will open the Offset Menu", (AcceptableValueBase)null, Array.Empty<object>()));
			if (EasySettingsCompatibility.enabled)
			{
				EasySettingsCompatibility.OnInitialized.AddListener((UnityAction)delegate
				{
					EasySettingsCompatibility.AddHeader("Appearance Offsets");
					EasySettingsCompatibility.AddToggle("Auto Apply Offsets", AutoApply);
					EasySettingsCompatibility.AddKeyButton("Offset Menu Hotkey", OffsetMenuHotKey);
				});
				EasySettingsCompatibility.OnApplySettings.AddListener((UnityAction)delegate
				{
					((BaseUnityPlugin)this).Config.Save();
				});
			}
			if (CodeYapper.enabled)
			{
				CodeYapper.RegisterListener<StringPacket>(new BinaryPacketListener(CodeYapper.ReceivePacket));
				CodeYapper.RegisterListener<OffsetPacket>(new BinaryPacketListener(CodeYapper.ReceivePacket));
			}
			Log.LogInfo((object)"Patching...");
			harmony.PatchAll();
			Log.LogInfo((object)"Patched!");
		}

		private static void OnConfigChanged(object sender, EventArgs e)
		{
			//IL_0028: Unknown result type (might be due to invalid IL or missing references)
			//IL_002e: Invalid comparison between Unknown and I4
			SettingChangedEventArgs e2 = (SettingChangedEventArgs)(object)((e is SettingChangedEventArgs) ? e : null);
			if (e2 != null && !((Object)(object)Player._mainPlayer == (Object)null) && (int)Player._mainPlayer._currentGameCondition == 1)
			{
			}
		}

		public void Update()
		{
			//IL_0031: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Invalid comparison between Unknown and I4
			//IL_004b: Unknown result type (might be due to invalid IL or missing references)
			if (Players.Count == 0 || (Object)(object)Player._mainPlayer == (Object)null || (int)Player._mainPlayer._currentGameCondition != 1)
			{
				return;
			}
			if (Input.GetKeyDown(OffsetMenuHotKey.Value) && !Player._mainPlayer._inChat && !SettingsManager._current._isOpen && !HostConsole._current._isOpen && !TabMenu._current._isOpen)
			{
				openOffsetWindow = !openOffsetWindow;
				if (openOffsetWindow)
				{
					CameraFunction._current._unlockedCamera = true;
				}
				else
				{
					CameraFunction._current._unlockedCamera = false;
				}
			}
			if (Player._mainPlayer._inChat || SettingsManager._current._isOpen || HostConsole._current._isOpen || (TabMenu._current._isOpen && openOffsetWindow))
			{
				openOffsetWindow = false;
			}
		}

		private void OnGUI()
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Invalid comparison between Unknown and I4
			//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_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_008b: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_0095: Unknown result type (might be due to invalid IL or missing references)
			if (Players.Count != 0 && !((Object)(object)Player._mainPlayer == (Object)null) && (int)Player._mainPlayer._currentGameCondition == 1 && openOffsetWindow)
			{
				offsetRect = new Rect(10f, 10f, (float)Screen.width / 3.5f, (float)(Screen.height - 30));
				GUI.Window(offsetId, offsetRect, new WindowFunction(DrawOffsetWindow), "Appearance Offsets");
			}
		}

		public void LateUpdate()
		{
			if (Players.Count == 0)
			{
				return;
			}
			foreach (PlayerOffsets player in Players)
			{
				player.AdjustBones();
			}
		}

		private void DrawOffsetWindow(int id)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			BodyOffsetStruct offsetStruct = Players[0]._offsetStruct;
			BodyOffsetStruct oldBos = offsetStruct;
			scrollPosition = GUILayout.BeginScrollView(scrollPosition, (GUILayoutOption[])(object)new GUILayoutOption[2]
			{
				GUILayout.Width(((Rect)(ref offsetRect)).width - 10f),
				GUILayout.Height(((Rect)(ref offsetRect)).height - 30f)
			});
			GUILayout.Label("Boob Position", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.boobPositionOffset.x, ref oldBoobPX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.boobPositionOffset.y, ref oldBoobPY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.boobPositionOffset.z, ref oldBoobPZ);
			GUILayout.Space(1f);
			GUILayout.Label("Boob Scale", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.boobScaleOffset.x, ref oldBoobSX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.boobScaleOffset.y, ref oldBoobSY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.boobScaleOffset.z, ref oldBoobSZ);
			GUILayout.Space(10f);
			GUILayout.Label("Belly Position", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.bellyPositionOffset.x, ref oldBellyPX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.bellyPositionOffset.y, ref oldBellyPY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.bellyPositionOffset.z, ref oldBellyPZ);
			GUILayout.Space(1f);
			GUILayout.Label("Belly Scale", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.bellyScaleOffset.x, ref oldBellySX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.bellyScaleOffset.y, ref oldBellySY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.bellyScaleOffset.z, ref oldBellySZ);
			GUILayout.Space(10f);
			GUILayout.Label("Butt Position", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.buttPositionOffset.x, ref oldButtPX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.buttPositionOffset.y, ref oldButtPY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.buttPositionOffset.z, ref oldButtPZ);
			GUILayout.Space(1f);
			GUILayout.Label("Butt Scale", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.buttScaleOffset.x, ref oldButtSX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.buttScaleOffset.y, ref oldButtSY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.buttScaleOffset.z, ref oldButtSZ);
			GUILayout.Space(10f);
			GUILayout.Label("Tail Position", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.tailPositionOffset.x, ref oldTailPX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.tailPositionOffset.y, ref oldTailPY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.tailPositionOffset.z, ref oldTailPZ);
			GUILayout.Space(1f);
			GUILayout.Label("Tail Scale", Array.Empty<GUILayoutOption>());
			InteractiveUI("    X-Offset: ", ref offsetStruct.tailScaleOffset.x, ref oldTailSX);
			InteractiveUI("    Y-Offset: ", ref offsetStruct.tailScaleOffset.y, ref oldTailSY);
			InteractiveUI("    Z-Offset: ", ref offsetStruct.tailScaleOffset.z, ref oldTailSZ);
			GUILayout.Space(10f);
			if (!AutoApply.Value)
			{
				Players[0]._offsetStruct = offsetStruct;
				if (GUILayout.Button("Apply", Array.Empty<GUILayoutOption>()))
				{
					Players[0].OffsetStruct = offsetStruct;
				}
				if (GUILayout.Button("Undo", Array.Empty<GUILayoutOption>()))
				{
					Players[0]._offsetStruct = originalOffsets;
				}
			}
			else if (HelperFunctions.OffsetStructChanged(oldBos, offsetStruct))
			{
				Players[0].OffsetStruct = offsetStruct;
			}
			if (GUILayout.Button("Reset", Array.Empty<GUILayoutOption>()))
			{
				if (AutoApply.Value)
				{
					Players[0].OffsetStruct = HelperFunctions.DefaultOffsetStruct();
				}
				else
				{
					Players[0]._offsetStruct = HelperFunctions.DefaultOffsetStruct();
				}
			}
			GUILayout.EndScrollView();
			static void InteractiveUI(string prefix, ref float offsetValue, ref string oldTextValue)
			{
				GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
				GUILayout.Label(prefix ?? "", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(70f) });
				if (oldTextValue == "0")
				{
					oldTextValue = "0.0";
				}
				string s = GUILayout.TextField(oldTextValue, Array.Empty<GUILayoutOption>());
				GUILayout.EndHorizontal();
				float.TryParse(s, out var result);
				offsetValue = ((float.Parse(oldTextValue) != result) ? GUILayout.HorizontalSlider(result, -1f, 1f, Array.Empty<GUILayoutOption>()) : GUILayout.HorizontalSlider(offsetValue, -1f, 1f, Array.Empty<GUILayoutOption>()));
				if (offsetValue == float.NaN)
				{
					offsetValue = 0f;
				}
				oldTextValue = offsetValue.ToString();
			}
		}

		public static IEnumerator AdjustOffset(int index, Vector3 offset, Vector3 target, Vector3 velocity, float duration)
		{
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: 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_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Unknown result type (might be due to invalid IL or missing references)
			while (Instance.Players.Count > index)
			{
				offset = Vector3.SmoothDamp(offset, target, ref velocity, duration);
				yield return null;
				if (!(Vector3.Distance(offset, target) > 0.001f))
				{
					break;
				}
			}
			if (Instance.Players.Count <= index)
			{
				offset = target;
			}
		}

		public static IEnumerator GetPlayerData(PlayerVisual pVisual)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (Object)(object)pVisual._raceModelObject != (Object)null));
			Instance.Players.Add(new PlayerOffsets(pVisual._player));
			if (!((Object)(object)pVisual._player == (Object)(object)Player._mainPlayer))
			{
				yield break;
			}
			BodyOffsetStruct loadedStruct = Instance.offsetProfile.LoadOffsets(ProfileDataManager._current.SelectedFileIndex);
			loadedStruct.name = pVisual._player.Network_nickname;
			Instance.Players[0]._offsetStruct = loadedStruct;
			Instance.originalOffsets = Instance.Players[0].OffsetStruct;
			UnityEvent onOffsetsChanged = BoneAdjuster.OnOffsetsChanged;
			object obj = <>c.<>9__73_1;
			if (obj == null)
			{
				UnityAction val = delegate
				{
					if (Instance.Players.Count > 0)
					{
						Instance.offsetProfile.SaveOffsets(Instance.Players[0].OffsetStruct);
					}
					if (!AtlyssNetworkManager._current._soloMode)
					{
						CodeYapper.SendPing();
					}
				};
				<>c.<>9__73_1 = val;
				obj = (object)val;
			}
			onOffsetsChanged.AddListener((UnityAction)obj);
		}

		public static IEnumerator SendPlayerData(Player player)
		{
			yield return (object)new WaitUntil((Func<bool>)(() => (int)player._currentGameCondition == 1 && (int)Player._mainPlayer._currentGameCondition == 1));
			if (!AtlyssNetworkManager._current._soloMode)
			{
				CodeYapper.SendPing();
			}
		}
	}
}
namespace Atlyss.AppearanceOffsets.SoftDependencies
{
	public static class CodeYapper
	{
		private const MethodImplOptions SoftDepend = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization;

		public const string modGUID = "CodeTalker";

		private static bool? _enabled;

		private static BaseUnityPlugin? _plugin;

		public static Version CurrentVersion { get; private set; } = new Version("2.2.3");

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("CodeTalker");
					_plugin = (Chainloader.PluginInfos.TryGetValue("CodeTalker", out var value) ? value.Instance : null);
					if ((Object)(object)_plugin == (Object)null)
					{
						Mod.Log.LogWarning((object)"Soft dependency CodeTalker was not found.");
					}
					else
					{
						CurrentVersion = _plugin.Info.Metadata.Version;
					}
				}
				return _enabled.Value;
			}
		}

		public static void ReceivePacket(PacketHeader header, BinaryPacketBase packet)
		{
			if (packet is StringPacket stringPacket)
			{
				Player[] array = Object.FindObjectsOfType<Player>();
				Player[] array2 = array;
				foreach (Player val in array2)
				{
					if (!((Object)(object)val == (Object)(object)Player._mainPlayer) && val._nickname == stringPacket.sData && val._steamID == header.SenderID.ToString())
					{
						Mod.Log.LogInfo((object)(Player._mainPlayer.Network_nickname + " Received Ping from " + val.Network_nickname));
						break;
					}
				}
			}
			if (!(packet is OffsetPacket offsetPacket))
			{
				return;
			}
			Player[] array3 = Object.FindObjectsOfType<Player>();
			Player[] array4 = array3;
			foreach (Player p in array4)
			{
				if (!((Object)(object)p == (Object)(object)Player._mainPlayer) && p._nickname == offsetPacket.oData.name && p._steamID == header.SenderID.ToString())
				{
					PlayerOffsets playerOffsets = Mod.Instance.Players.Find((PlayerOffsets o) => (Object)(object)o.player == (Object)(object)p);
					if (playerOffsets != null)
					{
						playerOffsets._offsetStruct = offsetPacket.oData;
					}
					else
					{
						playerOffsets = new PlayerOffsets(p);
						playerOffsets._offsetStruct = offsetPacket.oData;
						Mod.Instance.Players.Add(playerOffsets);
					}
					Player val2 = Mod.Instance.waitForPing.Find((Player pl) => (Object)(object)pl == (Object)(object)p);
					if ((Object)(object)val2 != (Object)null)
					{
						((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.SendPlayerData(Player._mainPlayer));
						Mod.Instance.waitForPing.Remove(val2);
					}
					break;
				}
			}
		}

		public static void SendPing()
		{
			if (enabled)
			{
				SendPacket((BinaryPacketBase)(object)new OffsetPacket(Mod.Instance.Players[0].OffsetStruct));
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static bool RegisterListener<T>(BinaryPacketListener listener) where T : BinaryPacketBase, new()
		{
			return CodeTalkerNetwork.RegisterListener<T>(listener);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static void SendPacket(BinaryPacketBase binaryPacket)
		{
			CodeTalkerNetwork.SendNetworkPacket(binaryPacket, (CompressionType)0, CompressionLevel.Fastest);
		}
	}
	public class StringPacket : BinaryPacketBase
	{
		public byte[] Payload { get; set; }

		public string sData { get; set; } = string.Empty;

		public override string PacketSignature => "AO.S";

		public StringPacket()
		{
		}

		public StringPacket(string value)
		{
			sData = value;
		}

		public override void Deserialize(byte[] data)
		{
			Payload = data;
			sData = Encoding.ASCII.GetString(data);
		}

		public override byte[] Serialize()
		{
			return Encoding.ASCII.GetBytes(sData);
		}
	}
	public class OffsetPacket : BinaryPacketBase
	{
		public byte[] Payload { get; set; }

		public BodyOffsetStruct oData { get; set; }

		public override string PacketSignature => "AO.OF";

		public OffsetPacket()
		{
		}

		public OffsetPacket(BodyOffsetStruct oStruct)
		{
			oData = oStruct;
		}

		public override void Deserialize(byte[] data)
		{
			Payload = data;
			BodyOffsetStruct bodyOffsetStruct = HelperFunctions.DefaultOffsetStruct();
			int num = Marshal.SizeOf(bodyOffsetStruct);
			IntPtr intPtr = IntPtr.Zero;
			try
			{
				intPtr = Marshal.AllocHGlobal(num);
				Marshal.Copy(data, 0, intPtr, num);
				bodyOffsetStruct = (BodyOffsetStruct)Marshal.PtrToStructure(intPtr, bodyOffsetStruct.GetType());
			}
			finally
			{
				Marshal.FreeHGlobal(intPtr);
			}
			oData = bodyOffsetStruct;
		}

		public override byte[] Serialize()
		{
			int num = Marshal.SizeOf(oData);
			byte[] array = new byte[num];
			IntPtr intPtr = IntPtr.Zero;
			try
			{
				intPtr = Marshal.AllocHGlobal(num);
				Marshal.StructureToPtr(oData, intPtr, fDeleteOld: true);
				Marshal.Copy(intPtr, array, 0, num);
			}
			finally
			{
				Marshal.FreeHGlobal(intPtr);
			}
			return array;
		}
	}
	public static class EasySettingsCompatibility
	{
		private const MethodImplOptions SoftDepend = MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization;

		public const string modGUID = "EasySettings";

		private static bool _warnedAboutTextFields = false;

		private static bool _warnedAboutModTabs = false;

		private static bool? _enabled;

		private static BaseUnityPlugin? _plugin;

		public static Version CurrentVersion { get; private set; } = new Version("1.3.0");

		public static bool enabled
		{
			get
			{
				if (!_enabled.HasValue)
				{
					_enabled = Chainloader.PluginInfos.ContainsKey("EasySettings");
					_plugin = (Chainloader.PluginInfos.TryGetValue("EasySettings", out var value) ? value.Instance : null);
					if ((Object)(object)_plugin == (Object)null)
					{
						Mod.Log.LogWarning((object)"Soft dependency EasySettings was not found.");
					}
					else
					{
						CurrentVersion = _plugin.Info.Metadata.Version;
					}
				}
				return _enabled.Value;
			}
		}

		public static UnityEvent OnInitialized
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			get
			{
				return Settings.OnInitialized;
			}
		}

		public static UnityEvent OnCancelSettings
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			get
			{
				return Settings.OnCancelSettings;
			}
		}

		public static UnityEvent OnApplySettings
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			get
			{
				return Settings.OnApplySettings;
			}
		}

		public static UnityEvent OnCloseSettings
		{
			[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
			get
			{
				return Settings.OnCloseSettings;
			}
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static SettingsTab GetOrAddCustomTab(string label)
		{
			if (CurrentVersion < new Version(1, 3, 0))
			{
				if (!_warnedAboutModTabs)
				{
					_warnedAboutModTabs = true;
					Mod.Log.LogWarning((object)$"EasySettings mod tabs are not supported in version {CurrentVersion} (need {new Version(1, 3, 0)})");
					Mod.Log.LogWarning((object)"This means that this mod won't be able to initialize mod tabs, so you may have some missing stuff.");
					Mod.Log.LogWarning((object)"Please update EasySettings or edit the configuration manually instead.");
				}
				return null;
			}
			return GetOrAddCustomTabInternal(label);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static SettingsTab GetOrAddCustomTabInternal(string label)
		{
			return Settings.GetOrAddCustomTab(label);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddSpace()
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddSpace()).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddHeader(string label)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddHeader(label)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddButton(string buttonLabel, UnityAction onClick)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddButton(buttonLabel, onClick)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddToggle(string label, ConfigEntry<bool> config)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddToggle(label, config)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddSlider(string label, ConfigEntry<float> config, bool wholeNumbers = false)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddSlider(label, config, wholeNumbers)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddAdvancedSlider(string label, ConfigEntry<float> config, bool wholeNumbers = false)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddAdvancedSlider(label, config, wholeNumbers)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddAdvancedSlider(string label, ConfigEntry<float> config, float min, float max, bool wholeNumbers = false)
		{
			//IL_0069: Unknown result type (might be due to invalid IL or missing references)
			//IL_0073: Expected O, but got Unknown
			AtlyssAdvancedSlider element = Settings.ModTab.AddAdvancedSlider(label, config.Value, min, max, wholeNumbers);
			AtlyssAdvancedSlider obj = element;
			if (obj != null)
			{
				obj.OnValueChanged.AddListener((UnityAction<float>)delegate(float newValue)
				{
					config.Value = newValue;
				});
			}
			AtlyssAdvancedSlider obj2 = element;
			if (obj2 != null)
			{
				obj2.OnResetClicked.AddListener((UnityAction)delegate
				{
					element.SetValue((float)((ConfigEntryBase)config).DefaultValue);
				});
			}
			return ((Component)((BaseAtlyssElement)element).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddAdvancedSliderInTab(SettingsTab tab, string label, ConfigEntry<float> config, float min, float max, bool wholeNumbers = false)
		{
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Expected O, but got Unknown
			AtlyssAdvancedSlider element = tab.AddAdvancedSlider(label, config.Value, min, max, wholeNumbers);
			AtlyssAdvancedSlider obj = element;
			if (obj != null)
			{
				obj.OnValueChanged.AddListener((UnityAction<float>)delegate(float newValue)
				{
					config.Value = newValue;
				});
			}
			AtlyssAdvancedSlider obj2 = element;
			if (obj2 != null)
			{
				obj2.OnResetClicked.AddListener((UnityAction)delegate
				{
					element.SetValue((float)((ConfigEntryBase)config).DefaultValue);
				});
			}
			return ((Component)((BaseAtlyssElement)element).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddDropdown<T>(string label, ConfigEntry<T> config) where T : Enum
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddDropdown<T>(label, config)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddKeyButton(string label, ConfigEntry<KeyCode> config)
		{
			return ((Component)((BaseAtlyssElement)Settings.ModTab.AddKeyButton(label, config)).Root).gameObject;
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		public static GameObject AddTextField(string label, ConfigEntry<string> config, string preset = "Text...")
		{
			if (CurrentVersion < new Version(1, 2, 0))
			{
				if (!_warnedAboutTextFields)
				{
					_warnedAboutTextFields = true;
					Mod.Log.LogWarning((object)$"EasySettings text fields are not supported in version {CurrentVersion} (need {new Version(1, 2, 0)})");
					Mod.Log.LogWarning((object)"This means that this mod won't be able to initialize text field settings, so you may have some missing stuff.");
					Mod.Log.LogWarning((object)"Please update EasySettings or edit the configuration manually instead.");
				}
				return null;
			}
			return AddTextFieldInternal(label, config, preset);
		}

		[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)]
		private static GameObject AddTextFieldInternal(string label, ConfigEntry<string> config, string preset = "Text...")
		{
			//IL_0056: Unknown result type (might be due to invalid IL or missing references)
			string value = config.Value;
			AtlyssTextField val = Settings.ModTab.AddTextField(label, config, preset);
			val.InputField.characterLimit = 0;
			val.InputField.SetTextWithoutNotify(value);
			val.Apply();
			RectTransform component = ((Component)val.InputField).GetComponent<RectTransform>();
			if (Object.op_Implicit((Object)(object)component))
			{
				component.SetInsetAndSizeFromParentEdge((Edge)1, 10f, component.sizeDelta.x * 1.5f);
			}
			return ((Component)((BaseAtlyssElement)val).Root).gameObject;
		}
	}
}
namespace Atlyss.AppearanceOffsets.Patches
{
	[HarmonyPatch(typeof(OptionsMenuCell), "SaveQuit_Game")]
	internal static class OptionsMenuCell__SaveQuit_Game
	{
		[HarmonyPrefix]
		internal static void FixingRaceModel()
		{
			//IL_006d: 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)
			if ((Object)(object)Player._mainPlayer._pVisual._playerRaceModel._tailDisplays[Player._mainPlayer._pVisual._playerRaceModel.SetTailIndex].rootBone != (Object)null)
			{
				Player._mainPlayer._pVisual._playerRaceModel._tailDisplays[Player._mainPlayer._pVisual._playerRaceModel.SetTailIndex].rootBone.localPosition = Mod.Instance.originalTailPos;
				Player._mainPlayer._pVisual._playerRaceModel._tailDisplays[Player._mainPlayer._pVisual._playerRaceModel.SetTailIndex].rootBone.localScale = Mod.Instance.originalTailScale;
			}
			Mod.Instance.Players.Clear();
			Mod.Instance.waitForPing.Clear();
		}
	}
	[HarmonyPatch(typeof(PlayerVisual), "Start")]
	internal static class PlayerVisual__Start
	{
		[HarmonyPostfix]
		internal static void RaceModeCoroutine(PlayerVisual __instance)
		{
			if ((Object)(object)__instance._player == (Object)(object)Player._mainPlayer)
			{
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.GetPlayerData(__instance));
				((MonoBehaviour)Mod.Instance).StartCoroutine(Mod.SendPlayerData(Player._mainPlayer));
			}
		}
	}
	[HarmonyPatch(typeof(Player), "Awake")]
	internal static class Player__Awake
	{
		[HarmonyPostfix]
		internal static void WaitingForPing(Player __instance)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001d: Invalid comparison between Unknown and I4
			if (!((Object)(object)Player._mainPlayer == (Object)null) && (int)Player._mainPlayer.Network_currentGameCondition == 1)
			{
				Mod.Instance.waitForPing.Add(__instance);
			}
		}
	}
	[HarmonyPatch(typeof(Player), "Handle_ServerParameters")]
	internal static class Player__Handle_ServerParameters
	{
		[HarmonyPrefix]
		internal static void CheckIfPlayerDisconnected(Player __instance)
		{
			if (!Object.op_Implicit((Object)(object)(__instance = Player._mainPlayer)) && ((NetworkBehaviour)__instance).netIdentity.connectionToClient == null)
			{
				Mod.Instance.Players.Remove(Mod.Instance.Players.Find((PlayerOffsets p) => (Object)(object)p.player == (Object)(object)__instance));
			}
		}
	}
	[HarmonyPatch(typeof(Player), "Server_SceneTransport")]
	internal static class Player__OnPlayerConditionChange
	{
		[HarmonyPostfix]
		internal static void GetPlayerValues(Player __instance)
		{
		}
	}
	[HarmonyPatch(typeof(ProfileDataManager), "Awake")]
	internal static class ProfileDataManager__Awake
	{
		[HarmonyPostfix]
		internal static void GetPathData(ProfileDataManager __instance)
		{
			Mod.Instance.offsetProfile = new OffsetProfileManager(__instance._dataPath);
		}
	}
}