Decompiled source of UltraNet v0.1.9

UltraNet.dll

Decompiled a month ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Xml;
using BepInEx;
using HarmonyLib;
using Jaket.Sam;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json.Linq;
using Steamworks;
using Steamworks.Data;
using TMPro;
using ULTRAKILL.Cheats;
using UltraNet;
using UltraNet.Canvas;
using UltraNet.Classes;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.Networking;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: AssemblyCompany("UltraNet")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyDescription("Description")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1")]
[assembly: AssemblyProduct("UltraNet")]
[assembly: AssemblyTitle("UltraNet")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.1.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
public class BundlesManager : MonoBehaviour
{
	public static AssetBundle netBundle;

	public void Awake()
	{
		Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		Assembly executingAssembly = Assembly.GetExecutingAssembly();
		string text = "UltraNet.Assets.ultranet.bundle";
		using Stream stream = executingAssembly.GetManifestResourceStream(text);
		if (stream == null)
		{
			Plugin.LogError("Embedded resource '" + text + "' not found!");
			return;
		}
		byte[] array = new byte[stream.Length];
		stream.Read(array, 0, array.Length);
		netBundle = AssetBundle.LoadFromMemory(array);
		if ((Object)(object)netBundle != (Object)null)
		{
			Plugin.LogInfo("Loaded embedded AssetBundle!");
		}
		else
		{
			Plugin.LogError("Failed to load AssetBundle from memory!");
		}
	}

	public void OnDestroy()
	{
		AssetBundle obj = netBundle;
		if (obj != null)
		{
			obj.Unload(false);
		}
	}
}
namespace UltraNet
{
	[BepInPlugin("duviz.UltraNet", "UltraNet", "0.1.9")]
	public class Plugin : BaseUnityPlugin
	{
		public static Plugin instance;

		public static bool debugMode;

		private GameObject canvasObject;

		private GameObject canvasInstance;

		private bool lastPlayerActive = false;

		private bool openedOnce = false;

		public static TMP_SpriteAsset defaultSpriteAsset;

		public void Awake()
		{
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			instance = this;
			new Harmony("duviz.UltraNet").PatchAll();
			LogInfo("UltraNet loaded.");
		}

		public void Start()
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0029: Expected O, but got Unknown
			GameObject val = new GameObject("Managers")
			{
				hideFlags = (HideFlags)61
			};
			GameObject val2 = new GameObject("PlayerFetcher")
			{
				hideFlags = (HideFlags)61
			};
			val.AddComponent<BundlesManager>();
			val.AddComponent<Numerators>();
			val.AddComponent<CustomBindingsPoCPlugin.InputListenerInstance>();
			val2.AddComponent<PlayerFetcher>();
			GameObject val3 = Object.Instantiate<GameObject>(BundlesManager.netBundle.LoadAsset<GameObject>("UltraNetNotifications"));
			canvasObject = BundlesManager.netBundle.LoadAsset<GameObject>("UltraNetCanvas");
			canvasInstance = Object.Instantiate<GameObject>(canvasObject);
			canvasInstance.SetActive(false);
			canvasInstance.GetComponent<CanvasScaler>().screenMatchMode = (ScreenMatchMode)1;
			defaultSpriteAsset = BundlesManager.netBundle.LoadAsset<TMP_SpriteAsset>("ilovemen");
			Object.DontDestroyOnLoad((Object)(object)canvasInstance);
			Object.DontDestroyOnLoad((Object)(object)val2);
			Object.DontDestroyOnLoad((Object)(object)val);
			openedOnce = PlayerPrefs.GetInt("UltraNet_Opened", 0) == 1;
			SceneManager.sceneLoaded += SceneLoadDelayed;
		}

		public void SceneLoadDelayed(Scene _, LoadSceneMode __)
		{
			((MonoBehaviour)this).Invoke("SceneLoad", 0.1f);
		}

		public void SceneLoad()
		{
			if (SceneHelper.CurrentScene == "Main Menu" && (Object)(object)((Component)this).gameObject.GetComponent<CustomBindingsPoCPlugin.InputListener>() == (Object)null)
			{
				((Component)this).gameObject.AddComponent<CustomBindingsPoCPlugin.InputListener>();
			}
		}

		public void Update()
		{
			if ((Object)(object)MonoSingleton<NewMovement>.Instance != (Object)null && !openedOnce)
			{
				if (lastPlayerActive != MonoSingleton<NewMovement>.Instance.activated)
				{
					MonoSingleton<HudMessageReceiver>.Instance.SendHudMessage("Press <color=#ff66cc>(T)</color> to open <color=#66ff66>UltraNet</color>", "", "", 0, false, false, true);
				}
				lastPlayerActive = MonoSingleton<NewMovement>.Instance.activated;
			}
		}

		public void PressKey()
		{
			if (!UIBusy())
			{
				canvasInstance.SetActive(!canvasInstance.activeSelf);
				if (canvasInstance.activeSelf)
				{
					ContentManager.instance.Open();
				}
				if (!openedOnce)
				{
					PlayerPrefs.SetInt("UltraNet_Opened", 1);
					openedOnce = true;
				}
			}
		}

		public static bool UIBusy()
		{
			return (Object)(object)EventSystem.current != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject != (Object)null && (Object)(object)EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>() != (Object)null && EventSystem.current.currentSelectedGameObject.GetComponent<TMP_InputField>().isFocused && EventSystem.current.currentSelectedGameObject.activeInHierarchy;
		}

		public void OnApplicationFocus(bool isFocused)
		{
			if ((Object)(object)MonoSingleton<OptionsManager>.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu" && !MonoSingleton<OptionsManager>.Instance.paused)
			{
				MonoSingleton<OptionsManager>.Instance.Pause();
			}
		}

		public static T Ass<T>(string path)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			return Addressables.LoadAssetAsync<T>((object)path).WaitForCompletion();
		}

		public static void LogInfo(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogInfo(msg);
		}

		public static void LogWarning(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogWarning(msg);
		}

		public static void LogError(object msg)
		{
			((BaseUnityPlugin)instance).Logger.LogError(msg);
		}
	}
	public class PluginInfo
	{
		public const string GUID = "duviz.UltraNet";

		public const string Name = "UltraNet";

		public const string Version = "0.1.9";
	}
}
namespace UltraNet.Patches
{
	[HarmonyPatch]
	public class CheatFix
	{
		[HarmonyPrefix]
		[HarmonyPatch(typeof(CheatsManager), "HandleCheatBind")]
		private static bool Patch1()
		{
			return !Plugin.UIBusy();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(CheatsController), "Update")]
		private static bool Patch2()
		{
			return !Plugin.UIBusy();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Noclip), "UpdateTick")]
		private static bool Patch3()
		{
			return !Plugin.UIBusy();
		}

		[HarmonyPrefix]
		[HarmonyPatch(typeof(Flight), "Update")]
		private static bool Patch4()
		{
			return !Plugin.UIBusy();
		}
	}
	[HarmonyPatch(typeof(FinalCyberRank))]
	public static class FinalCyberRankPatch
	{
		public const string url = "https://duviz.xyz/ultranet/user/completeCybergrind";

		public static int rankScore;

		public static float lastTime;

		[HarmonyPostfix]
		[HarmonyPatch(typeof(FinalCyberRank), "GameOver")]
		public static void GameOver(FinalCyberRank __instance)
		{
			if (!PlayerFetcher.CheatsActive() && LeaderboardController.CanSubmitScores && !(lastTime + 30f > Time.unscaledTime))
			{
				lastTime = Time.unscaledTime;
				((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/user/completeCybergrind", new Dictionary<string, string>
				{
					{
						"token",
						ContentManager.GetToken()
					},
					{
						"wave",
						Mathf.ClampToInt((long)__instance.savedWaves).ToString()
					}
				}, delegate
				{
				}));
			}
		}
	}
	[HarmonyPatch(typeof(FinalPit))]
	public static class LevelCompletionPatch
	{
		public const string url = "https://duviz.xyz/ultranet/user/complete";

		public static int rankScore;

		public static float lastTime;

		[HarmonyPrefix]
		[HarmonyPatch(typeof(FinalPit), "SendInfo")]
		public static void SendInfo(FinalPit __instance)
		{
			if (!__instance.infoSent && !PlayerFetcher.CheatsActive() && LeaderboardController.CanSubmitScores && !(lastTime + 30f > Time.unscaledTime))
			{
				lastTime = Time.unscaledTime;
				float seconds = MonoSingleton<StatsManager>.Instance.seconds;
				int num = Mathf.FloorToInt(seconds / 60f);
				int num2 = Mathf.FloorToInt(seconds % 60f);
				int num3 = Mathf.FloorToInt(seconds * 1000f % 1000f);
				string value = $"{num:00}:{num2:00}:{num3:000}";
				((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/user/complete", new Dictionary<string, string>
				{
					{
						"token",
						ContentManager.GetToken()
					},
					{
						"level",
						SceneHelper.CurrentScene
					},
					{ "time", value },
					{
						"rank",
						GetRank()
					}
				}, delegate
				{
				}));
			}
		}

		public static string GetRank()
		{
			rankScore = 0;
			StatsManager instance = MonoSingleton<StatsManager>.Instance;
			GetRanks(instance.timeRanks, instance.seconds, reverse: true, addToRankScore: true);
			GetRanks(instance.killRanks, instance.kills, reverse: false, addToRankScore: true);
			GetRanks(instance.styleRanks, instance.stylePoints, reverse: false, addToRankScore: true);
			string currentScene = SceneHelper.CurrentScene;
			int num = MonoSingleton<PrefsManager>.Instance.GetInt("difficulty", 0);
			if (rankScore == 12 && instance.restarts == 0)
			{
				return "P";
			}
			return GetRankName((float)rankScore / 3f);
		}

		public static string GetRankName(float score)
		{
			int num = Mathf.RoundToInt(score);
			bool flag = false;
			string result;
			switch (num)
			{
			case 1:
				result = "C";
				break;
			case 2:
				result = "B";
				break;
			case 3:
				result = "A";
				break;
			case 4:
			case 5:
			case 6:
				result = "S";
				break;
			default:
				result = "D";
				break;
			}
			bool flag2 = false;
			return result;
		}

		public static string GetRanks(int[] ranksToCheck, float value, bool reverse, bool addToRankScore = false)
		{
			int num = 0;
			bool flag = true;
			while (flag)
			{
				if (num >= ranksToCheck.Length)
				{
					if (addToRankScore)
					{
						rankScore += 4;
					}
					return "<color=#FF0000>S</color>";
				}
				if ((reverse && value <= (float)ranksToCheck[num]) || (!reverse && value >= (float)ranksToCheck[num]))
				{
					num++;
					continue;
				}
				if (addToRankScore)
				{
					rankScore += num;
				}
				switch (num)
				{
				case 0:
					return "<color=#0094FF>D</color>";
				case 1:
					return "<color=#4CFF00>C</color>";
				case 2:
					return "<color=#FFD800>B</color>";
				case 3:
					return "<color=#FF6A00>A</color>";
				}
			}
			return "X";
		}
	}
}
namespace UltraNet.Classes
{
	public static class CustomBindingsPoCPlugin
	{
		public class InputListener : MonoBehaviour
		{
			private InputListenerInstance inputs;

			public void Start()
			{
				inputs = InputListenerInstance.Instance;
			}

			public void Update()
			{
				if (!((Object)(object)inputs == (Object)null) && inputs.SomeFirstAction.WasPerformedThisFrame())
				{
					Plugin.instance.PressKey();
				}
			}
		}

		[HarmonyPatch(typeof(InputActions))]
		public static class InputActionPatches
		{
			[HarmonyPostfix]
			[HarmonyPatch(/*Could not decode attribute arguments.*/)]
			public static void InputActions_Constructor_Postfix(InputActions __instance)
			{
				if (__instance.asset.FindActionMap("UltraNet", false) == null)
				{
					MergeInputActionAssets(__instance);
				}
			}

			private static void MergeInputActionAssets(InputActions ukInputActions)
			{
				InputActionAsset asset = ukInputActions.asset;
				bool enabled = asset.enabled;
				if (enabled)
				{
					asset.Disable();
				}
				InputActionSetupExtensions.AddActionMap(asset, ActionMap);
				if (enabled)
				{
					asset.Enable();
				}
			}
		}

		public class InputListenerInstance : MonoBehaviour
		{
			public static InputListenerInstance Instance;

			private InputActionMap _actionMap;

			public InputAction SomeFirstAction { get; private set; }

			public void Awake()
			{
				Instance = this;
				((MonoBehaviour)this).StartCoroutine(WaitForIt());
			}

			public IEnumerator WaitForIt()
			{
				while ((Object)(object)MonoSingleton<InputManager>.Instance == (Object)null)
				{
					yield return null;
				}
				_actionMap = MonoSingleton<InputManager>.Instance.InputSource.Actions.asset.FindActionMap("UltraNet", false);
				SomeFirstAction = _actionMap.FindAction("Toggle panel", false);
			}
		}

		[HarmonyPatch(typeof(ControlsOptions))]
		public static class ControlsOptionsPatches
		{
			[HarmonyTranspiler]
			[HarmonyPatch(typeof(ControlsOptions), "Rebuild")]
			private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
			{
				List<CodeInstruction> list = new List<CodeInstruction>(instructions);
				MethodInfo addMap = AccessTools.Method(typeof(ControlsOptionsPatches), "AddMap", (Type[])null, (Type[])null);
				FieldInfo mapField = AccessTools.Field(typeof(CustomBindingsPoCPlugin), "ActionMap");
				foreach (CodeInstruction inst in list)
				{
					int num;
					if (inst.opcode == OpCodes.Newarr)
					{
						object operand = inst.operand;
						if (operand is Type t)
						{
							num = ((t == typeof(InputActionMap)) ? 1 : 0);
							goto IL_0145;
						}
					}
					num = 0;
					goto IL_0145;
					IL_0145:
					if (num != 0)
					{
						yield return inst;
						yield return new CodeInstruction(OpCodes.Ldsfld, (object)mapField);
						yield return new CodeInstruction(OpCodes.Call, (object)addMap);
					}
					else
					{
						yield return inst;
					}
				}
			}

			private static InputActionMap[] AddMap(InputActionMap[] original, InputActionMap extra)
			{
				if (original == null)
				{
					return (InputActionMap[])(object)new InputActionMap[1] { extra };
				}
				InputActionMap[] array = (InputActionMap[])(object)new InputActionMap[original.Length + 1];
				Array.Copy(original, array, original.Length);
				array[^1] = extra;
				return array;
			}
		}

		private const string InputMapName = "UltraNet";

		private const string SomeFirstActionName = "Toggle panel";

		private static readonly string YourActionMapJson = "{\r\n\t\t\"maps\": [\r\n\t\t\t{\r\n\t\t\t\t\"name\": \"UltraNet\",\r\n\t\t\t\t\"id\": \"6212261a-20ba-4c68-8568-ef2c0f5d770f\",\r\n\t\t\t\t\"actions\": [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"name\": \"Toggle panel\",\r\n\t\t\t\t\t\t\"type\": \"Button\",\r\n\t\t\t\t\t\t\"id\": \"bc66ba63-9493-499b-8c3d-0cf0992fc6a8\",\r\n\t\t\t\t\t\t\"expectedControlType\": \"Button\",\r\n\t\t\t\t\t\t\"processors\": \"\",\r\n\t\t\t\t\t\t\"interactions\": \"\",\r\n\t\t\t\t\t\t\"initialStateCheck\": false\r\n\t\t\t\t\t}\r\n\t\t\t\t],\r\n\t\t\t\t\"bindings\": [\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\"name\": \"\",\r\n\t\t\t\t\t\t\"id\": \"81a50518-0cf2-4bcd-a000-892c93e461e7\",\r\n\t\t\t\t\t\t\"path\": \"<Keyboard>/t\",\r\n\t\t\t\t\t\t\"interactions\": \"\",\r\n\t\t\t\t\t\t\"processors\": \"\",\r\n\t\t\t\t\t\t\"groups\": \"Keyboard & Mouse\",\r\n\t\t\t\t\t\t\"action\": \"Toggle panel\",\r\n\t\t\t\t\t\t\"isComposite\": false,\r\n\t\t\t\t\t\t\"isPartOfComposite\": false\r\n\t\t\t\t\t}\r\n\t\t\t\t]\r\n\t\t\t}\r\n\t\t]\r\n\t}";

		private static readonly InputActionMap ActionMap = InputActionMap.FromJson(YourActionMapJson)[0];
	}
	public class Numerators : MonoBehaviour
	{
		public static Numerators instance;

		public static bool _busy;

		public void Awake()
		{
			((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
			instance = this;
		}

		public IEnumerator TimerButton(Button button, float time)
		{
			yield return (object)new WaitForSecondsRealtime(time);
			if (!((Object)(object)button == (Object)null))
			{
				if (!_busy)
				{
					((UnityEvent)button.onClick).Invoke();
				}
				((MonoBehaviour)this).StartCoroutine(TimerButton(button, time));
			}
		}

		public static IEnumerator GetStringFromUrl(string url, Action<string> callback)
		{
			UnityWebRequest www = UnityWebRequest.Get(url);
			try
			{
				www.timeout = 10;
				yield return www.SendWebRequest();
				if ((int)www.result != 1)
				{
					if (!string.IsNullOrEmpty(www.error) && www.error.Contains("Unknown Error"))
					{
						callback?.Invoke("?");
					}
					Plugin.LogError("Failed to load string: " + www.error);
					callback?.Invoke(null);
				}
				else
				{
					callback?.Invoke(www.downloadHandler.text);
				}
			}
			finally
			{
				((IDisposable)www)?.Dispose();
			}
		}

		public static IEnumerator PostRequest(string url, Dictionary<string, string> postData, Action<string> callback)
		{
			_ = Time.realtimeSinceStartup;
			WWWForm form = new WWWForm();
			foreach (KeyValuePair<string, string> pair in postData)
			{
				form.AddField(pair.Key, pair.Value);
			}
			UnityWebRequest www = UnityWebRequest.Post(url, form);
			try
			{
				www.timeout = 10;
				yield return www.SendWebRequest();
				if ((int)www.result != 1)
				{
					if (!string.IsNullOrEmpty(www.error) && www.error.Contains("Unknown Error"))
					{
						callback?.Invoke("?");
					}
					Plugin.LogError("Failed to post request: " + www.error);
					callback?.Invoke(null);
				}
				else
				{
					callback?.Invoke(www.downloadHandler.text);
				}
			}
			finally
			{
				((IDisposable)www)?.Dispose();
			}
		}
	}
	public class Player : MonoBehaviour
	{
		public float lerpSpeed = 2f;

		private Vector3 targetPos;

		private Vector3Lerp lerpPos;

		private TMP_Text t;

		private string originalText;

		private bool lastCheats = false;

		public void SetTarget(Vector3 newPos, bool cheats)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_000e: Unknown result type (might be due to invalid IL or missing references)
			targetPos = newPos;
			lerpPos.Set(newPos);
			if (lastCheats != cheats)
			{
				t.text = (cheats ? ("<size=0.5>(C)</size>" + originalText) : originalText);
			}
			lastCheats = cheats;
		}

		public void CreateName(string text, string id, string url)
		{
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = Object.Instantiate<GameObject>(BundlesManager.netBundle.LoadAsset<GameObject>("PlayerName"));
			val.transform.localScale = new Vector3(-0.5f, 0.5f, 1f);
			val.transform.SetParent(((Component)this).transform, false);
			val.GetComponentInChildren<TMP_Text>().text = TextParser.Parse(text);
			t = val.GetComponentInChildren<TMP_Text>();
			originalText = TextParser.Parse(text);
			GetPfp(id, val, url);
		}

		public async void GetPfp(string id, GameObject obj, string url)
		{
			if (!string.IsNullOrEmpty(url))
			{
				obj.GetComponentInChildren<ImageGetter>().imageUrl = url;
				obj.GetComponentInChildren<ImageGetter>().SetImg();
			}
		}

		public void Update()
		{
			//IL_000d: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_002b: Unknown result type (might be due to invalid IL or missing references)
			((Component)this).transform.position = lerpPos.Grab();
			((Component)this).transform.LookAt(((Object)(object)Camera.main != (Object)null) ? ((Component)Camera.main).transform.position : Vector3.zero);
		}
	}
	public class PlayerFetcher : MonoBehaviour
	{
		public static PlayerFetcher instance;

		public static float syncTime = 0.4f;

		private Dictionary<string, GameObject> players = new Dictionary<string, GameObject>();

		private string syncUrl = "https://duviz.xyz/ultranet/user/update";

		private float timer = 0f;

		private bool _busy = false;

		private int attempts = 0;

		public void Update()
		{
			timer += Time.unscaledDeltaTime;
			if (timer >= syncTime && !((Object)(object)MonoSingleton<NewMovement>.Instance == (Object)null))
			{
				timer = 0f;
				Sync();
			}
		}

		public void Sync()
		{
			attempts++;
			if (attempts >= 10)
			{
				_busy = false;
			}
			if (_busy)
			{
				timer = syncTime;
				return;
			}
			_busy = true;
			attempts = 0;
			((MonoBehaviour)this).StopAllCoroutines();
			((MonoBehaviour)this).StartCoroutine(Numerators.PostRequest(syncUrl, new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{
					"position",
					ContentManager.GetPosition()
				},
				{
					"level",
					SceneHelper.CurrentScene
				},
				{
					"cheats",
					CheatsActive().ToString()
				}
			}, delegate(string json)
			{
				_busy = false;
				if (json != null)
				{
					ParseJson(json);
				}
			}));
		}

		public GameObject CreatePlayer(string id, Vector3 pos, string name, string url)
		{
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			//IL_0012: Unknown result type (might be due to invalid IL or missing references)
			GameObject val = new GameObject("Player viewer");
			val.transform.position = pos;
			Player player = val.AddComponent<Player>();
			player.CreateName(name, id, url);
			players.Add(id, val);
			return val;
		}

		public void ParseJson(string json)
		{
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d5: Expected O, but got Unknown
			//IL_01e1: Unknown result type (might be due to invalid IL or missing references)
			//IL_014b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0150: Unknown result type (might be due to invalid IL or missing references)
			//IL_01af: Unknown result type (might be due to invalid IL or missing references)
			//IL_019a: Unknown result type (might be due to invalid IL or missing references)
			JObject val;
			try
			{
				val = JObject.Parse(json);
			}
			catch (Exception arg)
			{
				Plugin.LogError($"Failed to parse scene json: {arg}");
				return;
			}
			foreach (KeyValuePair<string, GameObject> item in players.ToList())
			{
				if ((Object)(object)item.Value == (Object)null)
				{
					players.Remove(item.Key);
				}
			}
			List<string> list = new List<string>();
			foreach (KeyValuePair<string, JToken> item2 in (JObject)val["players"])
			{
				string id = item2.Key;
				JObject val2 = (JObject)item2.Value;
				string input = ((object)val2["position"])?.ToString();
				string name = ((object)val2["name"])?.ToString();
				string url = ((object)val2["pfp"])?.ToString();
				string text = ((object)val2["cheats"]).ToString();
				bool cheats = text.ToLower() == "true";
				Vector3 val3 = ParseVector3(input);
				GameObject val4 = players.FirstOrDefault((KeyValuePair<string, GameObject> keyValuePair) => keyValuePair.Key == id).Value;
				list.Add(id);
				if ((Object)(object)val4 == (Object)null)
				{
					val4 = CreatePlayer(id, val3, name, url);
				}
				val4.GetComponent<Player>().SetTarget(val3, cheats);
			}
			foreach (KeyValuePair<string, JToken> item3 in (JObject)val["events"])
			{
				string key = item3.Key;
				DoEvent(key);
			}
			foreach (KeyValuePair<string, GameObject> item4 in players.ToList())
			{
				if (!list.Contains(item4.Key))
				{
					GameObject value = item4.Value;
					players.Remove(item4.Key);
					if ((Object)(object)value != (Object)null)
					{
						Object.Destroy((Object)(object)value);
					}
				}
			}
		}

		private void DoEvent(string e)
		{
			//IL_0027: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: Unknown result type (might be due to invalid IL or missing references)
			//IL_0065: 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)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
			//IL_0101: Unknown result type (might be due to invalid IL or missing references)
			//IL_0111: Unknown result type (might be due to invalid IL or missing references)
			//IL_0121: Unknown result type (might be due to invalid IL or missing references)
			//IL_012c: Unknown result type (might be due to invalid IL or missing references)
			//IL_017c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0181: Unknown result type (might be due to invalid IL or missing references)
			if (e == "filth")
			{
				GameObject val = Plugin.Ass<GameObject>("Assets/Prefabs/Enemies/Zombie.prefab");
				GameObject val2 = Object.Instantiate<GameObject>(val, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity);
			}
			if (e == "stray")
			{
				GameObject val3 = Plugin.Ass<GameObject>("Assets/Prefabs/Enemies/Projectile Zombie.prefab");
				GameObject val4 = Object.Instantiate<GameObject>(val3, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity);
			}
			if (e == "minos")
			{
				GameObject val5 = Plugin.Ass<GameObject>("Assets/Prefabs/Enemies/MinosPrime.prefab");
				GameObject val6 = Object.Instantiate<GameObject>(val5, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity);
			}
			if (e == "explosion")
			{
				GameObject val7 = Plugin.Ass<GameObject>("Assets/Prefabs/Attacks and Projectiles/Explosions/Explosion.prefab");
				GameObject val8 = Object.Instantiate<GameObject>(val7, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity);
			}
			if (e == "gravity")
			{
				Physics.gravity = new Vector3(0f - Physics.gravity.y, 0f - Physics.gravity.z, 0f - Physics.gravity.x);
			}
			if (e.StartsWith("custom_"))
			{
				GameObject val9 = Plugin.Ass<GameObject>("Assets/Prefabs/" + e.Replace("custom_", "") + ".prefab");
				GameObject val10 = Object.Instantiate<GameObject>(val9, ((Component)MonoSingleton<NewMovement>.Instance).transform.position, Quaternion.identity);
			}
		}

		private Vector4 ParseVector4(string input)
		{
			//IL_007f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0084: Unknown result type (might be due to invalid IL or missing references)
			//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_0087: Unknown result type (might be due to invalid IL or missing references)
			input = input.Trim('(', ')', ' ');
			string[] array = input.Split(',');
			if (array.Length != 4)
			{
				Plugin.LogError("Invalid Vector4 format: " + input);
				return Vector4.zero;
			}
			return new Vector4(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture), float.Parse(array[2], CultureInfo.InvariantCulture), float.Parse(array[3], CultureInfo.InvariantCulture));
		}

		public static Vector3 ParseVector3(string input)
		{
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: 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_007a: Unknown result type (might be due to invalid IL or missing references)
			input = input.Trim('(', ')', ' ');
			string[] array = input.Split(',');
			if (array.Length != 3)
			{
				Plugin.LogError("Invalid Vector3 format: " + input);
				return Vector3.zero;
			}
			return new Vector3(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture), float.Parse(array[2], CultureInfo.InvariantCulture));
		}

		public static Vector2 ParseVector2(string input)
		{
			//IL_0065: 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_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_006d: Unknown result type (might be due to invalid IL or missing references)
			input = input.Trim('(', ')', ' ');
			string[] array = input.Split(',');
			if (array.Length != 2)
			{
				Plugin.LogError("Invalid Vector2 format: " + input);
				return Vector2.zero;
			}
			return new Vector2(float.Parse(array[0], CultureInfo.InvariantCulture), float.Parse(array[1], CultureInfo.InvariantCulture));
		}

		public static bool CheatsActive()
		{
			return MonoSingleton<CheatsController>.Instance.cheatsEnabled || MonoSingleton<StatsManager>.Instance.majorUsed;
		}
	}
	public class SteamAvatarFetcher : MonoBehaviour
	{
		private static readonly HttpClient client = new HttpClient();

		public async Task<string> GetSteamAvatarURL(string steamID64)
		{
			string xmlUrl = "https://steamcommunity.com/profiles/" + steamID64 + "/?xml=1";
			try
			{
				string xml = await client.GetStringAsync(xmlUrl);
				XmlDocument doc = new XmlDocument();
				doc.LoadXml(xml);
				XmlNode avatarFullNode = doc.SelectSingleNode("//avatarFull");
				if (avatarFullNode != null)
				{
					return avatarFullNode.InnerText;
				}
				Plugin.LogWarning("Not found.");
				return null;
			}
			catch (HttpRequestException ex)
			{
				HttpRequestException ex2 = ex;
				HttpRequestException e = ex2;
				Plugin.LogError("HTTP request error: " + e.Message);
				return null;
			}
			catch (XmlException ex3)
			{
				XmlException ex4 = ex3;
				XmlException e2 = ex4;
				Plugin.LogError("XML parsing error: " + e2.Message);
				return null;
			}
		}
	}
	public struct Vector3Lerp
	{
		public Vector3 PreviousValue;

		public Vector3 TargetValue;

		public float Duration;

		public float StartTime;

		public Vector3 Grab()
		{
			//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_0025: 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)
			return Vector3.Lerp(PreviousValue, TargetValue, (Time.realtimeSinceStartup - StartTime) / Duration);
		}

		public void Set(Vector3 value)
		{
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			PreviousValue = ((StartTime == 0f) ? value : Grab());
			TargetValue = value;
			Duration = Mathf.Max(Time.realtimeSinceStartup - StartTime, PlayerFetcher.syncTime);
			StartTime = Time.realtimeSinceStartup;
		}
	}
}
namespace UltraNet.Canvas
{
	[Serializable]
	public class ChatMessage
	{
		public string author;

		public string authorid;

		public string chat;

		public string content;

		public string custom;

		public string time;

		public string name;
	}
	[Serializable]
	public class ChatMessageList
	{
		public List<ChatMessage> messages;
	}
	public static class ChatParser
	{
		public static List<ChatMessage> Parse(string json)
		{
			try
			{
				string text = "{ \"messages\": " + json + "}";
				ChatMessageList chatMessageList = JsonUtility.FromJson<ChatMessageList>(text);
				return chatMessageList.messages;
			}
			catch (Exception)
			{
				return new List<ChatMessage>();
			}
		}
	}
	public class ContentManager : MonoBehaviour
	{
		[Serializable]
		public class R_Window
		{
			public string id;

			public GameObject prefab;

			public R_Window(string id, GameObject prefab)
			{
				this.id = id;
				this.prefab = prefab;
			}
		}

		public static ContentManager instance;

		public static List<string> openWindows = new List<string>();

		public static List<GameObject> openWindowsObjs = new List<GameObject>();

		public const string mainUrl = "D";

		public const string loginUrl = "https://duviz.xyz/login";

		public const string chatUrl = "https://duviz.xyz/ultranet/chat";

		public const string sendChatUrl = "https://duviz.xyz/ultranet/chat/sendMessageV2";

		public const string profileUrl = "https://duviz.xyz/ultranet/profileV2";

		public const string sendFriendRequestUrl = "https://duviz.xyz/ultranet/sendFriendRequest";

		public const string setFriendsUrl = "https://duviz.xyz/ultranet/setFriends";

		public const string getFriendsUrl = "https://duviz.xyz/ultranet/getFriends";

		public const string getFriendRequestsUrl = "https://duviz.xyz/ultranet/getFriendRequests";

		public const string getNotificationsUrl = "https://duviz.xyz/ultranet/getNotifications";

		public static string steamid = "";

		public static string compressedid = "";

		public static TMP_InputField CurrentChatField;

		[Header("Prefabs")]
		public List<R_Window> windows = new List<R_Window>();

		public AudioSource source = null;

		private bool checking = false;

		public static string profileSetBioUrl => "https://duviz.xyz/ultranet/user/" + steamid + "/editBio";

		public static string profileSetPronounsUrl => "https://duviz.xyz/ultranet/user/" + steamid + "/editPron";

		public void Awake()
		{
			instance = this;
		}

		public void Start()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			source = new GameObject("Audio").AddComponent<AudioSource>();
			source.playOnAwake = false;
			source.volume = 1f;
			Object.DontDestroyOnLoad((Object)(object)((Component)source).gameObject);
			MonoBehaviour.print((object)windows.Count);
			MonoBehaviour.print((object)windows);
			foreach (R_Window window in windows)
			{
				Plugin.LogInfo($"Window: {window.id}, isnull: {(Object)(object)window.prefab == (Object)null}");
			}
			if (windows.Count == 0)
			{
				Plugin.LogWarning("Windows list is empty, loading from bundles...");
				windows.Add(new R_Window("login", BundlesManager.netBundle.LoadAsset<GameObject>("Login Variant")));
				windows.Add(new R_Window("main", BundlesManager.netBundle.LoadAsset<GameObject>("UltranetMain Variant")));
				windows.Add(new R_Window("rules", BundlesManager.netBundle.LoadAsset<GameObject>("Rules Variant")));
				windows.Add(new R_Window("chat", BundlesManager.netBundle.LoadAsset<GameObject>("Chat Variant")));
				windows.Add(new R_Window("profile", BundlesManager.netBundle.LoadAsset<GameObject>("Profile Variant")));
				windows.Add(new R_Window("profilesettings", BundlesManager.netBundle.LoadAsset<GameObject>("Profile Settings Variant")));
				windows.Add(new R_Window("friends", BundlesManager.netBundle.LoadAsset<GameObject>("Friends Variant")));
				windows.Add(new R_Window("requests", BundlesManager.netBundle.LoadAsset<GameObject>("FriendRequests Variant")));
				windows.Add(new R_Window("friendChat", BundlesManager.netBundle.LoadAsset<GameObject>("Friend Chat Variant")));
			}
		}

		public void CheckForLogin()
		{
			if (checking)
			{
				return;
			}
			checking = true;
			if (GetToken() == "")
			{
				SpawnWindow("login");
				checking = false;
				return;
			}
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/login", new Dictionary<string, string> { 
			{
				"token",
				GetToken()
			} }, delegate(string json)
			{
				checking = false;
				if (json.StartsWith("Yay!"))
				{
					string text = json.Replace("Yay!", "");
					steamid = text.Split('#')[0];
					compressedid = text.Split('#')[1];
					SpawnWindow("main");
				}
				else
				{
					SpawnWindow("login");
				}
			}));
		}

		public void Open()
		{
			TMP_InputField currentChatField = CurrentChatField;
			if (currentChatField != null)
			{
				currentChatField.ActivateInputField();
			}
		}

		public void ClearWindows()
		{
			foreach (GameObject item in openWindowsObjs.ToList())
			{
				if ((Object)(object)item != (Object)null)
				{
					Object.Destroy((Object)(object)item);
				}
			}
			openWindows = new List<string>();
			openWindowsObjs = new List<GameObject>();
		}

		public void Login(string key)
		{
			if (key == "")
			{
				key = GUIUtility.systemCopyBuffer;
			}
			PlayerPrefs.SetString("UltranetToken", key);
			ClearWindows();
		}

		public void OpenProfile(string steamid)
		{
			GameObject val = SpawnWindow("profile");
			if (Object.op_Implicit((Object)(object)val))
			{
				val.GetComponent<R_Profile>().LoadProfile(steamid);
			}
		}

		public GameObject SpawnWindow(string id)
		{
			return SpawnWindowCustomID(id, id);
		}

		public GameObject SpawnWindowCustomID(string id, string customID)
		{
			R_Window r_Window = windows.Where((R_Window r_Window2) => r_Window2.id == id).FirstOrDefault();
			if (r_Window != null)
			{
				if (openWindows.Contains(customID))
				{
					Plugin.LogError("Window with id '" + customID + "' is already open!");
					return null;
				}
				Plugin.LogInfo("Spawning window '" + id + "' with custom id '" + customID + "'");
				GameObject val = Object.Instantiate<GameObject>(r_Window.prefab, ((Component)this).transform.GetChild(1));
				((Object)val).name = customID;
				return val;
			}
			Plugin.LogError("No window with id '" + id + "' found!");
			return null;
		}

		public void Update()
		{
			if ((Object)(object)MonoSingleton<OptionsManager>.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu" && !MonoSingleton<OptionsManager>.Instance.paused)
			{
				MonoSingleton<OptionsManager>.Instance.Pause();
			}
			Time.timeScale = 0f;
			Cursor.visible = true;
			Cursor.lockState = (CursorLockMode)0;
			if (Input.GetKeyDown((KeyCode)27))
			{
				Time.timeScale = 1f;
				((Component)this).gameObject.SetActive(false);
				if ((Object)(object)MonoSingleton<OptionsManager>.Instance != (Object)null && SceneHelper.CurrentScene != "Main Menu")
				{
					MonoSingleton<OptionsManager>.Instance.UnPause();
				}
			}
			if (openWindows.Count == 0)
			{
				CheckForLogin();
			}
		}

		public Color ParseColor(string colorStr)
		{
			//IL_0012: 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_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_001a: Unknown result type (might be due to invalid IL or missing references)
			Color result = default(Color);
			if (ColorUtility.TryParseHtmlString(colorStr, ref result))
			{
				return result;
			}
			return Color.white;
		}

		public static string GetToken()
		{
			return PlayerPrefs.GetString("UltranetToken", "");
		}

		public static string GetPosition()
		{
			//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_0011: 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)
			if ((Object)(object)Camera.main == (Object)null)
			{
				return ((object)Vector3.zero/*cast due to .constrained prefix*/).ToString();
			}
			return ((object)((Component)Camera.main).transform.position/*cast due to .constrained prefix*/).ToString();
		}
	}
	public class DMUrlText : MonoBehaviour, IPointerClickHandler, IEventSystemHandler, IPointerEnterHandler, IPointerExitHandler
	{
		public TMP_Text text;

		private bool hoveringLink;

		private bool hovering;

		public void OnPointerClick(PointerEventData eventData)
		{
			//IL_0007: 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)
			int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null);
			if (num != -1)
			{
				TMP_LinkInfo val = text.textInfo.linkInfo[num];
				string linkID = ((TMP_LinkInfo)(ref val)).GetLinkID();
				Application.OpenURL(linkID);
			}
		}

		public void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null);
			if (num != -1 && hovering)
			{
				if (!hoveringLink)
				{
					hoveringLink = true;
					Tooltip.ShowTooltip("Open URL");
				}
			}
			else if (hoveringLink)
			{
				hoveringLink = false;
				Tooltip.HideTooltip();
			}
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			hovering = true;
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			hovering = false;
		}
	}
	public class EnterButton : MonoBehaviour
	{
		public void Update()
		{
			if (Input.GetKeyDown((KeyCode)13))
			{
				((UnityEvent)((Component)this).GetComponent<Button>().onClick).Invoke();
			}
		}
	}
	public class GayInputField : MonoBehaviour
	{
	}
	public class ImageGetter : MonoBehaviour
	{
		public string imageUrl;

		public RawImage image;

		public bool modifySize = false;

		public static bool _loaded = true;

		public static List<(string, Texture2D)> cachedPngs = new List<(string, Texture2D)>();

		public void SetImg()
		{
			//IL_0081: 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_003f: 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_004e: Unknown result type (might be due to invalid IL or missing references)
			//IL_005b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0060: 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_006f: Unknown result type (might be due to invalid IL or missing references)
			if (!modifySize)
			{
				RectTransform component = ((Component)this).GetComponent<RectTransform>();
				RectTransform component2 = ((Component)image).GetComponent<RectTransform>();
				RectTransform component3 = ((Component)((Component)image).transform.parent).GetComponent<RectTransform>();
				component2.sizeDelta = component.sizeDelta - Vector2.one * 50f;
				component3.sizeDelta = component.sizeDelta - Vector2.one * 50f;
			}
			((Graphic)image).color = Color.black;
			((MonoBehaviour)Plugin.instance).StartCoroutine(GetTextureFromURL(imageUrl, delegate(Texture2D tex)
			{
				//IL_0020: Unknown result type (might be due to invalid IL or missing references)
				if ((Object)(object)tex != (Object)null)
				{
					image.texture = (Texture)(object)tex;
					((Graphic)image).color = Color.white;
				}
			}));
		}

		public static IEnumerator GetTextureFromURL(string url, Action<Texture2D> callback)
		{
			_loaded = false;
			(string, Texture2D) cached = cachedPngs.FirstOrDefault(((string, Texture2D) x) => x.Item1 == url);
			if ((Object)(object)cached.Item2 != (Object)null)
			{
				callback(cached.Item2);
				yield break;
			}
			UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(url);
			try
			{
				yield return uwr.SendWebRequest();
				if ((int)uwr.result != 1)
				{
					Plugin.LogError("Failed to load texture: " + uwr.error);
					callback?.Invoke(null);
					_loaded = true;
				}
				else
				{
					Texture2D tex = DownloadHandlerTexture.GetContent(uwr);
					((Texture)tex).filterMode = (FilterMode)0;
					callback?.Invoke(tex);
					_loaded = true;
					cachedPngs.Add((url, tex));
				}
			}
			finally
			{
				((IDisposable)uwr)?.Dispose();
			}
		}
	}
	public class InteractableOnPlayer : MonoBehaviour
	{
		private Button button;

		public void Start()
		{
			button = ((Component)this).GetComponent<Button>();
			((Selectable)button).interactable = false;
		}

		public void Update()
		{
			((Selectable)button).interactable = (Object)(object)MonoSingleton<NewMovement>.Instance != (Object)null && MonoSingleton<NewMovement>.Instance.activated;
		}
	}
	[Serializable]
	public class Notification
	{
		public string content;

		public string type;

		public bool read;
	}
	[Serializable]
	public class NotificationList
	{
		public List<Notification> notifications;
	}
	public class NotificationListener : MonoBehaviour
	{
		public static NotificationListener instance;

		public Animator animator;

		public static List<Notification> notifications = new List<Notification>();

		private bool loading = false;

		private float timer;

		public void Awake()
		{
			instance = this;
			Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
		}

		public void Start()
		{
			Fetch();
		}

		public static void Show()
		{
			if ((Object)(object)instance == (Object)null)
			{
				Plugin.LogWarning("No NotificationListener found!");
			}
			else
			{
				instance.animator.SetTrigger("appear");
			}
		}

		public void Update()
		{
			if (!loading)
			{
				timer += Time.unscaledDeltaTime;
				if (((Component)ContentManager.instance).gameObject.activeInHierarchy)
				{
					timer += Time.unscaledDeltaTime * 3f;
				}
				if (timer > 8f)
				{
					timer = 0f;
					Fetch();
				}
			}
		}

		public void Fetch()
		{
			if (loading)
			{
				return;
			}
			loading = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/getNotifications", new Dictionary<string, string> { 
			{
				"token",
				ContentManager.GetToken()
			} }, delegate(string json)
			{
				loading = false;
				notifications = NotificationParser.Parse(json);
				if (notifications == null)
				{
					notifications = new List<Notification>();
				}
				bool flag = true;
				foreach (Notification notification in notifications)
				{
					if (!notification.read)
					{
						flag = false;
						break;
					}
				}
				if (!flag)
				{
					Show();
				}
			}));
		}
	}
	public static class NotificationParser
	{
		public static List<Notification> Parse(string json)
		{
			try
			{
				string text = "{ \"notifications\": " + json + "}";
				NotificationList notificationList = JsonUtility.FromJson<NotificationList>(text);
				return notificationList.notifications;
			}
			catch (Exception)
			{
				return new List<Notification>();
			}
		}
	}
	[Serializable]
	public class Profile
	{
		public string description;

		public string messageCount;

		public string permissions;

		public string pronouns;

		public string rank;

		public string name;

		public string id;

		public string id2;

		public string status;

		public string friends;

		public string dms;

		public string level;
	}
	public class ProfileIDText : MonoBehaviour, IPointerClickHandler, IEventSystemHandler, IPointerEnterHandler, IPointerExitHandler
	{
		public TMP_Text text;

		private bool hoveringLink;

		private bool hovering;

		public void OnPointerClick(PointerEventData eventData)
		{
			//IL_0007: 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)
			int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null);
			if (num != -1)
			{
				TMP_LinkInfo val = text.textInfo.linkInfo[num];
				string linkID = ((TMP_LinkInfo)(ref val)).GetLinkID();
				R_DMs.OpenProfileStatic(linkID);
			}
		}

		public void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			int num = TMP_TextUtilities.FindIntersectingLink(text, Input.mousePosition, (Camera)null);
			if (num != -1 && hovering)
			{
				if (!hoveringLink)
				{
					hoveringLink = true;
					Tooltip.ShowTooltip("View profile");
				}
			}
			else if (hoveringLink)
			{
				hoveringLink = false;
				Tooltip.HideTooltip();
			}
		}

		public void OnPointerEnter(PointerEventData eventData)
		{
			hovering = true;
		}

		public void OnPointerExit(PointerEventData eventData)
		{
			hovering = false;
		}
	}
	[Serializable]
	public class ProfileList
	{
		public List<Profile> profiles;
	}
	public static class ProfileParser
	{
		public static List<Profile> Parse(string json)
		{
			try
			{
				string text = "{ \"profiles\": " + json + "}";
				ProfileList profileList = JsonUtility.FromJson<ProfileList>(text);
				return profileList.profiles;
			}
			catch (Exception)
			{
				return new List<Profile>();
			}
		}
	}
	public class ResetScrollbar : MonoBehaviour
	{
		public float value = 1f;

		private void Start()
		{
			ResetPos(value);
		}

		public void ResetPos(float value)
		{
			((Component)this).GetComponent<Scrollbar>().value = value;
		}

		public IEnumerator ResetNextFrame(float value)
		{
			yield return null;
			ResetPos(value);
			Plugin.LogInfo("Scrollbar reset to " + value);
		}
	}
	public class R_Chat : MonoBehaviour
	{
		public TMP_InputField Field;

		public TMP_InputField Content;

		private bool checking = false;

		private float checkCooldown = 0.2f;

		private float checkTimer = 0f;

		public void Start()
		{
			((UnityEvent<string>)(object)Field.onSubmit).AddListener((UnityAction<string>)delegate(string t)
			{
				SendMessage(t);
			});
			Field.ActivateInputField();
			ContentManager.CurrentChatField = Field;
		}

		public void Update()
		{
			if (!checking)
			{
				checkTimer += Time.unscaledDeltaTime;
				if (checkTimer >= checkCooldown)
				{
					CheckForMessages();
				}
			}
		}

		public void CheckForMessages()
		{
			if (checking)
			{
				return;
			}
			checkTimer = 0f;
			checking = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/chat", new Dictionary<string, string> { 
			{
				"token",
				ContentManager.GetToken()
			} }, delegate(string json)
			{
				checking = false;
				List<ChatMessage> list = ChatParser.Parse(json);
				string text = "";
				string text2 = "";
				string text3 = "";
				foreach (ChatMessage item in list)
				{
					text2 += "\n";
					string text4 = "";
					string text5 = "";
					if (item.author == "SYSTEM")
					{
						text4 = "<color=#228822>";
						text5 = "</color>";
					}
					if (item.name != "" && item.author != "SYSTEM")
					{
						text2 = text2 + "<color=#00000077>(</color><color=#00000077><link=" + item.author + ">" + item.name + "</link></color><color=#00000077>)</color> ";
					}
					text2 = text2 + text4 + TextParser.Parse(item.content) + text5;
					text3 = TextParser.Parse(item.content);
					text = item.authorid;
				}
				if (Content.text != text2)
				{
					Content.text = text2;
					SamAPI.TryPlay(TTSParser.Parse(text3), ContentManager.instance.source);
				}
			}));
		}

		public void SendMessage(string t)
		{
			if (!(t == ""))
			{
				Field.text = "";
				Field.ActivateInputField();
				checking = true;
				((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/chat/sendMessageV2", new Dictionary<string, string>
				{
					{
						"token",
						ContentManager.GetToken()
					},
					{ "content", t }
				}, delegate
				{
					checking = false;
					CheckForMessages();
				}));
			}
		}
	}
	public class R_DMs : MonoBehaviour
	{
		public TMP_InputField Field;

		public TMP_InputField ID;

		public TMP_InputField Title;

		public TMP_InputField Content;

		public Image pfp;

		public GameObject Online;

		public string chat = "PENIS";

		public string dmName = "PENIS";

		public string id = "PENIS";

		public string id2 = "PENIS";

		private bool checking = false;

		private float checkCooldown = 0.2f;

		private float checkTimer = 0f;

		public void Start()
		{
			((UnityEvent<string>)(object)Field.onSubmit).AddListener((UnityAction<string>)delegate(string t)
			{
				SendMessage(t);
			});
			Field.ActivateInputField();
			Title.text = dmName;
			ID.text = "#" + id2;
			ContentManager.CurrentChatField = Field;
			R_Friends.LoadPfp(id, pfp);
		}

		public void Update()
		{
			if (!checking)
			{
				checkTimer += Time.unscaledDeltaTime;
				if (checkTimer >= checkCooldown)
				{
					CheckForMessages();
				}
			}
		}

		public void CheckForMessages()
		{
			if (checking)
			{
				return;
			}
			checkTimer = 0f;
			checking = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/profileV2", new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "steamid", id }
			}, delegate(string json)
			{
				List<Profile> list = ProfileParser.Parse(json);
				if (list.Count >= 1)
				{
					Profile profile = list[0];
					if (profile.status.ToLower().Contains("online"))
					{
						Online.gameObject.SetActive(true);
						Title.text = profile.name + "\n<color=#333333>" + profile.level + "</color>";
					}
					else
					{
						Online.gameObject.SetActive(false);
					}
				}
			}));
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/chat", new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "chat", chat }
			}, delegate(string json)
			{
				checking = false;
				List<ChatMessage> list = ChatParser.Parse(json);
				string text = "";
				string text2 = "";
				string text3 = "";
				foreach (ChatMessage item in list)
				{
					string[] array = TextParser.Parse(item.content).Split(' ');
					for (int i = 0; i < array.Length; i++)
					{
						string text4 = array[i];
						if (text4.StartsWith("https://") || text4.StartsWith("http://"))
						{
							array[i] = "<color=#4AF><link=" + text4 + ">" + text4 + "</link></color>";
						}
					}
					string text5 = string.Join(' ', array);
					text2 += "\n";
					text2 = text2 + "(" + item.name + "): " + text5;
					text3 = text5;
					text = item.authorid;
				}
				if (Content.text != text2)
				{
					Content.text = text2;
					SamAPI.TryPlay(TTSParser.Parse(text3), ContentManager.instance.source);
				}
			}));
		}

		public void SendMessage(string t)
		{
			if (!(t == ""))
			{
				Field.text = "";
				Field.ActivateInputField();
				checking = true;
				((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/chat/sendMessageV2", new Dictionary<string, string>
				{
					{
						"token",
						ContentManager.GetToken()
					},
					{ "content", t },
					{ "chat", chat }
				}, delegate
				{
					checking = false;
					CheckForMessages();
				}));
			}
		}

		public void OpenProfile()
		{
			GameObject val = ContentManager.instance.SpawnWindowCustomID("profile", "profile." + id);
			R_Profile component = val.GetComponent<R_Profile>();
			component.LoadProfile(id);
		}

		public static void OpenProfileStatic(string id)
		{
			GameObject val = ContentManager.instance.SpawnWindowCustomID("profile", "profile." + id);
			R_Profile component = val.GetComponent<R_Profile>();
			component.LoadProfile(id);
		}
	}
	public class R_Friends : MonoBehaviour
	{
		public Transform Container;

		public GameObject FriendItem;

		public GameObject RequestsHolder;

		private bool loading = false;

		private float timer = 0f;

		private string lastFriends = "";

		public void Start()
		{
			Fetch();
		}

		public void Update()
		{
			bool active = false;
			foreach (Notification notification in NotificationListener.notifications)
			{
				if (notification.type == "friendRequest")
				{
					active = true;
				}
			}
			RequestsHolder.SetActive(active);
			if (!loading)
			{
				timer += Time.unscaledDeltaTime;
				if (timer >= 3f)
				{
					timer = 0f;
					Fetch();
				}
			}
		}

		public void Fetch()
		{
			if (loading)
			{
				return;
			}
			loading = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/getFriends", new Dictionary<string, string> { 
			{
				"token",
				ContentManager.GetToken()
			} }, delegate(string json)
			{
				//IL_02b5: Unknown result type (might be due to invalid IL or missing references)
				//IL_02bf: Expected O, but got Unknown
				loading = false;
				List<Profile> list = ProfileParser.Parse(json);
				string text = "";
				foreach (Profile item in list)
				{
					text = text + item.id + "," + item.name + "," + item.level + "," + item.status + ",";
				}
				foreach (Notification notification in NotificationListener.notifications)
				{
					text = text + notification.content + notification.read + notification.type;
				}
				if (!(text != lastFriends))
				{
					return;
				}
				lastFriends = text;
				CleanUI();
				foreach (Profile profile in list)
				{
					GameObject val = Object.Instantiate<GameObject>(FriendItem, Container);
					LoadPfp(profile.id, ((Component)val.transform.GetChild(0).GetChild(0)).GetComponent<Image>());
					((Component)val.transform.GetChild(1)).GetComponent<TMP_InputField>().text = profile.name;
					GameObject gameObject = ((Component)val.transform.GetChild(2)).gameObject;
					GameObject gameObject2 = ((Component)val.transform.GetChild(3)).gameObject;
					GameObject gameObject3 = ((Component)val.transform.GetChild(4)).gameObject;
					gameObject3.SetActive(profile.status.ToLower().Contains("online"));
					TMP_InputField component = ((Component)val.transform.GetChild(5)).gameObject.GetComponent<TMP_InputField>();
					component.text = profile.level;
					bool active = false;
					foreach (Notification notification2 in NotificationListener.notifications)
					{
						if (notification2.type == "dm" && notification2.content == profile.id)
						{
							active = true;
						}
					}
					gameObject2.SetActive(active);
					((UnityEvent)gameObject.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						GameObject val2 = ContentManager.instance.SpawnWindowCustomID("friendChat", "friendChat." + profile.dms);
						if (Object.op_Implicit((Object)(object)val2))
						{
							R_DMs component2 = val2.GetComponent<R_DMs>();
							component2.id = profile.id;
							component2.id2 = profile.id2;
							component2.dmName = profile.name;
							component2.chat = profile.dms;
						}
					});
				}
			}));
		}

		public void CleanUI()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in Container)
			{
				Transform val = item;
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
		}

		public static async void LoadPfp(string steamid, Image img)
		{
			if (ulong.TryParse(steamid, out var result))
			{
				img.sprite = await SteamAvatarUtils.GetAvatarSpriteAsync(result);
			}
		}
	}
	public class R_Login : MonoBehaviour
	{
		public TMP_InputField Input;

		public void Login()
		{
			ContentManager.instance.Login(Input.text);
		}
	}
	public class R_MainPanel : MonoBehaviour
	{
		public GameObject FriendNotification;

		public void Update()
		{
			bool active = false;
			foreach (Notification notification in NotificationListener.notifications)
			{
				if (notification.type == "friendRequest" || notification.type == "dm")
				{
					active = true;
				}
			}
			FriendNotification.SetActive(active);
		}
	}
	public class R_Profile : MonoBehaviour
	{
		public TMP_InputField Name;

		public TMP_InputField Bio;

		public TMP_InputField ID;

		public TMP_InputField Pronouns;

		public TMP_InputField Status;

		public TMP_InputField SearchField;

		public Image Pfp;

		public GameObject ProfileSettings;

		public GameObject SendFriendRequestButton;

		public GameObject RemoveFriendButton;

		private bool loading = false;

		private float timer = 0f;

		private string id;

		public void LoadProfile(string steamid)
		{
			if (loading)
			{
				return;
			}
			id = steamid;
			loading = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/profileV2", new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "steamid", steamid }
			}, delegate(string json)
			{
				loading = false;
				List<Profile> list = ProfileParser.Parse(json);
				if (list.Count >= 1)
				{
					Profile profile = list[0];
					Name.text = profile.name + " - " + profile.pronouns;
					Bio.text = profile.description;
					Pronouns.text = profile.permissions;
					ID.text = "#" + profile.id2;
					Status.text = profile.status;
					LoadPfp(profile.id);
					ProfileSettings.SetActive(profile.id == ContentManager.steamid);
					SendFriendRequestButton.SetActive(profile.id != ContentManager.steamid && profile.friends.ToLower() != "true");
					RemoveFriendButton.SetActive(profile.id != ContentManager.steamid && profile.friends.ToLower() == "true");
				}
				else
				{
					id = "";
					Name.text = "User not found";
					Bio.text = "<size=0>";
					Pronouns.text = "<size=0>";
					ID.text = "<size=0>";
					Status.text = "<size=0>";
					Pfp.sprite = null;
					ProfileSettings.SetActive(false);
					SendFriendRequestButton.SetActive(false);
				}
			}));
		}

		public void SetAsLoading()
		{
			ProfileSettings.SetActive(false);
			SendFriendRequestButton.SetActive(false);
			Name.text = "Loading...";
			Bio.text = "Loading...";
			Pronouns.text = "Loading...";
			ID.text = "Loading...";
			Status.text = "Loading...";
			Pfp.sprite = null;
		}

		public void Search()
		{
			if (SearchField.text != "")
			{
				SetAsLoading();
				LoadProfile(SearchField.text);
			}
			else
			{
				SetAsLoading();
				LoadProfile(ContentManager.steamid);
			}
		}

		public void SendFriendRequest()
		{
			SendFriendRequestButton.SetActive(false);
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/sendFriendRequest", new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "steamid", id }
			}, delegate
			{
			}));
		}

		public void RemoveFriend()
		{
			RemoveFriendButton.SetActive(false);
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/setFriends", new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "steamid", id },
				{ "status", "false" }
			}, delegate
			{
			}));
		}

		public async void LoadPfp(string steamid)
		{
			if (ulong.TryParse(steamid, out var result))
			{
				Sprite img = await SteamAvatarUtils.GetAvatarSpriteAsync(result);
				Pfp.sprite = img;
			}
		}

		public void Update()
		{
			if (!loading && !(id == ""))
			{
				timer += Time.unscaledDeltaTime;
				if (timer >= 7f)
				{
					timer = 0f;
					LoadProfile(id);
				}
			}
		}
	}
	public class R_ProfileSettings : MonoBehaviour
	{
		public TMP_InputField bio;

		public TMP_InputField pron;

		public void UpdateBio()
		{
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest(ContentManager.profileSetBioUrl, new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "input", bio.text }
			}, delegate
			{
			}));
		}

		public void UpdatePronouns()
		{
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest(ContentManager.profileSetPronounsUrl, new Dictionary<string, string>
			{
				{
					"token",
					ContentManager.GetToken()
				},
				{ "input", pron.text }
			}, delegate
			{
			}));
		}
	}
	public class R_Requests : MonoBehaviour
	{
		public TMP_InputField ID;

		public TMP_InputField Field;

		public Transform Container;

		public GameObject RequestItem;

		private bool loading = false;

		private float timer = 0f;

		public void Start()
		{
			ID.text = "ID: #" + ContentManager.compressedid;
			Fetch();
		}

		public void Update()
		{
			if (!loading)
			{
				timer += Time.unscaledDeltaTime;
				if (timer >= 3f)
				{
					timer = 0f;
					Fetch();
				}
			}
		}

		public void Fetch()
		{
			if (loading)
			{
				return;
			}
			loading = true;
			((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/getFriendRequests", new Dictionary<string, string> { 
			{
				"token",
				ContentManager.GetToken()
			} }, delegate(string json)
			{
				//IL_011a: Unknown result type (might be due to invalid IL or missing references)
				//IL_0124: Expected O, but got Unknown
				//IL_0138: Unknown result type (might be due to invalid IL or missing references)
				//IL_0142: Expected O, but got Unknown
				//IL_0156: Unknown result type (might be due to invalid IL or missing references)
				//IL_0160: Expected O, but got Unknown
				loading = false;
				List<Profile> list = ProfileParser.Parse(json);
				CleanUI();
				foreach (Profile profile in list)
				{
					GameObject item = Object.Instantiate<GameObject>(RequestItem, Container);
					LoadPfp(profile.id, ((Component)item.transform.GetChild(0).GetChild(0)).GetComponent<Image>());
					((Component)item.transform.GetChild(1)).GetComponent<TMP_InputField>().text = profile.name;
					GameObject gameObject = ((Component)item.transform.GetChild(0)).gameObject;
					GameObject gameObject2 = ((Component)item.transform.GetChild(2)).gameObject;
					GameObject gameObject3 = ((Component)item.transform.GetChild(3)).gameObject;
					((UnityEvent)gameObject.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						R_DMs.OpenProfileStatic(profile.id);
					});
					((UnityEvent)gameObject2.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						item.SetActive(false);
						((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/setFriends", new Dictionary<string, string>
						{
							{
								"token",
								ContentManager.GetToken()
							},
							{ "steamid", profile.id },
							{ "status", "true" }
						}, delegate
						{
						}));
					});
					((UnityEvent)gameObject3.GetComponent<Button>().onClick).AddListener((UnityAction)delegate
					{
						item.SetActive(false);
						((MonoBehaviour)Numerators.instance).StartCoroutine(Numerators.PostRequest("https://duviz.xyz/ultranet/setFriends", new Dictionary<string, string>
						{
							{
								"token",
								ContentManager.GetToken()
							},
							{ "steamid", profile.id },
							{ "status", "false" }
						}, delegate
						{
						}));
					});
				}
			}));
		}

		public void CleanUI()
		{
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Expected O, but got Unknown
			foreach (Transform item in Container)
			{
				Transform val = item;
				Object.Destroy((Object)(object)((Component)val).gameObject);
			}
		}

		public async void LoadPfp(string steamid, Image img)
		{
			if (ulong.TryParse(steamid, out var result))
			{
				img.sprite = await SteamAvatarUtils.GetAvatarSpriteAsync(result);
			}
		}

		public void Search()
		{
			if (!string.IsNullOrEmpty(Field.text))
			{
				R_DMs.OpenProfileStatic(Field.text);
			}
		}

		public void CopyID()
		{
			GUIUtility.systemCopyBuffer = ContentManager.compressedid;
		}
	}
	public class R_WindowDragger : MonoBehaviour, IPointerDownHandler, IEventSystemHandler, IDragHandler
	{
		public RectTransform parentWindow;

		private RectTransform canvasRect;

		private Vector2 offset;

		private void Start()
		{
			canvasRect = ((Component)((Component)this).GetComponentInParent<Canvas>()).GetComponent<RectTransform>();
		}

		public void OnPointerDown(PointerEventData eventData)
		{
			//IL_0008: 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_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)
			Vector2 val = default(Vector2);
			RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, eventData.position, eventData.pressEventCamera, ref val);
			offset = parentWindow.anchoredPosition - val;
			((Transform)parentWindow).SetAsLastSibling();
		}

		public void OnDrag(PointerEventData eventData)
		{
			//IL_0008: 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_001d: 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_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_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_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_004c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0051: Unknown result type (might be due to invalid IL or missing references)
			//IL_0057: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_006f: Unknown result type (might be due to invalid IL or missing references)
			//IL_007b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0089: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a6: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cb: 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)
			//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
			//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
			//IL_010e: Unknown result type (might be due to invalid IL or missing references)
			//IL_011a: Unknown result type (might be due to invalid IL or missing references)
			//IL_012b: Unknown result type (might be due to invalid IL or missing references)
			//IL_013c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0152: Unknown result type (might be due to invalid IL or missing references)
			//IL_016c: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, eventData.position, eventData.pressEventCamera, ref val);
			Vector2 val2 = val + offset;
			Rect rect = canvasRect.rect;
			Vector2 size = ((Rect)(ref rect)).size;
			rect = parentWindow.rect;
			Vector2 size2 = ((Rect)(ref rect)).size;
			float num = (0f - size.x) * canvasRect.pivot.x + size2.x * parentWindow.pivot.x;
			float num2 = size.x * (1f - canvasRect.pivot.x) - size2.x * (1f - parentWindow.pivot.x);
			float num3 = (0f - size.y) * canvasRect.pivot.y + size2.y * parentWindow.pivot.y;
			float num4 = size.y * (1f - canvasRect.pivot.y) - size2.y * (1f - parentWindow.pivot.y);
			val2.x = Mathf.Clamp(val2.x, num, num2);
			val2.y = Mathf.Clamp(val2.y, num3, num4);
			parentWindow.anchoredPosition = val2;
		}
	}
	public class R_WindowInstance : MonoBehaviour
	{
		public void Start()
		{
			ContentManager.openWindows.Add(((Object)this).name);
			ContentManager.openWindowsObjs.Add(((Component)this).gameObject);
		}

		public void OnDestroy()
		{
			ContentManager.openWindows.Remove(((Object)this).name);
			ContentManager.openWindowsObjs.Remove(((Component)this).gameObject);
		}

		public void DestroyWindow()
		{
			if (ContentManager.openWindowsObjs.Count == 1)
			{
				Plugin.instance.PressKey();
			}
			Object.Destroy((Object)(object)((Component)this).gameObject);
		}

		public void OpenURL(string url)
		{
			Application.OpenURL(url);
		}

		public void OpenSelfProfile()
		{
			ContentManager.instance.OpenProfile(ContentManager.steamid);
		}

		public void OpenWindow(string id)
		{
			ContentManager.instance.SpawnWindow(id);
		}

		public void Logout()
		{
			PlayerPrefs.SetString("UltranetToken", "");
			ContentManager.instance.ClearWindows();
		}
	}
	public class SliderConfig : MonoBehaviour
	{
		public string pref = "";

		public float defaultValue = 0f;

		public Slider slider;

		public void Start()
		{
			slider.value = PlayerPrefs.GetFloat(pref, defaultValue);
		}

		public void Change(int value)
		{
			PlayerPrefs.SetFloat(pref, slider.value);
		}
	}
	public static class SteamAvatarUtils
	{
		public static async Task<Sprite> GetAvatarSpriteAsync(ulong steamId)
		{
			Friend val = new Friend(SteamId.op_Implicit(steamId));
			Image? image = await ((Friend)(ref val)).GetLargeAvatarAsync();
			if (!image.HasValue)
			{
				return null;
			}
			Texture2D tex = ConvertSteamImageToTexture(image.Value);
			return Sprite.Create(tex, new Rect(0f, 0f, (float)((Texture)tex).width, (float)((Texture)tex).height), new Vector2(0.5f, 0.5f));
		}

		public static Texture2D ConvertSteamImageToTexture(Image image)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Expected O, but got Unknown
			//IL_0016: Unknown result type (might be due to invalid IL or missing references)
			Texture2D val = new Texture2D((int)image.Width, (int)image.Height, (TextureFormat)4, false);
			val.LoadRawTextureData(image.Data);
			val.Apply();
			return val;
		}
	}
	public static class TextParser
	{
		public static Dictionary<string, string> parses = new Dictionary<string, string>
		{
			{ "//10", "/" },
			{ "//11", "\\" },
			{ "//12", ":" },
			{ "//13", ";" },
			{ "//14", "<noparse><</noparse>" },
			{ "//15", "<noparse>></noparse>" },
			{ "//1", "'" },
			{ "//2", "\"" },
			{ "//3", "(" },
			{ "//4", ")" },
			{ "//5", "$" },
			{ "//6", "%" },
			{ "//7", "@" },
			{ "//8", "!" },
			{ "//9", "#" },
			{ ":drool:", "<sprite=0>" }
		};

		public static string Parse(string text)
		{
			string text2 = text;
			foreach (KeyValuePair<string, string> parse in parses)
			{
				text2 = text2.Replace(parse.Key, parse.Value);
			}
			return text2;
		}
	}
	public class Tooltip : MonoBehaviour
	{
		public static Tooltip instance;

		private RectTransform rectTransform;

		private RectTransform canvasRect;

		public void Awake()
		{
			instance = this;
			rectTransform = ((Component)this).GetComponent<RectTransform>();
			canvasRect = ((Component)((Component)this).GetComponentInParent<Canvas>()).GetComponent<RectTransform>();
			((Component)this).gameObject.SetActive(false);
		}

		public void Update()
		{
			//IL_0007: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: 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_0021: Unknown result type (might be due to invalid IL or missing references)
			Vector2 val = default(Vector2);
			RectTransformUtility.ScreenPointToLocalPointInRectangle(canvasRect, Vector2.op_Implicit(Input.mousePosition), (Camera)null, ref val);
			((Transform)rectTransform).localPosition = Vector2.op_Implicit(val);
			if (Input.GetMouseButtonDown(0))
			{
				HideTooltip();
			}
		}

		public static void ShowTooltip(string tooltip)
		{
			instance.Update();
			((Component)instance).gameObject.SetActive(true);
			((Component)((Component)instance).transform.GetChild(0)).GetComponentInChildren<TMP_Text>().text = tooltip;
		}

		public static void HideTooltip()
		{
			((Component)instance).gameObject.SetActive(false);
		}
	}
	public class TooltipButton : MonoBehaviour
	{
		public string tooltip;

		private void Start()
		{
			//IL_000d: 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_0014: Unknown result type (might be due to invalid IL or missing references)
			//IL_001a: Expected O, but got Unknown
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Unknown result type (might be due to invalid IL or missing references)
			//IL_0039: Unknown result type (might be due to invalid IL or missing references)
			//IL_003f: Expected O, but got Unknown
			EventTrigger val = ((Component)this).gameObject.AddComponent<EventTrigger>();
			Entry val2 = new Entry
			{
				eventID = (EventTriggerType)0
			};
			((UnityEvent<BaseEventData>)(object)val2.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				Tooltip.ShowTooltip(tooltip);
			});
			Entry val3 = new Entry
			{
				eventID = (EventTriggerType)1
			};
			((UnityEvent<BaseEventData>)(object)val3.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				Tooltip.HideTooltip();
			});
			val.triggers.Add(val2);
			val.triggers.Add(val3);
		}
	}
	public static class TTSParser
	{
		public static Dictionary<string, string> parses = new Dictionary<string, string>
		{
			{ "<sprite=0>", "drool" },
			{ ":3", "meow" },
			{ "<", "less than" },
			{ ">", "greater than" }
		};

		public static string Parse(string text)
		{
			string text2 = text;
			foreach (KeyValuePair<string, string> parse in parses)
			{
				text2 = text2.Replace(parse.Key, parse.Value);
			}
			return text2;
		}
	}
	public class UrlButton : MonoBehaviour
	{
		public void OpenUrl(string r)
		{
			Application.OpenURL(r);
		}
	}
}
namespace Jaket.Sam
{
	public class Buffer
	{
		private List<int> data = new List<int>();

		private int lastTimeTableIndex;

		public int Position;

		public void Set(int pos, int value)
		{
			while (pos >= data.Count)
			{
				data.Add(0);
			}
			data[pos] = value;
		}

		public void WriteArray(int index, int[] array)
		{
			Position += Constants.TimeTable[lastTimeTableIndex, index];
			lastTimeTableIndex = index;
			for (int i = 0; i < 5; i++)
			{
				Set(Position / 50 + i, array[i]);
			}
		}

		public void Write(int index, int v)
		{
			WriteArray(index, new int[5] { v, v, v, v, v });
		}

		public float[] GetFloats()
		{
			float[] array = new float[data.Count];
			for (int i = 0; i < data.Count; i++)
			{
				array[i] = (float)(data[i] - 127) / 255f;
			}
			return array;
		}
	}
	public class Constants
	{
		public static readonly Dictionary<char, string> ISO9 = new Dictionary<char, string>
		{
			{ 'А', "A" },
			{ 'Б', "B" },
			{ 'В', "V" },
			{ 'Г', "G" },
			{ 'Д', "D" },
			{ 'Е', "EE" },
			{ 'Ё', "Ë" },
			{ 'Ж', "ZH" },
			{ 'З', "Z" },
			{ 'И', "IE" },
			{ 'Й', "Y" },
			{ 'К', "K" },
			{ 'Л', "L" },
			{ 'М', "M" },
			{ 'Н', "N" },
			{ 'О', "O" },
			{ 'П', "P" },
			{ 'Р', "R" },
			{ 'С', "S" },
			{ 'Т', "T" },
			{ 'У', "OO" },
			{ 'Ф', "F" },
			{ 'Х', "H" },
			{ 'Ц', "TS" },
			{ 'Ч', "CH" },
			{ 'Ш', "SH" },
			{ 'Щ', "SHCH" },
			{ 'Ъ', "'" },
			{ 'Ы', "Y'" },
			{ 'Ь', "'" },
			{ 'Э', "EH" },
			{ 'Ю', "YU" },
			{ 'Я', "YA" }
		};

		public static readonly int[] RulesSet1 = new int[4076]
		{
			93, 193, 32, 40, 65, 46, 41, 61, 69, 72,
			52, 89, 46, 160, 40, 65, 41, 32, 61, 65,
			200, 32, 40, 65, 82, 69, 41, 32, 61, 65,
			65, 210, 32, 40, 65, 82, 41, 79, 61, 65,
			88, 210, 40, 65, 82, 41, 35, 61, 69, 72,
			52, 210, 32, 94, 40, 65, 83, 41, 35, 61,
			69, 89, 52, 211, 40, 65, 41, 87, 65, 61,
			65, 216, 40, 65, 87, 41, 61, 65, 79, 181,
			32, 58, 40, 65, 78, 89, 41, 61, 69, 72,
			52, 78, 73, 217, 40, 65, 41, 94, 43, 35,
			61, 69, 89, 181, 35, 58, 40, 65, 76, 76,
			89, 41, 61, 85, 76, 73, 217, 32, 40, 65,
			76, 41, 35, 61, 85, 204, 40, 65, 71, 65,
			73, 78, 41, 61, 65, 88, 71, 69, 72, 52,
			206, 35, 58, 40, 65, 71, 41, 69, 61, 73,
			72, 202, 40, 65, 41, 94, 37, 61, 69, 217,
			40, 65, 41, 94, 43, 58, 35, 61, 65, 197,
			32, 58, 40, 65, 41, 94, 43, 32, 61, 69,
			89, 180, 32, 40, 65, 82, 82, 41, 61, 65,
			88, 210, 40, 65, 82, 82, 41, 61, 65, 69,
			52, 210, 32, 94, 40, 65, 82, 41, 32, 61,
			65, 65, 53, 210, 40, 65, 82, 41, 61, 65,
			65, 53, 210, 40, 65, 73, 82, 41, 61, 69,
			72, 52, 210, 40, 65, 73, 41, 61, 69, 89,
			180, 40, 65, 89, 41, 61, 69, 89, 181, 40,
			65, 85, 41, 61, 65, 79, 180, 35, 58, 40,
			65, 76, 41, 32, 61, 85, 204, 35, 58, 40,
			65, 76, 83, 41, 32, 61, 85, 76, 218, 40,
			65, 76, 75, 41, 61, 65, 79, 52, 203, 40,
			65, 76, 41, 94, 61, 65, 79, 204, 32, 58,
			40, 65, 66, 76, 69, 41, 61, 69, 89, 52,
			66, 85, 204, 40, 65, 66, 76, 69, 41, 61,
			65, 88, 66, 85, 204, 40, 65, 41, 86, 79,
			61, 69, 89, 180, 40, 65, 78, 71, 41, 43,
			61, 69, 89, 52, 78, 202, 40, 65, 84, 65,
			82, 73, 41, 61, 65, 72, 84, 65, 65, 52,
			82, 73, 217, 40, 65, 41, 84, 79, 77, 61,
			65, 197, 40, 65, 41, 84, 84, 73, 61, 65,
			197, 32, 40, 65, 84, 41, 32, 61, 65, 69,
			212, 32, 40, 65, 41, 84, 61, 65, 200, 40,
			65, 41, 61, 65, 197, 93, 194, 32, 40, 66,
			41, 32, 61, 66, 73, 89, 180, 32, 40, 66,
			69, 41, 94, 35, 61, 66, 73, 200, 40, 66,
			69, 73, 78, 71, 41, 61, 66, 73, 89, 52,
			73, 72, 78, 216, 32, 40, 66, 79, 84, 72,
			41, 32, 61, 66, 79, 87, 52, 84, 200, 32,
			40, 66, 85, 83, 41, 35, 61, 66, 73, 72,
			52, 218, 40, 66, 82, 69, 65, 75, 41, 61,
			66, 82, 69, 89, 53, 203, 40, 66, 85, 73,
			76, 41, 61, 66, 73, 72, 52, 204, 40, 66,
			41, 61, 194, 93, 195, 32, 40, 67, 41, 32,
			61, 83, 73, 89, 180, 32, 40, 67, 72, 41,
			94, 61, 203, 94, 69, 40, 67, 72, 41, 61,
			203, 40, 67, 72, 65, 41, 82, 35, 61, 75,
			69, 72, 181, 40, 67, 72, 41, 61, 67, 200,
			32, 83, 40, 67, 73, 41, 35, 61, 83, 65,
			89, 180, 40, 67, 73, 41, 65, 61, 83, 200,
			40, 67, 73, 41, 79, 61, 83, 200, 40, 67,
			73, 41, 69, 78, 61, 83, 200, 40, 67, 73,
			84, 89, 41, 61, 83, 73, 72, 84, 73, 217,
			40, 67, 41, 43, 61, 211, 40, 67, 75, 41,
			61, 203, 40, 67, 79, 77, 77, 79, 68, 79,
			82, 69, 41, 61, 75, 65, 65, 52, 77, 65,
			72, 68, 79, 72, 210, 40, 67, 79, 77, 41,
			61, 75, 65, 72, 205, 40, 67, 85, 73, 84,
			41, 61, 75, 73, 72, 212, 40, 67, 82, 69,
			65, 41, 61, 75, 82, 73, 89, 69, 217, 40,
			67, 41, 61, 203, 93, 196, 32, 40, 68, 41,
			32, 61, 68, 73, 89, 180, 32, 40, 68, 82,
			46, 41, 32, 61, 68, 65, 65, 52, 75, 84,
			69, 210, 35, 58, 40, 68, 69, 68, 41, 32,
			61, 68, 73, 72, 196, 46, 69, 40, 68, 41,
			32, 61, 196, 35, 58, 94, 69, 40, 68, 41,
			32, 61, 212, 32, 40, 68, 69, 41, 94, 35,
			61, 68, 73, 200, 32, 40, 68, 79, 41, 32,
			61, 68, 85, 215, 32, 40, 68, 79, 69, 83,
			41, 61, 68, 65, 72, 218, 40, 68, 79, 78,
			69, 41, 32, 61, 68, 65, 72, 53, 206, 40,
			68, 79, 73, 78, 71, 41, 61, 68, 85, 87,
			52, 73, 72, 78, 216, 32, 40, 68, 79, 87,
			41, 61, 68, 65, 215, 35, 40, 68, 85, 41,
			65, 61, 74, 85, 215, 35, 40, 68, 85, 41,
			94, 35, 61, 74, 65, 216, 40, 68, 41, 61,
			196, 93, 197, 32, 40, 69, 41, 32, 61, 73,
			89, 73, 89, 180, 35, 58, 40, 69, 41, 32,
			189, 39, 58, 94, 40, 69, 41, 32, 189, 32,
			58, 40, 69, 41, 32, 61, 73, 217, 35, 40,
			69, 68, 41, 32, 61, 196, 35, 58, 40, 69,
			41, 68, 32, 189, 40, 69, 86, 41, 69, 82,
			61, 69, 72, 52, 214, 40, 69, 41, 94, 37,
			61, 73, 89, 180, 40, 69, 82, 73, 41, 35,
			61, 73, 89, 52, 82, 73, 217, 40, 69, 82,
			73, 41, 61, 69, 72, 52, 82, 73, 200, 35,
			58, 40, 69, 82, 41, 35, 61, 69, 210, 40,
			69, 82, 82, 79, 82, 41, 61, 69, 72, 52,
			82, 79, 72, 210, 40, 69, 82, 65, 83, 69,
			41, 61, 73, 72, 82, 69, 89, 53, 211, 40,
			69, 82, 41, 35, 61, 69, 72, 210, 40, 69,
			82, 41, 61, 69, 210, 32, 40, 69, 86, 69,
			78, 41, 61, 73, 89, 86, 69, 72, 206, 35,
			58, 40, 69, 41, 87, 189, 64, 40, 69, 87,
			41, 61, 85, 215, 40, 69, 87, 41, 61, 89,
			85, 215, 40, 69, 41, 79, 61, 73, 217, 35,
			58, 38, 40, 69, 83, 41, 32, 61, 73, 72,
			218, 35, 58, 40, 69, 41, 83, 32, 189, 35,
			58, 40, 69, 76, 89, 41, 32, 61, 76, 73,
			217, 35, 58, 40, 69, 77, 69, 78, 84, 41,
			61, 77, 69, 72, 78, 212, 40, 69, 70, 85,
			76, 41, 61, 70, 85, 72, 204, 40, 69, 69,
			41, 61, 73, 89, 180, 40, 69, 65, 82, 78,
			41, 61, 69, 82, 53, 206, 32, 40, 69, 65,
			82, 41, 94, 61, 69, 82, 181, 40, 69, 65,
			68, 41, 61, 69, 72, 196, 35, 58, 40, 69,
			65, 41, 32, 61, 73, 89, 65, 216, 40, 69,
			65, 41, 83, 85, 61, 69, 72, 181, 40, 69,
			65, 41, 61, 73, 89, 181, 40, 69, 73, 71,
			72, 41, 61, 69, 89, 180, 40, 69, 73, 41,
			61, 73, 89, 180, 32, 40, 69, 89, 69, 41,
			61, 65, 89, 180, 40, 69, 89, 41, 61, 73,
			217, 40, 69, 85, 41, 61, 89, 85, 87, 181,
			40, 69, 81, 85, 65, 76, 41, 61, 73, 89,
			52, 75, 87, 85, 204, 40, 69, 41, 61, 69,
			200, 93, 198, 32, 40, 70, 41, 32, 61, 69,
			72, 52, 198, 40, 70, 85, 76, 41, 61, 70,
			85, 72, 204, 40, 70, 82, 73, 69, 78, 68,
			41, 61, 70, 82, 69, 72, 53, 78, 196, 40,
			70, 65, 84, 72, 69, 82, 41, 61, 70, 65,
			65, 52, 68, 72, 69, 210, 40, 70, 41, 70,
			189, 40, 70, 41, 61, 198, 93, 199, 32, 40,
			71, 41, 32, 61, 74, 73, 89, 180, 40, 71,
			73, 86, 41, 61, 71, 73, 72, 53, 214, 32,
			40, 71, 41, 73, 94, 61, 199, 40, 71, 69,
			41, 84, 61, 71, 69, 72, 181, 83, 85, 40,
			71, 71, 69, 83, 41, 61, 71, 74, 69, 72,
			52, 211, 40, 71, 71, 41, 61, 199, 32, 66,
			35, 40, 71, 41, 61, 199, 40, 71, 41, 43,
			61, 202, 40, 71, 82, 69, 65, 84, 41, 61,
			71, 82, 69, 89, 52, 212, 40, 71, 79, 78,
			41, 69, 61, 71, 65, 79, 53, 206, 35, 40,
			71, 72, 41, 189, 32, 40, 71, 78, 41, 61,
			206, 40, 71, 41, 61, 199, 93, 200, 32, 40,
			72, 41, 32, 61, 69, 89, 52, 67, 200, 32,
			40, 72, 65, 86, 41, 61, 47, 72, 65, 69,
			54, 214, 32, 40, 72, 69, 82, 69, 41, 61,
			47, 72, 73, 89, 210, 32, 40, 72, 79, 85,
			82, 41, 61, 65, 87, 53, 69, 210, 40, 72,
			79, 87, 41, 61, 47, 72, 65, 215, 40, 72,
			41, 35, 61, 47, 200, 40, 72, 41, 189, 93,
			201, 32, 40, 73, 78, 41, 61, 73, 72, 206,
			32, 40, 73, 41, 32, 61, 65, 89, 180, 40,
			73, 41, 32, 61, 65, 217, 40, 73, 78, 41,
			68, 61, 65, 89, 53, 206, 83, 69, 77, 40,
			73, 41, 61, 73, 217, 32, 65, 78, 84, 40,
			73, 41, 61, 65, 217, 40, 73, 69, 82, 41,
			61, 73, 89, 69, 210, 35, 58, 82, 40, 73,
			69, 68, 41, 32, 61, 73, 89, 196, 40, 73,
			69, 68, 41, 32, 61, 65, 89, 53, 196, 40,
			73, 69, 78, 41, 61, 73, 89, 69, 72, 206,
			40, 73, 69, 41, 84, 61, 65, 89, 52, 69,
			200, 40, 73, 39, 41, 61, 65, 89, 181, 32,
			58, 40, 73, 41, 94, 37, 61, 65, 89, 181,
			32, 58, 40, 73, 69, 41, 32, 61, 65, 89,
			180, 40, 73, 41, 37, 61, 73, 217, 40, 73,
			69, 41, 61, 73, 89, 180, 32, 40, 73, 68,
			69, 65, 41, 61, 65, 89, 68, 73, 89, 53,
			65, 200, 40, 73, 41, 94, 43, 58, 35, 61,
			73, 200, 40, 73, 82, 41, 35, 61, 65, 89,
			210, 40, 73, 90, 41, 37, 61, 65, 89, 218,
			40, 73, 83, 41, 37, 61, 65, 89, 218, 73,
			94, 40, 73, 41, 94, 35, 61, 73, 200, 43,
			94, 40, 73, 41, 94, 43, 61, 65, 217, 35,
			58, 94, 40, 73, 41, 94, 43, 61, 73, 200,
			40, 73, 41, 94, 43, 61, 65, 217, 40, 73,
			82, 41, 61, 69, 210, 40, 73, 71, 72, 41,
			61, 65, 89, 180, 40, 73, 76, 68, 41, 61,
			65, 89, 53, 76, 196, 32, 40, 73, 71, 78,
			41, 61, 73, 72, 71, 206, 40, 73, 71, 78,
			41, 32, 61, 65, 89, 52, 206, 40, 73, 71,
			78, 41, 94, 61, 65, 89, 52, 206, 40, 73,
			71, 78, 41, 37, 61, 65, 89, 52, 206, 40,
			73, 67, 82, 79, 41, 61, 65, 89, 52, 75,
			82, 79, 200, 40, 73, 81, 85, 69, 41, 61,
			73, 89, 52, 203, 40, 73, 41, 61, 73, 200,
			93, 202, 32, 40, 74, 41, 32, 61, 74, 69,
			89, 180, 40, 74, 41, 61, 202, 93, 203, 32,
			40, 75, 41, 32, 61, 75, 69, 89, 180, 32,
			40, 75, 41, 78, 189, 40, 75, 41, 61, 203,
			93, 204, 32, 40, 76, 41, 32, 61, 69, 72,
			52, 204, 40, 76, 79, 41, 67, 35, 61, 76,
			79, 215, 76, 40, 76, 41, 189, 35, 58, 94,
			40, 76, 41, 37, 61, 85, 204, 40, 76, 69,
			65, 68, 41, 61, 76, 73, 89, 196, 32, 40,
			76, 65, 85, 71, 72, 41, 61, 76, 65, 69,
			52, 198, 40, 76, 41, 61, 204, 93, 205, 32,
			40, 77, 41, 32, 61, 69, 72, 52, 205, 32,
			40, 77, 82, 46, 41, 32, 61, 77, 73, 72,
			52, 83, 84, 69, 210, 32, 40, 77, 83, 46,
			41, 61, 77, 73, 72, 53, 218, 32, 40, 77,
			82, 83, 46, 41, 32, 61, 77, 73, 72, 52,
			83, 73, 88, 218, 40, 77, 79, 86, 41, 61,
			77, 85, 87, 52, 214, 40, 77, 65, 67, 72,
			73, 78, 41, 61, 77, 65, 72, 83, 72, 73,
			89, 53, 206, 77, 40, 77, 41, 189, 40, 77,
			41, 61, 205, 93, 206, 32, 40, 78, 41, 32,
			61, 69, 72, 52, 206, 69, 40, 78, 71, 41,
			43, 61, 78, 202, 40, 78, 71, 41, 82, 61,
			78, 88, 199, 40, 78, 71, 41, 35, 61, 78,
			88, 199, 40, 78, 71, 76, 41, 37, 61, 78,
			88, 71, 85, 204, 40, 78, 71, 41, 61, 78,
			216, 40, 78, 75, 41, 61, 78, 88, 203, 32,
			40, 78, 79, 87, 41, 32, 61, 78, 65, 87,
			180, 78, 40, 78, 41, 189, 40, 78, 79, 78,
			41, 69, 61, 78, 65, 72, 52, 206, 40, 78,
			41, 61, 206, 93, 207, 32, 40, 79, 41, 32,
			61, 79, 72, 52, 215, 40, 79, 70, 41, 32,
			61, 65, 72, 214, 32, 40, 79, 72, 41, 32,
			61, 79, 87, 181, 40, 79, 82, 79, 85, 71,
			72, 41, 61, 69, 82, 52, 79, 215, 35, 58,
			40, 79, 82, 41, 32, 61, 69, 210, 35, 58,
			40, 79, 82, 83, 41, 32, 61, 69, 82, 218,
			40, 79, 82, 41, 61, 65, 79, 210, 32, 40,
			79, 78, 69, 41, 61, 87, 65, 72, 206, 35,
			40, 79, 78, 69, 41, 32, 61, 87, 65, 72,
			206, 40, 79, 87, 41, 61, 79, 215, 32, 40,
			79, 86, 69, 82, 41, 61, 79, 87, 53, 86,
			69, 210, 80, 82, 40, 79, 41, 86, 61, 85,
			87, 180, 40, 79, 86, 41, 61, 65, 72, 52,
			214, 40, 79, 41, 94, 37, 61, 79, 87, 181,
			40, 79, 41, 94, 69, 78, 61, 79, 215, 40,
			79, 41, 94, 73, 35, 61, 79, 87, 181, 40,
			79, 76, 41, 68, 61, 79, 87, 52, 204, 40,
			79, 85, 71, 72, 84, 41, 61, 65, 79, 53,
			212, 40, 79, 85, 71, 72, 41, 61, 65, 72,
			53, 198, 32, 40, 79, 85, 41, 61, 65, 215,
			72, 40, 79, 85, 41, 83, 35, 61, 65, 87,
			180, 40, 79, 85, 83, 41, 61, 65, 88, 211,
			40, 79, 85, 82, 41, 61, 79, 72, 210, 40,
			79, 85, 76, 68, 41, 61, 85, 72, 53, 196,
			40, 79, 85, 41, 94, 76, 61, 65, 72, 181,
			40, 79, 85, 80, 41, 61, 85, 87, 53, 208,
			40, 79, 85, 41, 61, 65, 215, 40, 79, 89,
			41, 61, 79, 217, 40, 79, 73, 78, 71, 41,
			61, 79, 87, 52, 73, 72, 78, 216, 40, 79,
			73, 41, 61, 79, 89, 181, 40, 79, 79, 82,
			41, 61, 79, 72, 53, 210, 40, 79, 79, 75,
			41, 61, 85, 72, 53, 203, 70, 40, 79, 79,
			68, 41, 61, 85, 87, 53, 196, 76, 40, 79,
			79, 68, 41, 61, 65, 72, 53, 196, 77, 40,
			79, 79, 68, 41, 61, 85, 87, 53, 196, 40,
			79, 79, 68, 41, 61, 85, 72, 53, 196, 70,
			40, 79, 79, 84, 41, 61, 85, 72, 53, 212,
			40, 79, 79, 41, 61, 85, 87, 181, 40, 79,
			39, 41, 61, 79, 200, 40, 79, 41, 69, 61,
			79, 215, 40, 79, 41, 32, 61, 79, 215, 40,
			79, 65, 41, 61, 79, 87, 180, 32, 40, 79,
			78, 76, 89, 41, 61, 79, 87, 52, 78, 76,
			73, 217, 32, 40, 79, 78, 67, 69, 41, 61,
			87, 65, 72, 52, 78, 211, 40, 79, 78, 39,
			84, 41, 61, 79, 87, 52, 78, 212, 67, 40,
			79, 41, 78, 61, 65, 193, 40, 79, 41, 78,
			71, 61, 65, 207, 32, 58, 94, 40, 79, 41,
			78, 61, 65, 200, 73, 40, 79, 78, 41, 61,
			85, 206, 35, 58, 40, 79, 78, 41, 61, 85,
			206, 35, 94, 40, 79, 78, 41, 61, 85, 206,
			40, 79, 41, 83, 84, 61, 79, 215, 40, 79,
			70, 41, 94, 61, 65, 79, 52, 198, 40, 79,
			84, 72, 69, 82, 41, 61, 65, 72, 53, 68,
			72, 69, 210, 82, 40, 79, 41, 66, 61, 82,
			65, 193, 94, 82, 40, 79, 41, 58, 35, 61,
			79, 87, 181, 40, 79, 83, 83, 41, 32, 61,
			65, 79, 53, 211, 35, 58, 94, 40, 79, 77,
			41, 61, 65, 72, 205, 40, 79, 41, 61, 65,
			193, 93, 208, 32, 40, 80, 41, 32, 61, 80,
			73, 89, 180, 40, 80, 72, 41, 61, 198, 40,
			80, 69, 79, 80, 76, 41, 61, 80, 73, 89,
			53, 80, 85, 204, 40, 80, 79, 87, 41, 61,
			80, 65, 87, 180, 40, 80, 85, 84, 41, 32,
			61, 80, 85, 72, 212, 40, 80, 41, 80, 189,
			40, 80, 41, 83, 189, 40, 80, 41, 78, 189,
			40, 80, 82, 79, 70, 46, 41, 61, 80, 82,
			79, 72, 70, 69, 72, 52, 83, 69, 210, 40,
			80, 41, 61, 208, 93, 209, 32, 40, 81, 41,
			32, 61, 75, 89, 85, 87, 180, 40, 81, 85,
			65, 82, 41, 61, 75, 87, 79, 72, 53, 210,
			40, 81, 85, 41, 61, 75, 215, 40, 81, 41,
			61, 203, 93, 210, 32, 40, 82, 41, 32, 61,
			65, 65, 53, 210, 32, 40, 82, 69, 41, 94,
			35, 61, 82, 73, 217, 40, 82, 41, 82, 189,
			40, 82, 41, 61, 210, 93, 211, 32, 40, 83,
			41, 32, 61, 69, 72, 52, 211, 40, 83, 72,
			41, 61, 83, 200, 35, 40, 83, 73, 79, 78,
			41, 61, 90, 72, 85, 206, 40, 83, 79, 77,
			69, 41, 61, 83, 65, 72, 205, 35, 40, 83,
			85, 82, 41, 35, 61, 90, 72, 69, 210, 40,
			83, 85, 82, 41, 35, 61, 83, 72, 69, 210,
			35, 40, 83, 85, 41, 35, 61, 90, 72, 85,
			215, 35, 40, 83, 83, 85, 41, 35, 61, 83,
			72, 85, 215, 35, 40, 83, 69, 68, 41, 61,
			90, 196, 35, 40, 83, 41, 35, 61, 218, 40,
			83, 65, 73, 68, 41, 61, 83, 69, 72, 196,
			94, 40, 83, 73, 79, 78, 41, 61, 83, 72,
			85, 206, 40, 83, 41, 83, 189, 46, 40, 83,
			41, 32, 61, 218, 35, 58, 46, 69, 40, 83,
			41, 32, 61, 218, 35, 58, 94, 35, 40, 83,
			41, 32, 61, 211, 85, 40, 83, 41, 32, 61,
			211, 32, 58, 35, 40, 83, 41, 32, 61, 218,
			35, 35, 40, 83, 41, 32, 61, 218, 32, 40,
			83, 67, 72, 41, 61, 83, 203, 40, 83, 41,
			67, 43, 189, 35, 40, 83, 77, 41, 61, 90,
			85, 205, 35, 40, 83, 78, 41, 39, 61, 90,
			85, 205, 40, 83, 84, 76, 69, 41, 61, 83,
			85, 204, 40, 83, 41, 61, 211, 93, 212, 32,
			40, 84, 41, 32, 61, 84, 73, 89, 180, 32,
			40, 84, 72, 69, 41, 32, 35, 61, 68, 72,
			73, 217, 32, 40, 84, 72, 69, 41, 32, 61,
			68, 72, 65, 216, 40, 84, 79, 41, 32, 61,
			84, 85, 216, 32, 40, 84, 72, 65, 84, 41,
			61, 68, 72, 65, 69, 212, 32, 40, 84, 72,
			73, 83, 41, 32, 61, 68, 72, 73, 72, 211,
			32, 40, 84, 72, 69, 89, 41, 61, 68, 72,
			69, 217, 32, 40, 84, 72, 69, 82, 69, 41,
			61, 68, 72, 69, 72, 210, 40, 84, 72, 69,
			82, 41, 61, 68, 72, 69, 210, 40, 84, 72,
			69, 73, 82, 41, 61, 68, 72, 69, 72, 210,
			32, 40, 84, 72, 65, 78, 41, 32, 61, 68,
			72, 65, 69, 206, 32, 40, 84, 72, 69, 77,
			41, 32, 61, 68, 72, 65, 69, 206, 40, 84,
			72, 69, 83, 69, 41, 32, 61, 68, 72, 73,
			89, 218, 32, 40, 84, 72, 69, 78, 41, 61,
			68, 72, 69, 72, 206, 40, 84, 72, 82, 79,
			85, 71, 72, 41, 61, 84, 72, 82, 85, 87,
			180, 40, 84, 72, 79, 83, 69, 41, 61, 68,
			72, 79, 72, 218, 40, 84, 72, 79, 85, 71,
			72, 41, 32, 61, 68, 72, 79, 215, 40, 84,
			79, 68, 65, 89, 41, 61, 84, 85, 88, 68,
			69, 217, 40, 84, 79, 77, 79, 41, 82, 82,
			79, 87, 61, 84, 85, 77, 65, 65, 181, 40,
			84, 79, 41, 84, 65, 76, 61, 84, 79, 87,
			181, 32, 40, 84, 72, 85, 83, 41, 61, 68,
			72, 65, 72, 52, 211, 40, 84, 72, 41, 61,
			84, 200, 35, 58, 40, 84, 69, 68, 41, 61,
			84, 73, 88, 196, 83, 40, 84, 73, 41, 35,
			78, 61, 67, 200, 40, 84, 73, 41, 79, 61,
			83, 200, 40, 84, 73, 41, 65, 61, 83, 200,
			40, 84, 73, 69, 78, 41, 61, 83, 72, 85,
			206, 40, 84, 85, 82, 41, 35, 61, 67, 72,
			69, 210, 40, 84, 85, 41, 65, 61, 67, 72,
			85, 215, 32, 40, 84, 87, 79, 41, 61, 84,
			85, 215, 38, 40, 84, 41, 69, 78, 32, 189,
			40, 84, 41, 61, 212, 93, 213, 32, 40, 85,
			41, 32, 61, 89, 85, 87, 180, 32, 40, 85,
			78, 41, 73, 61, 89, 85, 87, 206, 32, 40,
			85, 78, 41, 61, 65, 72, 206, 32, 40, 85,
			80, 79, 78, 41, 61, 65, 88, 80, 65, 79,
			206, 64, 40, 85, 82, 41, 35, 61, 85, 72,
			52, 210, 40, 85, 82, 41, 35, 61, 89, 85,
			72, 52, 210, 40, 85, 82, 41, 61, 69, 210,
			40, 85, 41, 94, 32, 61, 65, 200, 40, 85,
			41, 94, 94, 61, 65, 72, 181, 40, 85, 89,
			41, 61, 65, 89, 181, 32, 71, 40, 85, 41,
			35, 189, 71, 40, 85, 41, 37, 189, 71, 40,
			85, 41, 35, 61, 215, 35, 78, 40, 85, 41,
			61, 89, 85, 215, 64, 40, 85, 41, 61, 85,
			215, 40, 85, 41, 61, 89, 85, 215, 93, 214,
			32, 40, 86, 41, 32, 61, 86, 73, 89, 180,
			40, 86, 73, 69, 87, 41, 61, 86, 89, 85,
			87, 181, 40, 86, 41, 61, 214, 93, 215, 32,
			40, 87, 41, 32, 61, 68, 65, 72, 52, 66,
			85, 76, 89, 85, 215, 32, 40, 87, 69, 82,
			69, 41, 61, 87, 69, 210, 40, 87, 65, 41,
			83, 72, 61, 87, 65, 193, 40, 87, 65, 41,
			83, 84, 61, 87, 69, 217, 40, 87, 65, 41,
			83, 61, 87, 65, 200, 40, 87, 65, 41, 84,
			61, 87, 65, 193, 40, 87, 72, 69, 82, 69,
			41, 61, 87, 72, 69, 72, 210, 40, 87, 72,
			65, 84, 41, 61, 87, 72, 65, 72, 212, 40,
			87, 72, 79, 76, 41, 61, 47, 72, 79, 87,
			204, 40, 87, 72, 79, 41, 61, 47, 72, 85,
			215, 40, 87, 72, 41, 61, 87, 200, 40, 87,
			65, 82, 41, 35, 61, 87, 69, 72, 210, 40,
			87, 65, 82, 41, 61, 87, 65, 79, 210, 40,
			87, 79, 82, 41, 94, 61, 87, 69, 210, 40,
			87, 82, 41, 61, 210, 40, 87, 79, 77, 41,
			65, 61, 87, 85, 72, 205, 40, 87, 79, 77,
			41, 69, 61, 87, 73, 72, 205, 40, 87, 69,
			65, 41, 82, 61, 87, 69, 200, 40, 87, 65,
			78, 84, 41, 61, 87, 65, 65, 53, 78, 212,
			65, 78, 83, 40, 87, 69, 82, 41, 61, 69,
			210, 40, 87, 41, 61, 215, 93, 216, 32, 40,
			88, 41, 32, 61, 69, 72, 52, 75, 211, 32,
			40, 88, 41, 61, 218, 40, 88, 41, 61, 75,
			211, 93, 217, 32, 40, 89, 41, 32, 61, 87,
			65, 89, 180, 40, 89, 79, 85, 78, 71, 41,
			61, 89, 65, 72, 78, 216, 32, 40, 89, 79,
			85, 82, 41, 61, 89, 79, 72, 210, 32, 40,
			89, 79, 85, 41, 61, 89, 85, 215, 32, 40,
			89, 69, 83, 41, 61, 89, 69, 72, 211, 32,
			40, 89, 41, 61, 217, 70, 40, 89, 41, 61,
			65, 217, 80, 83, 40, 89, 67, 72, 41, 61,
			65, 89, 203, 35, 58, 94, 40, 89, 41, 61,
			73, 217, 35, 58, 94, 40, 89, 41, 73, 61,
			73, 217, 32, 58, 40, 89, 41, 32, 61, 65,
			217, 32, 58, 40, 89, 41, 35, 61, 65, 217,
			32, 58, 40, 89, 41, 94, 43, 58, 35, 61,
			73, 200, 32, 58, 40, 89, 41, 94, 35, 61,
			65, 217, 40, 89, 41, 61, 73, 200, 93, 218,
			32, 40, 90, 41, 32, 61, 90, 73, 89, 180,
			40, 90, 41, 61, 218, 234
		};

		public static readonly int[] RulesSet2 = new int[447]
		{
			40, 65, 41, 189, 40, 33, 41, 61, 174, 40,
			34, 41, 32, 61, 45, 65, 72, 53, 78, 75,
			87, 79, 87, 84, 173, 40, 34, 41, 61, 75,
			87, 79, 87, 52, 84, 173, 40, 35, 41, 61,
			32, 78, 65, 72, 52, 77, 66, 69, 210, 40,
			36, 41, 61, 32, 68, 65, 65, 52, 76, 69,
			210, 40, 37, 41, 61, 32, 80, 69, 82, 83,
			69, 72, 52, 78, 212, 40, 38, 41, 61, 32,
			65, 69, 78, 196, 40, 39, 41, 189, 40, 42,
			41, 61, 32, 65, 69, 52, 83, 84, 69, 82,
			73, 72, 83, 203, 40, 43, 41, 61, 32, 80,
			76, 65, 72, 52, 211, 40, 44, 41, 61, 172,
			32, 40, 45, 41, 32, 61, 173, 40, 45, 41,
			189, 40, 46, 41, 61, 32, 80, 79, 89, 78,
			212, 40, 47, 41, 61, 32, 83, 76, 65, 69,
			52, 83, 200, 40, 48, 41, 61, 32, 90, 73,
			89, 52, 82, 79, 215, 32, 40, 49, 83, 84,
			41, 61, 70, 69, 82, 52, 83, 212, 32, 40,
			49, 48, 84, 72, 41, 61, 84, 69, 72, 52,
			78, 84, 200, 40, 49, 41, 61, 32, 87, 65,
			72, 52, 206, 32, 40, 50, 78, 68, 41, 61,
			83, 69, 72, 52, 75, 85, 78, 196, 40, 50,
			41, 61, 32, 84, 85, 87, 180, 32, 40, 51,
			82, 68, 41, 61, 84, 72, 69, 82, 52, 196,
			40, 51, 41, 61, 32, 84, 72, 82, 73, 89,
			180, 40, 52, 41, 61, 32, 70, 79, 72, 52,
			210, 32, 40, 53, 84, 72, 41, 61, 70, 73,
			72, 52, 70, 84, 200, 40, 53, 41, 61, 32,
			70, 65, 89, 52, 214, 32, 40, 54, 52, 41,
			32, 61, 83, 73, 72, 52, 75, 83, 84, 73,
			89, 32, 70, 79, 72, 210, 40, 54, 41, 61,
			32, 83, 73, 72, 52, 75, 211, 40, 55, 41,
			61, 32, 83, 69, 72, 52, 86, 85, 206, 32,
			40, 56, 84, 72, 41, 61, 69, 89, 52, 84,
			200, 40, 56, 41, 61, 32, 69, 89, 52, 212,
			40, 57, 41, 61, 32, 78, 65, 89, 52, 206,
			40, 58, 41, 61, 174, 40, 59, 41, 61, 174,
			40, 60, 41, 61, 32, 76, 69, 72, 52, 83,
			32, 68, 72, 65, 69, 206, 40, 61, 41, 61,
			32, 73, 89, 52, 75, 87, 85, 76, 218, 40,
			62, 41, 61, 32, 71, 82, 69, 89, 52, 84,
			69, 82, 32, 68, 72, 65, 69, 206, 40, 63,
			41, 61, 191, 40, 64, 41, 61, 32, 65, 69,
			54, 212, 40, 94, 41, 61, 32, 75, 65, 69,
			52, 82, 73, 88, 212, 93, 193
		};

		pu