Decompiled source of DiscordRichPresence v1.3.1

DiscordRichPresence.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using Discord;
using DiscordRichPresence.Hooks;
using DiscordRichPresence.Utils;
using Epic.OnlineServices;
using Epic.OnlineServices.Lobby;
using Facepunch.Steamworks;
using On.RoR2;
using On.RoR2.UI.MainMenu;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.Options;
using RoR2;
using RoR2.UI.MainMenu;
using UnityEngine;
using UnityEngine.SceneManagement;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("DiscordRichPresence")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+a5da1d01d40c9800718b46513c367dfc5837e19a")]
[assembly: AssemblyProduct("DiscordRichPresence")]
[assembly: AssemblyTitle("DiscordRichPresence")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace DiscordRichPresence
{
	[BepInPlugin("com.cuno.discord", "Discord Rich Presence", "1.3.1")]
	[NetworkCompatibility(/*Could not decode attribute arguments.*/)]
	[BepInDependency(/*Could not decode attribute arguments.*/)]
	public class DiscordRichPresencePlugin : BaseUnityPlugin
	{
		internal static ManualLogSource LoggerEXT { get; private set; }

		public static global::Discord.Discord Client { get; set; }

		public static Activity RichPresence { get; set; }

		public static DiscordRichPresencePlugin Instance { get; private set; }

		public static SceneDef CurrentScene => SceneCatalog.GetSceneDefForCurrentScene();

		public static float CurrentChargeLevel { get; set; }

		public static float MoonPillars { get; set; }

		public static float MoonPillarsLeft { get; set; }

		public static float MoonCountdownTimer { get; set; }

		public static string CurrentBoss { get; set; }

		public static bool IsInEOSLobby => EOSLobbyManager.GetFromPlatformSystems() != null && ((LobbyManager)EOSLobbyManager.GetFromPlatformSystems()).isInLobby;

		private void Start()
		{
			Client = new global::Discord.Discord(992086428240580720L, 1uL);
			ChangeActivity();
		}

		private void OnDiscordDisable()
		{
			Client.Dispose();
		}

		public void ChangeActivity()
		{
			ActivityManager activityManager = Client.GetActivityManager();
			Activity richPresence = default(Activity);
			richPresence.State = "Starting game...";
			RichPresence = richPresence;
			activityManager.UpdateActivity(RichPresence, delegate(Result result)
			{
				LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
		}

		private void Update()
		{
			if (Client != null)
			{
				Client.RunCallbacks();
			}
			else
			{
				LoggerEXT.LogInfo((object)"discord is null");
			}
		}

		public void Awake()
		{
			Instance = this;
			LoggerEXT = ((BaseUnityPlugin)this).Logger;
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Starting Discord Rich Presence...");
			Client = new global::Discord.Discord(992086428240580720L, 0uL);
			ChangeActivity();
			ActivityManager activityManager = Client.GetActivityManager();
			Client.GetActivityManager();
			Activity activity = default(Activity);
			activity.State = "Starting game...";
			activity.Assets = default(ActivityAssets);
			activity.Secrets = default(ActivitySecrets);
			activity.Timestamps = default(ActivityTimestamps);
			Activity richPresence = activity;
			richPresence.Assets.LargeImage = "https://raw.githubusercontent.com/mikhailmikhalchuk/RoR2-Discord-RP/refs/heads/master/Assets/riskofrain2.png";
			richPresence.Assets.LargeText = "DiscordRichPresence v" + ((BaseUnityPlugin)Instance).Info.Metadata.Version;
			RichPresence = richPresence;
			activityManager.UpdateActivity(RichPresence, delegate(Result result)
			{
				LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
			((BaseUnityPlugin)this).Logger.LogInfo((object)"Discord Rich Presence has started...");
			PluginConfig.AllowJoiningEntry = ((BaseUnityPlugin)this).Config.Bind<bool>("Options", "Allow Joining", true, "Controls whether or not other users should be allowed to ask to join your game.");
			PluginConfig.TeleporterStatusEntry = ((BaseUnityPlugin)this).Config.Bind<PluginConfig.TeleporterStatus>("Options", "Teleporter Status", PluginConfig.TeleporterStatus.None, "Controls whether the teleporter boss, teleporter charge status, or neither, should be shown alongside the current difficulty.");
			PluginConfig.MainMenuIdleMessageEntry = ((BaseUnityPlugin)this).Config.Bind<string>("Options", "Main Menu Idle Message", "", "Allows you to choose a message to be displayed when idling in the main menu.");
			if (RiskOfOptionsUtils.IsEnabled)
			{
				RiskOfOptionsUtils.AddIcon();
				RiskOfOptionsUtils.SetModDescription("Adds Discord Rich Presence functionality to Risk of Rain 2");
				RiskOfOptionsUtils.AddCheckBoxOption(PluginConfig.AllowJoiningEntry);
				RiskOfOptionsUtils.AddMultiOption<PluginConfig.TeleporterStatus>(PluginConfig.TeleporterStatusEntry);
				RiskOfOptionsUtils.AddTextInputOption(PluginConfig.MainMenuIdleMessageEntry);
			}
		}

		private static void InitializeHooks()
		{
			PauseManagerHooks.AddHooks();
			SteamworksLobbyHooks.AddHooks();
			RoR2Hooks.AddHooks();
			SceneManager.activeSceneChanged += SceneManager_activeSceneChanged;
			Stage.onServerStageBegin += Stage_onServerStageBegin;
		}

		public static void Dispose()
		{
			PauseManagerHooks.RemoveHooks();
			SteamworksLobbyHooks.RemoveHooks();
			RoR2Hooks.RemoveHooks();
			if (((object)(PlatformID)(ref EOSLoginManager.loggedInUserID)).ToString() != string.Empty)
			{
				EOSLobbyHooks.RemoveHooks();
			}
			SceneManager.activeSceneChanged -= SceneManager_activeSceneChanged;
			Stage.onServerStageBegin -= Stage_onServerStageBegin;
			Client.Dispose();
		}

		public void OnEnable()
		{
			InitializeHooks();
		}

		public void OnDisable()
		{
			Dispose();
		}

		private static void SceneManager_activeSceneChanged(Scene arg0, Scene arg1)
		{
			if (Client != null)
			{
				CurrentBoss = "";
				CurrentChargeLevel = 0f;
				MoonPillars = 0f;
				MoonPillarsLeft = 0f;
				MoonCountdownTimer = 0f;
				EOSLobbyManager fromPlatformSystems = EOSLobbyManager.GetFromPlatformSystems();
				if (((Scene)(ref arg1)).name == "title" && Client.Instance.Lobby.IsValid)
				{
					PresenceUtils.SetLobbyPresence(Client, RichPresence, Client.Instance);
				}
				else if (((Scene)(ref arg1)).name == "title" && IsInEOSLobby)
				{
					PresenceUtils.SetLobbyPresence(Client, RichPresence, fromPlatformSystems);
				}
				if (((Scene)(ref arg1)).name == "lobby" && !Client.Instance.Lobby.IsValid && !IsInEOSLobby)
				{
					PresenceUtils.SetMainMenuPresence(Client, RichPresence, "Choosing Character");
				}
				else if (((Scene)(ref arg1)).name == "lobby" && Client.Instance.Lobby.IsValid)
				{
					PresenceUtils.SetLobbyPresence(Client, RichPresence, Client.Instance, justParty: false, "Choosing Character");
				}
				else if (((Scene)(ref arg1)).name == "lobby" && IsInEOSLobby)
				{
					PresenceUtils.SetLobbyPresence(Client, RichPresence, fromPlatformSystems, justParty: false, "Choosing Character");
				}
				if (((Scene)(ref arg1)).name == "logbook")
				{
					PresenceUtils.SetMainMenuPresence(Client, RichPresence, "Reading Logbook");
				}
				else if ((Object)(object)Run.instance != (Object)null && (Object)(object)CurrentScene != (Object)null && (Client.Instance.Lobby.IsValid || IsInEOSLobby))
				{
					LoggerEXT.LogInfo((object)("Scene Manager Active Scene Changed Called With Value: " + (Run.instance.stageClearCount + 1)));
					PresenceUtils.SetStagePresence(Client, RichPresence, CurrentScene, Run.instance);
				}
			}
		}

		private static void Stage_onServerStageBegin(Stage obj)
		{
			CurrentChargeLevel = 0f;
			MoonPillars = 0f;
			MoonPillarsLeft = 0f;
			if ((Object)(object)CurrentScene != (Object)null && (Object)(object)Run.instance != (Object)null)
			{
				PresenceUtils.SetStagePresence(Client, RichPresence, CurrentScene, Run.instance);
			}
		}
	}
	public static class PluginConfig
	{
		public enum TeleporterStatus : byte
		{
			None,
			Boss,
			Charge
		}

		public static ConfigEntry<bool> AllowJoiningEntry { get; set; }

		public static ConfigEntry<TeleporterStatus> TeleporterStatusEntry { get; set; }

		public static ConfigEntry<string> MainMenuIdleMessageEntry { get; set; }
	}
}
namespace DiscordRichPresence.Utils
{
	public static class InfoTextUtils
	{
		public enum StyleTag : byte
		{
			Damage = 1,
			Healing,
			Utility,
			Health,
			Stack,
			Mono,
			Death,
			UserSetting,
			Artifact,
			Sub,
			Event,
			WorldEvent,
			KeywordName,
			Shrine
		}

		public static List<string> CharactersWithAssets = new List<string>
		{
			"Acrid", "Artificer", "Bandit", "Captain", "Commando", "Engineer", "Heretic", "Huntress", "Loader", "MUL-T",
			"Mercenary", "REX", "Railgunner", "False Son", "Seeker", "Chef", "CHEF", "Enforcer", "Miner", "Paladin",
			"HAN-D", "Sniper", "Bomber", "Nemesis Enforcer", "Nemesis Commando", "Nemesis Mercenary", "Chirr", "Executioner", "An Arbiter", "Red Mist",
			"Rocket", "Dancer", "Pilot", "Johnny", "Custodian", "Sonic", "Robomando", "Deputy", "Ranger", "Rifter",
			"Cadet", "Celestial War Tank", "Chrono Legionnaire BETA", "Chrono Legionnaire", "Cyborg", "Desolator", "Driver", "Interrogator", "Match Maker", "Mortician",
			"Nucleator", "Pathfinder", "Pyro", "Ravager", "Scout", "Seamstress", "Sorceress", "Spy", "Submariner", "Tesla Trooper",
			"Wanderer", "Cosmic Champion", "Belmont"
		};

		public static List<string> StagesWithAssets = new List<string>
		{
			"agatevillage", "ancientloft", "arena", "artifactworld", "bazaar", "blackbeach", "blackbeach2", "BulwarksHaunt_GhostWave", "catacombs_DS1_Catacombs", "dampcavesimple",
			"drybasin", "FBLScene", "foggyswamp", "forgottenhaven", "frozenwall", "goldshores", "golemplains", "goolake", "habitat", "habitatfall",
			"helminthroost", "itancientloft", "itdampcave", "itfrozenwall", "itgolemplains", "itgoolake", "itmoon", "itskymeadow", "lakes", "lakesnight",
			"lemuriantemple", "limbo", "meridian", "moon2", "mysteryspace", "riskofrain2", "shipgraveyard", "skymeadow", "slumberingsatellite", "sm64_bbf_SM64_BBF",
			"snowyforest", "sulfurpools", "village", "villagenight", "voidraid", "voidstage", "wispgraveyard", "rootjungle"
		};

		public static string GetCharacterInternalName(string name)
		{
			if (name == "「V??oid Fiend』")
			{
				return "voidfiend";
			}
			if (name == "CHEF")
			{
				return "Chef";
			}
			if (name == "Chrono Legionnaire BETA")
			{
				return "chronolegionnaire";
			}
			if (CharactersWithAssets.Contains(name))
			{
				return CharactersWithAssets.Find((string c) => c == name).ToLower().Replace(" ", "");
			}
			return "unknown";
		}

		public static string FormatTextStyleTag(string content, StyleTag styleTag)
		{
			string text = (((int)styleTag < 1 || (int)styleTag > 4) ? ("c" + styleTag) : ("cIs" + styleTag));
			return "<style=" + text + ">" + content + "</style>";
		}
	}
	public static class PresenceUtils
	{
		public static void SetStagePresence(global::Discord.Discord client, Activity richPresence, SceneDef scene, Run run, bool isPaused = false)
		{
			//IL_0134: Unknown result type (might be due to invalid IL or missing references)
			//IL_0362: Unknown result type (might be due to invalid IL or missing references)
			//IL_0368: Invalid comparison between Unknown and I4
			if ((Object)(object)Run.instance == (Object)null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogError((object)"Run instance is null. Check for its null status before passing it as a parameter. Stack trace follows:");
			}
			if ((Object)(object)scene == (Object)null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogError((object)"Scene is null. Check for its null status before passing it as a parameter. Stack trace follows:");
			}
			if (InfoTextUtils.StagesWithAssets.Contains(scene.baseSceneName))
			{
				richPresence.Assets.LargeImage = "https://raw.githubusercontent.com/mikhailmikhalchuk/RoR2-Discord-RP/refs/heads/master/Assets/" + scene.baseSceneName + ".png";
			}
			else
			{
				richPresence.Assets.LargeImage = "https://raw.githubusercontent.com/mikhailmikhalchuk/RoR2-Discord-RP/refs/heads/master/Assets/riskofrain2.png";
			}
			richPresence.Assets.LargeText = "DiscordRichPresence v" + ((BaseUnityPlugin)DiscordRichPresencePlugin.Instance).Info.Metadata.Version;
			richPresence.State = $"Stage {run.stageClearCount + 1} - {Language.GetString(scene.nameToken)}";
			InfiniteTowerRun val = (InfiniteTowerRun)(object)((run is InfiniteTowerRun) ? run : null);
			if (val != null && val.waveIndex > 0)
			{
				richPresence.State = $"Wave {val.waveIndex} - {Language.GetString(scene.nameToken)}";
			}
			string @string = Language.GetString(DifficultyCatalog.GetDifficultyDef(run.selectedDifficulty).nameToken);
			richPresence.Timestamps = default(ActivityTimestamps);
			richPresence.Secrets = default(ActivitySecrets);
			if (scene.baseSceneName == "outro")
			{
				DiscordRichPresencePlugin.MoonCountdownTimer = 0f;
				richPresence.Assets.LargeImage = "moon2";
				richPresence.Details = "Credits";
				richPresence.State = $"Stage {run.stageClearCount + 1} - {Language.GetString(scene.nameToken)}";
			}
			else if (DiscordRichPresencePlugin.MoonCountdownTimer > 0f)
			{
				richPresence.Details = "Escaping! | " + @string;
				if (!isPaused)
				{
					richPresence.Timestamps.End = DateTimeOffset.Now.ToUnixTimeSeconds() + (long)DiscordRichPresencePlugin.MoonCountdownTimer;
				}
			}
			else
			{
				richPresence.Details = @string;
				if (PluginConfig.TeleporterStatusEntry.Value == PluginConfig.TeleporterStatus.Boss && DiscordRichPresencePlugin.CurrentBoss != "")
				{
					richPresence.Details = "Fighting " + DiscordRichPresencePlugin.CurrentBoss + " | " + @string;
				}
				else if (PluginConfig.TeleporterStatusEntry.Value == PluginConfig.TeleporterStatus.Charge && DiscordRichPresencePlugin.CurrentChargeLevel > 0f && !Mathf.Approximately(DiscordRichPresencePlugin.CurrentChargeLevel, 1f))
				{
					richPresence.Details = "Charging teleporter (" + DiscordRichPresencePlugin.CurrentChargeLevel * 100f + "%) | " + @string;
				}
				if (((DiscordRichPresencePlugin.MoonPillars > 0f) | (DiscordRichPresencePlugin.MoonPillarsLeft > 0f)) && !Mathf.Approximately(DiscordRichPresencePlugin.MoonPillars, DiscordRichPresencePlugin.MoonPillarsLeft))
				{
					richPresence.Details = "Charging pillars " + DiscordRichPresencePlugin.MoonPillars + "/" + DiscordRichPresencePlugin.MoonPillarsLeft + " | " + @string;
				}
				if ((int)scene.sceneType == 1 && !isPaused)
				{
					richPresence.Timestamps.Start = DateTimeOffset.Now.ToUnixTimeSeconds() - (long)run.GetRunStopwatch();
				}
			}
			DiscordRichPresencePlugin.RichPresence = richPresence;
			ActivityManager activityManagerInstance = client.ActivityManagerInstance;
			activityManagerInstance.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
		}

		public static void SetMainMenuPresence(global::Discord.Discord client, Activity richPresence, string details = "")
		{
			richPresence.Assets = new ActivityAssets
			{
				LargeImage = "riskofrain2",
				LargeText = "DiscordRichPresence v" + ((BaseUnityPlugin)DiscordRichPresencePlugin.Instance).Info.Metadata.Version
			};
			richPresence.Details = PluginConfig.MainMenuIdleMessageEntry.Value;
			if (details != "")
			{
				richPresence.Details = details;
			}
			richPresence.Timestamps = default(ActivityTimestamps);
			richPresence.State = "In Menu";
			richPresence.Secrets = default(ActivitySecrets);
			richPresence.Party = default(ActivityParty);
			DiscordRichPresencePlugin.RichPresence = richPresence;
			ActivityManager activityManagerInstance = client.ActivityManagerInstance;
			activityManagerInstance.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
		}

		public static void SetLobbyPresence(global::Discord.Discord client, Activity richPresence, Client faceClient, bool justParty = false, string details = "")
		{
			if (!justParty)
			{
				richPresence.State = "In Lobby";
				richPresence.Details = "Preparing";
				if (details != "")
				{
					richPresence.Details = details;
				}
				richPresence.Assets = new ActivityAssets
				{
					LargeImage = "riskofrain2",
					LargeText = "DiscordRichPresence v" + ((BaseUnityPlugin)DiscordRichPresencePlugin.Instance).Info.Metadata.Version
				};
				richPresence.Timestamps = default(ActivityTimestamps);
			}
			richPresence = UpdateParty(richPresence, faceClient);
			DiscordRichPresencePlugin.RichPresence = richPresence;
			ActivityManager activityManagerInstance = client.ActivityManagerInstance;
			activityManagerInstance.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
		}

		public static void SetLobbyPresence(global::Discord.Discord client, Activity richPresence, EOSLobbyManager lobbyManager, bool justParty = false, string details = "")
		{
			if (!justParty)
			{
				richPresence.State = "In Lobby";
				richPresence.Details = "Preparing";
				if (details != "")
				{
					richPresence.Details = details;
				}
				richPresence.Assets = new ActivityAssets
				{
					LargeImage = "riskofrain2",
					LargeText = "DiscordRichPresence v" + ((BaseUnityPlugin)DiscordRichPresencePlugin.Instance).Info.Metadata.Version
				};
				richPresence.Timestamps = default(ActivityTimestamps);
			}
			richPresence = UpdateParty(richPresence, lobbyManager);
			DiscordRichPresencePlugin.RichPresence = richPresence;
			ActivityManager activityManagerInstance = client.ActivityManagerInstance;
			activityManagerInstance.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
		}

		public static Activity UpdateParty(Activity richPresence, Client faceClient, bool includeJoinButton = true)
		{
			richPresence.Party.Id = faceClient.Username;
			richPresence.Party.Size.CurrentSize = faceClient.Lobby.NumMembers;
			richPresence.Party.Size.MaxSize = faceClient.Lobby.MaxMembers;
			richPresence.Secrets = default(ActivitySecrets);
			if (PluginConfig.AllowJoiningEntry.Value && includeJoinButton)
			{
				richPresence.Secrets.Join = faceClient.Lobby.CurrentLobby.ToString();
			}
			return richPresence;
		}

		public static Activity UpdateParty(Activity richPresence, EOSLobbyManager lobbyManager, bool includeJoinButton = true)
		{
			richPresence.Party.Id = lobbyManager.CurrentLobbyId;
			richPresence.Party.Size.CurrentSize = ((LobbyManager)lobbyManager).newestLobbyData.totalMaxPlayers;
			richPresence.Party.Size.MaxSize = ((LobbyManager)lobbyManager).newestLobbyData.totalPlayerCount;
			richPresence.Secrets = default(ActivitySecrets);
			if (PluginConfig.AllowJoiningEntry.Value && includeJoinButton)
			{
				richPresence.Secrets.Join = ((object)(PlatformID)(ref ((LobbyManager)lobbyManager).GetLobbyMembers()[0])).ToString();
			}
			return richPresence;
		}
	}
	public static class RiskOfOptionsUtils
	{
		public static bool IsEnabled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions");

		public static void AddIcon()
		{
			//IL_004f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0056: Expected O, but got Unknown
			//IL_008b: 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)
			FileInfo fileInfo = null;
			DirectoryInfo directoryInfo = new DirectoryInfo(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location));
			FileInfo[] files = directoryInfo.GetFiles("icon.png", SearchOption.TopDirectoryOnly);
			if (files != null && files.Length != 0)
			{
				fileInfo = files[0];
			}
			if (fileInfo != null)
			{
				Texture2D val = new Texture2D(256, 256);
				if (ImageConversion.LoadImage(val, File.ReadAllBytes(fileInfo.FullName)))
				{
					ModSettingsManager.SetModIcon(Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)));
				}
			}
		}

		public static void AddCheckBoxOption(ConfigEntry<bool> entry)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(entry));
		}

		public static void AddMultiOption<T>(ConfigEntry<T> entry) where T : Enum
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)entry));
		}

		public static void AddTextInputOption(ConfigEntry<string> entry)
		{
			//IL_0002: Unknown result type (might be due to invalid IL or missing references)
			//IL_000c: Expected O, but got Unknown
			ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(entry));
		}

		public static void SetModDescription(string description)
		{
			ModSettingsManager.SetModDescription(description);
		}
	}
}
namespace DiscordRichPresence.Hooks
{
	public static class EOSLobbyHooks
	{
		public static void AddHooks()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			try
			{
				EOSLobbyManager.OnLobbyCreated += new hook_OnLobbyCreated(EOSLobbyManager_OnLobbyCreated);
				EOSLobbyManager.OnLobbyJoined += new hook_OnLobbyJoined(EOSLobbyManager_OnLobbyJoined);
				EOSLobbyManager.OnLobbyChanged += new hook_OnLobbyChanged(EOSLobbyManager_OnLobbyChanged);
				EOSLobbyManager.LeaveLobby += new hook_LeaveLobby(EOSLobbyManager_LeaveLobby);
			}
			catch (BadImageFormatException)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogError((object)"Couldn't hook EOS methods");
			}
		}

		public static void RemoveHooks()
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0013: Expected O, but got Unknown
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_002d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0037: Expected O, but got Unknown
			//IL_003f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0049: Expected O, but got Unknown
			try
			{
				EOSLobbyManager.OnLobbyCreated -= new hook_OnLobbyCreated(EOSLobbyManager_OnLobbyCreated);
				EOSLobbyManager.OnLobbyJoined -= new hook_OnLobbyJoined(EOSLobbyManager_OnLobbyJoined);
				EOSLobbyManager.OnLobbyChanged -= new hook_OnLobbyChanged(EOSLobbyManager_OnLobbyChanged);
				EOSLobbyManager.LeaveLobby -= new hook_LeaveLobby(EOSLobbyManager_LeaveLobby);
			}
			catch (BadImageFormatException)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogError((object)"Couldn't unhook EOS methods");
			}
		}

		private static void EOSLobbyManager_OnLobbyCreated(orig_OnLobbyCreated orig, EOSLobbyManager self, ref CreateLobbyCallbackInfo data)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, ref data);
			if ((int)((CreateLobbyCallbackInfo)(ref data)).ResultCode == 0 && self != null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("Discord broadcasting new EOS lobby with ID " + self.CurrentLobbyId));
				PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, self);
			}
		}

		private static void EOSLobbyManager_OnLobbyJoined(orig_OnLobbyJoined orig, EOSLobbyManager self, ref JoinLobbyCallbackInfo data)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			orig.Invoke(self, ref data);
			if ((int)((JoinLobbyCallbackInfo)(ref data)).ResultCode == 0 && self != null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)"Successfully joined EOS lobby");
				PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, self);
			}
		}

		private static void EOSLobbyManager_OnLobbyChanged(orig_OnLobbyChanged orig, EOSLobbyManager self)
		{
			orig.Invoke(self);
			if (self != null && ((LobbyManager)self).isInLobby)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)"Discord re-broadcasting EOS lobby");
				if ((Object)(object)Run.instance == (Object)null)
				{
					PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, self, DiscordRichPresencePlugin.RichPresence.Details == "Choosing Character");
					return;
				}
				DiscordRichPresencePlugin.RichPresence = PresenceUtils.UpdateParty(DiscordRichPresencePlugin.RichPresence, self, includeJoinButton: false);
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}

		private static void EOSLobbyManager_LeaveLobby(orig_LeaveLobby orig, EOSLobbyManager self)
		{
			orig.Invoke(self);
			if (DiscordRichPresencePlugin.Client != null)
			{
				PresenceUtils.SetMainMenuPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence);
			}
		}

		public static void EOSLoginManager_CompleteConnectLogin(orig_CompleteConnectLogin orig, EOSLoginManager self, ProductUserId localUserId)
		{
			orig.Invoke(self, localUserId);
			AddHooks();
			DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)((object)(PlatformID)(ref EOSLoginManager.loggedInUserID)).ToString());
		}
	}
	public static class PauseManagerHooks
	{
		public static void AddHooks()
		{
			PauseManager.onPauseStartGlobal = (Action)Delegate.Combine(PauseManager.onPauseStartGlobal, new Action(OnGamePaused));
			PauseManager.onPauseEndGlobal = (Action)Delegate.Combine(PauseManager.onPauseEndGlobal, new Action(OnGameUnPaused));
		}

		public static void RemoveHooks()
		{
			PauseManager.onPauseStartGlobal = (Action)Delegate.Remove(PauseManager.onPauseStartGlobal, new Action(OnGamePaused));
			PauseManager.onPauseEndGlobal = (Action)Delegate.Remove(PauseManager.onPauseEndGlobal, new Action(OnGameUnPaused));
		}

		private static void OnGamePaused()
		{
			if ((Object)(object)Run.instance != (Object)null && (Object)(object)DiscordRichPresencePlugin.CurrentScene != (Object)null)
			{
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance, isPaused: true);
			}
		}

		private static void OnGameUnPaused()
		{
			if ((Object)(object)Run.instance != (Object)null && (Object)(object)DiscordRichPresencePlugin.CurrentScene != (Object)null)
			{
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}
	}
	public static class RoR2Hooks
	{
		public static void AddHooks()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			CharacterBody.onBodyStartGlobal += CharacterBody_onBodyStartGlobal;
			CharacterBody.onBodyDestroyGlobal += CharacterBody_onBodyDestroyGlobal;
			Stage.onStageStartGlobal += Stage_onStageStartGlobal;
			TeleporterInteraction.FixedUpdate += new hook_FixedUpdate(TeleporterInteraction_FixedUpdate);
			EscapeSequenceController.SetCountdownTime += new hook_SetCountdownTime(EscapeSequenceController_SetCountdownTime);
			InfiniteTowerRun.BeginNextWave += new hook_BeginNextWave(InfiniteTowerRun_BeginNextWave);
			BaseMainMenuScreen.OnEnter += new hook_OnEnter(BaseMainMenuScreen_OnEnter);
			Run.OnClientGameOver += new hook_OnClientGameOver(Run_OnClientGameOver);
			MoonBatteryMissionController.OnBatteryCharged += new hook_OnBatteryCharged(MoonBatteryMissionController_OnBatteryCharged);
		}

		private static void MoonBatteryMissionController_OnBatteryCharged(orig_OnBatteryCharged orig, MoonBatteryMissionController self, HoldoutZoneController holdoutzone)
		{
			orig.Invoke(self, holdoutzone);
			DiscordRichPresencePlugin.MoonPillarsLeft = self.numRequiredBatteries;
			DiscordRichPresencePlugin.MoonPillars = self.numChargedBatteries;
			Activity richPresence = DiscordRichPresencePlugin.RichPresence;
			ActivityManager activityManager = DiscordRichPresencePlugin.Client.GetActivityManager();
			activityManager.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
			PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, richPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
		}

		private static void Stage_onStageStartGlobal(Stage obj)
		{
			LocalUser firstLocalUser = LocalUserManager.GetFirstLocalUser();
			object obj2;
			if (firstLocalUser == null)
			{
				obj2 = null;
			}
			else
			{
				PlayerCharacterMasterController cachedMasterController = firstLocalUser.cachedMasterController;
				if (cachedMasterController == null)
				{
					obj2 = null;
				}
				else
				{
					CharacterMaster master = cachedMasterController.master;
					obj2 = ((master != null) ? master.GetBody() : null);
				}
			}
			CharacterBody val = (CharacterBody)obj2;
			if (!((Object)(object)val == (Object)null))
			{
				Activity richPresence = DiscordRichPresencePlugin.RichPresence;
				richPresence.Assets.SmallImage = "https://raw.githubusercontent.com/mikhailmikhalchuk/RoR2-Discord-RP/refs/heads/master/Assets/Characters/" + InfoTextUtils.GetCharacterInternalName(val.GetDisplayName()) + ".png";
				richPresence.Assets.SmallText = val.GetDisplayName();
				ActivityManager activityManager = DiscordRichPresencePlugin.Client.GetActivityManager();
				activityManager.UpdateActivity(richPresence, delegate(Result result)
				{
					DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
				});
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, richPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}

		public static void RemoveHooks()
		{
			//IL_003e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Expected O, but got Unknown
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Expected O, but got Unknown
			//IL_0062: Unknown result type (might be due to invalid IL or missing references)
			//IL_006c: Expected O, but got Unknown
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_007e: Expected O, but got Unknown
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Expected O, but got Unknown
			//IL_0098: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a2: Expected O, but got Unknown
			CharacterBody.onBodyStartGlobal -= CharacterBody_onBodyStartGlobal;
			CharacterBody.onBodyDestroyGlobal -= CharacterBody_onBodyDestroyGlobal;
			Stage.onStageStartGlobal -= Stage_onStageStartGlobal;
			TeleporterInteraction.FixedUpdate -= new hook_FixedUpdate(TeleporterInteraction_FixedUpdate);
			EscapeSequenceController.SetCountdownTime -= new hook_SetCountdownTime(EscapeSequenceController_SetCountdownTime);
			InfiniteTowerRun.BeginNextWave -= new hook_BeginNextWave(InfiniteTowerRun_BeginNextWave);
			BaseMainMenuScreen.OnEnter -= new hook_OnEnter(BaseMainMenuScreen_OnEnter);
			Run.OnClientGameOver += new hook_OnClientGameOver(Run_OnClientGameOver);
			MoonBatteryMissionController.OnBatteryCharged += new hook_OnBatteryCharged(MoonBatteryMissionController_OnBatteryCharged);
		}

		private static void CharacterBody_onBodyStartGlobal(CharacterBody obj)
		{
			if (obj.isChampion)
			{
				DiscordRichPresencePlugin.CurrentBoss = obj.GetDisplayName();
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}

		private static void CharacterBody_onBodyDestroyGlobal(CharacterBody obj)
		{
			if (obj.isChampion && (Object)(object)Run.instance != (Object)null)
			{
				DiscordRichPresencePlugin.CurrentBoss = "";
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}

		private static void TeleporterInteraction_FixedUpdate(orig_FixedUpdate orig, TeleporterInteraction self)
		{
			if (Math.Abs(Math.Round(self.chargeFraction, 2) - (double)DiscordRichPresencePlugin.CurrentChargeLevel) > 0.005 && PluginConfig.TeleporterStatusEntry.Value == PluginConfig.TeleporterStatus.Charge && !DiscordRichPresencePlugin.RichPresence.State.Contains("Defeat!"))
			{
				DiscordRichPresencePlugin.CurrentChargeLevel = (float)Math.Round(self.chargeFraction, 2);
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
			orig.Invoke(self);
		}

		private static void EscapeSequenceController_SetCountdownTime(orig_SetCountdownTime orig, EscapeSequenceController self, double secondsRemaining)
		{
			DiscordRichPresencePlugin.MoonCountdownTimer = (float)secondsRemaining + 1f;
			PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			orig.Invoke(self, secondsRemaining);
		}

		private static void InfiniteTowerRun_BeginNextWave(orig_BeginNextWave orig, InfiniteTowerRun self)
		{
			PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, (Run)(object)self);
			orig.Invoke(self);
		}

		private static void BaseMainMenuScreen_OnEnter(orig_OnEnter orig, BaseMainMenuScreen self, MainMenuController mainMenuController)
		{
			if (Client.Instance.Lobby.IsValid)
			{
				PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, Client.Instance);
			}
			else if (DiscordRichPresencePlugin.IsInEOSLobby)
			{
				PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, EOSLobbyManager.GetFromPlatformSystems());
			}
			else
			{
				PresenceUtils.SetMainMenuPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence);
			}
			orig.Invoke(self, mainMenuController);
		}

		private static void Run_OnClientGameOver(orig_OnClientGameOver orig, Run self, RunReport runReport)
		{
			orig.Invoke(self, runReport);
			if ((Object)(object)Run.instance != (Object)null && (Object)(object)DiscordRichPresencePlugin.CurrentScene != (Object)null)
			{
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance, isPaused: true);
			}
			Activity richPresence = DiscordRichPresencePlugin.RichPresence;
			TimeSpan timeSpan = TimeSpan.FromSeconds((long)self.GetRunStopwatch());
			if ((long)self.GetRunStopwatch() > 3600)
			{
				richPresence.State = "Defeat! " + timeSpan.ToString("hh\\:mm\\:ss") + " - " + richPresence.State;
			}
			else
			{
				richPresence.State = "Defeat! " + timeSpan.ToString("mm\\:ss") + " - " + richPresence.State;
			}
			ActivityManager activityManagerInstance = DiscordRichPresencePlugin.Client.ActivityManagerInstance;
			activityManagerInstance.UpdateActivity(richPresence, delegate(Result result)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("activity updated, " + result));
			});
			DiscordRichPresencePlugin.RichPresence = richPresence;
		}
	}
	public static class SteamworksLobbyHooks
	{
		public static void AddHooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			SteamworksLobbyManager.OnLobbyCreated += new hook_OnLobbyCreated(SteamworksLobbyManager_OnLobbyCreated);
			SteamworksLobbyManager.OnLobbyChanged += new hook_OnLobbyChanged(SteamworksLobbyManager_OnLobbyChanged);
			SteamworksLobbyManager.LeaveLobby += new hook_LeaveLobby(SteamworksLobbyManager_LeaveLobby);
		}

		public static void RemoveHooks()
		{
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_0012: Expected O, but got Unknown
			//IL_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_002c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0036: Expected O, but got Unknown
			SteamworksLobbyManager.OnLobbyCreated -= new hook_OnLobbyCreated(SteamworksLobbyManager_OnLobbyCreated);
			SteamworksLobbyManager.OnLobbyChanged -= new hook_OnLobbyChanged(SteamworksLobbyManager_OnLobbyChanged);
			SteamworksLobbyManager.LeaveLobby -= new hook_LeaveLobby(SteamworksLobbyManager_LeaveLobby);
		}

		private static void SteamworksLobbyManager_OnLobbyCreated(orig_OnLobbyCreated orig, SteamworksLobbyManager self, bool success)
		{
			orig.Invoke(self, success);
			if (success && Client.Instance != null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)("Discord broadcasting new Steam lobby with ID " + Client.Instance.Lobby.CurrentLobby));
				PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, Client.Instance);
			}
		}

		private static void SteamworksLobbyManager_OnLobbyChanged(orig_OnLobbyChanged orig, SteamworksLobbyManager self)
		{
			orig.Invoke(self);
			if (((LobbyManager)self).isInLobby && Client.Instance != null)
			{
				DiscordRichPresencePlugin.LoggerEXT.LogInfo((object)"Discord re-broadcasting Steam lobby");
				if ((Object)(object)Run.instance == (Object)null)
				{
					PresenceUtils.SetLobbyPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, Client.Instance, DiscordRichPresencePlugin.RichPresence.Details == "Choosing Character");
					return;
				}
				DiscordRichPresencePlugin.RichPresence = PresenceUtils.UpdateParty(DiscordRichPresencePlugin.RichPresence, Client.Instance, includeJoinButton: false);
				PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance);
			}
		}

		private static void SteamworksLobbyManager_LeaveLobby(orig_LeaveLobby orig, SteamworksLobbyManager self)
		{
			orig.Invoke(self);
			if (DiscordRichPresencePlugin.Client != null)
			{
				PresenceUtils.SetMainMenuPresence(DiscordRichPresencePlugin.Client, DiscordRichPresencePlugin.RichPresence);
			}
		}
	}
}
namespace Discord
{
	public class ActivityManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityJoinHandler(IntPtr ptr, [MarshalAs(UnmanagedType.LPStr)] string secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivitySpectateHandler(IntPtr ptr, [MarshalAs(UnmanagedType.LPStr)] string secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityJoinRequestHandler(IntPtr ptr, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ActivityInviteHandler(IntPtr ptr, ActivityActionType type, ref User user, ref Activity activity);

			internal ActivityJoinHandler OnActivityJoin;

			internal ActivitySpectateHandler OnActivitySpectate;

			internal ActivityJoinRequestHandler OnActivityJoinRequest;

			internal ActivityInviteHandler OnActivityInvite;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RegisterCommandMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string command);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RegisterSteamMethod(IntPtr methodsPtr, uint steamId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateActivityCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateActivityMethod(IntPtr methodsPtr, ref Activity activity, IntPtr callbackData, UpdateActivityCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ClearActivityCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ClearActivityMethod(IntPtr methodsPtr, IntPtr callbackData, ClearActivityCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendRequestReplyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendRequestReplyMethod(IntPtr methodsPtr, long userId, ActivityJoinRequestReply reply, IntPtr callbackData, SendRequestReplyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendInviteMethod(IntPtr methodsPtr, long userId, ActivityActionType type, [MarshalAs(UnmanagedType.LPStr)] string content, IntPtr callbackData, SendInviteCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void AcceptInviteCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void AcceptInviteMethod(IntPtr methodsPtr, long userId, IntPtr callbackData, AcceptInviteCallback callback);

			internal RegisterCommandMethod RegisterCommand;

			internal RegisterSteamMethod RegisterSteam;

			internal UpdateActivityMethod UpdateActivity;

			internal ClearActivityMethod ClearActivity;

			internal SendRequestReplyMethod SendRequestReply;

			internal SendInviteMethod SendInvite;

			internal AcceptInviteMethod AcceptInvite;
		}

		public delegate void UpdateActivityHandler(Result result);

		public delegate void ClearActivityHandler(Result result);

		public delegate void SendRequestReplyHandler(Result result);

		public delegate void SendInviteHandler(Result result);

		public delegate void AcceptInviteHandler(Result result);

		public delegate void ActivityJoinHandler(string secret);

		public delegate void ActivitySpectateHandler(string secret);

		public delegate void ActivityJoinRequestHandler(ref User user);

		public delegate void ActivityInviteHandler(ActivityActionType type, ref User user, ref Activity activity);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event ActivityJoinHandler OnActivityJoin;

		public event ActivitySpectateHandler OnActivitySpectate;

		public event ActivityJoinRequestHandler OnActivityJoinRequest;

		public event ActivityInviteHandler OnActivityInvite;

		public void RegisterCommand()
		{
			RegisterCommand(null);
		}

		internal ActivityManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnActivityJoin = OnActivityJoinImpl;
			events.OnActivitySpectate = OnActivitySpectateImpl;
			events.OnActivityJoinRequest = OnActivityJoinRequestImpl;
			events.OnActivityInvite = OnActivityInviteImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public void RegisterCommand(string command)
		{
			Result result = Methods.RegisterCommand(MethodsPtr, command);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		public void RegisterSteam(uint steamId)
		{
			Result result = Methods.RegisterSteam(MethodsPtr, steamId);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void UpdateActivityCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			UpdateActivityHandler updateActivityHandler = (UpdateActivityHandler)gCHandle.Target;
			gCHandle.Free();
			updateActivityHandler(result);
		}

		public void UpdateActivity(Activity activity, UpdateActivityHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.UpdateActivity(MethodsPtr, ref activity, GCHandle.ToIntPtr(value), UpdateActivityCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void ClearActivityCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ClearActivityHandler clearActivityHandler = (ClearActivityHandler)gCHandle.Target;
			gCHandle.Free();
			clearActivityHandler(result);
		}

		public void ClearActivity(ClearActivityHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ClearActivity(MethodsPtr, GCHandle.ToIntPtr(value), ClearActivityCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void SendRequestReplyCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SendRequestReplyHandler sendRequestReplyHandler = (SendRequestReplyHandler)gCHandle.Target;
			gCHandle.Free();
			sendRequestReplyHandler(result);
		}

		public void SendRequestReply(long userId, ActivityJoinRequestReply reply, SendRequestReplyHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SendRequestReply(MethodsPtr, userId, reply, GCHandle.ToIntPtr(value), SendRequestReplyCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void SendInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			SendInviteHandler sendInviteHandler = (SendInviteHandler)gCHandle.Target;
			gCHandle.Free();
			sendInviteHandler(result);
		}

		public void SendInvite(long userId, ActivityActionType type, string content, SendInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.SendInvite(MethodsPtr, userId, type, content, GCHandle.ToIntPtr(value), SendInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void AcceptInviteCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			AcceptInviteHandler acceptInviteHandler = (AcceptInviteHandler)gCHandle.Target;
			gCHandle.Free();
			acceptInviteHandler(result);
		}

		public void AcceptInvite(long userId, AcceptInviteHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.AcceptInvite(MethodsPtr, userId, GCHandle.ToIntPtr(value), AcceptInviteCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void OnActivityJoinImpl(IntPtr ptr, string secret)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityJoin != null)
			{
				discord.ActivityManagerInstance.OnActivityJoin(secret);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivitySpectateImpl(IntPtr ptr, string secret)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivitySpectate != null)
			{
				discord.ActivityManagerInstance.OnActivitySpectate(secret);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivityJoinRequestImpl(IntPtr ptr, ref User user)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityJoinRequest != null)
			{
				discord.ActivityManagerInstance.OnActivityJoinRequest(ref user);
			}
		}

		[MonoPInvokeCallback]
		private static void OnActivityInviteImpl(IntPtr ptr, ActivityActionType type, ref User user, ref Activity activity)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.ActivityManagerInstance.OnActivityInvite != null)
			{
				discord.ActivityManagerInstance.OnActivityInvite(type, ref user, ref activity);
			}
		}
	}
	internal static class Constants
	{
		public const string DllName = "discord_game_sdk";
	}
	public enum Result
	{
		Ok,
		ServiceUnavailable,
		InvalidVersion,
		LockFailed,
		InternalError,
		InvalidPayload,
		InvalidCommand,
		InvalidPermissions,
		NotFetched,
		NotFound,
		Conflict,
		InvalidSecret,
		InvalidJoinSecret,
		NoEligibleActivity,
		InvalidInvite,
		NotAuthenticated,
		InvalidAccessToken,
		ApplicationMismatch,
		InvalidDataUrl,
		InvalidBase64,
		NotFiltered,
		LobbyFull,
		InvalidLobbySecret,
		InvalidFilename,
		InvalidFileSize,
		InvalidEntitlement,
		NotInstalled,
		NotRunning,
		InsufficientBuffer,
		PurchaseCanceled,
		InvalidGuild,
		InvalidEvent,
		InvalidChannel,
		InvalidOrigin,
		RateLimited,
		OAuth2Error,
		SelectChannelTimeout,
		GetGuildTimeout,
		SelectVoiceForceRequired,
		CaptureShortcutAlreadyListening,
		UnauthorizedForAchievement,
		InvalidGiftCode,
		PurchaseError,
		TransactionAborted,
		DrawingInitFailed
	}
	public enum CreateFlags
	{
		Default,
		NoRequireDiscord
	}
	public enum LogLevel
	{
		Error = 1,
		Warn,
		Info,
		Debug
	}
	public enum UserFlag
	{
		Partner = 2,
		HypeSquadEvents = 4,
		HypeSquadHouse1 = 0x40,
		HypeSquadHouse2 = 0x80,
		HypeSquadHouse3 = 0x100
	}
	public enum PremiumType
	{
		None,
		Tier1,
		Tier2
	}
	public enum ImageType
	{
		User
	}
	public enum ActivityPartyPrivacy
	{
		Private,
		Public
	}
	public enum ActivityType
	{
		Playing,
		Streaming,
		Listening,
		Watching
	}
	public enum ActivityActionType
	{
		Join = 1,
		Spectate
	}
	public enum ActivitySupportedPlatformFlags
	{
		Desktop = 1,
		Android = 2,
		iOS = 4
	}
	public enum ActivityJoinRequestReply
	{
		No,
		Yes,
		Ignore
	}
	public enum Status
	{
		Offline,
		Online,
		Idle,
		DoNotDisturb
	}
	public enum RelationshipType
	{
		None,
		Friend,
		Blocked,
		PendingIncoming,
		PendingOutgoing,
		Implicit
	}
	public enum LobbyType
	{
		Private = 1,
		Public
	}
	public enum LobbySearchComparison
	{
		LessThanOrEqual = -2,
		LessThan,
		Equal,
		GreaterThan,
		GreaterThanOrEqual,
		NotEqual
	}
	public enum LobbySearchCast
	{
		String = 1,
		Number
	}
	public enum LobbySearchDistance
	{
		Local,
		Default,
		Extended,
		Global
	}
	public enum KeyVariant
	{
		Normal,
		Right,
		Left
	}
	public enum MouseButton
	{
		Left,
		Middle,
		Right
	}
	public enum EntitlementType
	{
		Purchase = 1,
		PremiumSubscription,
		DeveloperGift,
		TestModePurchase,
		FreePurchase,
		UserGift,
		PremiumPurchase
	}
	public enum SkuType
	{
		Application = 1,
		DLC,
		Consumable,
		Bundle
	}
	public enum InputModeType
	{
		VoiceActivity,
		PushToTalk
	}
	public struct User
	{
		public long Id;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Username;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]
		public string Discriminator;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Avatar;

		public bool Bot;
	}
	public struct OAuth2Token
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string AccessToken;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1024)]
		public string Scopes;

		public long Expires;
	}
	public struct ImageHandle
	{
		public ImageType Type;

		public long Id;

		public uint Size;
	}
	public struct ImageDimensions
	{
		public uint Width;

		public uint Height;
	}
	public struct ActivityTimestamps
	{
		public long Start;

		public long End;
	}
	public struct ActivityAssets
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string LargeImage;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string LargeText;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string SmallImage;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string SmallText;
	}
	public struct PartySize
	{
		public int CurrentSize;

		public int MaxSize;
	}
	public struct ActivityParty
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Id;

		public PartySize Size;

		public ActivityPartyPrivacy Privacy;
	}
	public struct ActivitySecrets
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Match;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Join;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Spectate;
	}
	public struct Activity
	{
		public ActivityType Type;

		public long ApplicationId;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Name;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string State;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Details;

		public ActivityTimestamps Timestamps;

		public ActivityAssets Assets;

		public ActivityParty Party;

		public ActivitySecrets Secrets;

		public bool Instance;

		public uint SupportedPlatforms;
	}
	public struct Presence
	{
		public Status Status;

		public Activity Activity;
	}
	public struct Relationship
	{
		public RelationshipType Type;

		public User User;

		public Presence Presence;
	}
	public struct Lobby
	{
		public long Id;

		public LobbyType Type;

		public long OwnerId;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)]
		public string Secret;

		public uint Capacity;

		public bool Locked;
	}
	public struct ImeUnderline
	{
		public int From;

		public int To;

		public uint Color;

		public uint BackgroundColor;

		public bool Thick;
	}
	public struct Rect
	{
		public int Left;

		public int Top;

		public int Right;

		public int Bottom;
	}
	public struct FileStat
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)]
		public string Filename;

		public ulong Size;

		public ulong LastModified;
	}
	public struct Entitlement
	{
		public long Id;

		public EntitlementType Type;

		public long SkuId;
	}
	public struct SkuPrice
	{
		public uint Amount;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)]
		public string Currency;
	}
	public struct Sku
	{
		public long Id;

		public SkuType Type;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Name;

		public SkuPrice Price;
	}
	public struct InputMode
	{
		public InputModeType Type;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)]
		public string Shortcut;
	}
	public struct UserAchievement
	{
		public long UserId;

		public long AchievementId;

		public byte PercentComplete;

		[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]
		public string UnlockedAt;
	}
	public struct LobbyTransaction
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetTypeMethod(IntPtr methodsPtr, LobbyType type);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetOwnerMethod(IntPtr methodsPtr, long ownerId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetCapacityMethod(IntPtr methodsPtr, uint capacity);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DeleteMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetLockedMethod(IntPtr methodsPtr, bool locked);

			internal SetTypeMethod SetType;

			internal SetOwnerMethod SetOwner;

			internal SetCapacityMethod SetCapacity;

			internal SetMetadataMethod SetMetadata;

			internal DeleteMetadataMethod DeleteMetadata;

			internal SetLockedMethod SetLocked;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void SetType(LobbyType type)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetType(MethodsPtr, type);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetOwner(long ownerId)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetOwner(MethodsPtr, ownerId);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetCapacity(uint capacity)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetCapacity(MethodsPtr, capacity);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetMetadata(string key, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetMetadata(MethodsPtr, key, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void DeleteMetadata(string key)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.DeleteMetadata(MethodsPtr, key);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void SetLocked(bool locked)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetLocked(MethodsPtr, locked);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public struct LobbyMemberTransaction
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SetMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DeleteMetadataMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key);

			internal SetMetadataMethod SetMetadata;

			internal DeleteMetadataMethod DeleteMetadata;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void SetMetadata(string key, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.SetMetadata(MethodsPtr, key, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void DeleteMetadata(string key)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.DeleteMetadata(MethodsPtr, key);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public struct LobbySearchQuery
	{
		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result FilterMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, LobbySearchComparison comparison, LobbySearchCast cast, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result SortMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string key, LobbySearchCast cast, [MarshalAs(UnmanagedType.LPStr)] string value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result LimitMethod(IntPtr methodsPtr, uint limit);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DistanceMethod(IntPtr methodsPtr, LobbySearchDistance distance);

			internal FilterMethod Filter;

			internal SortMethod Sort;

			internal LimitMethod Limit;

			internal DistanceMethod Distance;
		}

		internal IntPtr MethodsPtr;

		internal object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public void Filter(string key, LobbySearchComparison comparison, LobbySearchCast cast, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Filter(MethodsPtr, key, comparison, cast, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Sort(string key, LobbySearchCast cast, string value)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Sort(MethodsPtr, key, cast, value);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Limit(uint limit)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Limit(MethodsPtr, limit);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}

		public void Distance(LobbySearchDistance distance)
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Result result = Methods.Distance(MethodsPtr, distance);
				if (result != 0)
				{
					throw new ResultException(result);
				}
			}
		}
	}
	public class ResultException : Exception
	{
		public readonly Result Result;

		public ResultException(Result result)
			: base(result.ToString())
		{
		}
	}
	public class Discord : IDisposable
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DestroyHandler(IntPtr MethodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result RunCallbacksMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLogHookCallback(IntPtr ptr, LogLevel level, [MarshalAs(UnmanagedType.LPStr)] string message);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SetLogHookMethod(IntPtr methodsPtr, LogLevel minLevel, IntPtr callbackData, SetLogHookCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetApplicationManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetUserManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetImageManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetActivityManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetRelationshipManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetLobbyManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetNetworkManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetOverlayManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetStorageManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetStoreManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetVoiceManagerMethod(IntPtr discordPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate IntPtr GetAchievementManagerMethod(IntPtr discordPtr);

			internal DestroyHandler Destroy;

			internal RunCallbacksMethod RunCallbacks;

			internal SetLogHookMethod SetLogHook;

			internal GetApplicationManagerMethod GetApplicationManager;

			internal GetUserManagerMethod GetUserManager;

			internal GetImageManagerMethod GetImageManager;

			internal GetActivityManagerMethod GetActivityManager;

			internal GetRelationshipManagerMethod GetRelationshipManager;

			internal GetLobbyManagerMethod GetLobbyManager;

			internal GetNetworkManagerMethod GetNetworkManager;

			internal GetOverlayManagerMethod GetOverlayManager;

			internal GetStorageManagerMethod GetStorageManager;

			internal GetStoreManagerMethod GetStoreManager;

			internal GetVoiceManagerMethod GetVoiceManager;

			internal GetAchievementManagerMethod GetAchievementManager;
		}

		internal struct FFICreateParams
		{
			internal long ClientId;

			internal ulong Flags;

			internal IntPtr Events;

			internal IntPtr EventData;

			internal IntPtr ApplicationEvents;

			internal uint ApplicationVersion;

			internal IntPtr UserEvents;

			internal uint UserVersion;

			internal IntPtr ImageEvents;

			internal uint ImageVersion;

			internal IntPtr ActivityEvents;

			internal uint ActivityVersion;

			internal IntPtr RelationshipEvents;

			internal uint RelationshipVersion;

			internal IntPtr LobbyEvents;

			internal uint LobbyVersion;

			internal IntPtr NetworkEvents;

			internal uint NetworkVersion;

			internal IntPtr OverlayEvents;

			internal uint OverlayVersion;

			internal IntPtr StorageEvents;

			internal uint StorageVersion;

			internal IntPtr StoreEvents;

			internal uint StoreVersion;

			internal IntPtr VoiceEvents;

			internal uint VoiceVersion;

			internal IntPtr AchievementEvents;

			internal uint AchievementVersion;
		}

		public delegate void SetLogHookHandler(LogLevel level, string message);

		private GCHandle SelfHandle;

		private IntPtr EventsPtr;

		private FFIEvents Events;

		private IntPtr ApplicationEventsPtr;

		private ApplicationManager.FFIEvents ApplicationEvents;

		internal ApplicationManager ApplicationManagerInstance;

		private IntPtr UserEventsPtr;

		private UserManager.FFIEvents UserEvents;

		internal UserManager UserManagerInstance;

		private IntPtr ImageEventsPtr;

		private ImageManager.FFIEvents ImageEvents;

		internal ImageManager ImageManagerInstance;

		private IntPtr ActivityEventsPtr;

		private ActivityManager.FFIEvents ActivityEvents;

		internal ActivityManager ActivityManagerInstance;

		private IntPtr RelationshipEventsPtr;

		private RelationshipManager.FFIEvents RelationshipEvents;

		internal RelationshipManager RelationshipManagerInstance;

		private IntPtr LobbyEventsPtr;

		private LobbyManager.FFIEvents LobbyEvents;

		internal LobbyManager LobbyManagerInstance;

		private IntPtr NetworkEventsPtr;

		private NetworkManager.FFIEvents NetworkEvents;

		internal NetworkManager NetworkManagerInstance;

		private IntPtr OverlayEventsPtr;

		private OverlayManager.FFIEvents OverlayEvents;

		internal OverlayManager OverlayManagerInstance;

		private IntPtr StorageEventsPtr;

		private StorageManager.FFIEvents StorageEvents;

		internal StorageManager StorageManagerInstance;

		private IntPtr StoreEventsPtr;

		private StoreManager.FFIEvents StoreEvents;

		internal StoreManager StoreManagerInstance;

		private IntPtr VoiceEventsPtr;

		private VoiceManager.FFIEvents VoiceEvents;

		internal VoiceManager VoiceManagerInstance;

		private IntPtr AchievementEventsPtr;

		private AchievementManager.FFIEvents AchievementEvents;

		internal AchievementManager AchievementManagerInstance;

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private GCHandle? setLogHook;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		[DllImport("discord_game_sdk", ExactSpelling = true)]
		private static extern Result DiscordCreate(uint version, ref FFICreateParams createParams, out IntPtr manager);

		public Discord(long clientId, ulong flags)
		{
			FFICreateParams createParams = default(FFICreateParams);
			createParams.ClientId = clientId;
			createParams.Flags = flags;
			Events = default(FFIEvents);
			EventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(Events));
			createParams.Events = EventsPtr;
			SelfHandle = GCHandle.Alloc(this);
			createParams.EventData = GCHandle.ToIntPtr(SelfHandle);
			ApplicationEvents = default(ApplicationManager.FFIEvents);
			ApplicationEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ApplicationEvents));
			createParams.ApplicationEvents = ApplicationEventsPtr;
			createParams.ApplicationVersion = 1u;
			UserEvents = default(UserManager.FFIEvents);
			UserEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(UserEvents));
			createParams.UserEvents = UserEventsPtr;
			createParams.UserVersion = 1u;
			ImageEvents = default(ImageManager.FFIEvents);
			ImageEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ImageEvents));
			createParams.ImageEvents = ImageEventsPtr;
			createParams.ImageVersion = 1u;
			ActivityEvents = default(ActivityManager.FFIEvents);
			ActivityEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ActivityEvents));
			createParams.ActivityEvents = ActivityEventsPtr;
			createParams.ActivityVersion = 1u;
			RelationshipEvents = default(RelationshipManager.FFIEvents);
			RelationshipEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(RelationshipEvents));
			createParams.RelationshipEvents = RelationshipEventsPtr;
			createParams.RelationshipVersion = 1u;
			LobbyEvents = default(LobbyManager.FFIEvents);
			LobbyEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(LobbyEvents));
			createParams.LobbyEvents = LobbyEventsPtr;
			createParams.LobbyVersion = 1u;
			NetworkEvents = default(NetworkManager.FFIEvents);
			NetworkEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(NetworkEvents));
			createParams.NetworkEvents = NetworkEventsPtr;
			createParams.NetworkVersion = 1u;
			OverlayEvents = default(OverlayManager.FFIEvents);
			OverlayEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(OverlayEvents));
			createParams.OverlayEvents = OverlayEventsPtr;
			createParams.OverlayVersion = 2u;
			StorageEvents = default(StorageManager.FFIEvents);
			StorageEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(StorageEvents));
			createParams.StorageEvents = StorageEventsPtr;
			createParams.StorageVersion = 1u;
			StoreEvents = default(StoreManager.FFIEvents);
			StoreEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(StoreEvents));
			createParams.StoreEvents = StoreEventsPtr;
			createParams.StoreVersion = 1u;
			VoiceEvents = default(VoiceManager.FFIEvents);
			VoiceEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(VoiceEvents));
			createParams.VoiceEvents = VoiceEventsPtr;
			createParams.VoiceVersion = 1u;
			AchievementEvents = default(AchievementManager.FFIEvents);
			AchievementEventsPtr = Marshal.AllocHGlobal(Marshal.SizeOf(AchievementEvents));
			createParams.AchievementEvents = AchievementEventsPtr;
			createParams.AchievementVersion = 1u;
			InitEvents(EventsPtr, ref Events);
			Result result = DiscordCreate(3u, ref createParams, out MethodsPtr);
			if (result != 0)
			{
				Dispose();
				throw new ResultException(result);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public void Dispose()
		{
			if (MethodsPtr != IntPtr.Zero)
			{
				Methods.Destroy(MethodsPtr);
			}
			SelfHandle.Free();
			Marshal.FreeHGlobal(EventsPtr);
			Marshal.FreeHGlobal(ApplicationEventsPtr);
			Marshal.FreeHGlobal(UserEventsPtr);
			Marshal.FreeHGlobal(ImageEventsPtr);
			Marshal.FreeHGlobal(ActivityEventsPtr);
			Marshal.FreeHGlobal(RelationshipEventsPtr);
			Marshal.FreeHGlobal(LobbyEventsPtr);
			Marshal.FreeHGlobal(NetworkEventsPtr);
			Marshal.FreeHGlobal(OverlayEventsPtr);
			Marshal.FreeHGlobal(StorageEventsPtr);
			Marshal.FreeHGlobal(StoreEventsPtr);
			Marshal.FreeHGlobal(VoiceEventsPtr);
			Marshal.FreeHGlobal(AchievementEventsPtr);
			if (setLogHook.HasValue)
			{
				setLogHook.Value.Free();
			}
		}

		public void RunCallbacks()
		{
			Result result = Methods.RunCallbacks(MethodsPtr);
			if (result != 0 && result != Result.NotRunning)
			{
				throw new ResultException(result);
			}
		}

		[MonoPInvokeCallback]
		private static void SetLogHookCallbackImpl(IntPtr ptr, LogLevel level, string message)
		{
			SetLogHookHandler setLogHookHandler = (SetLogHookHandler)GCHandle.FromIntPtr(ptr).Target;
			setLogHookHandler(level, message);
		}

		public void SetLogHook(LogLevel minLevel, SetLogHookHandler callback)
		{
			if (setLogHook.HasValue)
			{
				setLogHook.Value.Free();
			}
			setLogHook = GCHandle.Alloc(callback);
			Methods.SetLogHook(MethodsPtr, minLevel, GCHandle.ToIntPtr(setLogHook.Value), SetLogHookCallbackImpl);
		}

		public ApplicationManager GetApplicationManager()
		{
			if (ApplicationManagerInstance == null)
			{
				ApplicationManagerInstance = new ApplicationManager(Methods.GetApplicationManager(MethodsPtr), ApplicationEventsPtr, ref ApplicationEvents);
			}
			return ApplicationManagerInstance;
		}

		public UserManager GetUserManager()
		{
			if (UserManagerInstance == null)
			{
				UserManagerInstance = new UserManager(Methods.GetUserManager(MethodsPtr), UserEventsPtr, ref UserEvents);
			}
			return UserManagerInstance;
		}

		public ImageManager GetImageManager()
		{
			if (ImageManagerInstance == null)
			{
				ImageManagerInstance = new ImageManager(Methods.GetImageManager(MethodsPtr), ImageEventsPtr, ref ImageEvents);
			}
			return ImageManagerInstance;
		}

		public ActivityManager GetActivityManager()
		{
			if (ActivityManagerInstance == null)
			{
				ActivityManagerInstance = new ActivityManager(Methods.GetActivityManager(MethodsPtr), ActivityEventsPtr, ref ActivityEvents);
			}
			return ActivityManagerInstance;
		}

		public RelationshipManager GetRelationshipManager()
		{
			if (RelationshipManagerInstance == null)
			{
				RelationshipManagerInstance = new RelationshipManager(Methods.GetRelationshipManager(MethodsPtr), RelationshipEventsPtr, ref RelationshipEvents);
			}
			return RelationshipManagerInstance;
		}

		public LobbyManager GetLobbyManager()
		{
			if (LobbyManagerInstance == null)
			{
				LobbyManagerInstance = new LobbyManager(Methods.GetLobbyManager(MethodsPtr), LobbyEventsPtr, ref LobbyEvents);
			}
			return LobbyManagerInstance;
		}

		public NetworkManager GetNetworkManager()
		{
			if (NetworkManagerInstance == null)
			{
				NetworkManagerInstance = new NetworkManager(Methods.GetNetworkManager(MethodsPtr), NetworkEventsPtr, ref NetworkEvents);
			}
			return NetworkManagerInstance;
		}

		public OverlayManager GetOverlayManager()
		{
			if (OverlayManagerInstance == null)
			{
				OverlayManagerInstance = new OverlayManager(Methods.GetOverlayManager(MethodsPtr), OverlayEventsPtr, ref OverlayEvents);
			}
			return OverlayManagerInstance;
		}

		public StorageManager GetStorageManager()
		{
			if (StorageManagerInstance == null)
			{
				StorageManagerInstance = new StorageManager(Methods.GetStorageManager(MethodsPtr), StorageEventsPtr, ref StorageEvents);
			}
			return StorageManagerInstance;
		}

		public StoreManager GetStoreManager()
		{
			if (StoreManagerInstance == null)
			{
				StoreManagerInstance = new StoreManager(Methods.GetStoreManager(MethodsPtr), StoreEventsPtr, ref StoreEvents);
			}
			return StoreManagerInstance;
		}

		public VoiceManager GetVoiceManager()
		{
			if (VoiceManagerInstance == null)
			{
				VoiceManagerInstance = new VoiceManager(Methods.GetVoiceManager(MethodsPtr), VoiceEventsPtr, ref VoiceEvents);
			}
			return VoiceManagerInstance;
		}

		public AchievementManager GetAchievementManager()
		{
			if (AchievementManagerInstance == null)
			{
				AchievementManagerInstance = new AchievementManager(Methods.GetAchievementManager(MethodsPtr), AchievementEventsPtr, ref AchievementEvents);
			}
			return AchievementManagerInstance;
		}
	}
	internal class MonoPInvokeCallbackAttribute : Attribute
	{
	}
	public class ApplicationManager
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ValidateOrExitCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ValidateOrExitMethod(IntPtr methodsPtr, IntPtr callbackData, ValidateOrExitCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetCurrentLocaleMethod(IntPtr methodsPtr, StringBuilder locale);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetCurrentBranchMethod(IntPtr methodsPtr, StringBuilder branch);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetOAuth2TokenCallback(IntPtr ptr, Result result, ref OAuth2Token oauth2Token);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetOAuth2TokenMethod(IntPtr methodsPtr, IntPtr callbackData, GetOAuth2TokenCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetTicketCallback(IntPtr ptr, Result result, [MarshalAs(UnmanagedType.LPStr)] ref string data);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetTicketMethod(IntPtr methodsPtr, IntPtr callbackData, GetTicketCallback callback);

			internal ValidateOrExitMethod ValidateOrExit;

			internal GetCurrentLocaleMethod GetCurrentLocale;

			internal GetCurrentBranchMethod GetCurrentBranch;

			internal GetOAuth2TokenMethod GetOAuth2Token;

			internal GetTicketMethod GetTicket;
		}

		public delegate void ValidateOrExitHandler(Result result);

		public delegate void GetOAuth2TokenHandler(Result result, ref OAuth2Token oauth2Token);

		public delegate void GetTicketHandler(Result result, ref string data);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		internal ApplicationManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static void ValidateOrExitCallbackImpl(IntPtr ptr, Result result)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			ValidateOrExitHandler validateOrExitHandler = (ValidateOrExitHandler)gCHandle.Target;
			gCHandle.Free();
			validateOrExitHandler(result);
		}

		public void ValidateOrExit(ValidateOrExitHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.ValidateOrExit(MethodsPtr, GCHandle.ToIntPtr(value), ValidateOrExitCallbackImpl);
		}

		public string GetCurrentLocale()
		{
			StringBuilder stringBuilder = new StringBuilder(128);
			Methods.GetCurrentLocale(MethodsPtr, stringBuilder);
			return stringBuilder.ToString();
		}

		public string GetCurrentBranch()
		{
			StringBuilder stringBuilder = new StringBuilder(4096);
			Methods.GetCurrentBranch(MethodsPtr, stringBuilder);
			return stringBuilder.ToString();
		}

		[MonoPInvokeCallback]
		private static void GetOAuth2TokenCallbackImpl(IntPtr ptr, Result result, ref OAuth2Token oauth2Token)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetOAuth2TokenHandler getOAuth2TokenHandler = (GetOAuth2TokenHandler)gCHandle.Target;
			gCHandle.Free();
			getOAuth2TokenHandler(result, ref oauth2Token);
		}

		public void GetOAuth2Token(GetOAuth2TokenHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetOAuth2Token(MethodsPtr, GCHandle.ToIntPtr(value), GetOAuth2TokenCallbackImpl);
		}

		[MonoPInvokeCallback]
		private static void GetTicketCallbackImpl(IntPtr ptr, Result result, ref string data)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetTicketHandler getTicketHandler = (GetTicketHandler)gCHandle.Target;
			gCHandle.Free();
			getTicketHandler(result, ref data);
		}

		public void GetTicket(GetTicketHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetTicket(MethodsPtr, GCHandle.ToIntPtr(value), GetTicketCallbackImpl);
		}
	}
	public class UserManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CurrentUserUpdateHandler(IntPtr ptr);

			internal CurrentUserUpdateHandler OnCurrentUserUpdate;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetCurrentUserMethod(IntPtr methodsPtr, ref User currentUser);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetUserCallback(IntPtr ptr, Result result, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void GetUserMethod(IntPtr methodsPtr, long userId, IntPtr callbackData, GetUserCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetCurrentUserPremiumTypeMethod(IntPtr methodsPtr, ref PremiumType premiumType);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result CurrentUserHasFlagMethod(IntPtr methodsPtr, UserFlag flag, ref bool hasFlag);

			internal GetCurrentUserMethod GetCurrentUser;

			internal GetUserMethod GetUser;

			internal GetCurrentUserPremiumTypeMethod GetCurrentUserPremiumType;

			internal CurrentUserHasFlagMethod CurrentUserHasFlag;
		}

		public delegate void GetUserHandler(Result result, ref User user);

		public delegate void CurrentUserUpdateHandler();

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event CurrentUserUpdateHandler OnCurrentUserUpdate;

		internal UserManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnCurrentUserUpdate = OnCurrentUserUpdateImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		public User GetCurrentUser()
		{
			User currentUser = default(User);
			Result result = Methods.GetCurrentUser(MethodsPtr, ref currentUser);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return currentUser;
		}

		[MonoPInvokeCallback]
		private static void GetUserCallbackImpl(IntPtr ptr, Result result, ref User user)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			GetUserHandler getUserHandler = (GetUserHandler)gCHandle.Target;
			gCHandle.Free();
			getUserHandler(result, ref user);
		}

		public void GetUser(long userId, GetUserHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.GetUser(MethodsPtr, userId, GCHandle.ToIntPtr(value), GetUserCallbackImpl);
		}

		public PremiumType GetCurrentUserPremiumType()
		{
			PremiumType premiumType = PremiumType.None;
			Result result = Methods.GetCurrentUserPremiumType(MethodsPtr, ref premiumType);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return premiumType;
		}

		public bool CurrentUserHasFlag(UserFlag flag)
		{
			bool hasFlag = false;
			Result result = Methods.CurrentUserHasFlag(MethodsPtr, flag, ref hasFlag);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return hasFlag;
		}

		[MonoPInvokeCallback]
		private static void OnCurrentUserUpdateImpl(IntPtr ptr)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.UserManagerInstance.OnCurrentUserUpdate != null)
			{
				discord.UserManagerInstance.OnCurrentUserUpdate();
			}
		}
	}
	public class ImageManager
	{
		internal struct FFIEvents
		{
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FetchCallback(IntPtr ptr, Result result, ImageHandle handleResult);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FetchMethod(IntPtr methodsPtr, ImageHandle handle, bool refresh, IntPtr callbackData, FetchCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetDimensionsMethod(IntPtr methodsPtr, ImageHandle handle, ref ImageDimensions dimensions);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetDataMethod(IntPtr methodsPtr, ImageHandle handle, byte[] data, int dataLen);

			internal FetchMethod Fetch;

			internal GetDimensionsMethod GetDimensions;

			internal GetDataMethod GetData;
		}

		public delegate void FetchHandler(Result result, ImageHandle handleResult);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		internal ImageManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static void FetchCallbackImpl(IntPtr ptr, Result result, ImageHandle handleResult)
		{
			GCHandle gCHandle = GCHandle.FromIntPtr(ptr);
			FetchHandler fetchHandler = (FetchHandler)gCHandle.Target;
			gCHandle.Free();
			fetchHandler(result, handleResult);
		}

		public void Fetch(ImageHandle handle, bool refresh, FetchHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.Fetch(MethodsPtr, handle, refresh, GCHandle.ToIntPtr(value), FetchCallbackImpl);
		}

		public ImageDimensions GetDimensions(ImageHandle handle)
		{
			ImageDimensions dimensions = default(ImageDimensions);
			Result result = Methods.GetDimensions(MethodsPtr, handle, ref dimensions);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return dimensions;
		}

		public void GetData(ImageHandle handle, byte[] data)
		{
			Result result = Methods.GetData(MethodsPtr, handle, data, data.Length);
			if (result != 0)
			{
				throw new ResultException(result);
			}
		}
	}
	public class RelationshipManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void RefreshHandler(IntPtr ptr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void RelationshipUpdateHandler(IntPtr ptr, ref Relationship relationship);

			internal RefreshHandler OnRefresh;

			internal RelationshipUpdateHandler OnRelationshipUpdate;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate bool FilterCallback(IntPtr ptr, ref Relationship relationship);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void FilterMethod(IntPtr methodsPtr, IntPtr callbackData, FilterCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result CountMethod(IntPtr methodsPtr, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMethod(IntPtr methodsPtr, long userId, ref Relationship relationship);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetAtMethod(IntPtr methodsPtr, uint index, ref Relationship relationship);

			internal FilterMethod Filter;

			internal CountMethod Count;

			internal GetMethod Get;

			internal GetAtMethod GetAt;
		}

		public delegate bool FilterHandler(ref Relationship relationship);

		public delegate void RefreshHandler();

		public delegate void RelationshipUpdateHandler(ref Relationship relationship);

		private IntPtr MethodsPtr;

		private object MethodsStructure;

		private FFIMethods Methods
		{
			get
			{
				if (MethodsStructure == null)
				{
					MethodsStructure = Marshal.PtrToStructure(MethodsPtr, typeof(FFIMethods));
				}
				return (FFIMethods)MethodsStructure;
			}
		}

		public event RefreshHandler OnRefresh;

		public event RelationshipUpdateHandler OnRelationshipUpdate;

		internal RelationshipManager(IntPtr ptr, IntPtr eventsPtr, ref FFIEvents events)
		{
			if (eventsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
			InitEvents(eventsPtr, ref events);
			MethodsPtr = ptr;
			if (MethodsPtr == IntPtr.Zero)
			{
				throw new ResultException(Result.InternalError);
			}
		}

		private void InitEvents(IntPtr eventsPtr, ref FFIEvents events)
		{
			events.OnRefresh = OnRefreshImpl;
			events.OnRelationshipUpdate = OnRelationshipUpdateImpl;
			Marshal.StructureToPtr(events, eventsPtr, fDeleteOld: false);
		}

		[MonoPInvokeCallback]
		private static bool FilterCallbackImpl(IntPtr ptr, ref Relationship relationship)
		{
			FilterHandler filterHandler = (FilterHandler)GCHandle.FromIntPtr(ptr).Target;
			return filterHandler(ref relationship);
		}

		public void Filter(FilterHandler callback)
		{
			GCHandle value = GCHandle.Alloc(callback);
			Methods.Filter(MethodsPtr, GCHandle.ToIntPtr(value), FilterCallbackImpl);
			value.Free();
		}

		public int Count()
		{
			int count = 0;
			Result result = Methods.Count(MethodsPtr, ref count);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return count;
		}

		public Relationship Get(long userId)
		{
			Relationship relationship = default(Relationship);
			Result result = Methods.Get(MethodsPtr, userId, ref relationship);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return relationship;
		}

		public Relationship GetAt(uint index)
		{
			Relationship relationship = default(Relationship);
			Result result = Methods.GetAt(MethodsPtr, index, ref relationship);
			if (result != 0)
			{
				throw new ResultException(result);
			}
			return relationship;
		}

		[MonoPInvokeCallback]
		private static void OnRefreshImpl(IntPtr ptr)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.RelationshipManagerInstance.OnRefresh != null)
			{
				discord.RelationshipManagerInstance.OnRefresh();
			}
		}

		[MonoPInvokeCallback]
		private static void OnRelationshipUpdateImpl(IntPtr ptr, ref Relationship relationship)
		{
			Discord discord = (Discord)GCHandle.FromIntPtr(ptr).Target;
			if (discord.RelationshipManagerInstance.OnRelationshipUpdate != null)
			{
				discord.RelationshipManagerInstance.OnRelationshipUpdate(ref relationship);
			}
		}
	}
	public class LobbyManager
	{
		internal struct FFIEvents
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyUpdateHandler(IntPtr ptr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyDeleteHandler(IntPtr ptr, long lobbyId, uint reason);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberConnectHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberUpdateHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void MemberDisconnectHandler(IntPtr ptr, long lobbyId, long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyMessageHandler(IntPtr ptr, long lobbyId, long userId, IntPtr dataPtr, int dataLen);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SpeakingHandler(IntPtr ptr, long lobbyId, long userId, bool speaking);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void NetworkMessageHandler(IntPtr ptr, long lobbyId, long userId, byte channelId, IntPtr dataPtr, int dataLen);

			internal LobbyUpdateHandler OnLobbyUpdate;

			internal LobbyDeleteHandler OnLobbyDelete;

			internal MemberConnectHandler OnMemberConnect;

			internal MemberUpdateHandler OnMemberUpdate;

			internal MemberDisconnectHandler OnMemberDisconnect;

			internal LobbyMessageHandler OnLobbyMessage;

			internal SpeakingHandler OnSpeaking;

			internal NetworkMessageHandler OnNetworkMessage;
		}

		internal struct FFIMethods
		{
			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyCreateTransactionMethod(IntPtr methodsPtr, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyUpdateTransactionMethod(IntPtr methodsPtr, long lobbyId, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUpdateTransactionMethod(IntPtr methodsPtr, long lobbyId, long userId, ref IntPtr transaction);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CreateLobbyCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void CreateLobbyMethod(IntPtr methodsPtr, IntPtr transaction, IntPtr callbackData, CreateLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr transaction, IntPtr callbackData, UpdateLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DeleteLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DeleteLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DeleteLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyMethod(IntPtr methodsPtr, long lobbyId, [MarshalAs(UnmanagedType.LPStr)] string secret, IntPtr callbackData, ConnectLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyWithActivitySecretCallback(IntPtr ptr, Result result, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectLobbyWithActivitySecretMethod(IntPtr methodsPtr, [MarshalAs(UnmanagedType.LPStr)] string activitySecret, IntPtr callbackData, ConnectLobbyWithActivitySecretCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectLobbyCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectLobbyMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DisconnectLobbyCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMethod(IntPtr methodsPtr, long lobbyId, ref Lobby lobby);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyActivitySecretMethod(IntPtr methodsPtr, long lobbyId, StringBuilder secret);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMetadataValueMethod(IntPtr methodsPtr, long lobbyId, [MarshalAs(UnmanagedType.LPStr)] string key, StringBuilder value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyMetadataKeyMethod(IntPtr methodsPtr, long lobbyId, int index, StringBuilder key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result LobbyMetadataCountMethod(IntPtr methodsPtr, long lobbyId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result MemberCountMethod(IntPtr methodsPtr, long lobbyId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUserIdMethod(IntPtr methodsPtr, long lobbyId, int index, ref long userId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberUserMethod(IntPtr methodsPtr, long lobbyId, long userId, ref User user);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberMetadataValueMethod(IntPtr methodsPtr, long lobbyId, long userId, [MarshalAs(UnmanagedType.LPStr)] string key, StringBuilder value);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetMemberMetadataKeyMethod(IntPtr methodsPtr, long lobbyId, long userId, int index, StringBuilder key);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result MemberMetadataCountMethod(IntPtr methodsPtr, long lobbyId, long userId, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateMemberCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void UpdateMemberMethod(IntPtr methodsPtr, long lobbyId, long userId, IntPtr transaction, IntPtr callbackData, UpdateMemberCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendLobbyMessageCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SendLobbyMessageMethod(IntPtr methodsPtr, long lobbyId, byte[] data, int dataLen, IntPtr callbackData, SendLobbyMessageCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetSearchQueryMethod(IntPtr methodsPtr, ref IntPtr query);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SearchCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void SearchMethod(IntPtr methodsPtr, IntPtr query, IntPtr callbackData, SearchCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void LobbyCountMethod(IntPtr methodsPtr, ref int count);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result GetLobbyIdMethod(IntPtr methodsPtr, int index, ref long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectVoiceCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void ConnectVoiceMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, ConnectVoiceCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectVoiceCallback(IntPtr ptr, Result result);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate void DisconnectVoiceMethod(IntPtr methodsPtr, long lobbyId, IntPtr callbackData, DisconnectVoiceCallback callback);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result ConnectNetworkMethod(IntPtr methodsPtr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result DisconnectNetworkMethod(IntPtr methodsPtr, long lobbyId);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate Result FlushNetworkMethod(IntPtr methodsPtr);

			[UnmanagedFunctionPointer(CallingConvention.Winapi)]
			internal delegate

EOS.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Text;
using Epic.OnlineServices.Achievements;
using Epic.OnlineServices.AntiCheatClient;
using Epic.OnlineServices.AntiCheatCommon;
using Epic.OnlineServices.AntiCheatServer;
using Epic.OnlineServices.Auth;
using Epic.OnlineServices.Connect;
using Epic.OnlineServices.CustomInvites;
using Epic.OnlineServices.Ecom;
using Epic.OnlineServices.Friends;
using Epic.OnlineServices.IntegratedPlatform;
using Epic.OnlineServices.KWS;
using Epic.OnlineServices.Leaderboards;
using Epic.OnlineServices.Lobby;
using Epic.OnlineServices.Logging;
using Epic.OnlineServices.Metrics;
using Epic.OnlineServices.Mods;
using Epic.OnlineServices.P2P;
using Epic.OnlineServices.Platform;
using Epic.OnlineServices.PlayerDataStorage;
using Epic.OnlineServices.Presence;
using Epic.OnlineServices.ProgressionSnapshot;
using Epic.OnlineServices.RTC;
using Epic.OnlineServices.RTCAdmin;
using Epic.OnlineServices.RTCAudio;
using Epic.OnlineServices.Reports;
using Epic.OnlineServices.Sanctions;
using Epic.OnlineServices.Sessions;
using Epic.OnlineServices.Stats;
using Epic.OnlineServices.TitleStorage;
using Epic.OnlineServices.UI;
using Epic.OnlineServices.UserInfo;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyVersion("0.0.0.0")]
namespace Epic.OnlineServices
{
	public sealed class Helper
	{
		private struct Allocation
		{
			public int Size { get; private set; }

			public object Cache { get; private set; }

			public bool? IsArrayItemAllocated { get; private set; }

			public Allocation(int size, object cache, bool? isArrayItemAllocated = null)
			{
				Size = size;
				Cache = cache;
				IsArrayItemAllocated = isArrayItemAllocated;
			}
		}

		private struct PinnedBuffer
		{
			public GCHandle Handle { get; private set; }

			public int RefCount { get; set; }

			public PinnedBuffer(GCHandle handle)
			{
				Handle = handle;
				RefCount = 1;
			}
		}

		private class DelegateHolder
		{
			public Delegate Public { get; private set; }

			public Delegate Private { get; private set; }

			public Delegate[] StructDelegates { get; private set; }

			public ulong? NotificationId { get; set; }

			public DelegateHolder(Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
			{
				Public = publicDelegate;
				Private = privateDelegate;
				StructDelegates = structDelegates;
			}
		}

		private static Dictionary<IntPtr, Allocation> s_Allocations = new Dictionary<IntPtr, Allocation>();

		private static Dictionary<IntPtr, PinnedBuffer> s_PinnedBuffers = new Dictionary<IntPtr, PinnedBuffer>();

		private static Dictionary<IntPtr, DelegateHolder> s_Callbacks = new Dictionary<IntPtr, DelegateHolder>();

		private static Dictionary<string, DelegateHolder> s_StaticCallbacks = new Dictionary<string, DelegateHolder>();

		private static long s_LastClientDataId = 0L;

		private static Dictionary<IntPtr, object> s_ClientDatas = new Dictionary<IntPtr, object>();

		internal static void AddCallback(out IntPtr clientDataAddress, object clientData, Delegate publicDelegate, Delegate privateDelegate, params Delegate[] structDelegates)
		{
			lock (s_Callbacks)
			{
				clientDataAddress = AddClientData(clientData);
				s_Callbacks.Add(clientDataAddress, new DelegateHolder(publicDelegate, privateDelegate, structDelegates));
			}
		}

		private static void RemoveCallback(IntPtr clientDataAddress)
		{
			lock (s_Callbacks)
			{
				s_Callbacks.Remove(clientDataAddress);
				RemoveClientData(clientDataAddress);
			}
		}

		internal static bool TryGetCallback<TCallbackInfoInternal, TCallback, TCallbackInfo>(ref TCallbackInfoInternal callbackInfoInternal, out TCallback callback, out TCallbackInfo callbackInfo) where TCallbackInfoInternal : struct, ICallbackInfoInternal, IGettable<TCallbackInfo> where TCallback : class where TCallbackInfo : struct, ICallbackInfo
		{
			Get<TCallbackInfoInternal, TCallbackInfo>(ref callbackInfoInternal, out callbackInfo, out var clientDataAddress);
			callback = null;
			lock (s_Callbacks)
			{
				if (s_Callbacks.TryGetValue(clientDataAddress, out var value))
				{
					callback = value.Public as TCallback;
					return callback != null;
				}
			}
			return false;
		}

		internal static bool TryGetAndRemoveCallback<TCallbackInfoInternal, TCallback, TCallbackInfo>(ref TCallbackInfoInternal callbackInfoInternal, out TCallback callback, out TCallbackInfo callbackInfo) where TCallbackInfoInternal : struct, ICallbackInfoInternal, IGettable<TCallbackInfo> where TCallback : class where TCallbackInfo : struct, ICallbackInfo
		{
			Get<TCallbackInfoInternal, TCallbackInfo>(ref callbackInfoInternal, out callbackInfo, out var clientDataAddress);
			callback = null;
			lock (s_Callbacks)
			{
				if (s_Callbacks.TryGetValue(clientDataAddress, out var value))
				{
					callback = value.Public as TCallback;
					if (callback != null)
					{
						if (!value.NotificationId.HasValue && callbackInfo.GetResultCode().HasValue && Common.IsOperationComplete(callbackInfo.GetResultCode().Value))
						{
							RemoveCallback(clientDataAddress);
						}
						return true;
					}
				}
			}
			return false;
		}

		internal static bool TryGetStructCallback<TCallbackInfoInternal, TCallback, TCallbackInfo>(ref TCallbackInfoInternal callbackInfoInternal, out TCallback callback, out TCallbackInfo callbackInfo) where TCallbackInfoInternal : struct, ICallbackInfoInternal, IGettable<TCallbackInfo> where TCallback : class where TCallbackInfo : struct
		{
			Get<TCallbackInfoInternal, TCallbackInfo>(ref callbackInfoInternal, out callbackInfo, out var clientDataAddress);
			callback = null;
			lock (s_Callbacks)
			{
				if (s_Callbacks.TryGetValue(clientDataAddress, out var value))
				{
					callback = value.StructDelegates.FirstOrDefault((Delegate structDelegate) => structDelegate.GetType() == typeof(TCallback)) as TCallback;
					if (callback != null)
					{
						return true;
					}
				}
			}
			return false;
		}

		internal static void RemoveCallbackByNotificationId(ulong notificationId)
		{
			lock (s_Callbacks)
			{
				RemoveCallback(s_Callbacks.SingleOrDefault((KeyValuePair<IntPtr, DelegateHolder> pair) => pair.Value.NotificationId.HasValue && pair.Value.NotificationId == notificationId).Key);
			}
		}

		internal static void AddStaticCallback(string key, Delegate publicDelegate, Delegate privateDelegate)
		{
			lock (s_StaticCallbacks)
			{
				s_StaticCallbacks.Remove(key);
				s_StaticCallbacks.Add(key, new DelegateHolder(publicDelegate, privateDelegate));
			}
		}

		internal static bool TryGetStaticCallback<TCallback>(string key, out TCallback callback) where TCallback : class
		{
			callback = null;
			lock (s_StaticCallbacks)
			{
				if (s_StaticCallbacks.TryGetValue(key, out var value))
				{
					callback = value.Public as TCallback;
					if (callback != null)
					{
						return true;
					}
				}
			}
			return false;
		}

		internal static void AssignNotificationIdToCallback(IntPtr clientDataAddress, ulong notificationId)
		{
			if (notificationId == 0L)
			{
				RemoveCallback(clientDataAddress);
				return;
			}
			lock (s_Callbacks)
			{
				if (s_Callbacks.TryGetValue(clientDataAddress, out var value))
				{
					value.NotificationId = notificationId;
				}
			}
		}

		private static IntPtr AddClientData(object clientData)
		{
			lock (s_ClientDatas)
			{
				IntPtr intPtr = new IntPtr(++s_LastClientDataId);
				s_ClientDatas.Add(intPtr, clientData);
				return intPtr;
			}
		}

		private static void RemoveClientData(IntPtr clientDataAddress)
		{
			lock (s_ClientDatas)
			{
				s_ClientDatas.Remove(clientDataAddress);
			}
		}

		private static object GetClientData(IntPtr clientDataAddress)
		{
			lock (s_ClientDatas)
			{
				s_ClientDatas.TryGetValue(clientDataAddress, out var value);
				return value;
			}
		}

		private static void Convert<THandle>(IntPtr from, out THandle to) where THandle : Handle, new()
		{
			to = null;
			if (from != IntPtr.Zero)
			{
				to = new THandle();
				to.InnerHandle = from;
			}
		}

		private static void Convert(Handle from, out IntPtr to)
		{
			to = IntPtr.Zero;
			if (from != null)
			{
				to = from.InnerHandle;
			}
		}

		private static void Convert(byte[] from, out string to)
		{
			to = null;
			if (from != null)
			{
				to = Encoding.ASCII.GetString(from.Take(GetAnsiStringLength(from)).ToArray());
			}
		}

		private static void Convert(string from, out byte[] to, int fromLength)
		{
			if (from == null)
			{
				from = "";
			}
			to = Encoding.ASCII.GetBytes(new string(from.Take(fromLength).ToArray()).PadRight(fromLength, '\0'));
		}

		private static void Convert<TArray>(TArray[] from, out int to)
		{
			to = 0;
			if (from != null)
			{
				to = from.Length;
			}
		}

		private static void Convert<TArray>(TArray[] from, out uint to)
		{
			to = 0u;
			if (from != null)
			{
				to = (uint)from.Length;
			}
		}

		private static void Convert<TArray>(ArraySegment<TArray> from, out int to)
		{
			to = from.Count;
		}

		private static void Convert<T>(ArraySegment<T> from, out uint to)
		{
			to = (uint)from.Count;
		}

		private static void Convert(int from, out bool to)
		{
			to = from != 0;
		}

		private static void Convert(bool from, out int to)
		{
			to = (from ? 1 : 0);
		}

		private static void Convert(DateTimeOffset? from, out long to)
		{
			to = -1L;
			if (from.HasValue)
			{
				DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
				long num = (from.Value.UtcDateTime - dateTime).Ticks / 10000000;
				to = num;
			}
		}

		private static void Convert(long from, out DateTimeOffset? to)
		{
			to = null;
			if (from >= 0)
			{
				DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
				long num = from * 10000000;
				to = new DateTimeOffset(dateTime.Ticks + num, TimeSpan.Zero);
			}
		}

		internal static void Get<TArray>(TArray[] from, out int to)
		{
			Convert(from, out to);
		}

		internal static void Get<TArray>(TArray[] from, out uint to)
		{
			Convert(from, out to);
		}

		internal static void Get<TArray>(ArraySegment<TArray> from, out uint to)
		{
			Convert(from, out to);
		}

		internal static void Get<TTo>(IntPtr from, out TTo to) where TTo : Handle, new()
		{
			Convert<TTo>(from, out to);
		}

		internal static void Get<TFrom, TTo>(ref TFrom from, out TTo to) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			from.Get(out to);
		}

		internal static void Get(int from, out bool to)
		{
			Convert(from, out to);
		}

		internal static void Get(bool from, out int to)
		{
			Convert(from, out to);
		}

		internal static void Get(long from, out DateTimeOffset? to)
		{
			Convert(from, out to);
		}

		internal static void Get<TTo>(IntPtr from, out TTo[] to, int arrayLength, bool isArrayItemAllocated)
		{
			GetAllocation<TTo>(from, out to, arrayLength, isArrayItemAllocated);
		}

		internal static void Get<TTo>(IntPtr from, out TTo[] to, uint arrayLength, bool isArrayItemAllocated)
		{
			GetAllocation<TTo>(from, out to, (int)arrayLength, isArrayItemAllocated);
		}

		internal static void Get<TTo>(IntPtr from, out TTo[] to, int arrayLength)
		{
			GetAllocation<TTo>(from, out to, arrayLength, !typeof(TTo).IsValueType);
		}

		internal static void Get<TTo>(IntPtr from, out TTo[] to, uint arrayLength)
		{
			GetAllocation<TTo>(from, out to, (int)arrayLength, !typeof(TTo).IsValueType);
		}

		internal static void Get(IntPtr from, out ArraySegment<byte> to, uint arrayLength)
		{
			to = default(ArraySegment<byte>);
			if (arrayLength != 0)
			{
				byte[] array = new byte[arrayLength];
				Marshal.Copy(from, array, 0, (int)arrayLength);
				to = new ArraySegment<byte>(array);
			}
		}

		internal static void GetHandle<THandle>(IntPtr from, out THandle[] to, uint arrayLength) where THandle : Handle, new()
		{
			GetAllocation<THandle>(from, out to, (int)arrayLength);
		}

		internal static void Get<TFrom, TTo>(TFrom[] from, out TTo[] to) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			to = GetDefault<TTo[]>();
			if (from != null)
			{
				to = new TTo[from.Length];
				for (int i = 0; i < from.Length; i++)
				{
					from[i].Get(out to[i]);
				}
			}
		}

		internal static void Get<TFrom, TTo>(IntPtr from, out TTo[] to, int arrayLength) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			Get(from, out TFrom[] to2, arrayLength);
			Get(to2, out to);
		}

		internal static void Get<TFrom, TTo>(IntPtr from, out TTo[] to, uint arrayLength) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			Get<TFrom, TTo>(from, out to, (int)arrayLength);
		}

		internal static void Get<TTo>(IntPtr from, out TTo? to) where TTo : struct
		{
			GetAllocation(from, out to);
		}

		internal static void Get(byte[] from, out string to)
		{
			Convert(from, out to);
		}

		internal static void Get(IntPtr from, out object to)
		{
			to = GetClientData(from);
		}

		internal static void Get(IntPtr from, out Utf8String to)
		{
			GetAllocation(from, out to);
		}

		internal static void Get<T, TEnum>(T from, out T to, TEnum currentEnum, TEnum expectedEnum)
		{
			to = GetDefault<T>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				to = from;
			}
		}

		internal static void Get<TFrom, TTo, TEnum>(ref TFrom from, out TTo to, TEnum currentEnum, TEnum expectedEnum) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			to = GetDefault<TTo>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Get<TFrom, TTo>(ref from, out to);
			}
		}

		internal static void Get<TEnum>(int from, out bool? to, TEnum currentEnum, TEnum expectedEnum)
		{
			to = GetDefault<bool?>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Convert(from, out var to2);
				to = to2;
			}
		}

		internal static void Get<TFrom, TEnum>(TFrom from, out TFrom? to, TEnum currentEnum, TEnum expectedEnum) where TFrom : struct
		{
			to = GetDefault<TFrom?>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				to = from;
			}
		}

		internal static void Get<TFrom, TEnum>(IntPtr from, out TFrom to, TEnum currentEnum, TEnum expectedEnum) where TFrom : Handle, new()
		{
			to = GetDefault<TFrom>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Get(from, out to);
			}
		}

		internal static void Get<TEnum>(IntPtr from, out IntPtr? to, TEnum currentEnum, TEnum expectedEnum)
		{
			to = GetDefault<IntPtr?>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Get(from, out to);
			}
		}

		internal static void Get<TEnum>(IntPtr from, out Utf8String to, TEnum currentEnum, TEnum expectedEnum)
		{
			to = GetDefault<Utf8String>();
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Get(from, out to);
			}
		}

		internal static void Get<TFrom, TTo>(IntPtr from, out TTo to) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			to = GetDefault<TTo>();
			Get(from, out TFrom? to2);
			if (to2.HasValue)
			{
				to2.Value.Get(out to);
			}
		}

		internal static void Get<TFrom, TTo>(IntPtr from, out TTo? to) where TFrom : struct, IGettable<TTo> where TTo : struct
		{
			to = GetDefault<TTo?>();
			Get(from, out TFrom? to2);
			if (to2.HasValue)
			{
				to2.Value.Get(out var other);
				to = other;
			}
		}

		internal static void Get<TFrom, TTo>(ref TFrom from, out TTo to, out IntPtr clientDataAddress) where TFrom : struct, ICallbackInfoInternal, IGettable<TTo> where TTo : struct
		{
			from.Get(out to);
			clientDataAddress = from.ClientDataAddress;
		}

		public static int GetAllocationCount()
		{
			return s_Allocations.Count + s_PinnedBuffers.Aggregate(0, (int acc, KeyValuePair<IntPtr, PinnedBuffer> x) => acc + x.Value.RefCount) + s_Callbacks.Count + s_ClientDatas.Count;
		}

		internal static void Copy(byte[] from, IntPtr to)
		{
			if (from != null && to != IntPtr.Zero)
			{
				Marshal.Copy(from, 0, to, from.Length);
			}
		}

		internal static void Copy(ArraySegment<byte> from, IntPtr to)
		{
			if (from.Count != 0 && to != IntPtr.Zero)
			{
				Marshal.Copy(from.Array, from.Offset, to, from.Count);
			}
		}

		internal static void Dispose(ref IntPtr value)
		{
			RemoveAllocation(ref value);
			RemovePinnedBuffer(ref value);
		}

		internal static void Dispose<TDisposable>(ref TDisposable disposable) where TDisposable : IDisposable
		{
			if (disposable != null)
			{
				disposable.Dispose();
			}
		}

		internal static void Dispose<TEnum>(ref IntPtr value, TEnum currentEnum, TEnum expectedEnum)
		{
			if ((int)(object)currentEnum == (int)(object)expectedEnum)
			{
				Dispose(ref value);
			}
		}

		private static int GetAnsiStringLength(byte[] bytes)
		{
			int num = 0;
			for (int i = 0; i < bytes.Length && bytes[i] != 0; i++)
			{
				num++;
			}
			return num;
		}

		private static int GetAnsiStringLength(IntPtr address)
		{
			int i;
			for (i = 0; Marshal.ReadByte(address, i) != 0; i++)
			{
			}
			return i;
		}

		internal static T GetDefault<T>()
		{
			return default(T);
		}

		private static void GetAllocation<T>(IntPtr source, out T target)
		{
			target = GetDefault<T>();
			if (source == IntPtr.Zero)
			{
				return;
			}
			if (TryGetAllocationCache(source, out var cache) && cache != null)
			{
				if (!(cache.GetType() == typeof(T)))
				{
					throw new CachedTypeAllocationException(source, cache.GetType(), typeof(T));
				}
				target = (T)cache;
			}
			else
			{
				target = (T)Marshal.PtrToStructure(source, typeof(T));
			}
		}

		private static void GetAllocation<T>(IntPtr source, out T? target) where T : struct
		{
			target = GetDefault<T?>();
			if (source == IntPtr.Zero)
			{
				return;
			}
			if (TryGetAllocationCache(source, out var cache) && cache != null)
			{
				if (!(cache.GetType() == typeof(T)))
				{
					throw new CachedTypeAllocationException(source, cache.GetType(), typeof(T));
				}
				target = (T?)cache;
			}
			else
			{
				target = (T?)Marshal.PtrToStructure(source, typeof(T));
			}
		}

		private static void GetAllocation<THandle>(IntPtr source, out THandle[] target, int arrayLength) where THandle : Handle, new()
		{
			target = null;
			if (source == IntPtr.Zero)
			{
				return;
			}
			if (TryGetAllocationCache(source, out var cache) && cache != null)
			{
				if (!(cache.GetType() == typeof(THandle[])))
				{
					throw new CachedTypeAllocationException(source, cache.GetType(), typeof(THandle[]));
				}
				Array array = (Array)cache;
				if (array.Length != arrayLength)
				{
					throw new CachedArrayAllocationException(source, array.Length, arrayLength);
				}
				target = array as THandle[];
			}
			else
			{
				int num = Marshal.SizeOf(typeof(IntPtr));
				List<THandle> list = new List<THandle>();
				for (int i = 0; i < arrayLength; i++)
				{
					Convert<THandle>(Marshal.ReadIntPtr(new IntPtr(source.ToInt64() + i * num)), out var to);
					list.Add(to);
				}
				target = list.ToArray();
			}
		}

		private static void GetAllocation<T>(IntPtr from, out T[] to, int arrayLength, bool isArrayItemAllocated)
		{
			to = null;
			if (from == IntPtr.Zero)
			{
				return;
			}
			if (TryGetAllocationCache(from, out var cache) && cache != null)
			{
				if (cache.GetType() == typeof(T[]))
				{
					Array array = (Array)cache;
					if (array.Length == arrayLength)
					{
						to = array as T[];
						return;
					}
					throw new CachedArrayAllocationException(from, array.Length, arrayLength);
				}
				throw new CachedTypeAllocationException(from, cache.GetType(), typeof(T[]));
			}
			int num = ((!isArrayItemAllocated) ? Marshal.SizeOf(typeof(T)) : Marshal.SizeOf(typeof(IntPtr)));
			List<T> list = new List<T>();
			for (int i = 0; i < arrayLength; i++)
			{
				IntPtr intPtr = new IntPtr(from.ToInt64() + i * num);
				if (isArrayItemAllocated)
				{
					intPtr = Marshal.ReadIntPtr(intPtr);
				}
				T target2;
				if (typeof(T) == typeof(Utf8String))
				{
					GetAllocation(intPtr, out var target);
					target2 = (T)(object)target;
				}
				else
				{
					GetAllocation(intPtr, out target2);
				}
				list.Add(target2);
			}
			to = list.ToArray();
		}

		private static void GetAllocation(IntPtr source, out Utf8String target)
		{
			target = null;
			if (!(source == IntPtr.Zero))
			{
				int ansiStringLength = GetAnsiStringLength(source);
				byte[] array = new byte[ansiStringLength + 1];
				Marshal.Copy(source, array, 0, ansiStringLength + 1);
				target = new Utf8String(array);
			}
		}

		internal static IntPtr AddAllocation(int size)
		{
			if (size == 0)
			{
				return IntPtr.Zero;
			}
			IntPtr intPtr = Marshal.AllocHGlobal(size);
			Marshal.WriteByte(intPtr, 0, 0);
			lock (s_Allocations)
			{
				s_Allocations.Add(intPtr, new Allocation(size, null));
				return intPtr;
			}
		}

		internal static IntPtr AddAllocation(uint size)
		{
			return AddAllocation((int)size);
		}

		private static IntPtr AddAllocation<T>(int size, T cache)
		{
			if (size == 0 || cache == null)
			{
				return IntPtr.Zero;
			}
			IntPtr intPtr = Marshal.AllocHGlobal(size);
			Marshal.StructureToPtr(cache, intPtr, fDeleteOld: false);
			lock (s_Allocations)
			{
				s_Allocations.Add(intPtr, new Allocation(size, cache));
				return intPtr;
			}
		}

		private static IntPtr AddAllocation<T>(int size, T[] cache, bool? isArrayItemAllocated)
		{
			if (size == 0 || cache == null)
			{
				return IntPtr.Zero;
			}
			IntPtr intPtr = Marshal.AllocHGlobal(size);
			Marshal.WriteByte(intPtr, 0, 0);
			lock (s_Allocations)
			{
				s_Allocations.Add(intPtr, new Allocation(size, cache, isArrayItemAllocated));
				return intPtr;
			}
		}

		private static IntPtr AddAllocation<T>(T[] array, bool isArrayItemAllocated)
		{
			if (array == null)
			{
				return IntPtr.Zero;
			}
			int num = ((!isArrayItemAllocated) ? Marshal.SizeOf(typeof(T)) : Marshal.SizeOf(typeof(IntPtr)));
			IntPtr result = AddAllocation(array.Length * num, array, isArrayItemAllocated);
			for (int i = 0; i < array.Length; i++)
			{
				T val = (T)array.GetValue(i);
				if (isArrayItemAllocated)
				{
					IntPtr to;
					if (typeof(T) == typeof(Utf8String))
					{
						to = AddPinnedBuffer((Utf8String)(object)val);
					}
					else if (typeof(T).BaseType == typeof(Handle))
					{
						Convert((Handle)(object)val, out to);
					}
					else
					{
						to = AddAllocation(Marshal.SizeOf(typeof(T)), val);
					}
					Marshal.StructureToPtr(ptr: new IntPtr(result.ToInt64() + i * num), structure: to, fDeleteOld: false);
				}
				else
				{
					IntPtr ptr2 = new IntPtr(result.ToInt64() + i * num);
					Marshal.StructureToPtr(val, ptr2, fDeleteOld: false);
				}
			}
			return result;
		}

		private static void RemoveAllocation(ref IntPtr address)
		{
			if (address == IntPtr.Zero)
			{
				return;
			}
			Allocation value;
			lock (s_Allocations)
			{
				if (!s_Allocations.TryGetValue(address, out value))
				{
					return;
				}
				s_Allocations.Remove(address);
			}
			if (value.IsArrayItemAllocated.HasValue)
			{
				int num = ((!value.IsArrayItemAllocated.Value) ? Marshal.SizeOf(value.Cache.GetType().GetElementType()) : Marshal.SizeOf(typeof(IntPtr)));
				Array array = value.Cache as Array;
				for (int i = 0; i < array.Length; i++)
				{
					if (value.IsArrayItemAllocated.Value)
					{
						IntPtr ptr = new IntPtr(address.ToInt64() + i * num);
						ptr = Marshal.ReadIntPtr(ptr);
						Dispose(ref ptr);
						continue;
					}
					object value2 = array.GetValue(i);
					if (value2 is IDisposable && value2 is IDisposable disposable)
					{
						disposable.Dispose();
					}
				}
			}
			if (value.Cache is IDisposable && value.Cache is IDisposable disposable2)
			{
				disposable2.Dispose();
			}
			Marshal.FreeHGlobal(address);
			address = IntPtr.Zero;
		}

		private static bool TryGetAllocationCache(IntPtr address, out object cache)
		{
			cache = null;
			lock (s_Allocations)
			{
				if (s_Allocations.TryGetValue(address, out var value))
				{
					cache = value.Cache;
					return true;
				}
			}
			return false;
		}

		private static IntPtr AddPinnedBuffer(byte[] buffer, int offset)
		{
			if (buffer == null)
			{
				return IntPtr.Zero;
			}
			GCHandle handle = GCHandle.Alloc(buffer, GCHandleType.Pinned);
			IntPtr intPtr = Marshal.UnsafeAddrOfPinnedArrayElement(buffer, offset);
			lock (s_PinnedBuffers)
			{
				if (s_PinnedBuffers.ContainsKey(intPtr))
				{
					PinnedBuffer value = s_PinnedBuffers[intPtr];
					value.RefCount++;
					s_PinnedBuffers[intPtr] = value;
				}
				else
				{
					s_PinnedBuffers.Add(intPtr, new PinnedBuffer(handle));
				}
				return intPtr;
			}
		}

		private static IntPtr AddPinnedBuffer(Utf8String str)
		{
			if (str == null || str.Bytes == null)
			{
				return IntPtr.Zero;
			}
			return AddPinnedBuffer(str.Bytes, 0);
		}

		internal static IntPtr AddPinnedBuffer(ArraySegment<byte> array)
		{
			if (array == null)
			{
				return IntPtr.Zero;
			}
			return AddPinnedBuffer(array.Array, array.Offset);
		}

		private static void RemovePinnedBuffer(ref IntPtr address)
		{
			if (address == IntPtr.Zero)
			{
				return;
			}
			lock (s_PinnedBuffers)
			{
				if (s_PinnedBuffers.TryGetValue(address, out var value))
				{
					value.RefCount--;
					if (value.RefCount == 0)
					{
						s_PinnedBuffers.Remove(address);
						value.Handle.Free();
					}
					else
					{
						s_PinnedBuffers[address] = value;
					}
				}
			}
			address = IntPtr.Zero;
		}

		internal static void Set<T>(ref T from, ref T to) where T : struct
		{
			to = from;
		}

		internal static void Set(object from, ref IntPtr to)
		{
			RemoveClientData(to);
			to = AddClientData(from);
		}

		internal static void Set(Utf8String from, ref IntPtr to)
		{
			Dispose(ref to);
			to = AddPinnedBuffer(from);
		}

		internal static void Set(Handle from, ref IntPtr to)
		{
			Convert(from, out to);
		}

		internal static void Set<T>(T? from, ref IntPtr to) where T : struct
		{
			Dispose(ref to);
			to = AddAllocation(Marshal.SizeOf(typeof(T)), from);
		}

		internal static void Set<T>(T[] from, ref IntPtr to, bool isArrayItemAllocated)
		{
			Dispose(ref to);
			to = AddAllocation(from, isArrayItemAllocated);
		}

		internal static void Set(ArraySegment<byte> from, ref IntPtr to, out uint arrayLength)
		{
			to = AddPinnedBuffer(from);
			Get(from, out arrayLength);
		}

		internal static void Set<T>(T[] from, ref IntPtr to)
		{
			Set(from, ref to, !typeof(T).IsValueType);
		}

		internal static void Set<T>(T[] from, ref IntPtr to, bool isArrayItemAllocated, out int arrayLength)
		{
			Set(from, ref to, isArrayItemAllocated);
			Get(from, out arrayLength);
		}

		internal static void Set<T>(T[] from, ref IntPtr to, bool isArrayItemAllocated, out uint arrayLength)
		{
			Set(from, ref to, isArrayItemAllocated);
			Get(from, out arrayLength);
		}

		internal static void Set<T>(T[] from, ref IntPtr to, out int arrayLength)
		{
			Set(from, ref to, !typeof(T).IsValueType, out arrayLength);
		}

		internal static void Set<T>(T[] from, ref IntPtr to, out uint arrayLength)
		{
			Set(from, ref to, !typeof(T).IsValueType, out arrayLength);
		}

		internal static void Set(DateTimeOffset? from, ref long to)
		{
			Convert(from, out to);
		}

		internal static void Set(bool from, ref int to)
		{
			Convert(from, out to);
		}

		internal static void Set(string from, ref byte[] to, int stringLength)
		{
			Convert(from, out to, stringLength);
		}

		internal static void Set<T, TEnum>(T from, ref T to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
		{
			if (from != null)
			{
				Dispose(ref disposable);
				to = from;
				toEnum = fromEnum;
			}
		}

		internal static void Set<TFrom, TEnum, TTo>(ref TFrom from, ref TTo to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null) where TFrom : struct where TTo : struct, ISettable<TFrom>
		{
			Dispose(ref disposable);
			Set(ref from, ref to);
			toEnum = fromEnum;
		}

		internal static void Set<T, TEnum>(T? from, ref T to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null) where T : struct
		{
			if (from.HasValue)
			{
				Dispose(ref disposable);
				T from2 = from.Value;
				Helper.Set<T>(ref from2, ref to);
				toEnum = fromEnum;
			}
		}

		internal static void Set<TEnum>(Handle from, ref IntPtr to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
		{
			if (from != null)
			{
				Dispose(ref to);
				Dispose(ref disposable);
				Set(from, ref to);
				toEnum = fromEnum;
			}
		}

		internal static void Set<TEnum>(Utf8String from, ref IntPtr to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
		{
			if (from != null)
			{
				Dispose(ref to);
				Dispose(ref disposable);
				Set(from, ref to);
				toEnum = fromEnum;
			}
		}

		internal static void Set<TEnum>(bool? from, ref int to, TEnum fromEnum, ref TEnum toEnum, IDisposable disposable = null)
		{
			if (from.HasValue)
			{
				Dispose(ref disposable);
				Set(from.Value, ref to);
				toEnum = fromEnum;
			}
		}

		internal static void Set<TFrom, TIntermediate>(ref TFrom from, ref IntPtr to) where TFrom : struct where TIntermediate : struct, ISettable<TFrom>
		{
			TIntermediate cache = new TIntermediate();
			cache.Set(ref from);
			Dispose(ref to);
			to = AddAllocation(Marshal.SizeOf(typeof(TIntermediate)), cache);
		}

		internal static void Set<TFrom, TIntermediate>(ref TFrom? from, ref IntPtr to) where TFrom : struct where TIntermediate : struct, ISettable<TFrom>
		{
			Dispose(ref to);
			if (from.HasValue)
			{
				TIntermediate cache = new TIntermediate();
				TFrom other = from.Value;
				cache.Set(ref other);
				to = AddAllocation(Marshal.SizeOf(typeof(TIntermediate)), cache);
			}
		}

		internal static void Set<TFrom, TTo>(ref TFrom from, ref TTo to) where TFrom : struct where TTo : struct, ISettable<TFrom>
		{
			to.Set(ref from);
		}

		internal static void Set<TFrom, TIntermediate>(ref TFrom[] from, ref IntPtr to, out int arrayLength) where TFrom : struct where TIntermediate : struct, ISettable<TFrom>
		{
			arrayLength = 0;
			if (from != null)
			{
				TIntermediate[] array = new TIntermediate[from.Length];
				for (int i = 0; i < from.Length; i++)
				{
					array[i].Set(ref from[i]);
				}
				Set(array, ref to);
				Get(from, out arrayLength);
			}
		}

		internal static void Set<TFrom, TIntermediate>(ref TFrom[] from, ref IntPtr to, out uint arrayLength) where TFrom : struct where TIntermediate : struct, ISettable<TFrom>
		{
			Set<TFrom, TIntermediate>(ref from, ref to, out int arrayLength2);
			arrayLength = (uint)arrayLength2;
		}
	}
	public static class Config
	{
		public const string LibraryName = "EOSSDK-Win64-Shipping";

		public const CallingConvention LibraryCallingConvention = CallingConvention.Cdecl;
	}
	public static class Extensions
	{
		public static bool IsOperationComplete(this Result result)
		{
			return Common.IsOperationComplete(result);
		}

		public static string ToHexString(this byte[] byteArray)
		{
			return Common.ToString(new ArraySegment<byte>(byteArray));
		}
	}
	public abstract class Handle : IEquatable<Handle>, IFormattable
	{
		public IntPtr InnerHandle { get; internal set; }

		public Handle()
		{
		}

		public Handle(IntPtr innerHandle)
		{
			InnerHandle = innerHandle;
		}

		public static bool operator ==(Handle left, Handle right)
		{
			if ((object)left == null)
			{
				if ((object)right == null)
				{
					return true;
				}
				return false;
			}
			return left.Equals(right);
		}

		public static bool operator !=(Handle left, Handle right)
		{
			return !(left == right);
		}

		public override bool Equals(object obj)
		{
			return Equals(obj as Handle);
		}

		public override int GetHashCode()
		{
			return (int)(65536 + InnerHandle.ToInt64());
		}

		public bool Equals(Handle other)
		{
			if ((object)other == null)
			{
				return false;
			}
			if ((object)this == other)
			{
				return true;
			}
			if (GetType() != other.GetType())
			{
				return false;
			}
			return InnerHandle == other.InnerHandle;
		}

		public override string ToString()
		{
			return InnerHandle.ToString();
		}

		public virtual string ToString(string format, IFormatProvider formatProvider)
		{
			if (format != null)
			{
				return InnerHandle.ToString(format);
			}
			return InnerHandle.ToString();
		}
	}
	internal class AllocationException : Exception
	{
		public AllocationException(string message)
			: base(message)
		{
		}
	}
	internal class ExternalAllocationException : AllocationException
	{
		public ExternalAllocationException(IntPtr address, Type type)
			: base(string.Format("Attempting to allocate '{0}' over externally allocated memory at {1}", type, address.ToString("X")))
		{
		}
	}
	internal class CachedTypeAllocationException : AllocationException
	{
		public CachedTypeAllocationException(IntPtr address, Type foundType, Type expectedType)
			: base(string.Format("Cached allocation is '{0}' but expected '{1}' at {2}", foundType, expectedType, address.ToString("X")))
		{
		}
	}
	internal class CachedArrayAllocationException : AllocationException
	{
		public CachedArrayAllocationException(IntPtr address, int foundLength, int expectedLength)
			: base(string.Format("Cached array allocation has length {0} but expected {1} at {2}", foundLength, expectedLength, address.ToString("X")))
		{
		}
	}
	internal class DynamicBindingException : Exception
	{
		public DynamicBindingException(string bindingName)
			: base($"Failed to hook dynamic binding for '{bindingName}'")
		{
		}
	}
	internal interface ICallbackInfo
	{
		object ClientData { get; }

		Result? GetResultCode();
	}
	internal interface ICallbackInfoInternal
	{
		IntPtr ClientDataAddress { get; }
	}
	internal interface IGettable<T> where T : struct
	{
		void Get(out T other);
	}
	internal interface ISettable<T> where T : struct
	{
		void Set(ref T other);

		void Set(ref T? other);
	}
	[AttributeUsage(AttributeTargets.Method)]
	internal sealed class MonoPInvokeCallbackAttribute : System.Attribute
	{
		public MonoPInvokeCallbackAttribute(Type type)
		{
		}
	}
	[DebuggerDisplay("{ToString()}")]
	public sealed class Utf8String
	{
		public int Length { get; private set; }

		public byte[] Bytes { get; private set; }

		private string Utf16
		{
			get
			{
				if (Length > 0)
				{
					return Encoding.UTF8.GetString(Bytes, 0, Length);
				}
				if (Bytes == null)
				{
					throw new Exception("Bytes array is null.");
				}
				if (Bytes.Length == 0 || Bytes[Bytes.Length - 1] != 0)
				{
					throw new Exception("Bytes array is not null terminated.");
				}
				return "";
			}
			set
			{
				if (value != null)
				{
					Bytes = new byte[Encoding.UTF8.GetMaxByteCount(value.Length) + 1];
					Length = Encoding.UTF8.GetBytes(value, 0, value.Length, Bytes, 0);
				}
				else
				{
					Length = 0;
				}
			}
		}

		public byte this[int index]
		{
			get
			{
				return Bytes[index];
			}
			set
			{
				Bytes[index] = value;
			}
		}

		public Utf8String()
		{
			Length = 0;
		}

		public Utf8String(byte[] bytes)
		{
			if (bytes == null)
			{
				throw new ArgumentNullException("bytes");
			}
			if (bytes.Length == 0 || bytes[^1] != 0)
			{
				throw new ArgumentException("Argument is not null terminated.", "bytes");
			}
			Bytes = bytes;
			Length = Bytes.Length - 1;
		}

		public Utf8String(string value)
		{
			Utf16 = value;
		}

		public static explicit operator Utf8String(byte[] bytes)
		{
			return new Utf8String(bytes);
		}

		public static explicit operator byte[](Utf8String u8str)
		{
			return u8str.Bytes;
		}

		public static implicit operator Utf8String(string str)
		{
			return new Utf8String(str);
		}

		public static implicit operator string(Utf8String u8str)
		{
			if (u8str != null)
			{
				return u8str.ToString();
			}
			return null;
		}

		public static Utf8String operator +(Utf8String left, Utf8String right)
		{
			byte[] array = new byte[left.Length + right.Length + 1];
			Buffer.BlockCopy(left.Bytes, 0, array, 0, left.Length);
			Buffer.BlockCopy(right.Bytes, 0, array, left.Length, right.Length + 1);
			return new Utf8String(array);
		}

		public static bool operator ==(Utf8String left, Utf8String right)
		{
			if ((object)left == null)
			{
				if ((object)right == null)
				{
					return true;
				}
				return false;
			}
			return left.Equals(right);
		}

		public static bool operator !=(Utf8String left, Utf8String right)
		{
			return !(left == right);
		}

		public override bool Equals(object obj)
		{
			if (!(obj is Utf8String utf8String))
			{
				return false;
			}
			if ((object)this == utf8String)
			{
				return true;
			}
			if (Length != utf8String.Length)
			{
				return false;
			}
			for (int i = 0; i < Length; i++)
			{
				if (this[i] != utf8String[i])
				{
					return false;
				}
			}
			return true;
		}

		public override string ToString()
		{
			return Utf16;
		}

		public override int GetHashCode()
		{
			return ToString().GetHashCode();
		}
	}
	public enum AttributeType
	{
		Boolean,
		Int64,
		Double,
		String
	}
	public static class Bindings
	{
		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Achievements_AddNotifyAchievementsUnlocked(IntPtr handle, ref AddNotifyAchievementsUnlockedOptionsInternal options, IntPtr clientData, OnAchievementsUnlockedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Achievements_AddNotifyAchievementsUnlockedV2(IntPtr handle, ref AddNotifyAchievementsUnlockedV2OptionsInternal options, IntPtr clientData, OnAchievementsUnlockedCallbackV2Internal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyAchievementDefinitionByAchievementId(IntPtr handle, ref CopyAchievementDefinitionByAchievementIdOptionsInternal options, ref IntPtr outDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyAchievementDefinitionByIndex(IntPtr handle, ref CopyAchievementDefinitionByIndexOptionsInternal options, ref IntPtr outDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyAchievementDefinitionV2ByAchievementId(IntPtr handle, ref CopyAchievementDefinitionV2ByAchievementIdOptionsInternal options, ref IntPtr outDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyAchievementDefinitionV2ByIndex(IntPtr handle, ref CopyAchievementDefinitionV2ByIndexOptionsInternal options, ref IntPtr outDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyPlayerAchievementByAchievementId(IntPtr handle, ref CopyPlayerAchievementByAchievementIdOptionsInternal options, ref IntPtr outAchievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyPlayerAchievementByIndex(IntPtr handle, ref CopyPlayerAchievementByIndexOptionsInternal options, ref IntPtr outAchievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyUnlockedAchievementByAchievementId(IntPtr handle, ref CopyUnlockedAchievementByAchievementIdOptionsInternal options, ref IntPtr outAchievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Achievements_CopyUnlockedAchievementByIndex(IntPtr handle, ref CopyUnlockedAchievementByIndexOptionsInternal options, ref IntPtr outAchievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_DefinitionV2_Release(IntPtr achievementDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_Definition_Release(IntPtr achievementDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Achievements_GetAchievementDefinitionCount(IntPtr handle, ref GetAchievementDefinitionCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Achievements_GetPlayerAchievementCount(IntPtr handle, ref GetPlayerAchievementCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Achievements_GetUnlockedAchievementCount(IntPtr handle, ref GetUnlockedAchievementCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_PlayerAchievement_Release(IntPtr achievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_QueryDefinitions(IntPtr handle, ref QueryDefinitionsOptionsInternal options, IntPtr clientData, OnQueryDefinitionsCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_QueryPlayerAchievements(IntPtr handle, ref QueryPlayerAchievementsOptionsInternal options, IntPtr clientData, OnQueryPlayerAchievementsCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_RemoveNotifyAchievementsUnlocked(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_UnlockAchievements(IntPtr handle, ref UnlockAchievementsOptionsInternal options, IntPtr clientData, OnUnlockAchievementsCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Achievements_UnlockedAchievement_Release(IntPtr achievement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_ActiveSession_CopyInfo(IntPtr handle, ref ActiveSessionCopyInfoOptionsInternal options, ref IntPtr outActiveSessionInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_ActiveSession_GetRegisteredPlayerByIndex(IntPtr handle, ref ActiveSessionGetRegisteredPlayerByIndexOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_ActiveSession_GetRegisteredPlayerCount(IntPtr handle, ref ActiveSessionGetRegisteredPlayerCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_ActiveSession_Info_Release(IntPtr activeSessionInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_ActiveSession_Release(IntPtr activeSessionHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_AddExternalIntegrityCatalog(IntPtr handle, ref AddExternalIntegrityCatalogOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatClient_AddNotifyClientIntegrityViolated(IntPtr handle, ref AddNotifyClientIntegrityViolatedOptionsInternal options, IntPtr clientData, OnClientIntegrityViolatedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatClient_AddNotifyMessageToPeer(IntPtr handle, ref AddNotifyMessageToPeerOptionsInternal options, IntPtr clientData, OnMessageToPeerCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatClient_AddNotifyMessageToServer(IntPtr handle, ref AddNotifyMessageToServerOptionsInternal options, IntPtr clientData, OnMessageToServerCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatClient_AddNotifyPeerActionRequired(IntPtr handle, ref AddNotifyPeerActionRequiredOptionsInternal options, IntPtr clientData, OnPeerActionRequiredCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatClient_AddNotifyPeerAuthStatusChanged(IntPtr handle, ref AddNotifyPeerAuthStatusChangedOptionsInternal options, IntPtr clientData, OnPeerAuthStatusChangedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_BeginSession(IntPtr handle, ref Epic.OnlineServices.AntiCheatClient.BeginSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_EndSession(IntPtr handle, ref Epic.OnlineServices.AntiCheatClient.EndSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_GetProtectMessageOutputLength(IntPtr handle, ref Epic.OnlineServices.AntiCheatClient.GetProtectMessageOutputLengthOptionsInternal options, ref uint outBufferSizeBytes);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_PollStatus(IntPtr handle, ref PollStatusOptionsInternal options, ref AntiCheatClientViolationType outViolationType, IntPtr outMessage);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_ProtectMessage(IntPtr handle, ref Epic.OnlineServices.AntiCheatClient.ProtectMessageOptionsInternal options, IntPtr outBuffer, ref uint outBytesWritten);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_ReceiveMessageFromPeer(IntPtr handle, ref ReceiveMessageFromPeerOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_ReceiveMessageFromServer(IntPtr handle, ref ReceiveMessageFromServerOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_RegisterPeer(IntPtr handle, ref RegisterPeerOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatClient_RemoveNotifyClientIntegrityViolated(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatClient_RemoveNotifyMessageToPeer(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatClient_RemoveNotifyMessageToServer(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatClient_RemoveNotifyPeerActionRequired(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatClient_RemoveNotifyPeerAuthStatusChanged(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_UnprotectMessage(IntPtr handle, ref Epic.OnlineServices.AntiCheatClient.UnprotectMessageOptionsInternal options, IntPtr outBuffer, ref uint outBytesWritten);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatClient_UnregisterPeer(IntPtr handle, ref UnregisterPeerOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatServer_AddNotifyClientActionRequired(IntPtr handle, ref AddNotifyClientActionRequiredOptionsInternal options, IntPtr clientData, OnClientActionRequiredCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatServer_AddNotifyClientAuthStatusChanged(IntPtr handle, ref AddNotifyClientAuthStatusChangedOptionsInternal options, IntPtr clientData, OnClientAuthStatusChangedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_AntiCheatServer_AddNotifyMessageToClient(IntPtr handle, ref AddNotifyMessageToClientOptionsInternal options, IntPtr clientData, OnMessageToClientCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_BeginSession(IntPtr handle, ref Epic.OnlineServices.AntiCheatServer.BeginSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_EndSession(IntPtr handle, ref Epic.OnlineServices.AntiCheatServer.EndSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_GetProtectMessageOutputLength(IntPtr handle, ref Epic.OnlineServices.AntiCheatServer.GetProtectMessageOutputLengthOptionsInternal options, ref uint outBufferSizeBytes);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogEvent(IntPtr handle, ref LogEventOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogGameRoundEnd(IntPtr handle, ref LogGameRoundEndOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogGameRoundStart(IntPtr handle, ref LogGameRoundStartOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerDespawn(IntPtr handle, ref LogPlayerDespawnOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerRevive(IntPtr handle, ref LogPlayerReviveOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerSpawn(IntPtr handle, ref LogPlayerSpawnOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerTakeDamage(IntPtr handle, ref LogPlayerTakeDamageOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerTick(IntPtr handle, ref LogPlayerTickOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerUseAbility(IntPtr handle, ref LogPlayerUseAbilityOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_LogPlayerUseWeapon(IntPtr handle, ref LogPlayerUseWeaponOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_ProtectMessage(IntPtr handle, ref Epic.OnlineServices.AntiCheatServer.ProtectMessageOptionsInternal options, IntPtr outBuffer, ref uint outBytesWritten);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_ReceiveMessageFromClient(IntPtr handle, ref ReceiveMessageFromClientOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_RegisterClient(IntPtr handle, ref RegisterClientOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_RegisterEvent(IntPtr handle, ref RegisterEventOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatServer_RemoveNotifyClientActionRequired(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatServer_RemoveNotifyClientAuthStatusChanged(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_AntiCheatServer_RemoveNotifyMessageToClient(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_SetClientDetails(IntPtr handle, ref SetClientDetailsOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_SetClientNetworkState(IntPtr handle, ref SetClientNetworkStateOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_SetGameSessionId(IntPtr handle, ref SetGameSessionIdOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_UnprotectMessage(IntPtr handle, ref Epic.OnlineServices.AntiCheatServer.UnprotectMessageOptionsInternal options, IntPtr outBuffer, ref uint outBytesWritten);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_AntiCheatServer_UnregisterClient(IntPtr handle, ref UnregisterClientOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Auth_AddNotifyLoginStatusChanged(IntPtr handle, ref Epic.OnlineServices.Auth.AddNotifyLoginStatusChangedOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Auth.OnLoginStatusChangedCallbackInternal notification);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Auth_CopyIdToken(IntPtr handle, ref Epic.OnlineServices.Auth.CopyIdTokenOptionsInternal options, ref IntPtr outIdToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Auth_CopyUserAuthToken(IntPtr handle, ref CopyUserAuthTokenOptionsInternal options, IntPtr localUserId, ref IntPtr outUserAuthToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_DeletePersistentAuth(IntPtr handle, ref DeletePersistentAuthOptionsInternal options, IntPtr clientData, OnDeletePersistentAuthCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Auth_GetLoggedInAccountByIndex(IntPtr handle, int index);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_Auth_GetLoggedInAccountsCount(IntPtr handle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern LoginStatus EOS_Auth_GetLoginStatus(IntPtr handle, IntPtr localUserId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Auth_GetMergedAccountByIndex(IntPtr handle, IntPtr localUserId, uint index);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Auth_GetMergedAccountsCount(IntPtr handle, IntPtr localUserId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Auth_GetSelectedAccountId(IntPtr handle, IntPtr localUserId, ref IntPtr outSelectedAccountId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_IdToken_Release(IntPtr idToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_LinkAccount(IntPtr handle, ref Epic.OnlineServices.Auth.LinkAccountOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Auth.OnLinkAccountCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_Login(IntPtr handle, ref Epic.OnlineServices.Auth.LoginOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Auth.OnLoginCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_Logout(IntPtr handle, ref LogoutOptionsInternal options, IntPtr clientData, OnLogoutCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_QueryIdToken(IntPtr handle, ref QueryIdTokenOptionsInternal options, IntPtr clientData, OnQueryIdTokenCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_RemoveNotifyLoginStatusChanged(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_Token_Release(IntPtr authToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_VerifyIdToken(IntPtr handle, ref Epic.OnlineServices.Auth.VerifyIdTokenOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Auth.OnVerifyIdTokenCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Auth_VerifyUserAuth(IntPtr handle, ref VerifyUserAuthOptionsInternal options, IntPtr clientData, OnVerifyUserAuthCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_ByteArray_ToString(IntPtr byteArray, uint length, IntPtr outBuffer, ref uint inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Connect_AddNotifyAuthExpiration(IntPtr handle, ref AddNotifyAuthExpirationOptionsInternal options, IntPtr clientData, OnAuthExpirationCallbackInternal notification);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Connect_AddNotifyLoginStatusChanged(IntPtr handle, ref Epic.OnlineServices.Connect.AddNotifyLoginStatusChangedOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Connect.OnLoginStatusChangedCallbackInternal notification);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_CopyIdToken(IntPtr handle, ref Epic.OnlineServices.Connect.CopyIdTokenOptionsInternal options, ref IntPtr outIdToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_CopyProductUserExternalAccountByAccountId(IntPtr handle, ref CopyProductUserExternalAccountByAccountIdOptionsInternal options, ref IntPtr outExternalAccountInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_CopyProductUserExternalAccountByAccountType(IntPtr handle, ref CopyProductUserExternalAccountByAccountTypeOptionsInternal options, ref IntPtr outExternalAccountInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_CopyProductUserExternalAccountByIndex(IntPtr handle, ref CopyProductUserExternalAccountByIndexOptionsInternal options, ref IntPtr outExternalAccountInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_CopyProductUserInfo(IntPtr handle, ref CopyProductUserInfoOptionsInternal options, ref IntPtr outExternalAccountInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_CreateDeviceId(IntPtr handle, ref CreateDeviceIdOptionsInternal options, IntPtr clientData, OnCreateDeviceIdCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_CreateUser(IntPtr handle, ref Epic.OnlineServices.Connect.CreateUserOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Connect.OnCreateUserCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_DeleteDeviceId(IntPtr handle, ref DeleteDeviceIdOptionsInternal options, IntPtr clientData, OnDeleteDeviceIdCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_ExternalAccountInfo_Release(IntPtr externalAccountInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Connect_GetExternalAccountMapping(IntPtr handle, ref GetExternalAccountMappingsOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Connect_GetLoggedInUserByIndex(IntPtr handle, int index);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_Connect_GetLoggedInUsersCount(IntPtr handle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern LoginStatus EOS_Connect_GetLoginStatus(IntPtr handle, IntPtr localUserId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Connect_GetProductUserExternalAccountCount(IntPtr handle, ref GetProductUserExternalAccountCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Connect_GetProductUserIdMapping(IntPtr handle, ref GetProductUserIdMappingOptionsInternal options, IntPtr outBuffer, ref int inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_IdToken_Release(IntPtr idToken);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_LinkAccount(IntPtr handle, ref Epic.OnlineServices.Connect.LinkAccountOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Connect.OnLinkAccountCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_Login(IntPtr handle, ref Epic.OnlineServices.Connect.LoginOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Connect.OnLoginCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_QueryExternalAccountMappings(IntPtr handle, ref QueryExternalAccountMappingsOptionsInternal options, IntPtr clientData, OnQueryExternalAccountMappingsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_QueryProductUserIdMappings(IntPtr handle, ref QueryProductUserIdMappingsOptionsInternal options, IntPtr clientData, OnQueryProductUserIdMappingsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_RemoveNotifyAuthExpiration(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_RemoveNotifyLoginStatusChanged(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_TransferDeviceIdAccount(IntPtr handle, ref TransferDeviceIdAccountOptionsInternal options, IntPtr clientData, OnTransferDeviceIdAccountCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_UnlinkAccount(IntPtr handle, ref UnlinkAccountOptionsInternal options, IntPtr clientData, OnUnlinkAccountCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Connect_VerifyIdToken(IntPtr handle, ref Epic.OnlineServices.Connect.VerifyIdTokenOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Connect.OnVerifyIdTokenCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_ContinuanceToken_ToString(IntPtr continuanceToken, IntPtr outBuffer, ref int inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_AcceptRequestToJoin(IntPtr handle, ref AcceptRequestToJoinOptionsInternal options, IntPtr clientData, OnAcceptRequestToJoinCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyCustomInviteAccepted(IntPtr handle, ref AddNotifyCustomInviteAcceptedOptionsInternal options, IntPtr clientData, OnCustomInviteAcceptedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyCustomInviteReceived(IntPtr handle, ref AddNotifyCustomInviteReceivedOptionsInternal options, IntPtr clientData, OnCustomInviteReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyCustomInviteRejected(IntPtr handle, ref AddNotifyCustomInviteRejectedOptionsInternal options, IntPtr clientData, OnCustomInviteRejectedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyRequestToJoinAccepted(IntPtr handle, ref AddNotifyRequestToJoinAcceptedOptionsInternal options, IntPtr clientData, OnRequestToJoinAcceptedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyRequestToJoinReceived(IntPtr handle, ref AddNotifyRequestToJoinReceivedOptionsInternal options, IntPtr clientData, OnRequestToJoinReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyRequestToJoinRejected(IntPtr handle, ref AddNotifyRequestToJoinRejectedOptionsInternal options, IntPtr clientData, OnRequestToJoinRejectedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifyRequestToJoinResponseReceived(IntPtr handle, ref AddNotifyRequestToJoinResponseReceivedOptionsInternal options, IntPtr clientData, OnRequestToJoinResponseReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_CustomInvites_AddNotifySendCustomNativeInviteRequested(IntPtr handle, ref AddNotifySendCustomNativeInviteRequestedOptionsInternal options, IntPtr clientData, OnSendCustomNativeInviteRequestedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_CustomInvites_FinalizeInvite(IntPtr handle, ref FinalizeInviteOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RejectRequestToJoin(IntPtr handle, ref RejectRequestToJoinOptionsInternal options, IntPtr clientData, OnRejectRequestToJoinCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyCustomInviteAccepted(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyCustomInviteReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyCustomInviteRejected(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyRequestToJoinAccepted(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyRequestToJoinReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyRequestToJoinRejected(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifyRequestToJoinResponseReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_RemoveNotifySendCustomNativeInviteRequested(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_SendCustomInvite(IntPtr handle, ref SendCustomInviteOptionsInternal options, IntPtr clientData, OnSendCustomInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_CustomInvites_SendRequestToJoin(IntPtr handle, ref SendRequestToJoinOptionsInternal options, IntPtr clientData, OnSendRequestToJoinCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_CustomInvites_SetCustomInvite(IntPtr handle, ref SetCustomInviteOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_EApplicationStatus_ToString(ApplicationStatus applicationStatus);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_ENetworkStatus_ToString(NetworkStatus networkStatus);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_EResult_IsOperationComplete(Result result);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_EResult_ToString(Result result);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_CatalogItem_Release(IntPtr catalogItem);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_CatalogOffer_Release(IntPtr catalogOffer);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_CatalogRelease_Release(IntPtr catalogRelease);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_Checkout(IntPtr handle, ref CheckoutOptionsInternal options, IntPtr clientData, OnCheckoutCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyEntitlementById(IntPtr handle, ref CopyEntitlementByIdOptionsInternal options, ref IntPtr outEntitlement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyEntitlementByIndex(IntPtr handle, ref CopyEntitlementByIndexOptionsInternal options, ref IntPtr outEntitlement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyEntitlementByNameAndIndex(IntPtr handle, ref CopyEntitlementByNameAndIndexOptionsInternal options, ref IntPtr outEntitlement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyItemById(IntPtr handle, ref CopyItemByIdOptionsInternal options, ref IntPtr outItem);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyItemImageInfoByIndex(IntPtr handle, ref CopyItemImageInfoByIndexOptionsInternal options, ref IntPtr outImageInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyItemReleaseByIndex(IntPtr handle, ref CopyItemReleaseByIndexOptionsInternal options, ref IntPtr outRelease);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyLastRedeemedEntitlementByIndex(IntPtr handle, ref CopyLastRedeemedEntitlementByIndexOptionsInternal options, IntPtr outRedeemedEntitlementId, ref int inOutRedeemedEntitlementIdLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyOfferById(IntPtr handle, ref CopyOfferByIdOptionsInternal options, ref IntPtr outOffer);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyOfferByIndex(IntPtr handle, ref CopyOfferByIndexOptionsInternal options, ref IntPtr outOffer);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyOfferImageInfoByIndex(IntPtr handle, ref CopyOfferImageInfoByIndexOptionsInternal options, ref IntPtr outImageInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyOfferItemByIndex(IntPtr handle, ref CopyOfferItemByIndexOptionsInternal options, ref IntPtr outItem);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyTransactionById(IntPtr handle, ref CopyTransactionByIdOptionsInternal options, ref IntPtr outTransaction);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_CopyTransactionByIndex(IntPtr handle, ref CopyTransactionByIndexOptionsInternal options, ref IntPtr outTransaction);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_Entitlement_Release(IntPtr entitlement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetEntitlementsByNameCount(IntPtr handle, ref GetEntitlementsByNameCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetEntitlementsCount(IntPtr handle, ref GetEntitlementsCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetItemImageInfoCount(IntPtr handle, ref GetItemImageInfoCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetItemReleaseCount(IntPtr handle, ref GetItemReleaseCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetLastRedeemedEntitlementsCount(IntPtr handle, ref GetLastRedeemedEntitlementsCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetOfferCount(IntPtr handle, ref GetOfferCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetOfferImageInfoCount(IntPtr handle, ref GetOfferImageInfoCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetOfferItemCount(IntPtr handle, ref GetOfferItemCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_GetTransactionCount(IntPtr handle, ref GetTransactionCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_KeyImageInfo_Release(IntPtr keyImageInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryEntitlementToken(IntPtr handle, ref QueryEntitlementTokenOptionsInternal options, IntPtr clientData, OnQueryEntitlementTokenCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryEntitlements(IntPtr handle, ref QueryEntitlementsOptionsInternal options, IntPtr clientData, OnQueryEntitlementsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryOffers(IntPtr handle, ref QueryOffersOptionsInternal options, IntPtr clientData, OnQueryOffersCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryOwnership(IntPtr handle, ref QueryOwnershipOptionsInternal options, IntPtr clientData, OnQueryOwnershipCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryOwnershipBySandboxIds(IntPtr handle, ref QueryOwnershipBySandboxIdsOptionsInternal options, IntPtr clientData, OnQueryOwnershipBySandboxIdsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_QueryOwnershipToken(IntPtr handle, ref QueryOwnershipTokenOptionsInternal options, IntPtr clientData, OnQueryOwnershipTokenCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_RedeemEntitlements(IntPtr handle, ref RedeemEntitlementsOptionsInternal options, IntPtr clientData, OnRedeemEntitlementsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_Transaction_CopyEntitlementByIndex(IntPtr handle, ref TransactionCopyEntitlementByIndexOptionsInternal options, ref IntPtr outEntitlement);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Ecom_Transaction_GetEntitlementsCount(IntPtr handle, ref TransactionGetEntitlementsCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Ecom_Transaction_GetTransactionId(IntPtr handle, IntPtr outBuffer, ref int inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Ecom_Transaction_Release(IntPtr transaction);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_EpicAccountId_FromString(IntPtr accountIdString);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_EpicAccountId_IsValid(IntPtr accountId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_EpicAccountId_ToString(IntPtr accountId, IntPtr outBuffer, ref int inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_AcceptInvite(IntPtr handle, ref AcceptInviteOptionsInternal options, IntPtr clientData, OnAcceptInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Friends_AddNotifyBlockedUsersUpdate(IntPtr handle, ref AddNotifyBlockedUsersUpdateOptionsInternal options, IntPtr clientData, OnBlockedUsersUpdateCallbackInternal blockedUsersUpdateHandler);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Friends_AddNotifyFriendsUpdate(IntPtr handle, ref AddNotifyFriendsUpdateOptionsInternal options, IntPtr clientData, OnFriendsUpdateCallbackInternal friendsUpdateHandler);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Friends_GetBlockedUserAtIndex(IntPtr handle, ref GetBlockedUserAtIndexOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_Friends_GetBlockedUsersCount(IntPtr handle, ref GetBlockedUsersCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_Friends_GetFriendAtIndex(IntPtr handle, ref GetFriendAtIndexOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_Friends_GetFriendsCount(IntPtr handle, ref GetFriendsCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern FriendsStatus EOS_Friends_GetStatus(IntPtr handle, ref GetStatusOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_QueryFriends(IntPtr handle, ref QueryFriendsOptionsInternal options, IntPtr clientData, OnQueryFriendsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_RejectInvite(IntPtr handle, ref Epic.OnlineServices.Friends.RejectInviteOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Friends.OnRejectInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_RemoveNotifyBlockedUsersUpdate(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_RemoveNotifyFriendsUpdate(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Friends_SendInvite(IntPtr handle, ref Epic.OnlineServices.Friends.SendInviteOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Friends.OnSendInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_GetVersion();

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Initialize(ref InitializeOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_IntegratedPlatformOptionsContainer_Add(IntPtr handle, ref IntegratedPlatformOptionsContainerAddOptionsInternal inOptions);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_IntegratedPlatformOptionsContainer_Release(IntPtr integratedPlatformOptionsContainerHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_IntegratedPlatform_AddNotifyUserLoginStatusChanged(IntPtr handle, ref AddNotifyUserLoginStatusChangedOptionsInternal options, IntPtr clientData, OnUserLoginStatusChangedCallbackInternal callbackFunction);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_IntegratedPlatform_ClearUserPreLogoutCallback(IntPtr handle, ref ClearUserPreLogoutCallbackOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_IntegratedPlatform_CreateIntegratedPlatformOptionsContainer(ref CreateIntegratedPlatformOptionsContainerOptionsInternal options, ref IntPtr outIntegratedPlatformOptionsContainerHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_IntegratedPlatform_FinalizeDeferredUserLogout(IntPtr handle, ref FinalizeDeferredUserLogoutOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_IntegratedPlatform_RemoveNotifyUserLoginStatusChanged(IntPtr handle, ulong notificationId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_IntegratedPlatform_SetUserLoginStatus(IntPtr handle, ref SetUserLoginStatusOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_IntegratedPlatform_SetUserPreLogoutCallback(IntPtr handle, ref SetUserPreLogoutCallbackOptionsInternal options, IntPtr clientData, OnUserPreLogoutCallbackInternal callbackFunction);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_KWS_AddNotifyPermissionsUpdateReceived(IntPtr handle, ref AddNotifyPermissionsUpdateReceivedOptionsInternal options, IntPtr clientData, OnPermissionsUpdateReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_KWS_CopyPermissionByIndex(IntPtr handle, ref CopyPermissionByIndexOptionsInternal options, ref IntPtr outPermission);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_CreateUser(IntPtr handle, ref Epic.OnlineServices.KWS.CreateUserOptionsInternal options, IntPtr clientData, Epic.OnlineServices.KWS.OnCreateUserCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_KWS_GetPermissionByKey(IntPtr handle, ref GetPermissionByKeyOptionsInternal options, ref KWSPermissionStatus outPermission);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern int EOS_KWS_GetPermissionsCount(IntPtr handle, ref GetPermissionsCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_PermissionStatus_Release(IntPtr permissionStatus);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_QueryAgeGate(IntPtr handle, ref QueryAgeGateOptionsInternal options, IntPtr clientData, OnQueryAgeGateCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_QueryPermissions(IntPtr handle, ref QueryPermissionsOptionsInternal options, IntPtr clientData, OnQueryPermissionsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_RemoveNotifyPermissionsUpdateReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_RequestPermissions(IntPtr handle, ref RequestPermissionsOptionsInternal options, IntPtr clientData, OnRequestPermissionsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_KWS_UpdateParentEmail(IntPtr handle, ref UpdateParentEmailOptionsInternal options, IntPtr clientData, OnUpdateParentEmailCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardDefinitionByIndex(IntPtr handle, ref CopyLeaderboardDefinitionByIndexOptionsInternal options, ref IntPtr outLeaderboardDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardDefinitionByLeaderboardId(IntPtr handle, ref CopyLeaderboardDefinitionByLeaderboardIdOptionsInternal options, ref IntPtr outLeaderboardDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardRecordByIndex(IntPtr handle, ref CopyLeaderboardRecordByIndexOptionsInternal options, ref IntPtr outLeaderboardRecord);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardRecordByUserId(IntPtr handle, ref CopyLeaderboardRecordByUserIdOptionsInternal options, ref IntPtr outLeaderboardRecord);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardUserScoreByIndex(IntPtr handle, ref CopyLeaderboardUserScoreByIndexOptionsInternal options, ref IntPtr outLeaderboardUserScore);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Leaderboards_CopyLeaderboardUserScoreByUserId(IntPtr handle, ref CopyLeaderboardUserScoreByUserIdOptionsInternal options, ref IntPtr outLeaderboardUserScore);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_Definition_Release(IntPtr leaderboardDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Leaderboards_GetLeaderboardDefinitionCount(IntPtr handle, ref GetLeaderboardDefinitionCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Leaderboards_GetLeaderboardRecordCount(IntPtr handle, ref GetLeaderboardRecordCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Leaderboards_GetLeaderboardUserScoreCount(IntPtr handle, ref GetLeaderboardUserScoreCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_LeaderboardDefinition_Release(IntPtr leaderboardDefinition);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_LeaderboardRecord_Release(IntPtr leaderboardRecord);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_LeaderboardUserScore_Release(IntPtr leaderboardUserScore);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_QueryLeaderboardDefinitions(IntPtr handle, ref QueryLeaderboardDefinitionsOptionsInternal options, IntPtr clientData, OnQueryLeaderboardDefinitionsCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_QueryLeaderboardRanks(IntPtr handle, ref QueryLeaderboardRanksOptionsInternal options, IntPtr clientData, OnQueryLeaderboardRanksCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Leaderboards_QueryLeaderboardUserScores(IntPtr handle, ref QueryLeaderboardUserScoresOptionsInternal options, IntPtr clientData, OnQueryLeaderboardUserScoresCompleteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyAttributeByIndex(IntPtr handle, ref LobbyDetailsCopyAttributeByIndexOptionsInternal options, ref IntPtr outAttribute);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyAttributeByKey(IntPtr handle, ref LobbyDetailsCopyAttributeByKeyOptionsInternal options, ref IntPtr outAttribute);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyInfo(IntPtr handle, ref LobbyDetailsCopyInfoOptionsInternal options, ref IntPtr outLobbyDetailsInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyMemberAttributeByIndex(IntPtr handle, ref LobbyDetailsCopyMemberAttributeByIndexOptionsInternal options, ref IntPtr outAttribute);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyMemberAttributeByKey(IntPtr handle, ref LobbyDetailsCopyMemberAttributeByKeyOptionsInternal options, ref IntPtr outAttribute);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyDetails_CopyMemberInfo(IntPtr handle, ref LobbyDetailsCopyMemberInfoOptionsInternal options, ref IntPtr outLobbyDetailsMemberInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_LobbyDetails_GetAttributeCount(IntPtr handle, ref LobbyDetailsGetAttributeCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_LobbyDetails_GetLobbyOwner(IntPtr handle, ref LobbyDetailsGetLobbyOwnerOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_LobbyDetails_GetMemberAttributeCount(IntPtr handle, ref LobbyDetailsGetMemberAttributeCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern IntPtr EOS_LobbyDetails_GetMemberByIndex(IntPtr handle, ref LobbyDetailsGetMemberByIndexOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_LobbyDetails_GetMemberCount(IntPtr handle, ref LobbyDetailsGetMemberCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbyDetails_Info_Release(IntPtr lobbyDetailsInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbyDetails_MemberInfo_Release(IntPtr lobbyDetailsMemberInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbyDetails_Release(IntPtr lobbyHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_AddAttribute(IntPtr handle, ref LobbyModificationAddAttributeOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_AddMemberAttribute(IntPtr handle, ref LobbyModificationAddMemberAttributeOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbyModification_Release(IntPtr lobbyModificationHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_RemoveAttribute(IntPtr handle, ref LobbyModificationRemoveAttributeOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_RemoveMemberAttribute(IntPtr handle, ref LobbyModificationRemoveMemberAttributeOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_SetAllowedPlatformIds(IntPtr handle, ref LobbyModificationSetAllowedPlatformIdsOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_SetBucketId(IntPtr handle, ref LobbyModificationSetBucketIdOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_SetInvitesAllowed(IntPtr handle, ref LobbyModificationSetInvitesAllowedOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_SetMaxMembers(IntPtr handle, ref LobbyModificationSetMaxMembersOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbyModification_SetPermissionLevel(IntPtr handle, ref LobbyModificationSetPermissionLevelOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_CopySearchResultByIndex(IntPtr handle, ref LobbySearchCopySearchResultByIndexOptionsInternal options, ref IntPtr outLobbyDetailsHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbySearch_Find(IntPtr handle, ref LobbySearchFindOptionsInternal options, IntPtr clientData, LobbySearchOnFindCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_LobbySearch_GetSearchResultCount(IntPtr handle, ref LobbySearchGetSearchResultCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_LobbySearch_Release(IntPtr lobbySearchHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_RemoveParameter(IntPtr handle, ref LobbySearchRemoveParameterOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_SetLobbyId(IntPtr handle, ref LobbySearchSetLobbyIdOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_SetMaxResults(IntPtr handle, ref LobbySearchSetMaxResultsOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_SetParameter(IntPtr handle, ref LobbySearchSetParameterOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_LobbySearch_SetTargetUserId(IntPtr handle, ref LobbySearchSetTargetUserIdOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyJoinLobbyAccepted(IntPtr handle, ref AddNotifyJoinLobbyAcceptedOptionsInternal options, IntPtr clientData, OnJoinLobbyAcceptedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLeaveLobbyRequested(IntPtr handle, ref AddNotifyLeaveLobbyRequestedOptionsInternal options, IntPtr clientData, OnLeaveLobbyRequestedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyInviteAccepted(IntPtr handle, ref AddNotifyLobbyInviteAcceptedOptionsInternal options, IntPtr clientData, OnLobbyInviteAcceptedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyInviteReceived(IntPtr handle, ref AddNotifyLobbyInviteReceivedOptionsInternal options, IntPtr clientData, OnLobbyInviteReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyInviteRejected(IntPtr handle, ref AddNotifyLobbyInviteRejectedOptionsInternal options, IntPtr clientData, OnLobbyInviteRejectedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyMemberStatusReceived(IntPtr handle, ref AddNotifyLobbyMemberStatusReceivedOptionsInternal options, IntPtr clientData, OnLobbyMemberStatusReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyMemberUpdateReceived(IntPtr handle, ref AddNotifyLobbyMemberUpdateReceivedOptionsInternal options, IntPtr clientData, OnLobbyMemberUpdateReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyLobbyUpdateReceived(IntPtr handle, ref AddNotifyLobbyUpdateReceivedOptionsInternal options, IntPtr clientData, OnLobbyUpdateReceivedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifyRTCRoomConnectionChanged(IntPtr handle, ref AddNotifyRTCRoomConnectionChangedOptionsInternal options, IntPtr clientData, OnRTCRoomConnectionChangedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern ulong EOS_Lobby_AddNotifySendLobbyNativeInviteRequested(IntPtr handle, ref AddNotifySendLobbyNativeInviteRequestedOptionsInternal options, IntPtr clientData, OnSendLobbyNativeInviteRequestedCallbackInternal notificationFn);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_Attribute_Release(IntPtr lobbyAttribute);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_CopyLobbyDetailsHandle(IntPtr handle, ref CopyLobbyDetailsHandleOptionsInternal options, ref IntPtr outLobbyDetailsHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_CopyLobbyDetailsHandleByInviteId(IntPtr handle, ref CopyLobbyDetailsHandleByInviteIdOptionsInternal options, ref IntPtr outLobbyDetailsHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_CopyLobbyDetailsHandleByUiEventId(IntPtr handle, ref CopyLobbyDetailsHandleByUiEventIdOptionsInternal options, ref IntPtr outLobbyDetailsHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_CreateLobby(IntPtr handle, ref CreateLobbyOptionsInternal options, IntPtr clientData, OnCreateLobbyCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_CreateLobbySearch(IntPtr handle, ref CreateLobbySearchOptionsInternal options, ref IntPtr outLobbySearchHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_DestroyLobby(IntPtr handle, ref DestroyLobbyOptionsInternal options, IntPtr clientData, OnDestroyLobbyCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_GetConnectString(IntPtr handle, ref GetConnectStringOptionsInternal options, IntPtr outBuffer, ref uint inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern uint EOS_Lobby_GetInviteCount(IntPtr handle, ref Epic.OnlineServices.Lobby.GetInviteCountOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_GetInviteIdByIndex(IntPtr handle, ref Epic.OnlineServices.Lobby.GetInviteIdByIndexOptionsInternal options, IntPtr outBuffer, ref int inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_GetRTCRoomName(IntPtr handle, ref GetRTCRoomNameOptionsInternal options, IntPtr outBuffer, ref uint inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_HardMuteMember(IntPtr handle, ref HardMuteMemberOptionsInternal options, IntPtr clientData, OnHardMuteMemberCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_IsRTCRoomConnected(IntPtr handle, ref IsRTCRoomConnectedOptionsInternal options, ref int bOutIsConnected);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_JoinLobby(IntPtr handle, ref JoinLobbyOptionsInternal options, IntPtr clientData, OnJoinLobbyCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_JoinLobbyById(IntPtr handle, ref JoinLobbyByIdOptionsInternal options, IntPtr clientData, OnJoinLobbyByIdCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_KickMember(IntPtr handle, ref KickMemberOptionsInternal options, IntPtr clientData, OnKickMemberCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_LeaveLobby(IntPtr handle, ref LeaveLobbyOptionsInternal options, IntPtr clientData, OnLeaveLobbyCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_ParseConnectString(IntPtr handle, ref ParseConnectStringOptionsInternal options, IntPtr outBuffer, ref uint inOutBufferLength);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_PromoteMember(IntPtr handle, ref PromoteMemberOptionsInternal options, IntPtr clientData, OnPromoteMemberCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_QueryInvites(IntPtr handle, ref Epic.OnlineServices.Lobby.QueryInvitesOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Lobby.OnQueryInvitesCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RejectInvite(IntPtr handle, ref Epic.OnlineServices.Lobby.RejectInviteOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Lobby.OnRejectInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyJoinLobbyAccepted(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLeaveLobbyRequested(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyInviteAccepted(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyInviteReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyInviteRejected(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyMemberStatusReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyMemberUpdateReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyLobbyUpdateReceived(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifyRTCRoomConnectionChanged(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_RemoveNotifySendLobbyNativeInviteRequested(IntPtr handle, ulong inId);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_SendInvite(IntPtr handle, ref Epic.OnlineServices.Lobby.SendInviteOptionsInternal options, IntPtr clientData, Epic.OnlineServices.Lobby.OnSendInviteCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Lobby_UpdateLobby(IntPtr handle, ref UpdateLobbyOptionsInternal options, IntPtr clientData, OnUpdateLobbyCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Lobby_UpdateLobbyModification(IntPtr handle, ref UpdateLobbyModificationOptionsInternal options, ref IntPtr outLobbyModificationHandle);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Logging_SetCallback(LogMessageFuncInternal callback);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Logging_SetLogLevel(LogCategory logCategory, LogLevel logLevel);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Metrics_BeginPlayerSession(IntPtr handle, ref BeginPlayerSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Metrics_EndPlayerSession(IntPtr handle, ref EndPlayerSessionOptionsInternal options);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_Mods_CopyModInfo(IntPtr handle, ref CopyModInfoOptionsInternal options, ref IntPtr outEnumeratedMods);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Mods_EnumerateMods(IntPtr handle, ref EnumerateModsOptionsInternal options, IntPtr clientData, OnEnumerateModsCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Mods_InstallMod(IntPtr handle, ref InstallModOptionsInternal options, IntPtr clientData, OnInstallModCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Mods_ModInfo_Release(IntPtr modInfo);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Mods_UninstallMod(IntPtr handle, ref UninstallModOptionsInternal options, IntPtr clientData, OnUninstallModCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern void EOS_Mods_UpdateMod(IntPtr handle, ref UpdateModOptionsInternal options, IntPtr clientData, OnUpdateModCallbackInternal completionDelegate);

		[DllImport("EOSSDK-Win64-Shipping")]
		internal static extern Result EOS_P2P_AcceptConnection(IntPtr handle, ref AcceptConnectionOptionsInternal options);

		[DllImpo

Facepunch.Steamworks.dll

Decompiled 2 weeks ago
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Sockets;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Facepunch.Steamworks;
using Facepunch.Steamworks.Callbacks;
using Facepunch.Steamworks.Interop;
using SteamNative;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
namespace SteamNative
{
	[StructLayout(LayoutKind.Sequential)]
	internal class Callback
	{
		internal enum Flags : byte
		{
			Registered = 1,
			GameServer
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1)]
		public class VTable
		{
			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate void ResultD(IntPtr pvParam);

			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate void ResultWithInfoD(IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall);

			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate int GetSizeD();

			public ResultD ResultA;

			public ResultWithInfoD ResultB;

			public GetSizeD GetSize;
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1)]
		public class VTableWin
		{
			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate void ResultD(IntPtr pvParam);

			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate void ResultWithInfoD(IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall);

			[UnmanagedFunctionPointer(CallingConvention.StdCall)]
			public delegate int GetSizeD();

			public ResultWithInfoD ResultB;

			public ResultD ResultA;

			public GetSizeD GetSize;
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1)]
		public class VTableThis
		{
			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate void ResultD(IntPtr thisptr, IntPtr pvParam);

			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate void ResultWithInfoD(IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall);

			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate int GetSizeD(IntPtr thisptr);

			public ResultD ResultA;

			public ResultWithInfoD ResultB;

			public GetSizeD GetSize;
		}

		[StructLayout(LayoutKind.Sequential, Pack = 1)]
		public class VTableWinThis
		{
			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate void ResultD(IntPtr thisptr, IntPtr pvParam);

			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate void ResultWithInfoD(IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall);

			[UnmanagedFunctionPointer(CallingConvention.ThisCall)]
			public delegate int GetSizeD(IntPtr thisptr);

			public ResultWithInfoD ResultB;

			public ResultD ResultA;

			public GetSizeD GetSize;
		}

		public IntPtr vTablePtr;

		public byte CallbackFlags;

		public int CallbackId;
	}
	internal class CallbackHandle : IDisposable
	{
		internal BaseSteamworks Steamworks;

		internal GCHandle FuncA;

		internal GCHandle FuncB;

		internal GCHandle FuncC;

		internal IntPtr vTablePtr;

		internal GCHandle PinnedCallback;

		public virtual bool IsValid => true;

		internal CallbackHandle(BaseSteamworks steamworks)
		{
			Steamworks = steamworks;
		}

		public void Dispose()
		{
			UnregisterCallback();
			if (FuncA.IsAllocated)
			{
				FuncA.Free();
			}
			if (FuncB.IsAllocated)
			{
				FuncB.Free();
			}
			if (FuncC.IsAllocated)
			{
				FuncC.Free();
			}
			if (PinnedCallback.IsAllocated)
			{
				PinnedCallback.Free();
			}
			if (vTablePtr != IntPtr.Zero)
			{
				Marshal.FreeHGlobal(vTablePtr);
				vTablePtr = IntPtr.Zero;
			}
		}

		private void UnregisterCallback()
		{
			if (PinnedCallback.IsAllocated)
			{
				Steamworks.native.api.SteamAPI_UnregisterCallback(PinnedCallback.AddrOfPinnedObject());
			}
		}
	}
	internal abstract class CallResult : CallbackHandle
	{
		internal SteamAPICall_t Call;

		public override bool IsValid => (ulong)Call != 0;

		internal CallResult(BaseSteamworks steamworks, SteamAPICall_t call)
			: base(steamworks)
		{
			Call = call;
		}

		internal void Try()
		{
			bool pbFailed = false;
			if (Steamworks.native.utils.IsAPICallCompleted(Call, ref pbFailed))
			{
				Steamworks.UnregisterCallResult(this);
				RunCallback();
			}
		}

		internal abstract void RunCallback();
	}
	internal class CallResult<T> : CallResult
	{
		internal delegate T ConvertFromPointer(IntPtr p);

		private static byte[] resultBuffer = new byte[16384];

		private Action<T, bool> CallbackFunction;

		private ConvertFromPointer ConvertFromPointerFunction;

		internal int ResultSize = -1;

		internal int CallbackId;

		internal CallResult(BaseSteamworks steamworks, SteamAPICall_t call, Action<T, bool> callbackFunction, ConvertFromPointer fromPointer, int resultSize, int callbackId)
			: base(steamworks, call)
		{
			ResultSize = resultSize;
			CallbackId = callbackId;
			CallbackFunction = callbackFunction;
			ConvertFromPointerFunction = fromPointer;
			Steamworks.RegisterCallResult(this);
		}

		public override string ToString()
		{
			return $"CallResult( {typeof(T).Name}, {CallbackId}, {ResultSize}b )";
		}

		internal unsafe override void RunCallback()
		{
			bool pbFailed = false;
			fixed (byte* ptr = resultBuffer)
			{
				if (!Steamworks.native.utils.GetAPICallResult(Call, (IntPtr)ptr, resultBuffer.Length, CallbackId, ref pbFailed) || pbFailed)
				{
					CallbackFunction(default(T), arg2: true);
					return;
				}
				T arg = ConvertFromPointerFunction((IntPtr)ptr);
				CallbackFunction(arg, arg2: false);
			}
		}
	}
	internal class MonoPInvokeCallbackAttribute : Attribute
	{
	}
	internal static class CallbackIdentifiers
	{
		public const int SteamUser = 100;

		public const int SteamGameServer = 200;

		public const int SteamFriends = 300;

		public const int SteamBilling = 400;

		public const int SteamMatchmaking = 500;

		public const int SteamContentServer = 600;

		public const int SteamUtils = 700;

		public const int ClientFriends = 800;

		public const int ClientUser = 900;

		public const int SteamApps = 1000;

		public const int SteamUserStats = 1100;

		public const int SteamNetworking = 1200;

		public const int ClientRemoteStorage = 1300;

		public const int ClientDepotBuilder = 1400;

		public const int SteamGameServerItems = 1500;

		public const int ClientUtils = 1600;

		public const int SteamGameCoordinator = 1700;

		public const int SteamGameServerStats = 1800;

		public const int Steam2Async = 1900;

		public const int SteamGameStats = 2000;

		public const int ClientHTTP = 2100;

		public const int ClientScreenshots = 2200;

		public const int SteamScreenshots = 2300;

		public const int ClientAudio = 2400;

		public const int ClientUnifiedMessages = 2500;

		public const int SteamStreamLauncher = 2600;

		public const int ClientController = 2700;

		public const int SteamController = 2800;

		public const int ClientParentalSettings = 2900;

		public const int ClientDeviceAuth = 3000;

		public const int ClientNetworkDeviceManager = 3100;

		public const int ClientMusic = 3200;

		public const int ClientRemoteClientManager = 3300;

		public const int ClientUGC = 3400;

		public const int SteamStreamClient = 3500;

		public const int ClientProductBuilder = 3600;

		public const int ClientShortcuts = 3700;

		public const int ClientRemoteControlManager = 3800;

		public const int SteamAppList = 3900;

		public const int SteamMusic = 4000;

		public const int SteamMusicRemote = 4100;

		public const int ClientVR = 4200;

		public const int ClientGameNotification = 4300;

		public const int SteamGameNotification = 4400;

		public const int SteamHTMLSurface = 4500;

		public const int ClientVideo = 4600;

		public const int ClientInventory = 4700;

		public const int ClientBluetoothManager = 4800;

		public const int ClientSharedConnection = 4900;

		public const int SteamParentalSettings = 5000;

		public const int ClientShader = 5100;
	}
	internal static class Defines
	{
		internal const string STEAMAPPLIST_INTERFACE_VERSION = "STEAMAPPLIST_INTERFACE_VERSION001";

		internal const string STEAMAPPS_INTERFACE_VERSION = "STEAMAPPS_INTERFACE_VERSION008";

		internal const string STEAMAPPTICKET_INTERFACE_VERSION = "STEAMAPPTICKET_INTERFACE_VERSION001";

		internal const string STEAMCONTROLLER_INTERFACE_VERSION = "SteamController006";

		internal const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends015";

		internal const string STEAMGAMECOORDINATOR_INTERFACE_VERSION = "SteamGameCoordinator001";

		internal const string STEAMGAMESERVER_INTERFACE_VERSION = "SteamGameServer012";

		internal const string STEAMGAMESERVERSTATS_INTERFACE_VERSION = "SteamGameServerStats001";

		internal const string STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_004";

		internal const string STEAMHTTP_INTERFACE_VERSION = "STEAMHTTP_INTERFACE_VERSION002";

		internal const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V002";

		internal const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009";

		internal const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002";

		internal const string STEAMMUSIC_INTERFACE_VERSION = "STEAMMUSIC_INTERFACE_VERSION001";

		internal const string STEAMMUSICREMOTE_INTERFACE_VERSION = "STEAMMUSICREMOTE_INTERFACE_VERSION001";

		internal const string STEAMNETWORKING_INTERFACE_VERSION = "SteamNetworking005";

		internal const string STEAMPARENTALSETTINGS_INTERFACE_VERSION = "STEAMPARENTALSETTINGS_INTERFACE_VERSION001";

		internal const string STEAMREMOTESTORAGE_INTERFACE_VERSION = "STEAMREMOTESTORAGE_INTERFACE_VERSION014";

		internal const string STEAMSCREENSHOTS_INTERFACE_VERSION = "STEAMSCREENSHOTS_INTERFACE_VERSION003";

		internal const string STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION010";

		internal const string STEAMUSER_INTERFACE_VERSION = "SteamUser019";

		internal const string STEAMUSERSTATS_INTERFACE_VERSION = "STEAMUSERSTATS_INTERFACE_VERSION011";

		internal const string STEAMUTILS_INTERFACE_VERSION = "SteamUtils009";

		internal const string STEAMVIDEO_INTERFACE_VERSION = "STEAMVIDEO_INTERFACE_V002";
	}
	internal enum Universe
	{
		Invalid,
		Public,
		Beta,
		Internal,
		Dev,
		Max
	}
	internal enum Result
	{
		OK = 1,
		Fail = 2,
		NoConnection = 3,
		InvalidPassword = 5,
		LoggedInElsewhere = 6,
		InvalidProtocolVer = 7,
		InvalidParam = 8,
		FileNotFound = 9,
		Busy = 10,
		InvalidState = 11,
		InvalidName = 12,
		InvalidEmail = 13,
		DuplicateName = 14,
		AccessDenied = 15,
		Timeout = 16,
		Banned = 17,
		AccountNotFound = 18,
		InvalidSteamID = 19,
		ServiceUnavailable = 20,
		NotLoggedOn = 21,
		Pending = 22,
		EncryptionFailure = 23,
		InsufficientPrivilege = 24,
		LimitExceeded = 25,
		Revoked = 26,
		Expired = 27,
		AlreadyRedeemed = 28,
		DuplicateRequest = 29,
		AlreadyOwned = 30,
		IPNotFound = 31,
		PersistFailed = 32,
		LockingFailed = 33,
		LogonSessionReplaced = 34,
		ConnectFailed = 35,
		HandshakeFailed = 36,
		IOFailure = 37,
		RemoteDisconnect = 38,
		ShoppingCartNotFound = 39,
		Blocked = 40,
		Ignored = 41,
		NoMatch = 42,
		AccountDisabled = 43,
		ServiceReadOnly = 44,
		AccountNotFeatured = 45,
		AdministratorOK = 46,
		ContentVersion = 47,
		TryAnotherCM = 48,
		PasswordRequiredToKickSession = 49,
		AlreadyLoggedInElsewhere = 50,
		Suspended = 51,
		Cancelled = 52,
		DataCorruption = 53,
		DiskFull = 54,
		RemoteCallFailed = 55,
		PasswordUnset = 56,
		ExternalAccountUnlinked = 57,
		PSNTicketInvalid = 58,
		ExternalAccountAlreadyLinked = 59,
		RemoteFileConflict = 60,
		IllegalPassword = 61,
		SameAsPreviousValue = 62,
		AccountLogonDenied = 63,
		CannotUseOldPassword = 64,
		InvalidLoginAuthCode = 65,
		AccountLogonDeniedNoMail = 66,
		HardwareNotCapableOfIPT = 67,
		IPTInitError = 68,
		ParentalControlRestricted = 69,
		FacebookQueryError = 70,
		ExpiredLoginAuthCode = 71,
		IPLoginRestrictionFailed = 72,
		AccountLockedDown = 73,
		AccountLogonDeniedVerifiedEmailRequired = 74,
		NoMatchingURL = 75,
		BadResponse = 76,
		RequirePasswordReEntry = 77,
		ValueOutOfRange = 78,
		UnexpectedError = 79,
		Disabled = 80,
		InvalidCEGSubmission = 81,
		RestrictedDevice = 82,
		RegionLocked = 83,
		RateLimitExceeded = 84,
		AccountLoginDeniedNeedTwoFactor = 85,
		ItemDeleted = 86,
		AccountLoginDeniedThrottle = 87,
		TwoFactorCodeMismatch = 88,
		TwoFactorActivationCodeMismatch = 89,
		AccountAssociatedToMultiplePartners = 90,
		NotModified = 91,
		NoMobileDevice = 92,
		TimeNotSynced = 93,
		SmsCodeFailed = 94,
		AccountLimitExceeded = 95,
		AccountActivityLimitExceeded = 96,
		PhoneActivityLimitExceeded = 97,
		RefundToWallet = 98,
		EmailSendFailure = 99,
		NotSettled = 100,
		NeedCaptcha = 101,
		GSLTDenied = 102,
		GSOwnerDenied = 103,
		InvalidItemType = 104,
		IPBanned = 105,
		GSLTExpired = 106,
		InsufficientFunds = 107,
		TooManyPending = 108,
		NoSiteLicensesFound = 109,
		WGNetworkSendExceeded = 110,
		AccountNotFriends = 111,
		LimitedUserAccount = 112
	}
	internal enum VoiceResult
	{
		OK,
		NotInitialized,
		NotRecording,
		NoData,
		BufferTooSmall,
		DataCorrupted,
		Restricted,
		UnsupportedCodec,
		ReceiverOutOfDate,
		ReceiverDidNotAnswer
	}
	internal enum DenyReason
	{
		Invalid,
		InvalidVersion,
		Generic,
		NotLoggedOn,
		NoLicense,
		Cheater,
		LoggedInElseWhere,
		UnknownText,
		IncompatibleAnticheat,
		MemoryCorruption,
		IncompatibleSoftware,
		SteamConnectionLost,
		SteamConnectionError,
		SteamResponseTimedOut,
		SteamValidationStalled,
		SteamOwnerLeftGuestUser
	}
	internal enum BeginAuthSessionResult
	{
		OK,
		InvalidTicket,
		DuplicateRequest,
		InvalidVersion,
		GameMismatch,
		ExpiredTicket
	}
	internal enum AuthSessionResponse
	{
		OK,
		UserNotConnectedToSteam,
		NoLicenseOrExpired,
		VACBanned,
		LoggedInElseWhere,
		VACCheckTimedOut,
		AuthTicketCanceled,
		AuthTicketInvalidAlreadyUsed,
		AuthTicketInvalid,
		PublisherIssuedBan
	}
	internal enum UserHasLicenseForAppResult
	{
		HasLicense,
		DoesNotHaveLicense,
		NoAuth
	}
	internal enum AccountType
	{
		Invalid,
		Individual,
		Multiseat,
		GameServer,
		AnonGameServer,
		Pending,
		ContentServer,
		Clan,
		Chat,
		ConsoleUser,
		AnonUser,
		Max
	}
	internal enum AppReleaseState
	{
		Unknown,
		Unavailable,
		Prerelease,
		PreloadOnly,
		Released
	}
	internal enum AppOwnershipFlags
	{
		None = 0,
		OwnsLicense = 1,
		FreeLicense = 2,
		RegionRestricted = 4,
		LowViolence = 8,
		InvalidPlatform = 0x10,
		SharedLicense = 0x20,
		FreeWeekend = 0x40,
		RetailLicense = 0x80,
		LicenseLocked = 0x100,
		LicensePending = 0x200,
		LicenseExpired = 0x400,
		LicensePermanent = 0x800,
		LicenseRecurring = 0x1000,
		LicenseCanceled = 0x2000,
		AutoGrant = 0x4000,
		PendingGift = 0x8000,
		RentalNotActivated = 0x10000,
		Rental = 0x20000,
		SiteLicense = 0x40000
	}
	internal enum AppType
	{
		Invalid = 0,
		Game = 1,
		Application = 2,
		Tool = 4,
		Demo = 8,
		Media_DEPRECATED = 16,
		DLC = 32,
		Guide = 64,
		Driver = 128,
		Config = 256,
		Hardware = 512,
		Franchise = 1024,
		Video = 2048,
		Plugin = 4096,
		Music = 8192,
		Series = 16384,
		Comic = 32768,
		Shortcut = 1073741824,
		DepotOnly = int.MinValue
	}
	internal enum SteamUserStatType
	{
		INVALID,
		INT,
		FLOAT,
		AVGRATE,
		ACHIEVEMENTS,
		GROUPACHIEVEMENTS,
		MAX
	}
	internal enum ChatEntryType
	{
		Invalid = 0,
		ChatMsg = 1,
		Typing = 2,
		InviteGame = 3,
		Emote = 4,
		LeftConversation = 6,
		Entered = 7,
		WasKicked = 8,
		WasBanned = 9,
		Disconnected = 10,
		HistoricalChat = 11,
		LinkBlocked = 14
	}
	internal enum ChatRoomEnterResponse
	{
		Success = 1,
		DoesntExist = 2,
		NotAllowed = 3,
		Full = 4,
		Error = 5,
		Banned = 6,
		Limited = 7,
		ClanDisabled = 8,
		CommunityBan = 9,
		MemberBlockedYou = 10,
		YouBlockedMember = 11,
		RatelimitExceeded = 15
	}
	internal enum ChatSteamIDInstanceFlags
	{
		AccountInstanceMask = 4095,
		InstanceFlagClan = 524288,
		InstanceFlagLobby = 262144,
		InstanceFlagMMSLobby = 131072
	}
	internal enum MarketingMessageFlags
	{
		None = 0,
		HighPriority = 1,
		PlatformWindows = 2,
		PlatformMac = 4,
		PlatformLinux = 8,
		PlatformRestrictions = 14
	}
	internal enum NotificationPosition
	{
		TopLeft,
		TopRight,
		BottomLeft,
		BottomRight
	}
	internal enum BroadcastUploadResult
	{
		None,
		OK,
		InitFailed,
		FrameFailed,
		Timeout,
		BandwidthExceeded,
		LowFPS,
		MissingKeyFrames,
		NoConnection,
		RelayFailed,
		SettingsChanged,
		MissingAudio,
		TooFarBehind,
		TranscodeBehind
	}
	internal enum LaunchOptionType
	{
		None = 0,
		Default = 1,
		SafeMode = 2,
		Multiplayer = 3,
		Config = 4,
		OpenVR = 5,
		Server = 6,
		Editor = 7,
		Manual = 8,
		Benchmark = 9,
		Option1 = 10,
		Option2 = 11,
		Option3 = 12,
		OculusVR = 13,
		OpenVROverlay = 14,
		OSVR = 15,
		Dialog = 1000
	}
	internal enum VRHMDType
	{
		None = -1,
		Unknown = 0,
		HTC_Dev = 1,
		HTC_VivePre = 2,
		HTC_Vive = 3,
		HTC_Unknown = 20,
		Oculus_DK1 = 21,
		Oculus_DK2 = 22,
		Oculus_Rift = 23,
		Oculus_Unknown = 40,
		Acer_Unknown = 50,
		Acer_WindowsMR = 51,
		Dell_Unknown = 60,
		Dell_Visor = 61,
		Lenovo_Unknown = 70,
		Lenovo_Explorer = 71,
		HP_Unknown = 80,
		HP_WindowsMR = 81,
		Samsung_Unknown = 90,
		Samsung_Odyssey = 91,
		Unannounced_Unknown = 100,
		Unannounced_WindowsMR = 101
	}
	internal enum GameIDType
	{
		App,
		GameMod,
		Shortcut,
		P2P
	}
	internal enum FailureType
	{
		FlushedCallbackQueue,
		PipeFail
	}
	internal enum FriendRelationship
	{
		None,
		Blocked,
		RequestRecipient,
		Friend,
		RequestInitiator,
		Ignored,
		IgnoredFriend,
		Suggested_DEPRECATED,
		Max
	}
	internal enum PersonaState
	{
		Offline,
		Online,
		Busy,
		Away,
		Snooze,
		LookingToTrade,
		LookingToPlay,
		Max
	}
	internal enum FriendFlags
	{
		None = 0,
		Blocked = 1,
		FriendshipRequested = 2,
		Immediate = 4,
		ClanMember = 8,
		OnGameServer = 16,
		RequestingFriendship = 128,
		RequestingInfo = 256,
		Ignored = 512,
		IgnoredFriend = 1024,
		ChatMember = 4096,
		All = 65535
	}
	internal enum UserRestriction
	{
		None = 0,
		Unknown = 1,
		AnyChat = 2,
		VoiceChat = 4,
		GroupChat = 8,
		Rating = 0x10,
		GameInvites = 0x20,
		Trading = 0x40
	}
	internal enum OverlayToStoreFlag
	{
		None,
		AddToCart,
		AddToCartAndShow
	}
	internal enum PersonaChange
	{
		Name = 1,
		Status = 2,
		ComeOnline = 4,
		GoneOffline = 8,
		GamePlayed = 0x10,
		GameServer = 0x20,
		Avatar = 0x40,
		JoinedSource = 0x80,
		LeftSource = 0x100,
		RelationshipChanged = 0x200,
		NameFirstSet = 0x400,
		FacebookInfo = 0x800,
		Nickname = 0x1000,
		SteamLevel = 0x2000
	}
	internal enum SteamAPICallFailure
	{
		None = -1,
		SteamGone,
		NetworkFailure,
		InvalidHandle,
		MismatchedCallback
	}
	internal enum GamepadTextInputMode
	{
		Normal,
		Password
	}
	internal enum GamepadTextInputLineMode
	{
		SingleLine,
		MultipleLines
	}
	internal enum CheckFileSignature
	{
		InvalidSignature,
		ValidSignature,
		FileNotFound,
		NoSignaturesFoundForThisApp,
		NoSignaturesFoundForThisFile
	}
	internal enum MatchMakingServerResponse
	{
		ServerResponded,
		ServerFailedToRespond,
		NoServersListedOnMasterServer
	}
	internal enum LobbyType
	{
		Private,
		FriendsOnly,
		Public,
		Invisible
	}
	internal enum LobbyComparison
	{
		EqualToOrLessThan = -2,
		LessThan,
		Equal,
		GreaterThan,
		EqualToOrGreaterThan,
		NotEqual
	}
	internal enum LobbyDistanceFilter
	{
		Close,
		Default,
		Far,
		Worldwide
	}
	internal enum ChatMemberStateChange
	{
		Entered = 1,
		Left = 2,
		Disconnected = 4,
		Kicked = 8,
		Banned = 0x10
	}
	internal enum RemoteStoragePlatform
	{
		None = 0,
		Windows = 1,
		OSX = 2,
		PS3 = 4,
		Linux = 8,
		Reserved2 = 16,
		All = -1
	}
	internal enum RemoteStoragePublishedFileVisibility
	{
		Public,
		FriendsOnly,
		Private
	}
	internal enum WorkshopFileType
	{
		First = 0,
		Community = 0,
		Microtransaction = 1,
		Collection = 2,
		Art = 3,
		Video = 4,
		Screenshot = 5,
		Game = 6,
		Software = 7,
		Concept = 8,
		WebGuide = 9,
		IntegratedGuide = 10,
		Merch = 11,
		ControllerBinding = 12,
		SteamworksAccessInvite = 13,
		SteamVideo = 14,
		GameManagedItem = 15,
		Max = 16
	}
	internal enum WorkshopVote
	{
		Unvoted,
		For,
		Against,
		Later
	}
	internal enum WorkshopFileAction
	{
		Played,
		Completed
	}
	internal enum WorkshopEnumerationType
	{
		RankedByVote,
		Recent,
		Trending,
		FavoritesOfFriends,
		VotedByFriends,
		ContentByFriends,
		RecentFromFollowedUsers
	}
	internal enum WorkshopVideoProvider
	{
		None,
		Youtube
	}
	internal enum UGCReadAction
	{
		ontinueReadingUntilFinished,
		ontinueReading,
		lose
	}
	internal enum LeaderboardDataRequest
	{
		Global,
		GlobalAroundUser,
		Friends,
		Users
	}
	internal enum LeaderboardSortMethod
	{
		None,
		Ascending,
		Descending
	}
	internal enum LeaderboardDisplayType
	{
		None,
		Numeric,
		TimeSeconds,
		TimeMilliSeconds
	}
	internal enum LeaderboardUploadScoreMethod
	{
		None,
		KeepBest,
		ForceUpdate
	}
	internal enum RegisterActivationCodeResult
	{
		ResultOK,
		ResultFail,
		ResultAlreadyRegistered,
		ResultTimeout,
		AlreadyOwned
	}
	internal enum P2PSessionError
	{
		None,
		NotRunningApp,
		NoRightsToApp,
		DestinationNotLoggedIn,
		Timeout,
		Max
	}
	internal enum P2PSend
	{
		Unreliable,
		UnreliableNoDelay,
		Reliable,
		ReliableWithBuffering
	}
	internal enum SNetSocketState
	{
		Invalid = 0,
		Connected = 1,
		Initiated = 10,
		LocalCandidatesFound = 11,
		ReceivedRemoteCandidates = 12,
		ChallengeHandshake = 15,
		Disconnecting = 21,
		LocalDisconnect = 22,
		TimeoutDuringConnect = 23,
		RemoteEndDisconnected = 24,
		ConnectionBroken = 25
	}
	internal enum SNetSocketConnectionType
	{
		NotConnected,
		UDP,
		UDPRelay
	}
	internal enum VRScreenshotType
	{
		None,
		Mono,
		Stereo,
		MonoCubemap,
		MonoPanorama,
		StereoPanorama
	}
	internal enum AudioPlayback_Status
	{
		Undefined,
		Playing,
		Paused,
		Idle
	}
	internal enum HTTPMethod
	{
		Invalid,
		GET,
		HEAD,
		POST,
		PUT,
		DELETE,
		OPTIONS,
		PATCH
	}
	internal enum HTTPStatusCode
	{
		Invalid = 0,
		HTTPStatusCode100Continue = 100,
		HTTPStatusCode101SwitchingProtocols = 101,
		HTTPStatusCode200OK = 200,
		HTTPStatusCode201Created = 201,
		HTTPStatusCode202Accepted = 202,
		HTTPStatusCode203NonAuthoritative = 203,
		HTTPStatusCode204NoContent = 204,
		HTTPStatusCode205ResetContent = 205,
		HTTPStatusCode206PartialContent = 206,
		HTTPStatusCode300MultipleChoices = 300,
		HTTPStatusCode301MovedPermanently = 301,
		HTTPStatusCode302Found = 302,
		HTTPStatusCode303SeeOther = 303,
		HTTPStatusCode304NotModified = 304,
		HTTPStatusCode305UseProxy = 305,
		HTTPStatusCode307TemporaryRedirect = 307,
		HTTPStatusCode400BadRequest = 400,
		HTTPStatusCode401Unauthorized = 401,
		HTTPStatusCode402PaymentRequired = 402,
		HTTPStatusCode403Forbidden = 403,
		HTTPStatusCode404NotFound = 404,
		HTTPStatusCode405MethodNotAllowed = 405,
		HTTPStatusCode406NotAcceptable = 406,
		HTTPStatusCode407ProxyAuthRequired = 407,
		HTTPStatusCode408RequestTimeout = 408,
		HTTPStatusCode409Conflict = 409,
		HTTPStatusCode410Gone = 410,
		HTTPStatusCode411LengthRequired = 411,
		HTTPStatusCode412PreconditionFailed = 412,
		HTTPStatusCode413RequestEntityTooLarge = 413,
		HTTPStatusCode414RequestURITooLong = 414,
		HTTPStatusCode415UnsupportedMediaType = 415,
		HTTPStatusCode416RequestedRangeNotSatisfiable = 416,
		HTTPStatusCode417ExpectationFailed = 417,
		HTTPStatusCode4xxUnknown = 418,
		HTTPStatusCode429TooManyRequests = 429,
		HTTPStatusCode500InternalServerError = 500,
		HTTPStatusCode501NotImplemented = 501,
		HTTPStatusCode502BadGateway = 502,
		HTTPStatusCode503ServiceUnavailable = 503,
		HTTPStatusCode504GatewayTimeout = 504,
		HTTPStatusCode505HTTPVersionNotSupported = 505,
		HTTPStatusCode5xxUnknown = 599
	}
	internal enum SteamControllerPad
	{
		Left,
		Right
	}
	internal enum ControllerSource
	{
		None,
		LeftTrackpad,
		RightTrackpad,
		Joystick,
		ABXY,
		Switch,
		LeftTrigger,
		RightTrigger,
		Gyro,
		CenterTrackpad,
		RightJoystick,
		DPad,
		Key,
		Mouse,
		Count
	}
	internal enum ControllerSourceMode
	{
		None,
		Dpad,
		Buttons,
		FourButtons,
		AbsoluteMouse,
		RelativeMouse,
		JoystickMove,
		JoystickMouse,
		JoystickCamera,
		ScrollWheel,
		Trigger,
		TouchMenu,
		MouseJoystick,
		MouseRegion,
		RadialMenu,
		SingleButton,
		Switches
	}
	internal enum ControllerActionOrigin
	{
		None,
		A,
		B,
		X,
		Y,
		LeftBumper,
		RightBumper,
		LeftGrip,
		RightGrip,
		Start,
		Back,
		LeftPad_Touch,
		LeftPad_Swipe,
		LeftPad_Click,
		LeftPad_DPadNorth,
		LeftPad_DPadSouth,
		LeftPad_DPadWest,
		LeftPad_DPadEast,
		RightPad_Touch,
		RightPad_Swipe,
		RightPad_Click,
		RightPad_DPadNorth,
		RightPad_DPadSouth,
		RightPad_DPadWest,
		RightPad_DPadEast,
		LeftTrigger_Pull,
		LeftTrigger_Click,
		RightTrigger_Pull,
		RightTrigger_Click,
		LeftStick_Move,
		LeftStick_Click,
		LeftStick_DPadNorth,
		LeftStick_DPadSouth,
		LeftStick_DPadWest,
		LeftStick_DPadEast,
		Gyro_Move,
		Gyro_Pitch,
		Gyro_Yaw,
		Gyro_Roll,
		PS4_X,
		PS4_Circle,
		PS4_Triangle,
		PS4_Square,
		PS4_LeftBumper,
		PS4_RightBumper,
		PS4_Options,
		PS4_Share,
		PS4_LeftPad_Touch,
		PS4_LeftPad_Swipe,
		PS4_LeftPad_Click,
		PS4_LeftPad_DPadNorth,
		PS4_LeftPad_DPadSouth,
		PS4_LeftPad_DPadWest,
		PS4_LeftPad_DPadEast,
		PS4_RightPad_Touch,
		PS4_RightPad_Swipe,
		PS4_RightPad_Click,
		PS4_RightPad_DPadNorth,
		PS4_RightPad_DPadSouth,
		PS4_RightPad_DPadWest,
		PS4_RightPad_DPadEast,
		PS4_CenterPad_Touch,
		PS4_CenterPad_Swipe,
		PS4_CenterPad_Click,
		PS4_CenterPad_DPadNorth,
		PS4_CenterPad_DPadSouth,
		PS4_CenterPad_DPadWest,
		PS4_CenterPad_DPadEast,
		PS4_LeftTrigger_Pull,
		PS4_LeftTrigger_Click,
		PS4_RightTrigger_Pull,
		PS4_RightTrigger_Click,
		PS4_LeftStick_Move,
		PS4_LeftStick_Click,
		PS4_LeftStick_DPadNorth,
		PS4_LeftStick_DPadSouth,
		PS4_LeftStick_DPadWest,
		PS4_LeftStick_DPadEast,
		PS4_RightStick_Move,
		PS4_RightStick_Click,
		PS4_RightStick_DPadNorth,
		PS4_RightStick_DPadSouth,
		PS4_RightStick_DPadWest,
		PS4_RightStick_DPadEast,
		PS4_DPad_North,
		PS4_DPad_South,
		PS4_DPad_West,
		PS4_DPad_East,
		PS4_Gyro_Move,
		PS4_Gyro_Pitch,
		PS4_Gyro_Yaw,
		PS4_Gyro_Roll,
		XBoxOne_A,
		XBoxOne_B,
		XBoxOne_X,
		XBoxOne_Y,
		XBoxOne_LeftBumper,
		XBoxOne_RightBumper,
		XBoxOne_Menu,
		XBoxOne_View,
		XBoxOne_LeftTrigger_Pull,
		XBoxOne_LeftTrigger_Click,
		XBoxOne_RightTrigger_Pull,
		XBoxOne_RightTrigger_Click,
		XBoxOne_LeftStick_Move,
		XBoxOne_LeftStick_Click,
		XBoxOne_LeftStick_DPadNorth,
		XBoxOne_LeftStick_DPadSouth,
		XBoxOne_LeftStick_DPadWest,
		XBoxOne_LeftStick_DPadEast,
		XBoxOne_RightStick_Move,
		XBoxOne_RightStick_Click,
		XBoxOne_RightStick_DPadNorth,
		XBoxOne_RightStick_DPadSouth,
		XBoxOne_RightStick_DPadWest,
		XBoxOne_RightStick_DPadEast,
		XBoxOne_DPad_North,
		XBoxOne_DPad_South,
		XBoxOne_DPad_West,
		XBoxOne_DPad_East,
		XBox360_A,
		XBox360_B,
		XBox360_X,
		XBox360_Y,
		XBox360_LeftBumper,
		XBox360_RightBumper,
		XBox360_Start,
		XBox360_Back,
		XBox360_LeftTrigger_Pull,
		XBox360_LeftTrigger_Click,
		XBox360_RightTrigger_Pull,
		XBox360_RightTrigger_Click,
		XBox360_LeftStick_Move,
		XBox360_LeftStick_Click,
		XBox360_LeftStick_DPadNorth,
		XBox360_LeftStick_DPadSouth,
		XBox360_LeftStick_DPadWest,
		XBox360_LeftStick_DPadEast,
		XBox360_RightStick_Move,
		XBox360_RightStick_Click,
		XBox360_RightStick_DPadNorth,
		XBox360_RightStick_DPadSouth,
		XBox360_RightStick_DPadWest,
		XBox360_RightStick_DPadEast,
		XBox360_DPad_North,
		XBox360_DPad_South,
		XBox360_DPad_West,
		XBox360_DPad_East,
		SteamV2_A,
		SteamV2_B,
		SteamV2_X,
		SteamV2_Y,
		SteamV2_LeftBumper,
		SteamV2_RightBumper,
		SteamV2_LeftGrip,
		SteamV2_RightGrip,
		SteamV2_LeftGrip_Upper,
		SteamV2_RightGrip_Upper,
		SteamV2_LeftBumper_Pressure,
		SteamV2_RightBumper_Pressure,
		SteamV2_LeftGrip_Pressure,
		SteamV2_RightGrip_Pressure,
		SteamV2_LeftGrip_Upper_Pressure,
		SteamV2_RightGrip_Upper_Pressure,
		SteamV2_Start,
		SteamV2_Back,
		SteamV2_LeftPad_Touch,
		SteamV2_LeftPad_Swipe,
		SteamV2_LeftPad_Click,
		SteamV2_LeftPad_Pressure,
		SteamV2_LeftPad_DPadNorth,
		SteamV2_LeftPad_DPadSouth,
		SteamV2_LeftPad_DPadWest,
		SteamV2_LeftPad_DPadEast,
		SteamV2_RightPad_Touch,
		SteamV2_RightPad_Swipe,
		SteamV2_RightPad_Click,
		SteamV2_RightPad_Pressure,
		SteamV2_RightPad_DPadNorth,
		SteamV2_RightPad_DPadSouth,
		SteamV2_RightPad_DPadWest,
		SteamV2_RightPad_DPadEast,
		SteamV2_LeftTrigger_Pull,
		SteamV2_LeftTrigger_Click,
		SteamV2_RightTrigger_Pull,
		SteamV2_RightTrigger_Click,
		SteamV2_LeftStick_Move,
		SteamV2_LeftStick_Click,
		SteamV2_LeftStick_DPadNorth,
		SteamV2_LeftStick_DPadSouth,
		SteamV2_LeftStick_DPadWest,
		SteamV2_LeftStick_DPadEast,
		SteamV2_Gyro_Move,
		SteamV2_Gyro_Pitch,
		SteamV2_Gyro_Yaw,
		SteamV2_Gyro_Roll,
		Count
	}
	internal enum SteamControllerLEDFlag
	{
		SetColor,
		RestoreUserDefault
	}
	internal enum SteamInputType
	{
		Unknown,
		SteamController,
		XBox360Controller,
		XBoxOneController,
		GenericXInput,
		PS4Controller
	}
	internal enum UGCMatchingUGCType
	{
		Items = 0,
		Items_Mtx = 1,
		Items_ReadyToUse = 2,
		Collections = 3,
		Artwork = 4,
		Videos = 5,
		Screenshots = 6,
		AllGuides = 7,
		WebGuides = 8,
		IntegratedGuides = 9,
		UsableInGame = 10,
		ControllerBindings = 11,
		GameManagedItems = 12,
		All = -1
	}
	internal enum UserUGCList
	{
		Published,
		VotedOn,
		VotedUp,
		VotedDown,
		WillVoteLater,
		Favorited,
		Subscribed,
		UsedOrPlayed,
		Followed
	}
	internal enum UserUGCListSortOrder
	{
		CreationOrderDesc,
		CreationOrderAsc,
		TitleAsc,
		LastUpdatedDesc,
		SubscriptionDateDesc,
		VoteScoreDesc,
		ForModeration
	}
	internal enum UGCQuery
	{
		RankedByVote,
		RankedByPublicationDate,
		AcceptedForGameRankedByAcceptanceDate,
		RankedByTrend,
		FavoritedByFriendsRankedByPublicationDate,
		CreatedByFriendsRankedByPublicationDate,
		RankedByNumTimesReported,
		CreatedByFollowedUsersRankedByPublicationDate,
		NotYetRated,
		RankedByTotalVotesAsc,
		RankedByVotesUp,
		RankedByTextSearch,
		RankedByTotalUniqueSubscriptions,
		RankedByPlaytimeTrend,
		RankedByTotalPlaytime,
		RankedByAveragePlaytimeTrend,
		RankedByLifetimeAveragePlaytime,
		RankedByPlaytimeSessionsTrend,
		RankedByLifetimePlaytimeSessions
	}
	internal enum ItemUpdateStatus
	{
		Invalid,
		PreparingConfig,
		PreparingContent,
		UploadingContent,
		UploadingPreviewFile,
		CommittingChanges
	}
	internal enum ItemState
	{
		None = 0,
		Subscribed = 1,
		LegacyItem = 2,
		Installed = 4,
		NeedsUpdate = 8,
		Downloading = 0x10,
		DownloadPending = 0x20
	}
	internal enum ItemStatistic
	{
		NumSubscriptions,
		NumFavorites,
		NumFollowers,
		NumUniqueSubscriptions,
		NumUniqueFavorites,
		NumUniqueFollowers,
		NumUniqueWebsiteViews,
		ReportScore,
		NumSecondsPlayed,
		NumPlaytimeSessions,
		NumComments,
		NumSecondsPlayedDuringTimePeriod,
		NumPlaytimeSessionsDuringTimePeriod
	}
	internal enum ItemPreviewType
	{
		Image = 0,
		YouTubeVideo = 1,
		Sketchfab = 2,
		EnvironmentMap_HorizontalCross = 3,
		EnvironmentMap_LatLong = 4,
		ReservedMax = 255
	}
	internal enum HTMLMouseButton
	{
		Left,
		Right,
		Middle
	}
	internal enum MouseCursor
	{
		user,
		none,
		arrow,
		ibeam,
		hourglass,
		waitarrow,
		crosshair,
		up,
		sizenw,
		sizese,
		sizene,
		sizesw,
		sizew,
		sizee,
		sizen,
		sizes,
		sizewe,
		sizens,
		sizeall,
		no,
		hand,
		blank,
		middle_pan,
		north_pan,
		north_east_pan,
		east_pan,
		south_east_pan,
		south_pan,
		south_west_pan,
		west_pan,
		north_west_pan,
		alias,
		cell,
		colresize,
		copycur,
		verticaltext,
		rowresize,
		zoomin,
		zoomout,
		help,
		custom,
		last
	}
	internal enum HTMLKeyModifiers
	{
		None = 0,
		AltDown = 1,
		CtrlDown = 2,
		ShiftDown = 4
	}
	internal enum SteamItemFlags
	{
		NoTrade = 1,
		Removed = 0x100,
		Consumed = 0x200
	}
	internal enum ParentalFeature
	{
		Invalid,
		Store,
		Community,
		Profile,
		Friends,
		News,
		Trading,
		Settings,
		Console,
		Browser,
		ParentalSetup,
		Library,
		Test,
		Max
	}
	internal static class Helpers
	{
		private static StringBuilder[] StringBuilderPool;

		private static int StringBuilderPoolIndex;

		public static StringBuilder TakeStringBuilder()
		{
			if (StringBuilderPool == null)
			{
				StringBuilderPool = new StringBuilder[8];
				for (int i = 0; i < StringBuilderPool.Length; i++)
				{
					StringBuilderPool[i] = new StringBuilder(4096);
				}
			}
			StringBuilderPoolIndex++;
			if (StringBuilderPoolIndex >= StringBuilderPool.Length)
			{
				StringBuilderPoolIndex = 0;
			}
			StringBuilderPool[StringBuilderPoolIndex].Capacity = 4096;
			StringBuilderPool[StringBuilderPoolIndex].Length = 0;
			return StringBuilderPool[StringBuilderPoolIndex];
		}
	}
	internal static class Platform
	{
		internal interface Interface : IDisposable
		{
			bool IsValid { get; }

			uint ISteamAppList_GetNumInstalledApps();

			uint ISteamAppList_GetInstalledApps(IntPtr pvecAppID, uint unMaxAppIDs);

			int ISteamAppList_GetAppName(uint nAppID, StringBuilder pchName, int cchNameMax);

			int ISteamAppList_GetAppInstallDir(uint nAppID, StringBuilder pchDirectory, int cchNameMax);

			int ISteamAppList_GetAppBuildId(uint nAppID);

			bool ISteamApps_BIsSubscribed();

			bool ISteamApps_BIsLowViolence();

			bool ISteamApps_BIsCybercafe();

			bool ISteamApps_BIsVACBanned();

			IntPtr ISteamApps_GetCurrentGameLanguage();

			IntPtr ISteamApps_GetAvailableGameLanguages();

			bool ISteamApps_BIsSubscribedApp(uint appID);

			bool ISteamApps_BIsDlcInstalled(uint appID);

			uint ISteamApps_GetEarliestPurchaseUnixTime(uint nAppID);

			bool ISteamApps_BIsSubscribedFromFreeWeekend();

			int ISteamApps_GetDLCCount();

			bool ISteamApps_BGetDLCDataByIndex(int iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool pbAvailable, StringBuilder pchName, int cchNameBufferSize);

			void ISteamApps_InstallDLC(uint nAppID);

			void ISteamApps_UninstallDLC(uint nAppID);

			void ISteamApps_RequestAppProofOfPurchaseKey(uint nAppID);

			bool ISteamApps_GetCurrentBetaName(StringBuilder pchName, int cchNameBufferSize);

			bool ISteamApps_MarkContentCorrupt([MarshalAs(UnmanagedType.U1)] bool bMissingFilesOnly);

			uint ISteamApps_GetInstalledDepots(uint appID, IntPtr pvecDepots, uint cMaxDepots);

			uint ISteamApps_GetAppInstallDir(uint appID, StringBuilder pchFolder, uint cchFolderBufferSize);

			bool ISteamApps_BIsAppInstalled(uint appID);

			CSteamID ISteamApps_GetAppOwner();

			IntPtr ISteamApps_GetLaunchQueryParam(string pchKey);

			bool ISteamApps_GetDlcDownloadProgress(uint nAppID, out ulong punBytesDownloaded, out ulong punBytesTotal);

			int ISteamApps_GetAppBuildId();

			void ISteamApps_RequestAllProofOfPurchaseKeys();

			SteamAPICall_t ISteamApps_GetFileDetails(string pszFileName);

			HSteamPipe ISteamClient_CreateSteamPipe();

			bool ISteamClient_BReleaseSteamPipe(int hSteamPipe);

			HSteamUser ISteamClient_ConnectToGlobalUser(int hSteamPipe);

			HSteamUser ISteamClient_CreateLocalUser(out int phSteamPipe, AccountType eAccountType);

			void ISteamClient_ReleaseUser(int hSteamPipe, int hUser);

			IntPtr ISteamClient_GetISteamUser(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamGameServer(int hSteamUser, int hSteamPipe, string pchVersion);

			void ISteamClient_SetLocalIPBinding(uint unIP, ushort usPort);

			IntPtr ISteamClient_GetISteamFriends(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamUtils(int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamMatchmaking(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamMatchmakingServers(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamGenericInterface(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamUserStats(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamGameServerStats(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamApps(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamNetworking(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamRemoteStorage(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamScreenshots(int hSteamuser, int hSteamPipe, string pchVersion);

			uint ISteamClient_GetIPCCallCount();

			void ISteamClient_SetWarningMessageHook(IntPtr pFunction);

			bool ISteamClient_BShutdownIfAllPipesClosed();

			IntPtr ISteamClient_GetISteamHTTP(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamController(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamUGC(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamAppList(int hSteamUser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamMusic(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamMusicRemote(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamHTMLSurface(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamInventory(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamVideo(int hSteamuser, int hSteamPipe, string pchVersion);

			IntPtr ISteamClient_GetISteamParentalSettings(int hSteamuser, int hSteamPipe, string pchVersion);

			bool ISteamController_Init();

			bool ISteamController_Shutdown();

			void ISteamController_RunFrame();

			int ISteamController_GetConnectedControllers(IntPtr handlesOut);

			bool ISteamController_ShowBindingPanel(ulong controllerHandle);

			ControllerActionSetHandle_t ISteamController_GetActionSetHandle(string pszActionSetName);

			void ISteamController_ActivateActionSet(ulong controllerHandle, ulong actionSetHandle);

			ControllerActionSetHandle_t ISteamController_GetCurrentActionSet(ulong controllerHandle);

			void ISteamController_ActivateActionSetLayer(ulong controllerHandle, ulong actionSetLayerHandle);

			void ISteamController_DeactivateActionSetLayer(ulong controllerHandle, ulong actionSetLayerHandle);

			void ISteamController_DeactivateAllActionSetLayers(ulong controllerHandle);

			int ISteamController_GetActiveActionSetLayers(ulong controllerHandle, IntPtr handlesOut);

			ControllerDigitalActionHandle_t ISteamController_GetDigitalActionHandle(string pszActionName);

			ControllerDigitalActionData_t ISteamController_GetDigitalActionData(ulong controllerHandle, ulong digitalActionHandle);

			int ISteamController_GetDigitalActionOrigins(ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin originsOut);

			ControllerAnalogActionHandle_t ISteamController_GetAnalogActionHandle(string pszActionName);

			ControllerAnalogActionData_t ISteamController_GetAnalogActionData(ulong controllerHandle, ulong analogActionHandle);

			int ISteamController_GetAnalogActionOrigins(ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin originsOut);

			void ISteamController_StopAnalogActionMomentum(ulong controllerHandle, ulong eAction);

			void ISteamController_TriggerHapticPulse(ulong controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec);

			void ISteamController_TriggerRepeatedHapticPulse(ulong controllerHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags);

			void ISteamController_TriggerVibration(ulong controllerHandle, ushort usLeftSpeed, ushort usRightSpeed);

			void ISteamController_SetLEDColor(ulong controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags);

			int ISteamController_GetGamepadIndexForController(ulong ulControllerHandle);

			ControllerHandle_t ISteamController_GetControllerForGamepadIndex(int nIndex);

			ControllerMotionData_t ISteamController_GetMotionData(ulong controllerHandle);

			bool ISteamController_ShowDigitalActionOrigins(ulong controllerHandle, ulong digitalActionHandle, float flScale, float flXPosition, float flYPosition);

			bool ISteamController_ShowAnalogActionOrigins(ulong controllerHandle, ulong analogActionHandle, float flScale, float flXPosition, float flYPosition);

			IntPtr ISteamController_GetStringForActionOrigin(ControllerActionOrigin eOrigin);

			IntPtr ISteamController_GetGlyphForActionOrigin(ControllerActionOrigin eOrigin);

			SteamInputType ISteamController_GetInputTypeForHandle(ulong controllerHandle);

			IntPtr ISteamFriends_GetPersonaName();

			SteamAPICall_t ISteamFriends_SetPersonaName(string pchPersonaName);

			PersonaState ISteamFriends_GetPersonaState();

			int ISteamFriends_GetFriendCount(int iFriendFlags);

			CSteamID ISteamFriends_GetFriendByIndex(int iFriend, int iFriendFlags);

			FriendRelationship ISteamFriends_GetFriendRelationship(ulong steamIDFriend);

			PersonaState ISteamFriends_GetFriendPersonaState(ulong steamIDFriend);

			IntPtr ISteamFriends_GetFriendPersonaName(ulong steamIDFriend);

			bool ISteamFriends_GetFriendGamePlayed(ulong steamIDFriend, ref FriendGameInfo_t pFriendGameInfo);

			IntPtr ISteamFriends_GetFriendPersonaNameHistory(ulong steamIDFriend, int iPersonaName);

			int ISteamFriends_GetFriendSteamLevel(ulong steamIDFriend);

			IntPtr ISteamFriends_GetPlayerNickname(ulong steamIDPlayer);

			int ISteamFriends_GetFriendsGroupCount();

			FriendsGroupID_t ISteamFriends_GetFriendsGroupIDByIndex(int iFG);

			IntPtr ISteamFriends_GetFriendsGroupName(short friendsGroupID);

			int ISteamFriends_GetFriendsGroupMembersCount(short friendsGroupID);

			void ISteamFriends_GetFriendsGroupMembersList(short friendsGroupID, IntPtr pOutSteamIDMembers, int nMembersCount);

			bool ISteamFriends_HasFriend(ulong steamIDFriend, int iFriendFlags);

			int ISteamFriends_GetClanCount();

			CSteamID ISteamFriends_GetClanByIndex(int iClan);

			IntPtr ISteamFriends_GetClanName(ulong steamIDClan);

			IntPtr ISteamFriends_GetClanTag(ulong steamIDClan);

			bool ISteamFriends_GetClanActivityCounts(ulong steamIDClan, out int pnOnline, out int pnInGame, out int pnChatting);

			SteamAPICall_t ISteamFriends_DownloadClanActivityCounts(IntPtr psteamIDClans, int cClansToRequest);

			int ISteamFriends_GetFriendCountFromSource(ulong steamIDSource);

			CSteamID ISteamFriends_GetFriendFromSourceByIndex(ulong steamIDSource, int iFriend);

			bool ISteamFriends_IsUserInSource(ulong steamIDUser, ulong steamIDSource);

			void ISteamFriends_SetInGameVoiceSpeaking(ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool bSpeaking);

			void ISteamFriends_ActivateGameOverlay(string pchDialog);

			void ISteamFriends_ActivateGameOverlayToUser(string pchDialog, ulong steamID);

			void ISteamFriends_ActivateGameOverlayToWebPage(string pchURL);

			void ISteamFriends_ActivateGameOverlayToStore(uint nAppID, OverlayToStoreFlag eFlag);

			void ISteamFriends_SetPlayedWith(ulong steamIDUserPlayedWith);

			void ISteamFriends_ActivateGameOverlayInviteDialog(ulong steamIDLobby);

			int ISteamFriends_GetSmallFriendAvatar(ulong steamIDFriend);

			int ISteamFriends_GetMediumFriendAvatar(ulong steamIDFriend);

			int ISteamFriends_GetLargeFriendAvatar(ulong steamIDFriend);

			bool ISteamFriends_RequestUserInformation(ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool bRequireNameOnly);

			SteamAPICall_t ISteamFriends_RequestClanOfficerList(ulong steamIDClan);

			CSteamID ISteamFriends_GetClanOwner(ulong steamIDClan);

			int ISteamFriends_GetClanOfficerCount(ulong steamIDClan);

			CSteamID ISteamFriends_GetClanOfficerByIndex(ulong steamIDClan, int iOfficer);

			uint ISteamFriends_GetUserRestrictions();

			bool ISteamFriends_SetRichPresence(string pchKey, string pchValue);

			void ISteamFriends_ClearRichPresence();

			IntPtr ISteamFriends_GetFriendRichPresence(ulong steamIDFriend, string pchKey);

			int ISteamFriends_GetFriendRichPresenceKeyCount(ulong steamIDFriend);

			IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex(ulong steamIDFriend, int iKey);

			void ISteamFriends_RequestFriendRichPresence(ulong steamIDFriend);

			bool ISteamFriends_InviteUserToGame(ulong steamIDFriend, string pchConnectString);

			int ISteamFriends_GetCoplayFriendCount();

			CSteamID ISteamFriends_GetCoplayFriend(int iCoplayFriend);

			int ISteamFriends_GetFriendCoplayTime(ulong steamIDFriend);

			AppId_t ISteamFriends_GetFriendCoplayGame(ulong steamIDFriend);

			SteamAPICall_t ISteamFriends_JoinClanChatRoom(ulong steamIDClan);

			bool ISteamFriends_LeaveClanChatRoom(ulong steamIDClan);

			int ISteamFriends_GetClanChatMemberCount(ulong steamIDClan);

			CSteamID ISteamFriends_GetChatMemberByIndex(ulong steamIDClan, int iUser);

			bool ISteamFriends_SendClanChatMessage(ulong steamIDClanChat, string pchText);

			int ISteamFriends_GetClanChatMessage(ulong steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, out ChatEntryType peChatEntryType, out ulong psteamidChatter);

			bool ISteamFriends_IsClanChatAdmin(ulong steamIDClanChat, ulong steamIDUser);

			bool ISteamFriends_IsClanChatWindowOpenInSteam(ulong steamIDClanChat);

			bool ISteamFriends_OpenClanChatWindowInSteam(ulong steamIDClanChat);

			bool ISteamFriends_CloseClanChatWindowInSteam(ulong steamIDClanChat);

			bool ISteamFriends_SetListenForFriendsMessages([MarshalAs(UnmanagedType.U1)] bool bInterceptEnabled);

			bool ISteamFriends_ReplyToFriendMessage(ulong steamIDFriend, string pchMsgToSend);

			int ISteamFriends_GetFriendMessage(ulong steamIDFriend, int iMessageID, IntPtr pvData, int cubData, out ChatEntryType peChatEntryType);

			SteamAPICall_t ISteamFriends_GetFollowerCount(ulong steamID);

			SteamAPICall_t ISteamFriends_IsFollowing(ulong steamID);

			SteamAPICall_t ISteamFriends_EnumerateFollowingList(uint unStartIndex);

			bool ISteamFriends_IsClanPublic(ulong steamIDClan);

			bool ISteamFriends_IsClanOfficialGameGroup(ulong steamIDClan);

			bool ISteamGameServer_InitGameServer(uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, uint nGameAppId, string pchVersionString);

			void ISteamGameServer_SetProduct(string pszProduct);

			void ISteamGameServer_SetGameDescription(string pszGameDescription);

			void ISteamGameServer_SetModDir(string pszModDir);

			void ISteamGameServer_SetDedicatedServer([MarshalAs(UnmanagedType.U1)] bool bDedicated);

			void ISteamGameServer_LogOn(string pszToken);

			void ISteamGameServer_LogOnAnonymous();

			void ISteamGameServer_LogOff();

			bool ISteamGameServer_BLoggedOn();

			bool ISteamGameServer_BSecure();

			CSteamID ISteamGameServer_GetSteamID();

			bool ISteamGameServer_WasRestartRequested();

			void ISteamGameServer_SetMaxPlayerCount(int cPlayersMax);

			void ISteamGameServer_SetBotPlayerCount(int cBotplayers);

			void ISteamGameServer_SetServerName(string pszServerName);

			void ISteamGameServer_SetMapName(string pszMapName);

			void ISteamGameServer_SetPasswordProtected([MarshalAs(UnmanagedType.U1)] bool bPasswordProtected);

			void ISteamGameServer_SetSpectatorPort(ushort unSpectatorPort);

			void ISteamGameServer_SetSpectatorServerName(string pszSpectatorServerName);

			void ISteamGameServer_ClearAllKeyValues();

			void ISteamGameServer_SetKeyValue(string pKey, string pValue);

			void ISteamGameServer_SetGameTags(string pchGameTags);

			void ISteamGameServer_SetGameData(string pchGameData);

			void ISteamGameServer_SetRegion(string pszRegion);

			bool ISteamGameServer_SendUserConnectAndAuthenticate(uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, out ulong pSteamIDUser);

			CSteamID ISteamGameServer_CreateUnauthenticatedUserConnection();

			void ISteamGameServer_SendUserDisconnect(ulong steamIDUser);

			bool ISteamGameServer_BUpdateUserData(ulong steamIDUser, string pchPlayerName, uint uScore);

			HAuthTicket ISteamGameServer_GetAuthSessionTicket(IntPtr pTicket, int cbMaxTicket, out uint pcbTicket);

			BeginAuthSessionResult ISteamGameServer_BeginAuthSession(IntPtr pAuthTicket, int cbAuthTicket, ulong steamID);

			void ISteamGameServer_EndAuthSession(ulong steamID);

			void ISteamGameServer_CancelAuthTicket(uint hAuthTicket);

			UserHasLicenseForAppResult ISteamGameServer_UserHasLicenseForApp(ulong steamID, uint appID);

			bool ISteamGameServer_RequestUserGroupStatus(ulong steamIDUser, ulong steamIDGroup);

			void ISteamGameServer_GetGameplayStats();

			SteamAPICall_t ISteamGameServer_GetServerReputation();

			uint ISteamGameServer_GetPublicIP();

			bool ISteamGameServer_HandleIncomingPacket(IntPtr pData, int cbData, uint srcIP, ushort srcPort);

			int ISteamGameServer_GetNextOutgoingPacket(IntPtr pOut, int cbMaxOut, out uint pNetAdr, out ushort pPort);

			void ISteamGameServer_EnableHeartbeats([MarshalAs(UnmanagedType.U1)] bool bActive);

			void ISteamGameServer_SetHeartbeatInterval(int iHeartbeatInterval);

			void ISteamGameServer_ForceHeartbeat();

			SteamAPICall_t ISteamGameServer_AssociateWithClan(ulong steamIDClan);

			SteamAPICall_t ISteamGameServer_ComputeNewPlayerCompatibility(ulong steamIDNewPlayer);

			SteamAPICall_t ISteamGameServerStats_RequestUserStats(ulong steamIDUser);

			bool ISteamGameServerStats_GetUserStat(ulong steamIDUser, string pchName, out int pData);

			bool ISteamGameServerStats_GetUserStat0(ulong steamIDUser, string pchName, out float pData);

			bool ISteamGameServerStats_GetUserAchievement(ulong steamIDUser, string pchName, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved);

			bool ISteamGameServerStats_SetUserStat(ulong steamIDUser, string pchName, int nData);

			bool ISteamGameServerStats_SetUserStat0(ulong steamIDUser, string pchName, float fData);

			bool ISteamGameServerStats_UpdateUserAvgRateStat(ulong steamIDUser, string pchName, float flCountThisSession, double dSessionLength);

			bool ISteamGameServerStats_SetUserAchievement(ulong steamIDUser, string pchName);

			bool ISteamGameServerStats_ClearUserAchievement(ulong steamIDUser, string pchName);

			SteamAPICall_t ISteamGameServerStats_StoreUserStats(ulong steamIDUser);

			void ISteamHTMLSurface_DestructISteamHTMLSurface();

			bool ISteamHTMLSurface_Init();

			bool ISteamHTMLSurface_Shutdown();

			SteamAPICall_t ISteamHTMLSurface_CreateBrowser(string pchUserAgent, string pchUserCSS);

			void ISteamHTMLSurface_RemoveBrowser(uint unBrowserHandle);

			void ISteamHTMLSurface_LoadURL(uint unBrowserHandle, string pchURL, string pchPostData);

			void ISteamHTMLSurface_SetSize(uint unBrowserHandle, uint unWidth, uint unHeight);

			void ISteamHTMLSurface_StopLoad(uint unBrowserHandle);

			void ISteamHTMLSurface_Reload(uint unBrowserHandle);

			void ISteamHTMLSurface_GoBack(uint unBrowserHandle);

			void ISteamHTMLSurface_GoForward(uint unBrowserHandle);

			void ISteamHTMLSurface_AddHeader(uint unBrowserHandle, string pchKey, string pchValue);

			void ISteamHTMLSurface_ExecuteJavascript(uint unBrowserHandle, string pchScript);

			void ISteamHTMLSurface_MouseUp(uint unBrowserHandle, HTMLMouseButton eMouseButton);

			void ISteamHTMLSurface_MouseDown(uint unBrowserHandle, HTMLMouseButton eMouseButton);

			void ISteamHTMLSurface_MouseDoubleClick(uint unBrowserHandle, HTMLMouseButton eMouseButton);

			void ISteamHTMLSurface_MouseMove(uint unBrowserHandle, int x, int y);

			void ISteamHTMLSurface_MouseWheel(uint unBrowserHandle, int nDelta);

			void ISteamHTMLSurface_KeyDown(uint unBrowserHandle, uint nNativeKeyCode, HTMLKeyModifiers eHTMLKeyModifiers);

			void ISteamHTMLSurface_KeyUp(uint unBrowserHandle, uint nNativeKeyCode, HTMLKeyModifiers eHTMLKeyModifiers);

			void ISteamHTMLSurface_KeyChar(uint unBrowserHandle, uint cUnicodeChar, HTMLKeyModifiers eHTMLKeyModifiers);

			void ISteamHTMLSurface_SetHorizontalScroll(uint unBrowserHandle, uint nAbsolutePixelScroll);

			void ISteamHTMLSurface_SetVerticalScroll(uint unBrowserHandle, uint nAbsolutePixelScroll);

			void ISteamHTMLSurface_SetKeyFocus(uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool bHasKeyFocus);

			void ISteamHTMLSurface_ViewSource(uint unBrowserHandle);

			void ISteamHTMLSurface_CopyToClipboard(uint unBrowserHandle);

			void ISteamHTMLSurface_PasteFromClipboard(uint unBrowserHandle);

			void ISteamHTMLSurface_Find(uint unBrowserHandle, string pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool bReverse);

			void ISteamHTMLSurface_StopFind(uint unBrowserHandle);

			void ISteamHTMLSurface_GetLinkAtPosition(uint unBrowserHandle, int x, int y);

			void ISteamHTMLSurface_SetCookie(string pchHostname, string pchKey, string pchValue, string pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool bSecure, [MarshalAs(UnmanagedType.U1)] bool bHTTPOnly);

			void ISteamHTMLSurface_SetPageScaleFactor(uint unBrowserHandle, float flZoom, int nPointX, int nPointY);

			void ISteamHTMLSurface_SetBackgroundMode(uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool bBackgroundMode);

			void ISteamHTMLSurface_SetDPIScalingFactor(uint unBrowserHandle, float flDPIScaling);

			void ISteamHTMLSurface_AllowStartRequest(uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool bAllowed);

			void ISteamHTMLSurface_JSDialogResponse(uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool bResult);

			HTTPRequestHandle ISteamHTTP_CreateHTTPRequest(HTTPMethod eHTTPRequestMethod, string pchAbsoluteURL);

			bool ISteamHTTP_SetHTTPRequestContextValue(uint hRequest, ulong ulContextValue);

			bool ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(uint hRequest, uint unTimeoutSeconds);

			bool ISteamHTTP_SetHTTPRequestHeaderValue(uint hRequest, string pchHeaderName, string pchHeaderValue);

			bool ISteamHTTP_SetHTTPRequestGetOrPostParameter(uint hRequest, string pchParamName, string pchParamValue);

			bool ISteamHTTP_SendHTTPRequest(uint hRequest, ref ulong pCallHandle);

			bool ISteamHTTP_SendHTTPRequestAndStreamResponse(uint hRequest, ref ulong pCallHandle);

			bool ISteamHTTP_DeferHTTPRequest(uint hRequest);

			bool ISteamHTTP_PrioritizeHTTPRequest(uint hRequest);

			bool ISteamHTTP_GetHTTPResponseHeaderSize(uint hRequest, string pchHeaderName, out uint unResponseHeaderSize);

			bool ISteamHTTP_GetHTTPResponseHeaderValue(uint hRequest, string pchHeaderName, out byte pHeaderValueBuffer, uint unBufferSize);

			bool ISteamHTTP_GetHTTPResponseBodySize(uint hRequest, out uint unBodySize);

			bool ISteamHTTP_GetHTTPResponseBodyData(uint hRequest, out byte pBodyDataBuffer, uint unBufferSize);

			bool ISteamHTTP_GetHTTPStreamingResponseBodyData(uint hRequest, uint cOffset, out byte pBodyDataBuffer, uint unBufferSize);

			bool ISteamHTTP_ReleaseHTTPRequest(uint hRequest);

			bool ISteamHTTP_GetHTTPDownloadProgressPct(uint hRequest, out float pflPercentOut);

			bool ISteamHTTP_SetHTTPRequestRawPostBody(uint hRequest, string pchContentType, out byte pubBody, uint unBodyLen);

			HTTPCookieContainerHandle ISteamHTTP_CreateCookieContainer([MarshalAs(UnmanagedType.U1)] bool bAllowResponsesToModify);

			bool ISteamHTTP_ReleaseCookieContainer(uint hCookieContainer);

			bool ISteamHTTP_SetCookie(uint hCookieContainer, string pchHost, string pchUrl, string pchCookie);

			bool ISteamHTTP_SetHTTPRequestCookieContainer(uint hRequest, uint hCookieContainer);

			bool ISteamHTTP_SetHTTPRequestUserAgentInfo(uint hRequest, string pchUserAgentInfo);

			bool ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(uint hRequest, [MarshalAs(UnmanagedType.U1)] bool bRequireVerifiedCertificate);

			bool ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(uint hRequest, uint unMilliseconds);

			bool ISteamHTTP_GetHTTPRequestWasTimedOut(uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool pbWasTimedOut);

			Result ISteamInventory_GetResultStatus(int resultHandle);

			bool ISteamInventory_GetResultItems(int resultHandle, IntPtr pOutItemsArray, out uint punOutItemsArraySize);

			bool ISteamInventory_GetResultItemProperty(int resultHandle, uint unItemIndex, string pchPropertyName, StringBuilder pchValueBuffer, out uint punValueBufferSizeOut);

			uint ISteamInventory_GetResultTimestamp(int resultHandle);

			bool ISteamInventory_CheckResultSteamID(int resultHandle, ulong steamIDExpected);

			void ISteamInventory_DestroyResult(int resultHandle);

			bool ISteamInventory_GetAllItems(ref int pResultHandle);

			bool ISteamInventory_GetItemsByID(ref int pResultHandle, ulong[] pInstanceIDs, uint unCountInstanceIDs);

			bool ISteamInventory_SerializeResult(int resultHandle, IntPtr pOutBuffer, out uint punOutBufferSize);

			bool ISteamInventory_DeserializeResult(ref int pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs(UnmanagedType.U1)] bool bRESERVED_MUST_BE_FALSE);

			bool ISteamInventory_GenerateItems(ref int pResultHandle, int[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength);

			bool ISteamInventory_GrantPromoItems(ref int pResultHandle);

			bool ISteamInventory_AddPromoItem(ref int pResultHandle, int itemDef);

			bool ISteamInventory_AddPromoItems(ref int pResultHandle, int[] pArrayItemDefs, uint unArrayLength);

			bool ISteamInventory_ConsumeItem(ref int pResultHandle, ulong itemConsume, uint unQuantity);

			bool ISteamInventory_ExchangeItems(ref int pResultHandle, int[] pArrayGenerate, uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, ulong[] pArrayDestroy, uint[] punArrayDestroyQuantity, uint unArrayDestroyLength);

			bool ISteamInventory_TransferItemQuantity(ref int pResultHandle, ulong itemIdSource, uint unQuantity, ulong itemIdDest);

			void ISteamInventory_SendItemDropHeartbeat();

			bool ISteamInventory_TriggerItemDrop(ref int pResultHandle, int dropListDefinition);

			bool ISteamInventory_TradeItems(ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] pArrayGiveQuantity, uint nArrayGiveLength, ulong[] pArrayGet, uint[] pArrayGetQuantity, uint nArrayGetLength);

			bool ISteamInventory_LoadItemDefinitions();

			bool ISteamInventory_GetItemDefinitionIDs(IntPtr pItemDefIDs, out uint punItemDefIDsArraySize);

			bool ISteamInventory_GetItemDefinitionProperty(int iDefinition, string pchPropertyName, StringBuilder pchValueBuffer, out uint punValueBufferSizeOut);

			SteamAPICall_t ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(ulong steamID);

			bool ISteamInventory_GetEligiblePromoItemDefinitionIDs(ulong steamID, IntPtr pItemDefIDs, out uint punItemDefIDsArraySize);

			SteamAPICall_t ISteamInventory_StartPurchase(int[] pArrayItemDefs, uint[] punArrayQuantity, uint unArrayLength);

			SteamAPICall_t ISteamInventory_RequestPrices();

			uint ISteamInventory_GetNumItemsWithPrices();

			bool ISteamInventory_GetItemsWithPrices(IntPtr pArrayItemDefs, IntPtr pPrices, uint unArrayLength);

			bool ISteamInventory_GetItemPrice(int iDefinition, out ulong pPrice);

			SteamInventoryUpdateHandle_t ISteamInventory_StartUpdateProperties();

			bool ISteamInventory_RemoveProperty(ulong handle, ulong nItemID, string pchPropertyName);

			bool ISteamInventory_SetProperty(ulong handle, ulong nItemID, string pchPropertyName, string pchPropertyValue);

			bool ISteamInventory_SetProperty0(ulong handle, ulong nItemID, string pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamInventory_SetProperty0(ulong handle, ulong nItemID, string pchPropertyName, long nValue);

			bool ISteamInventory_SetProperty0(ulong handle, ulong nItemID, string pchPropertyName, float flValue);

			bool ISteamInventory_SubmitUpdateProperties(ulong handle, ref int pResultHandle);

			int ISteamMatchmaking_GetFavoriteGameCount();

			bool ISteamMatchmaking_GetFavoriteGame(int iGame, ref uint pnAppID, out uint pnIP, out ushort pnConnPort, out ushort pnQueryPort, out uint punFlags, out uint pRTime32LastPlayedOnServer);

			int ISteamMatchmaking_AddFavoriteGame(uint nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer);

			bool ISteamMatchmaking_RemoveFavoriteGame(uint nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags);

			SteamAPICall_t ISteamMatchmaking_RequestLobbyList();

			void ISteamMatchmaking_AddRequestLobbyListStringFilter(string pchKeyToMatch, string pchValueToMatch, LobbyComparison eComparisonType);

			void ISteamMatchmaking_AddRequestLobbyListNumericalFilter(string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType);

			void ISteamMatchmaking_AddRequestLobbyListNearValueFilter(string pchKeyToMatch, int nValueToBeCloseTo);

			void ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(int nSlotsAvailable);

			void ISteamMatchmaking_AddRequestLobbyListDistanceFilter(LobbyDistanceFilter eLobbyDistanceFilter);

			void ISteamMatchmaking_AddRequestLobbyListResultCountFilter(int cMaxResults);

			void ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(ulong steamIDLobby);

			CSteamID ISteamMatchmaking_GetLobbyByIndex(int iLobby);

			SteamAPICall_t ISteamMatchmaking_CreateLobby(LobbyType eLobbyType, int cMaxMembers);

			SteamAPICall_t ISteamMatchmaking_JoinLobby(ulong steamIDLobby);

			void ISteamMatchmaking_LeaveLobby(ulong steamIDLobby);

			bool ISteamMatchmaking_InviteUserToLobby(ulong steamIDLobby, ulong steamIDInvitee);

			int ISteamMatchmaking_GetNumLobbyMembers(ulong steamIDLobby);

			CSteamID ISteamMatchmaking_GetLobbyMemberByIndex(ulong steamIDLobby, int iMember);

			IntPtr ISteamMatchmaking_GetLobbyData(ulong steamIDLobby, string pchKey);

			bool ISteamMatchmaking_SetLobbyData(ulong steamIDLobby, string pchKey, string pchValue);

			int ISteamMatchmaking_GetLobbyDataCount(ulong steamIDLobby);

			bool ISteamMatchmaking_GetLobbyDataByIndex(ulong steamIDLobby, int iLobbyData, StringBuilder pchKey, int cchKeyBufferSize, StringBuilder pchValue, int cchValueBufferSize);

			bool ISteamMatchmaking_DeleteLobbyData(ulong steamIDLobby, string pchKey);

			IntPtr ISteamMatchmaking_GetLobbyMemberData(ulong steamIDLobby, ulong steamIDUser, string pchKey);

			void ISteamMatchmaking_SetLobbyMemberData(ulong steamIDLobby, string pchKey, string pchValue);

			bool ISteamMatchmaking_SendLobbyChatMsg(ulong steamIDLobby, IntPtr pvMsgBody, int cubMsgBody);

			int ISteamMatchmaking_GetLobbyChatEntry(ulong steamIDLobby, int iChatID, out ulong pSteamIDUser, IntPtr pvData, int cubData, out ChatEntryType peChatEntryType);

			bool ISteamMatchmaking_RequestLobbyData(ulong steamIDLobby);

			void ISteamMatchmaking_SetLobbyGameServer(ulong steamIDLobby, uint unGameServerIP, ushort unGameServerPort, ulong steamIDGameServer);

			bool ISteamMatchmaking_GetLobbyGameServer(ulong steamIDLobby, out uint punGameServerIP, out ushort punGameServerPort, out ulong psteamIDGameServer);

			bool ISteamMatchmaking_SetLobbyMemberLimit(ulong steamIDLobby, int cMaxMembers);

			int ISteamMatchmaking_GetLobbyMemberLimit(ulong steamIDLobby);

			bool ISteamMatchmaking_SetLobbyType(ulong steamIDLobby, LobbyType eLobbyType);

			bool ISteamMatchmaking_SetLobbyJoinable(ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool bLobbyJoinable);

			CSteamID ISteamMatchmaking_GetLobbyOwner(ulong steamIDLobby);

			bool ISteamMatchmaking_SetLobbyOwner(ulong steamIDLobby, ulong steamIDNewOwner);

			bool ISteamMatchmaking_SetLinkedLobby(ulong steamIDLobby, ulong steamIDLobbyDependent);

			HServerListRequest ISteamMatchmakingServers_RequestInternetServerList(uint iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse);

			HServerListRequest ISteamMatchmakingServers_RequestLANServerList(uint iApp, IntPtr pRequestServersResponse);

			HServerListRequest ISteamMatchmakingServers_RequestFriendsServerList(uint iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse);

			HServerListRequest ISteamMatchmakingServers_RequestFavoritesServerList(uint iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse);

			HServerListRequest ISteamMatchmakingServers_RequestHistoryServerList(uint iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse);

			HServerListRequest ISteamMatchmakingServers_RequestSpectatorServerList(uint iApp, IntPtr ppchFilters, uint nFilters, IntPtr pRequestServersResponse);

			void ISteamMatchmakingServers_ReleaseRequest(IntPtr hServerListRequest);

			IntPtr ISteamMatchmakingServers_GetServerDetails(IntPtr hRequest, int iServer);

			void ISteamMatchmakingServers_CancelQuery(IntPtr hRequest);

			void ISteamMatchmakingServers_RefreshQuery(IntPtr hRequest);

			bool ISteamMatchmakingServers_IsRefreshing(IntPtr hRequest);

			int ISteamMatchmakingServers_GetServerCount(IntPtr hRequest);

			void ISteamMatchmakingServers_RefreshServer(IntPtr hRequest, int iServer);

			HServerQuery ISteamMatchmakingServers_PingServer(uint unIP, ushort usPort, IntPtr pRequestServersResponse);

			HServerQuery ISteamMatchmakingServers_PlayerDetails(uint unIP, ushort usPort, IntPtr pRequestServersResponse);

			HServerQuery ISteamMatchmakingServers_ServerRules(uint unIP, ushort usPort, IntPtr pRequestServersResponse);

			void ISteamMatchmakingServers_CancelServerQuery(int hServerQuery);

			bool ISteamMusic_BIsEnabled();

			bool ISteamMusic_BIsPlaying();

			AudioPlayback_Status ISteamMusic_GetPlaybackStatus();

			void ISteamMusic_Play();

			void ISteamMusic_Pause();

			void ISteamMusic_PlayPrevious();

			void ISteamMusic_PlayNext();

			void ISteamMusic_SetVolume(float flVolume);

			float ISteamMusic_GetVolume();

			bool ISteamMusicRemote_RegisterSteamMusicRemote(string pchName);

			bool ISteamMusicRemote_DeregisterSteamMusicRemote();

			bool ISteamMusicRemote_BIsCurrentMusicRemote();

			bool ISteamMusicRemote_BActivationSuccess([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_SetDisplayName(string pchDisplayName);

			bool ISteamMusicRemote_SetPNGIcon_64x64(IntPtr pvBuffer, uint cbBufferLength);

			bool ISteamMusicRemote_EnablePlayPrevious([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_EnablePlayNext([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_EnableShuffled([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_EnableLooped([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_EnableQueue([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_EnablePlaylists([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_UpdatePlaybackStatus(AudioPlayback_Status nStatus);

			bool ISteamMusicRemote_UpdateShuffled([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_UpdateLooped([MarshalAs(UnmanagedType.U1)] bool bValue);

			bool ISteamMusicRemote_UpdateVolume(float flValue);

			bool ISteamMusicRemote_CurrentEntryWillChange();

			bool ISteamMusicRemote_CurrentEntryIsAvailable([MarshalAs(UnmanagedType.U1)] bool bAvailable);

			bool ISteamMusicRemote_UpdateCurrentEntryText(string pchText);

			bool ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(int nValue);

			bool ISteamMusicRemote_UpdateCurrentEntryCoverArt(IntPtr pvBuffer, uint cbBufferLength);

			bool ISteamMusicRemote_CurrentEntryDidChange();

			bool ISteamMusicRemote_QueueWillChange();

			bool ISteamMusicRemote_ResetQueueEntries();

			bool ISteamMusicRemote_SetQueueEntry(int nID, int nPosition, string pchEntryText);

			bool ISteamMusicRemote_SetCurrentQueueEntry(int nID);

			bool ISteamMusicRemote_QueueDidChange();

			bool ISteamMusicRemote_PlaylistWillChange();

			bool ISteamMusicRemote_ResetPlaylistEntries();

			bool ISteamMusicRemote_SetPlaylistEntry(int nID, int nPosition, string pchEntryText);

			bool ISteamMusicRemote_SetCurrentPlaylistEntry(int nID);

			bool ISteamMusicRemote_PlaylistDidChange();

			bool ISteamNetworking_SendP2PPacket(ulong steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel);

			bool ISteamNetworking_IsP2PPacketAvailable(out uint pcubMsgSize, int nChannel);

			bool ISteamNetworking_ReadP2PPacket(IntPtr pubDest, uint cubDest, out uint pcubMsgSize, out ulong psteamIDRemote, int nChannel);

			bool ISteamNetworking_AcceptP2PSessionWithUser(ulong steamIDRemote);

			bool ISteamNetworking_CloseP2PSessionWithUser(ulong steamIDRemote);

			bool ISteamNetworking_CloseP2PChannelWithUser(ulong steamIDRemote, int nChannel);

			bool ISteamNetworking_GetP2PSessionState(ulong steamIDRemote, ref P2PSessionState_t pConnectionState);

			bool ISteamNetworking_AllowP2PPacketRelay([MarshalAs(UnmanagedType.U1)] bool bAllow);

			SNetListenSocket_t ISteamNetworking_CreateListenSocket(int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs(UnmanagedType.U1)] bool bAllowUseOfPacketRelay);

			SNetSocket_t ISteamNetworking_CreateP2PConnectionSocket(ulong steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool bAllowUseOfPacketRelay);

			SNetSocket_t ISteamNetworking_CreateConnectionSocket(uint nIP, ushort nPort, int nTimeoutSec);

			bool ISteamNetworking_DestroySocket(uint hSocket, [MarshalAs(UnmanagedType.U1)] bool bNotifyRemoteEnd);

			bool ISteamNetworking_DestroyListenSocket(uint hSocket, [MarshalAs(UnmanagedType.U1)] bool bNotifyRemoteEnd);

			bool ISteamNetworking_SendDataOnSocket(uint hSocket, IntPtr pubData, uint cubData, [MarshalAs(UnmanagedType.U1)] bool bReliable);

			bool ISteamNetworking_IsDataAvailableOnSocket(uint hSocket, out uint pcubMsgSize);

			bool ISteamNetworking_RetrieveDataFromSocket(uint hSocket, IntPtr pubDest, uint cubDest, out uint pcubMsgSize);

			bool ISteamNetworking_IsDataAvailable(uint hListenSocket, out uint pcubMsgSize, ref uint phSocket);

			bool ISteamNetworking_RetrieveData(uint hListenSocket, IntPtr pubDest, uint cubDest, out uint pcubMsgSize, ref uint phSocket);

			bool ISteamNetworking_GetSocketInfo(uint hSocket, out ulong pSteamIDRemote, IntPtr peSocketStatus, out uint punIPRemote, out ushort punPortRemote);

			bool ISteamNetworking_GetListenSocketInfo(uint hListenSocket, out uint pnIP, out ushort pnPort);

			SNetSocketConnectionType ISteamNetworking_GetSocketConnectionType(uint hSocket);

			int ISteamNetworking_GetMaxPacketSize(uint hSocket);

			bool ISteamParentalSettings_BIsParentalLockEnabled();

			bool ISteamParentalSettings_BIsParentalLockLocked();

			bool ISteamParentalSettings_BIsAppBlocked(uint nAppID);

			bool ISteamParentalSettings_BIsAppInBlockList(uint nAppID);

			bool ISteamParentalSettings_BIsFeatureBlocked(ParentalFeature eFeature);

			bool ISteamParentalSettings_BIsFeatureInBlockList(ParentalFeature eFeature);

			bool ISteamRemoteStorage_FileWrite(string pchFile, IntPtr pvData, int cubData);

			int ISteamRemoteStorage_FileRead(string pchFile, IntPtr pvData, int cubDataToRead);

			SteamAPICall_t ISteamRemoteStorage_FileWriteAsync(string pchFile, IntPtr pvData, uint cubData);

			SteamAPICall_t ISteamRemoteStorage_FileReadAsync(string pchFile, uint nOffset, uint cubToRead);

			bool ISteamRemoteStorage_FileReadAsyncComplete(ulong hReadCall, IntPtr pvBuffer, uint cubToRead);

			bool ISteamRemoteStorage_FileForget(string pchFile);

			bool ISteamRemoteStorage_FileDelete(string pchFile);

			SteamAPICall_t ISteamRemoteStorage_FileShare(string pchFile);

			bool ISteamRemoteStorage_SetSyncPlatforms(string pchFile, RemoteStoragePlatform eRemoteStoragePlatform);

			UGCFileWriteStreamHandle_t ISteamRemoteStorage_FileWriteStreamOpen(string pchFile);

			bool ISteamRemoteStorage_FileWriteStreamWriteChunk(ulong writeHandle, IntPtr pvData, int cubData);

			bool ISteamRemoteStorage_FileWriteStreamClose(ulong writeHandle);

			bool ISteamRemoteStorage_FileWriteStreamCancel(ulong writeHandle);

			bool ISteamRemoteStorage_FileExists(string pchFile);

			bool ISteamRemoteStorage_FilePersisted(string pchFile);

			int ISteamRemoteStorage_GetFileSize(string pchFile);

			long ISteamRemoteStorage_GetFileTimestamp(string pchFile);

			RemoteStoragePlatform ISteamRemoteStorage_GetSyncPlatforms(string pchFile);

			int ISteamRemoteStorage_GetFileCount();

			IntPtr ISteamRemoteStorage_GetFileNameAndSize(int iFile, out int pnFileSizeInBytes);

			bool ISteamRemoteStorage_GetQuota(out ulong pnTotalBytes, out ulong puAvailableBytes);

			bool ISteamRemoteStorage_IsCloudEnabledForAccount();

			bool ISteamRemoteStorage_IsCloudEnabledForApp();

			void ISteamRemoteStorage_SetCloudEnabledForApp([MarshalAs(UnmanagedType.U1)] bool bEnabled);

			SteamAPICall_t ISteamRemoteStorage_UGCDownload(ulong hContent, uint unPriority);

			bool ISteamRemoteStorage_GetUGCDownloadProgress(ulong hContent, out int pnBytesDownloaded, out int pnBytesExpected);

			bool ISteamRemoteStorage_GetUGCDetails(ulong hContent, ref uint pnAppID, StringBuilder ppchName, out int pnFileSizeInBytes, out ulong pSteamIDOwner);

			int ISteamRemoteStorage_UGCRead(ulong hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction);

			int ISteamRemoteStorage_GetCachedUGCCount();

			UGCHandle_t ISteamRemoteStorage_GetCachedUGCHandle(int iCachedContent);

			SteamAPICall_t ISteamRemoteStorage_PublishWorkshopFile(string pchFile, string pchPreviewFile, uint nConsumerAppId, string pchTitle, string pchDescription, RemoteStoragePublishedFileVisibility eVisibility, ref SteamParamStringArray_t pTags, WorkshopFileType eWorkshopFileType);

			PublishedFileUpdateHandle_t ISteamRemoteStorage_CreatePublishedFileUpdateRequest(ulong unPublishedFileId);

			bool ISteamRemoteStorage_UpdatePublishedFileFile(ulong updateHandle, string pchFile);

			bool ISteamRemoteStorage_UpdatePublishedFilePreviewFile(ulong updateHandle, string pchPreviewFile);

			bool ISteamRemoteStorage_UpdatePublishedFileTitle(ulong updateHandle, string pchTitle);

			bool ISteamRemoteStorage_UpdatePublishedFileDescription(ulong updateHandle, string pchDescription);

			bool ISteamRemoteStorage_UpdatePublishedFileVisibility(ulong updateHandle, RemoteStoragePublishedFileVisibility eVisibility);

			bool ISteamRemoteStorage_UpdatePublishedFileTags(ulong updateHandle, ref SteamParamStringArray_t pTags);

			SteamAPICall_t ISteamRemoteStorage_CommitPublishedFileUpdate(ulong updateHandle);

			SteamAPICall_t ISteamRemoteStorage_GetPublishedFileDetails(ulong unPublishedFileId, uint unMaxSecondsOld);

			SteamAPICall_t ISteamRemoteStorage_DeletePublishedFile(ulong unPublishedFileId);

			SteamAPICall_t ISteamRemoteStorage_EnumerateUserPublishedFiles(uint unStartIndex);

			SteamAPICall_t ISteamRemoteStorage_SubscribePublishedFile(ulong unPublishedFileId);

			SteamAPICall_t ISteamRemoteStorage_EnumerateUserSubscribedFiles(uint unStartIndex);

			SteamAPICall_t ISteamRemoteStorage_UnsubscribePublishedFile(ulong unPublishedFileId);

			bool ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(ulong updateHandle, string pchChangeDescription);

			SteamAPICall_t ISteamRemoteStorage_GetPublishedItemVoteDetails(ulong unPublishedFileId);

			SteamAPICall_t ISteamRemoteStorage_UpdateUserPublishedItemVote(ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool bVoteUp);

			SteamAPICall_t ISteamRemoteStorage_GetUserPublishedItemVoteDetails(ulong unPublishedFileId);

			SteamAPICall_t ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(ulong steamId, uint unStartIndex, ref SteamParamStringArray_t pRequiredTags, ref SteamParamStringArray_t pExcludedTags);

			SteamAPICall_t ISteamRemoteStorage_PublishVideo(WorkshopVideoProvider eVideoProvider, string pchVideoAccount, string pchVideoIdentifier, string pchPreviewFile, uint nConsumerAppId, string pchTitle, string pchDescription, RemoteStoragePublishedFileVisibility eVisibility, ref SteamParamStringArray_t pTags);

			SteamAPICall_t ISteamRemoteStorage_SetUserPublishedFileAction(ulong unPublishedFileId, WorkshopFileAction eAction);

			SteamAPICall_t ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(WorkshopFileAction eAction, uint unStartIndex);

			SteamAPICall_t ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(WorkshopEnumerationType eEnumerationType, uint unStartIndex, uint unCount, uint unDays, ref SteamParamStringArray_t pTags, ref SteamParamStringArray_t pUserTags);

			SteamAPICall_t ISteamRemoteStorage_UGCDownloadToLocation(ulong hContent, string pchLocation, uint unPriority);

			ScreenshotHandle ISteamScreenshots_WriteScreenshot(IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight);

			ScreenshotHandle ISteamScreenshots_AddScreenshotToLibrary(string pchFilename, string pchThumbnailFilename, int nWidth, int nHeight);

			void ISteamScreenshots_TriggerScreenshot();

			void ISteamScreenshots_HookScreenshots([MarshalAs(UnmanagedType.U1)] bool bHook);

			bool ISteamScreenshots_SetLocation(uint hScreenshot, string pchLocation);

			bool ISteamScreenshots_TagUser(uint hScreenshot, ulong steamID);

			bool ISteamScreenshots_TagPublishedFile(uint hScreenshot, ulong unPublishedFileID);

			bool ISteamScreenshots_IsScreenshotsHooked();

			ScreenshotHandle ISteamScreenshots_AddVRScreenshotToLibrary(VRScreenshotType eType, string pchFilename, string pchVRFilename);

			UGCQueryHandle_t ISteamUGC_CreateQueryUserUGCRequest(uint unAccountID, UserUGCList eListType, UGCMatchingUGCType eMatchingUGCType, UserUGCListSortOrder eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint unPage);

			UGCQueryHandle_t ISteamUGC_CreateQueryAllUGCRequest(UGCQuery eQueryType, UGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint unPage);

			UGCQueryHandle_t ISteamUGC_CreateQueryUGCDetailsRequest(IntPtr pvecPublishedFileID, uint unNumPublishedFileIDs);

			SteamAPICall_t ISteamUGC_SendQueryUGCRequest(ulong handle);

			bool ISteamUGC_GetQueryUGCResult(ulong handle, uint index, ref SteamUGCDetails_t pDetails);

			bool ISteamUGC_GetQueryUGCPreviewURL(ulong handle, uint index, StringBuilder pchURL, uint cchURLSize);

			bool ISteamUGC_GetQueryUGCMetadata(ulong handle, uint index, StringBuilder pchMetadata, uint cchMetadatasize);

			bool ISteamUGC_GetQueryUGCChildren(ulong handle, uint index, IntPtr pvecPublishedFileID, uint cMaxEntries);

			bool ISteamUGC_GetQueryUGCStatistic(ulong handle, uint index, ItemStatistic eStatType, out ulong pStatValue);

			uint ISteamUGC_GetQueryUGCNumAdditionalPreviews(ulong handle, uint index);

			bool ISteamUGC_GetQueryUGCAdditionalPreview(ulong handle, uint index, uint previewIndex, StringBuilder pchURLOrVideoID, uint cchURLSize, StringBuilder pchOriginalFileName, uint cchOriginalFileNameSize, out ItemPreviewType pPreviewType);

			uint ISteamUGC_GetQueryUGCNumKeyValueTags(ulong handle, uint index);

			bool ISteamUGC_GetQueryUGCKeyValueTag(ulong handle, uint index, uint keyValueTagIndex, StringBuilder pchKey, uint cchKeySize, StringBuilder pchValue, uint cchValueSize);

			bool ISteamUGC_ReleaseQueryUGCRequest(ulong handle);

			bool ISteamUGC_AddRequiredTag(ulong handle, string pTagName);

			bool ISteamUGC_AddExcludedTag(ulong handle, string pTagName);

			bool ISteamUGC_SetReturnOnlyIDs(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnOnlyIDs);

			bool ISteamUGC_SetReturnKeyValueTags(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnKeyValueTags);

			bool ISteamUGC_SetReturnLongDescription(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnLongDescription);

			bool ISteamUGC_SetReturnMetadata(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnMetadata);

			bool ISteamUGC_SetReturnChildren(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnChildren);

			bool ISteamUGC_SetReturnAdditionalPreviews(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnAdditionalPreviews);

			bool ISteamUGC_SetReturnTotalOnly(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bReturnTotalOnly);

			bool ISteamUGC_SetReturnPlaytimeStats(ulong handle, uint unDays);

			bool ISteamUGC_SetLanguage(ulong handle, string pchLanguage);

			bool ISteamUGC_SetAllowCachedResponse(ulong handle, uint unMaxAgeSeconds);

			bool ISteamUGC_SetCloudFileNameFilter(ulong handle, string pMatchCloudFileName);

			bool ISteamUGC_SetMatchAnyTag(ulong handle, [MarshalAs(UnmanagedType.U1)] bool bMatchAnyTag);

			bool ISteamUGC_SetSearchText(ulong handle, string pSearchText);

			bool ISteamUGC_SetRankedByTrendDays(ulong handle, uint unDays);

			bool ISteamUGC_AddRequiredKeyValueTag(ulong handle, string pKey, string pValue);

			SteamAPICall_t ISteamUGC_RequestUGCDetails(ulong nPublishedFileID, uint unMaxAgeSeconds);

			SteamAPICall_t ISteamUGC_CreateItem(uint nConsumerAppId, WorkshopFileType eFileType);

			UGCUpdateHandle_t ISteamUGC_StartItemUpdate(uint nConsumerAppId, ulong nPublishedFileID);

			bool ISteamUGC_SetItemTitle(ulong handle, string pchTitle);

			bool ISteamUGC_SetItemDescription(ulong handle, string pchDescription);

			bool ISteamUGC_SetItemUpdateLanguage(ulong handle, string pchLanguage);

			bool ISteamUGC_SetItemMetadata(ulong handle, string pchMetaData);

			bool ISteamUGC_SetItemVisibility(ulong handle, RemoteStoragePublishedFileVisibility eVisibility);

			bool ISteamUGC_SetItemTags(ulong updateHandle, ref SteamParamStringArray_t pTags);

			bool ISteamUGC_SetItemContent(ulong handle, string pszContentFolder);

			bool ISteamUGC_SetItemPreview(ulong handle, string pszPreviewFile);

			bool ISteamUGC_RemoveItemKeyValueTags(ulong handle, string pchKey);

			bool ISteamUGC_AddItemKeyValueTag(ulong handle, string pchKey, string pchValue);

			bool ISteamUGC_AddItemPreviewFile(ulong handle, string pszPreviewFile, ItemPreviewType type);

			bool ISteamUGC_AddItemPreviewVideo(ulong handle, string pszVideoID);

			bool ISteamUGC_UpdateItemPreviewFile(ulong handle, uint index, string pszPreviewFile);

			bool ISteamUGC_UpdateItemPreviewVideo(ulong handle, uint index, string pszVideoID);

			bool ISteamUGC_RemoveItemPreview(ulong handle, uint index);

			SteamAPICall_t ISteamUGC_SubmitItemUpdate(ulong handle, string pchChangeNote);

			ItemUpdateStatus ISteamUGC_GetItemUpdateProgress(ulong handle, out ulong punBytesProcessed, out ulong punBytesTotal);

			SteamAPICall_t ISteamUGC_SetUserItemVote(ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool bVoteUp);

			SteamAPICall_t ISteamUGC_GetUserItemVote(ulong nPublishedFileID);

			SteamAPICall_t ISteamUGC_AddItemToFavorites(uint nAppId, ulong nPublishedFileID);

			SteamAPICall_t ISteamUGC_RemoveItemFromFavorites(uint nAppId, ulong nPublishedFileID);

			SteamAPICall_t ISteamUGC_SubscribeItem(ulong nPublishedFileID);

			SteamAPICall_t ISteamUGC_UnsubscribeItem(ulong nPublishedFileID);

			uint ISteamUGC_GetNumSubscribedItems();

			uint ISteamUGC_GetSubscribedItems(IntPtr pvecPublishedFileID, uint cMaxEntries);

			uint ISteamUGC_GetItemState(ulong nPublishedFileID);

			bool ISteamUGC_GetItemInstallInfo(ulong nPublishedFileID, out ulong punSizeOnDisk, StringBuilder pchFolder, uint cchFolderSize, out uint punTimeStamp);

			bool ISteamUGC_GetItemDownloadInfo(ulong nPublishedFileID, out ulong punBytesDownloaded, out ulong punBytesTotal);

			bool ISteamUGC_DownloadItem(ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool bHighPriority);

			bool ISteamUGC_BInitWorkshopForGameServer(uint unWorkshopDepotID, string pszFolder);

			void ISteamUGC_SuspendDownloads([MarshalAs(UnmanagedType.U1)] bool bSuspend);

			SteamAPICall_t ISteamUGC_StartPlaytimeTracking(IntPtr pvecPublishedFileID, uint unNumPublishedFileIDs);

			SteamAPICall_t ISteamUGC_StopPlaytimeTracking(IntPtr pvecPublishedFileID, uint unNumPublishedFileIDs);

			SteamAPICall_t ISteamUGC_StopPlaytimeTrackingForAllItems();

			SteamAPICall_t ISteamUGC_AddDependency(ulong nParentPublishedFileID, ulong nChildPublishedFileID);

			SteamAPICall_t ISteamUGC_RemoveDependency(ulong nParentPublishedFileID, ulong nChildPublishedFileID);

			SteamAPICall_t ISteamUGC_AddAppDependency(ulong nPublishedFileID, uint nAppID);

			SteamAPICall_t ISteamUGC_RemoveAppDependency(ulong nPublishedFileID, uint nAppID);

			SteamAPICall_t ISteamUGC_GetAppDependencies(ulong nPublishedFileID);

			SteamAPICall_t ISteamUGC_DeleteItem(ulong nPublishedFileID);

			HSteamUser ISteamUser_GetHSteamUser();

			bool ISteamUser_BLoggedOn();

			CSteamID ISteamUser_GetSteamID();

			int ISteamUser_InitiateGameConnection(IntPtr pAuthBlob, int cbMaxAuthBlob, ulong steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs(UnmanagedType.U1)] bool bSecure);

			void ISteamUser_TerminateGameConnection(uint unIPServer, ushort usPortServer);

			void ISteamUser_TrackAppUsageEvent(ulong gameID, int eAppUsageEvent, string pchExtraInfo);

			bool ISteamUser_GetUserDataFolder(StringBuilder pchBuffer, int cubBuffer);

			void ISteamUser_StartVoiceRecording();

			void ISteamUser_StopVoiceRecording();

			VoiceResult ISteamUser_GetAvailableVoice(out uint pcbCompressed, out uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated);

			VoiceResult ISteamUser_GetVoice([MarshalAs(UnmanagedType.U1)] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, out uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated);

			VoiceResult ISteamUser_DecompressVoice(IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, out uint nBytesWritten, uint nDesiredSampleRate);

			uint ISteamUser_GetVoiceOptimalSampleRate();

			HAuthTicket ISteamUser_GetAuthSessionTicket(IntPtr pTicket, int cbMaxTicket, out uint pcbTicket);

			BeginAuthSessionResult ISteamUser_BeginAuthSession(IntPtr pAuthTicket, int cbAuthTicket, ulong steamID);

			void ISteamUser_EndAuthSession(ulong steamID);

			void ISteamUser_CancelAuthTicket(uint hAuthTicket);

			UserHasLicenseForAppResult ISteamUser_UserHasLicenseForApp(ulong steamID, uint appID);

			bool ISteamUser_BIsBehindNAT();

			void ISteamUser_AdvertiseGame(ulong steamIDGameServer, uint unIPServer, ushort usPortServer);

			SteamAPICall_t ISteamUser_RequestEncryptedAppTicket(IntPtr pDataToInclude, int cbDataToInclude);

			bool ISteamUser_GetEncryptedAppTicket(IntPtr pTicket, int cbMaxTicket, out uint pcbTicket);

			int ISteamUser_GetGameBadgeLevel(int nSeries, [MarshalAs(UnmanagedType.U1)] bool bFoil);

			int ISteamUser_GetPlayerSteamLevel();

			SteamAPICall_t ISteamUser_RequestStoreAuthURL(string pchRedirectURL);

			bool ISteamUser_BIsPhoneVerified();

			bool ISteamUser_BIsTwoFactorEnabled();

			bool ISteamUser_BIsPhoneIdentifying();

			bool ISteamUser_BIsPhoneRequiringVerification();

			bool ISteamUserStats_RequestCurrentStats();

			bool ISteamUserStats_GetStat(string pchName, out int pData);

			bool ISteamUserStats_GetStat0(string pchName, out float pData);

			bool ISteamUserStats_SetStat(string pchName, int nData);

			bool ISteamUserStats_SetStat0(string pchName, float fData);

			bool ISteamUserStats_UpdateAvgRateStat(string pchName, float flCountThisSession, double dSessionLength);

			bool ISteamUserStats_GetAchievement(string pchName, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved);

			bool ISteamUserStats_SetAchievement(string pchName);

			bool ISteamUserStats_ClearAchievement(string pchName);

			bool ISteamUserStats_GetAchievementAndUnlockTime(string pchName, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved, out uint punUnlockTime);

			bool ISteamUserStats_StoreStats();

			int ISteamUserStats_GetAchievementIcon(string pchName);

			IntPtr ISteamUserStats_GetAchievementDisplayAttribute(string pchName, string pchKey);

			bool ISteamUserStats_IndicateAchievementProgress(string pchName, uint nCurProgress, uint nMaxProgress);

			uint ISteamUserStats_GetNumAchievements();

			IntPtr ISteamUserStats_GetAchievementName(uint iAchievement);

			SteamAPICall_t ISteamUserStats_RequestUserStats(ulong steamIDUser);

			bool ISteamUserStats_GetUserStat(ulong steamIDUser, string pchName, out int pData);

			bool ISteamUserStats_GetUserStat0(ulong steamIDUser, string pchName, out float pData);

			bool ISteamUserStats_GetUserAchievement(ulong steamIDUser, string pchName, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved);

			bool ISteamUserStats_GetUserAchievementAndUnlockTime(ulong steamIDUser, string pchName, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved, out uint punUnlockTime);

			bool ISteamUserStats_ResetAllStats([MarshalAs(UnmanagedType.U1)] bool bAchievementsToo);

			SteamAPICall_t ISteamUserStats_FindOrCreateLeaderboard(string pchLeaderboardName, LeaderboardSortMethod eLeaderboardSortMethod, LeaderboardDisplayType eLeaderboardDisplayType);

			SteamAPICall_t ISteamUserStats_FindLeaderboard(string pchLeaderboardName);

			IntPtr ISteamUserStats_GetLeaderboardName(ulong hSteamLeaderboard);

			int ISteamUserStats_GetLeaderboardEntryCount(ulong hSteamLeaderboard);

			LeaderboardSortMethod ISteamUserStats_GetLeaderboardSortMethod(ulong hSteamLeaderboard);

			LeaderboardDisplayType ISteamUserStats_GetLeaderboardDisplayType(ulong hSteamLeaderboard);

			SteamAPICall_t ISteamUserStats_DownloadLeaderboardEntries(ulong hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd);

			SteamAPICall_t ISteamUserStats_DownloadLeaderboardEntriesForUsers(ulong hSteamLeaderboard, IntPtr prgUsers, int cUsers);

			bool ISteamUserStats_GetDownloadedLeaderboardEntry(ulong hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, IntPtr pDetails, int cDetailsMax);

			SteamAPICall_t ISteamUserStats_UploadLeaderboardScore(ulong hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, int[] pScoreDetails, int cScoreDetailsCount);

			SteamAPICall_t ISteamUserStats_AttachLeaderboardUGC(ulong hSteamLeaderboard, ulong hUGC);

			SteamAPICall_t ISteamUserStats_GetNumberOfCurrentPlayers();

			SteamAPICall_t ISteamUserStats_RequestGlobalAchievementPercentages();

			int ISteamUserStats_GetMostAchievedAchievementInfo(StringBuilder pchName, uint unNameBufLen, out float pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved);

			int ISteamUserStats_GetNextMostAchievedAchievementInfo(int iIteratorPrevious, StringBuilder pchName, uint unNameBufLen, out float pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool pbAchieved);

			bool ISteamUserStats_GetAchievementAchievedPercent(string pchName, out float pflPercent);

			SteamAPICall_t ISteamUserStats_RequestGlobalStats(int nHistoryDays);

			bool ISteamUserStats_GetGlobalStat(string pchStatName, out long pData);

			bool ISteamUserStats_GetGlobalStat0(string pchStatName, out double pData);

			int ISteamUserStats_GetGlobalStatHistory(string pchStatName, out long pData, uint cubData);

			int ISteamUserStats_GetGlobalStatHistory0(string pchStatName, out double pData, uint cubData);

			uint ISteamUtils_GetSecondsSinceAppActive();

			uint ISteamUtils_GetSecondsSinceComputerActive();

			Universe ISteamUtils_GetConnectedUniverse();

			uint ISteamUtils_GetServerRealTime();

			IntPtr ISteamUtils_GetIPCountry();

			bool ISteamUtils_GetImageSize(int iImage, out uint pnWidth, out uint pnHeight);

			bool ISteamUtils_GetImageRGBA(int iImage, IntPtr pubDest, int nDestBufferSize);

			bool ISteamUtils_GetCSERIPPort(out uint unIP, out ushort usPort);

			byte ISteamUtils_GetCurrentBatteryPower();

			uint ISteamUtils_GetAppID();

			void ISteamUtils_SetOverlayNotificationPosition(NotificationPosition eNotificationPosition);

			bool ISteamUtils_IsAPICallCompleted(ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool pbFailed);

			SteamAPICallFailure ISteamUtils_GetAPICallFailureReason(ulong hSteamAPICall);

			bool ISteamUtils_GetAPICallResult(ulong hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool pbFailed);

			uint ISteamUtils_GetIPCCallCount();

			void ISteamUtils_SetWarningMessageHook(IntPtr pFunction);

			bool ISteamUtils_IsOverlayEnabled();

			bool ISteamUtils_BOverlayNeedsPresent();

			SteamAPICall_t ISteamUtils_CheckFileSignature(string szFileName);

			bool ISteamUtils_ShowGamepadTextInput(GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, string pchDescription, uint unCharMax, string pchExistingText);

			uint ISteamUtils_GetEnteredGamepadTextLength();

			bool ISteamUtils_GetEnteredGamepadTextInput(StringBuilder pchText, uint cchText);

			IntPtr ISteamUtils_GetSteamUILanguage();

			bool ISteamUtils_IsSteamRunningInVR();

			void ISteamUtils_SetOverlayNotificationInset(int nHorizontalInset, int nVerticalInset);

			bool ISteamUtils_IsSteamInBigPictureMode();

			void ISteamUtils_StartVRDashboard();

			bool ISteamUtils_IsVRHeadsetStreamingEnabled();

			void ISteamUtils_SetVRHeadsetStreamingEnabled([MarshalAs(UnmanagedType.U1)] bool bEnabled);

			void ISteamVideo_GetVideoURL(uint unVideoAppID);

			bool ISteamVideo_IsBroadcasting(IntPtr pnNumViewers);

			void ISteamVideo_GetOPFSettings(uint unVideoAppID);

			bool ISteamVideo_GetOPFStringForApp(uint unVideoAppID, StringBuilder pchBuffer, out int pnBufferSize);

			bool SteamApi_SteamAPI_Init();

			void SteamApi_SteamAPI_RunCallbacks();

			void SteamApi_SteamGameServer_RunCallbacks();

			void SteamApi_SteamAPI_RegisterCallback(IntPtr pCallback, int callback);

			void SteamApi_SteamAPI_UnregisterCallback(IntPtr pCallback);

			void SteamApi_SteamAPI_RegisterCallResult(IntPtr pCallback, ulong callback);

			void SteamApi_SteamAPI_UnregisterCallResult(IntPtr pCallback, ulong callback);

			bool SteamApi_SteamInternal_GameServer_Init(uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, string pchVersionString);

			void SteamApi_SteamAPI_Shutdown();

			void SteamApi_SteamGameServer_Shutdown();

			HSteamUser SteamApi_SteamAPI_GetHSteamUser();

			HSteamPipe SteamApi_SteamAPI_GetHSteamPipe();

			HSteamUser SteamApi_SteamGameServer_GetHSteamUser();

			HSteamPipe SteamApi_SteamGameServer_GetHSteamPipe();

			IntPtr SteamApi_SteamInternal_CreateInterface(string version);

			bool SteamApi_SteamAPI_RestartAppIfNecessary(uint unOwnAppID);
		}

		internal class Linux32 : Interface, IDisposable
		{
			internal static class Native
			{
				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern HSteamPipe SteamAPI_ISteamClient_CreateSteamPipe(IntPtr ISteamClient);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern bool SteamAPI_ISteamClient_BReleaseSteamPipe(IntPtr ISteamClient, int hSteamPipe);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern HSteamUser SteamAPI_ISteamClient_ConnectToGlobalUser(IntPtr ISteamClient, int hSteamPipe);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern HSteamUser SteamAPI_ISteamClient_CreateLocalUser(IntPtr ISteamClient, out int phSteamPipe, AccountType eAccountType);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern void SteamAPI_ISteamClient_ReleaseUser(IntPtr ISteamClient, int hSteamPipe, int hUser);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUser(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameServer(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern void SteamAPI_ISteamClient_SetLocalIPBinding(IntPtr ISteamClient, uint unIP, ushort usPort);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamFriends(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUtils(IntPtr ISteamClient, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMatchmaking(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMatchmakingServers(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGenericInterface(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUserStats(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameServerStats(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamApps(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamNetworking(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamRemoteStorage(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamScreenshots(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern uint SteamAPI_ISteamClient_GetIPCCallCount(IntPtr ISteamClient);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern void SteamAPI_ISteamClient_SetWarningMessageHook(IntPtr ISteamClient, IntPtr pFunction);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(IntPtr ISteamClient);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamHTTP(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamController(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamUGC(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamAppList(IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMusic(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamMusicRemote(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamHTMLSurface(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamInventory(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamVideo(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern IntPtr SteamAPI_ISteamClient_GetISteamParentalSettings(IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string pchVersion);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern HSteamUser SteamAPI_ISteamUser_GetHSteamUser(IntPtr ISteamUser);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern bool SteamAPI_ISteamUser_BLoggedOn(IntPtr ISteamUser);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern CSteamID SteamAPI_ISteamUser_GetSteamID(IntPtr ISteamUser);

				[DllImport("libsteam_api.so", CallingConvention = CallingConvention.Cdecl)]
				internal static extern int SteamAPI_ISteamUser_InitiateGameConnection(IntPtr ISteamUser, IntPtr pAuthBlob, int cbMaxAuthBlob, ulong steamIDGameServer, uint un

Newtonsoft.Json.dll

Decompiled 2 weeks ago
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Data;
using System.Data.SqlTypes;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Numerics;
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Serialization;
using System.Runtime.Serialization.Formatters;
using System.Runtime.Versioning;
using System.Security;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Xml;
using System.Xml.Linq;
using Microsoft.CodeAnalysis;
using Newtonsoft.Json.Bson;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Linq.JsonPath;
using Newtonsoft.Json.Schema;
using Newtonsoft.Json.Serialization;
using Newtonsoft.Json.Utilities;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AllowPartiallyTrustedCallers]
[assembly: AssemblyDelaySign(true)]
[assembly: AssemblyKeyFile("../IdentityPublicKey.snk")]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Schema, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7")]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f561df277c6c0b497d629032b410cdcf286e537c054724f7ffa0164345f62b3e642029d7a80cc351918955328c4adc8a048823ef90b0cf38ea7db0d729caf2b633c3babe08b0310198c1081995c19029bc675193744eab9d7345b8a67258ec17d112cebdbbb2a281487dceeafb9d83aa930f32103fbe1d2911425bc5744002c7")]
[assembly: InternalsVisibleTo("Newtonsoft.Json.Dynamic, PublicKey=0024000004800000940000000602000000240000525341310004000001000100cbd8d53b9d7de30f1f1278f636ec462cf9c254991291e66ebb157a885638a517887633b898ccbcf0d5c5ff7be85a6abe9e765d0ac7cd33c68dac67e7e64530e8222101109f154ab14a941c490ac155cd1d4fcba0fabb49016b4ef28593b015cab5937da31172f03f67d09edda404b88a60023f062ae71d0b2e4438b74cc11dc9")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("9ca358aa-317b-4925-8ada-4a29e943a363")]
[assembly: CLSCompliant(true)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("Newtonsoft")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyCopyright("Copyright © James Newton-King 2008")]
[assembly: AssemblyDescription("Json.NET is a popular high-performance JSON framework for .NET")]
[assembly: AssemblyFileVersion("12.0.301")]
[assembly: AssemblyInformationalVersion("12.0.301")]
[assembly: AssemblyProduct("Json.NET")]
[assembly: AssemblyTitle("Json.NET for Unity AOT (IL2CPP)")]
[assembly: NeutralResourcesLanguage("en-US")]
[assembly: AssemblyVersion("12.0.0.0")]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	internal sealed class IsReadOnlyAttribute : Attribute
	{
	}
	[CompilerGenerated]
	[Microsoft.CodeAnalysis.Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

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

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

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
}
namespace System.Diagnostics.CodeAnalysis
{
	[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, AllowMultiple = true)]
	internal sealed class NotNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false)]
	internal sealed class NotNullWhenAttribute : Attribute
	{
		public bool ReturnValue { get; }

		public NotNullWhenAttribute(bool returnValue)
		{
			ReturnValue = returnValue;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter | AttributeTargets.ReturnValue, Inherited = false)]
	internal sealed class MaybeNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, Inherited = false)]
	internal sealed class AllowNullAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Parameter, Inherited = false)]
	internal class DoesNotReturnIfAttribute : Attribute
	{
		public bool ParameterValue { get; }

		public DoesNotReturnIfAttribute(bool parameterValue)
		{
			ParameterValue = parameterValue;
		}
	}
}
namespace Newtonsoft.Json
{
	public enum ConstructorHandling
	{
		Default,
		AllowNonPublicDefaultConstructor
	}
	public enum DateFormatHandling
	{
		IsoDateFormat,
		MicrosoftDateFormat
	}
	public enum DateParseHandling
	{
		None,
		DateTime,
		DateTimeOffset
	}
	public enum DateTimeZoneHandling
	{
		Local,
		Utc,
		Unspecified,
		RoundtripKind
	}
	public class DefaultJsonNameTable : JsonNameTable
	{
		private class Entry
		{
			internal readonly string Value;

			internal readonly int HashCode;

			internal Entry Next;

			internal Entry(string value, int hashCode, Entry next)
			{
				Value = value;
				HashCode = hashCode;
				Next = next;
			}
		}

		private static readonly int HashCodeRandomizer;

		private int _count;

		private Entry[] _entries;

		private int _mask = 31;

		static DefaultJsonNameTable()
		{
			HashCodeRandomizer = Environment.TickCount;
		}

		public DefaultJsonNameTable()
		{
			_entries = new Entry[_mask + 1];
		}

		public override string? Get(char[] key, int start, int length)
		{
			if (length == 0)
			{
				return string.Empty;
			}
			int num = length + HashCodeRandomizer;
			num += (num << 7) ^ key[start];
			int num2 = start + length;
			for (int i = start + 1; i < num2; i++)
			{
				num += (num << 7) ^ key[i];
			}
			num -= num >> 17;
			num -= num >> 11;
			num -= num >> 5;
			int num3 = num & _mask;
			for (Entry entry = _entries[num3]; entry != null; entry = entry.Next)
			{
				if (entry.HashCode == num && TextEquals(entry.Value, key, start, length))
				{
					return entry.Value;
				}
			}
			return null;
		}

		public string Add(string key)
		{
			if (key == null)
			{
				throw new ArgumentNullException("key");
			}
			int length = key.Length;
			if (length == 0)
			{
				return string.Empty;
			}
			int num = length + HashCodeRandomizer;
			for (int i = 0; i < key.Length; i++)
			{
				num += (num << 7) ^ key[i];
			}
			num -= num >> 17;
			num -= num >> 11;
			num -= num >> 5;
			for (Entry entry = _entries[num & _mask]; entry != null; entry = entry.Next)
			{
				if (entry.HashCode == num && entry.Value.Equals(key, StringComparison.Ordinal))
				{
					return entry.Value;
				}
			}
			return AddEntry(key, num);
		}

		private string AddEntry(string str, int hashCode)
		{
			int num = hashCode & _mask;
			Entry entry = new Entry(str, hashCode, _entries[num]);
			_entries[num] = entry;
			if (_count++ == _mask)
			{
				Grow();
			}
			return entry.Value;
		}

		private void Grow()
		{
			Entry[] entries = _entries;
			int num = _mask * 2 + 1;
			Entry[] array = new Entry[num + 1];
			for (int i = 0; i < entries.Length; i++)
			{
				Entry entry = entries[i];
				while (entry != null)
				{
					int num2 = entry.HashCode & num;
					Entry next = entry.Next;
					entry.Next = array[num2];
					array[num2] = entry;
					entry = next;
				}
			}
			_entries = array;
			_mask = num;
		}

		private static bool TextEquals(string str1, char[] str2, int str2Start, int str2Length)
		{
			if (str1.Length != str2Length)
			{
				return false;
			}
			for (int i = 0; i < str1.Length; i++)
			{
				if (str1[i] != str2[str2Start + i])
				{
					return false;
				}
			}
			return true;
		}
	}
	[Flags]
	public enum DefaultValueHandling
	{
		Include = 0,
		Ignore = 1,
		Populate = 2,
		IgnoreAndPopulate = 3
	}
	public enum FloatFormatHandling
	{
		String,
		Symbol,
		DefaultValue
	}
	public enum FloatParseHandling
	{
		Double,
		Decimal
	}
	public enum Formatting
	{
		None,
		Indented
	}
	public interface IArrayPool<T>
	{
		T[] Rent(int minimumLength);

		void Return(T[]? array);
	}
	public interface IJsonLineInfo
	{
		int LineNumber { get; }

		int LinePosition { get; }

		bool HasLineInfo();
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonArrayAttribute : JsonContainerAttribute
	{
		private bool _allowNullItems;

		public bool AllowNullItems
		{
			get
			{
				return _allowNullItems;
			}
			set
			{
				_allowNullItems = value;
			}
		}

		public JsonArrayAttribute()
		{
		}

		public JsonArrayAttribute(bool allowNullItems)
		{
			_allowNullItems = allowNullItems;
		}

		public JsonArrayAttribute(string id)
			: base(id)
		{
		}
	}
	[AttributeUsage(AttributeTargets.Constructor, AllowMultiple = false)]
	public sealed class JsonConstructorAttribute : Attribute
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public abstract class JsonContainerAttribute : Attribute
	{
		internal bool? _isReference;

		internal bool? _itemIsReference;

		internal ReferenceLoopHandling? _itemReferenceLoopHandling;

		internal TypeNameHandling? _itemTypeNameHandling;

		private Type? _namingStrategyType;

		private object[]? _namingStrategyParameters;

		public string? Id { get; set; }

		public string? Title { get; set; }

		public string? Description { get; set; }

		public Type? ItemConverterType { get; set; }

		public object[]? ItemConverterParameters { get; set; }

		public Type? NamingStrategyType
		{
			get
			{
				return _namingStrategyType;
			}
			set
			{
				_namingStrategyType = value;
				NamingStrategyInstance = null;
			}
		}

		public object[]? NamingStrategyParameters
		{
			get
			{
				return _namingStrategyParameters;
			}
			set
			{
				_namingStrategyParameters = value;
				NamingStrategyInstance = null;
			}
		}

		internal NamingStrategy? NamingStrategyInstance { get; set; }

		public bool IsReference
		{
			get
			{
				return _isReference.GetValueOrDefault();
			}
			set
			{
				_isReference = value;
			}
		}

		public bool ItemIsReference
		{
			get
			{
				return _itemIsReference.GetValueOrDefault();
			}
			set
			{
				_itemIsReference = value;
			}
		}

		public ReferenceLoopHandling ItemReferenceLoopHandling
		{
			get
			{
				return _itemReferenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_itemReferenceLoopHandling = value;
			}
		}

		public TypeNameHandling ItemTypeNameHandling
		{
			get
			{
				return _itemTypeNameHandling.GetValueOrDefault();
			}
			set
			{
				_itemTypeNameHandling = value;
			}
		}

		protected JsonContainerAttribute()
		{
		}

		protected JsonContainerAttribute(string id)
		{
			Id = id;
		}
	}
	public static class JsonConvert
	{
		public static readonly string True = "true";

		public static readonly string False = "false";

		public static readonly string Null = "null";

		public static readonly string Undefined = "undefined";

		public static readonly string PositiveInfinity = "Infinity";

		public static readonly string NegativeInfinity = "-Infinity";

		public static readonly string NaN = "NaN";

		public static Func<JsonSerializerSettings>? DefaultSettings { get; set; }

		public static string ToString(DateTime value)
		{
			return ToString(value, DateFormatHandling.IsoDateFormat, DateTimeZoneHandling.RoundtripKind);
		}

		public static string ToString(DateTime value, DateFormatHandling format, DateTimeZoneHandling timeZoneHandling)
		{
			DateTime value2 = DateTimeUtils.EnsureDateTime(value, timeZoneHandling);
			using StringWriter stringWriter = StringUtils.CreateStringWriter(64);
			stringWriter.Write('"');
			DateTimeUtils.WriteDateTimeString(stringWriter, value2, format, null, CultureInfo.InvariantCulture);
			stringWriter.Write('"');
			return stringWriter.ToString();
		}

		public static string ToString(DateTimeOffset value)
		{
			return ToString(value, DateFormatHandling.IsoDateFormat);
		}

		public static string ToString(DateTimeOffset value, DateFormatHandling format)
		{
			using StringWriter stringWriter = StringUtils.CreateStringWriter(64);
			stringWriter.Write('"');
			DateTimeUtils.WriteDateTimeOffsetString(stringWriter, value, format, null, CultureInfo.InvariantCulture);
			stringWriter.Write('"');
			return stringWriter.ToString();
		}

		public static string ToString(bool value)
		{
			if (!value)
			{
				return False;
			}
			return True;
		}

		public static string ToString(char value)
		{
			return ToString(char.ToString(value));
		}

		public static string ToString(Enum value)
		{
			return value.ToString("D");
		}

		public static string ToString(int value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(short value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(ushort value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(uint value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(long value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		private static string ToStringInternal(BigInteger value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(ulong value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(float value)
		{
			return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture));
		}

		internal static string ToString(float value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);
		}

		private static string EnsureFloatFormat(double value, string text, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			if (floatFormatHandling == FloatFormatHandling.Symbol || (!double.IsInfinity(value) && !double.IsNaN(value)))
			{
				return text;
			}
			if (floatFormatHandling == FloatFormatHandling.DefaultValue)
			{
				if (nullable)
				{
					return Null;
				}
				return "0.0";
			}
			return quoteChar + text + quoteChar;
		}

		public static string ToString(double value)
		{
			return EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture));
		}

		internal static string ToString(double value, FloatFormatHandling floatFormatHandling, char quoteChar, bool nullable)
		{
			return EnsureFloatFormat(value, EnsureDecimalPlace(value, value.ToString("R", CultureInfo.InvariantCulture)), floatFormatHandling, quoteChar, nullable);
		}

		private static string EnsureDecimalPlace(double value, string text)
		{
			if (double.IsNaN(value) || double.IsInfinity(value) || text.IndexOf('.') != -1 || text.IndexOf('E') != -1 || text.IndexOf('e') != -1)
			{
				return text;
			}
			return text + ".0";
		}

		private static string EnsureDecimalPlace(string text)
		{
			if (text.IndexOf('.') != -1)
			{
				return text;
			}
			return text + ".0";
		}

		public static string ToString(byte value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		[CLSCompliant(false)]
		public static string ToString(sbyte value)
		{
			return value.ToString(null, CultureInfo.InvariantCulture);
		}

		public static string ToString(decimal value)
		{
			return EnsureDecimalPlace(value.ToString(null, CultureInfo.InvariantCulture));
		}

		public static string ToString(Guid value)
		{
			return ToString(value, '"');
		}

		internal static string ToString(Guid value, char quoteChar)
		{
			string text = value.ToString("D", CultureInfo.InvariantCulture);
			string text2 = quoteChar.ToString(CultureInfo.InvariantCulture);
			return text2 + text + text2;
		}

		public static string ToString(TimeSpan value)
		{
			return ToString(value, '"');
		}

		internal static string ToString(TimeSpan value, char quoteChar)
		{
			return ToString(value.ToString(), quoteChar);
		}

		public static string ToString(Uri? value)
		{
			if (value == null)
			{
				return Null;
			}
			return ToString(value, '"');
		}

		internal static string ToString(Uri value, char quoteChar)
		{
			return ToString(value.OriginalString, quoteChar);
		}

		public static string ToString(string? value)
		{
			return ToString(value, '"');
		}

		public static string ToString(string? value, char delimiter)
		{
			return ToString(value, delimiter, StringEscapeHandling.Default);
		}

		public static string ToString(string? value, char delimiter, StringEscapeHandling stringEscapeHandling)
		{
			if (delimiter != '"' && delimiter != '\'')
			{
				throw new ArgumentException("Delimiter must be a single or double quote.", "delimiter");
			}
			return JavaScriptUtils.ToEscapedJavaScriptString(value, delimiter, appendDelimiters: true, stringEscapeHandling);
		}

		public static string ToString(object? value)
		{
			if (value == null)
			{
				return Null;
			}
			return ConvertUtils.GetTypeCode(value.GetType()) switch
			{
				PrimitiveTypeCode.String => ToString((string)value), 
				PrimitiveTypeCode.Char => ToString((char)value), 
				PrimitiveTypeCode.Boolean => ToString((bool)value), 
				PrimitiveTypeCode.SByte => ToString((sbyte)value), 
				PrimitiveTypeCode.Int16 => ToString((short)value), 
				PrimitiveTypeCode.UInt16 => ToString((ushort)value), 
				PrimitiveTypeCode.Int32 => ToString((int)value), 
				PrimitiveTypeCode.Byte => ToString((byte)value), 
				PrimitiveTypeCode.UInt32 => ToString((uint)value), 
				PrimitiveTypeCode.Int64 => ToString((long)value), 
				PrimitiveTypeCode.UInt64 => ToString((ulong)value), 
				PrimitiveTypeCode.Single => ToString((float)value), 
				PrimitiveTypeCode.Double => ToString((double)value), 
				PrimitiveTypeCode.DateTime => ToString((DateTime)value), 
				PrimitiveTypeCode.Decimal => ToString((decimal)value), 
				PrimitiveTypeCode.DBNull => Null, 
				PrimitiveTypeCode.DateTimeOffset => ToString((DateTimeOffset)value), 
				PrimitiveTypeCode.Guid => ToString((Guid)value), 
				PrimitiveTypeCode.Uri => ToString((Uri)value), 
				PrimitiveTypeCode.TimeSpan => ToString((TimeSpan)value), 
				PrimitiveTypeCode.BigInteger => ToStringInternal((BigInteger)value), 
				_ => throw new ArgumentException("Unsupported type: {0}. Use the JsonSerializer class to get the object's JSON representation.".FormatWith(CultureInfo.InvariantCulture, value.GetType())), 
			};
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value)
		{
			return SerializeObject(value, (Type?)null, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting)
		{
			return SerializeObject(value, formatting, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return SerializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return SerializeObject(value, null, formatting, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, JsonSerializerSettings settings)
		{
			return SerializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Type? type, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			return SerializeObjectInternal(value, type, jsonSerializer);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Formatting formatting, JsonSerializerSettings? settings)
		{
			return SerializeObject(value, null, formatting, settings);
		}

		[DebuggerStepThrough]
		public static string SerializeObject(object? value, Type? type, Formatting formatting, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			jsonSerializer.Formatting = formatting;
			return SerializeObjectInternal(value, type, jsonSerializer);
		}

		private static string SerializeObjectInternal(object? value, Type? type, JsonSerializer jsonSerializer)
		{
			StringWriter stringWriter = new StringWriter(new StringBuilder(256), CultureInfo.InvariantCulture);
			using (JsonTextWriter jsonTextWriter = new JsonTextWriter(stringWriter))
			{
				jsonTextWriter.Formatting = jsonSerializer.Formatting;
				jsonSerializer.Serialize(jsonTextWriter, value, type);
			}
			return stringWriter.ToString();
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value)
		{
			return DeserializeObject(value, (Type?)null, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, JsonSerializerSettings settings)
		{
			return DeserializeObject(value, null, settings);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, Type type)
		{
			return DeserializeObject(value, type, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static T DeserializeObject<T>(string value)
		{
			return JsonConvert.DeserializeObject<T>(value, (JsonSerializerSettings?)null);
		}

		[DebuggerStepThrough]
		public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject)
		{
			return DeserializeObject<T>(value);
		}

		[DebuggerStepThrough]
		public static T DeserializeAnonymousType<T>(string value, T anonymousTypeObject, JsonSerializerSettings settings)
		{
			return DeserializeObject<T>(value, settings);
		}

		[DebuggerStepThrough]
		[return: MaybeNull]
		public static T DeserializeObject<T>(string value, params JsonConverter[] converters)
		{
			return (T)DeserializeObject(value, typeof(T), converters);
		}

		[DebuggerStepThrough]
		[return: MaybeNull]
		public static T DeserializeObject<T>(string value, JsonSerializerSettings? settings)
		{
			return (T)DeserializeObject(value, typeof(T), settings);
		}

		[DebuggerStepThrough]
		public static object? DeserializeObject(string value, Type type, params JsonConverter[] converters)
		{
			JsonSerializerSettings settings = ((converters != null && converters.Length != 0) ? new JsonSerializerSettings
			{
				Converters = converters
			} : null);
			return DeserializeObject(value, type, settings);
		}

		public static object? DeserializeObject(string value, Type? type, JsonSerializerSettings? settings)
		{
			ValidationUtils.ArgumentNotNull(value, "value");
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			if (!jsonSerializer.IsCheckAdditionalContentSet())
			{
				jsonSerializer.CheckAdditionalContent = true;
			}
			using JsonTextReader reader = new JsonTextReader(new StringReader(value));
			return jsonSerializer.Deserialize(reader, type);
		}

		[DebuggerStepThrough]
		public static void PopulateObject(string value, object target)
		{
			PopulateObject(value, target, null);
		}

		public static void PopulateObject(string value, object target, JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = JsonSerializer.CreateDefault(settings);
			using JsonReader jsonReader = new JsonTextReader(new StringReader(value));
			jsonSerializer.Populate(jsonReader, target);
			if (settings == null || !settings.CheckAdditionalContent)
			{
				return;
			}
			while (jsonReader.Read())
			{
				if (jsonReader.TokenType != JsonToken.Comment)
				{
					throw JsonSerializationException.Create(jsonReader, "Additional text found in JSON string after finishing deserializing object.");
				}
			}
		}

		public static string SerializeXmlNode(XmlNode? node)
		{
			return SerializeXmlNode(node, Formatting.None);
		}

		public static string SerializeXmlNode(XmlNode? node, Formatting formatting)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static string SerializeXmlNode(XmlNode? node, Formatting formatting, bool omitRootObject)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter
			{
				OmitRootObject = omitRootObject
			};
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static XmlDocument? DeserializeXmlNode(string value)
		{
			return DeserializeXmlNode(value, null);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName)
		{
			return DeserializeXmlNode(value, deserializeRootElementName, writeArrayAttribute: false);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName, bool writeArrayAttribute)
		{
			return DeserializeXmlNode(value, deserializeRootElementName, writeArrayAttribute, encodeSpecialCharacters: false);
		}

		public static XmlDocument? DeserializeXmlNode(string value, string? deserializeRootElementName, bool writeArrayAttribute, bool encodeSpecialCharacters)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			xmlNodeConverter.DeserializeRootElementName = deserializeRootElementName;
			xmlNodeConverter.WriteArrayAttribute = writeArrayAttribute;
			xmlNodeConverter.EncodeSpecialCharacters = encodeSpecialCharacters;
			return (XmlDocument)DeserializeObject(value, typeof(XmlDocument), xmlNodeConverter);
		}

		public static string SerializeXNode(XObject? node)
		{
			return SerializeXNode(node, Formatting.None);
		}

		public static string SerializeXNode(XObject? node, Formatting formatting)
		{
			return SerializeXNode(node, formatting, omitRootObject: false);
		}

		public static string SerializeXNode(XObject? node, Formatting formatting, bool omitRootObject)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter
			{
				OmitRootObject = omitRootObject
			};
			return SerializeObject(node, formatting, xmlNodeConverter);
		}

		public static XDocument? DeserializeXNode(string value)
		{
			return DeserializeXNode(value, null);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName)
		{
			return DeserializeXNode(value, deserializeRootElementName, writeArrayAttribute: false);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName, bool writeArrayAttribute)
		{
			return DeserializeXNode(value, deserializeRootElementName, writeArrayAttribute, encodeSpecialCharacters: false);
		}

		public static XDocument? DeserializeXNode(string value, string? deserializeRootElementName, bool writeArrayAttribute, bool encodeSpecialCharacters)
		{
			XmlNodeConverter xmlNodeConverter = new XmlNodeConverter();
			xmlNodeConverter.DeserializeRootElementName = deserializeRootElementName;
			xmlNodeConverter.WriteArrayAttribute = writeArrayAttribute;
			xmlNodeConverter.EncodeSpecialCharacters = encodeSpecialCharacters;
			return (XDocument)DeserializeObject(value, typeof(XDocument), xmlNodeConverter);
		}
	}
	public abstract class JsonConverter
	{
		public virtual bool CanRead => true;

		public virtual bool CanWrite => true;

		public abstract void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer);

		public abstract object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer);

		public abstract bool CanConvert(Type objectType);
	}
	public abstract class JsonConverter<T> : JsonConverter
	{
		public sealed override void WriteJson(JsonWriter writer, object? value, JsonSerializer serializer)
		{
			if (!((value != null) ? (value is T) : ReflectionUtils.IsNullable(typeof(T))))
			{
				throw new JsonSerializationException("Converter cannot write specified value to JSON. {0} is required.".FormatWith(CultureInfo.InvariantCulture, typeof(T)));
			}
			WriteJson(writer, (T)value, serializer);
		}

		public abstract void WriteJson(JsonWriter writer, [AllowNull] T value, JsonSerializer serializer);

		public sealed override object? ReadJson(JsonReader reader, Type objectType, object? existingValue, JsonSerializer serializer)
		{
			bool flag = existingValue == null;
			if (!flag && !(existingValue is T))
			{
				throw new JsonSerializationException("Converter cannot read JSON with the specified existing value. {0} is required.".FormatWith(CultureInfo.InvariantCulture, typeof(T)));
			}
			return ReadJson(reader, objectType, flag ? default(T) : ((T)existingValue), !flag, serializer);
		}

		public abstract T ReadJson(JsonReader reader, Type objectType, [AllowNull] T existingValue, bool hasExistingValue, JsonSerializer serializer);

		public sealed override bool CanConvert(Type objectType)
		{
			return typeof(T).IsAssignableFrom(objectType);
		}
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Enum | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter, AllowMultiple = false)]
	public sealed class JsonConverterAttribute : Attribute
	{
		private readonly Type _converterType;

		public Type ConverterType => _converterType;

		public object[]? ConverterParameters { get; }

		public JsonConverterAttribute(Type converterType)
		{
			if (converterType == null)
			{
				throw new ArgumentNullException("converterType");
			}
			_converterType = converterType;
		}

		public JsonConverterAttribute(Type converterType, params object[] converterParameters)
			: this(converterType)
		{
			ConverterParameters = converterParameters;
		}
	}
	public class JsonConverterCollection : Collection<JsonConverter>
	{
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonDictionaryAttribute : JsonContainerAttribute
	{
		public JsonDictionaryAttribute()
		{
		}

		public JsonDictionaryAttribute(string id)
			: base(id)
		{
		}
	}
	[Serializable]
	public class JsonException : Exception
	{
		public JsonException()
		{
		}

		public JsonException(string message)
			: base(message)
		{
		}

		public JsonException(string message, Exception? innerException)
			: base(message, innerException)
		{
		}

		public JsonException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		internal static JsonException Create(IJsonLineInfo lineInfo, string path, string message)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			return new JsonException(message);
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public class JsonExtensionDataAttribute : Attribute
	{
		public bool WriteData { get; set; }

		public bool ReadData { get; set; }

		public JsonExtensionDataAttribute()
		{
			WriteData = true;
			ReadData = true;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public sealed class JsonIgnoreAttribute : Attribute
	{
	}
	public abstract class JsonNameTable
	{
		public abstract string? Get(char[] key, int start, int length);
	}
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Interface, AllowMultiple = false)]
	public sealed class JsonObjectAttribute : JsonContainerAttribute
	{
		private MemberSerialization _memberSerialization;

		internal MissingMemberHandling? _missingMemberHandling;

		internal Required? _itemRequired;

		internal NullValueHandling? _itemNullValueHandling;

		public MemberSerialization MemberSerialization
		{
			get
			{
				return _memberSerialization;
			}
			set
			{
				_memberSerialization = value;
			}
		}

		public MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling.GetValueOrDefault();
			}
			set
			{
				_missingMemberHandling = value;
			}
		}

		public NullValueHandling ItemNullValueHandling
		{
			get
			{
				return _itemNullValueHandling.GetValueOrDefault();
			}
			set
			{
				_itemNullValueHandling = value;
			}
		}

		public Required ItemRequired
		{
			get
			{
				return _itemRequired.GetValueOrDefault();
			}
			set
			{
				_itemRequired = value;
			}
		}

		public JsonObjectAttribute()
		{
		}

		public JsonObjectAttribute(MemberSerialization memberSerialization)
		{
			MemberSerialization = memberSerialization;
		}

		public JsonObjectAttribute(string id)
			: base(id)
		{
		}
	}
	internal enum JsonContainerType
	{
		None,
		Object,
		Array,
		Constructor
	}
	internal struct JsonPosition
	{
		private static readonly char[] SpecialCharacters = new char[18]
		{
			'.', ' ', '\'', '/', '"', '[', ']', '(', ')', '\t',
			'\n', '\r', '\f', '\b', '\\', '\u0085', '\u2028', '\u2029'
		};

		internal JsonContainerType Type;

		internal int Position;

		internal string? PropertyName;

		internal bool HasIndex;

		public JsonPosition(JsonContainerType type)
		{
			Type = type;
			HasIndex = TypeHasIndex(type);
			Position = -1;
			PropertyName = null;
		}

		internal int CalculateLength()
		{
			switch (Type)
			{
			case JsonContainerType.Object:
				return PropertyName.Length + 5;
			case JsonContainerType.Array:
			case JsonContainerType.Constructor:
				return MathUtils.IntLength((ulong)Position) + 2;
			default:
				throw new ArgumentOutOfRangeException("Type");
			}
		}

		internal void WriteTo(StringBuilder sb, ref StringWriter? writer, ref char[]? buffer)
		{
			switch (Type)
			{
			case JsonContainerType.Object:
			{
				string propertyName = PropertyName;
				if (propertyName.IndexOfAny(SpecialCharacters) != -1)
				{
					sb.Append("['");
					if (writer == null)
					{
						writer = new StringWriter(sb);
					}
					JavaScriptUtils.WriteEscapedJavaScriptString(writer, propertyName, '\'', appendDelimiters: false, JavaScriptUtils.SingleQuoteCharEscapeFlags, StringEscapeHandling.Default, null, ref buffer);
					sb.Append("']");
				}
				else
				{
					if (sb.Length > 0)
					{
						sb.Append('.');
					}
					sb.Append(propertyName);
				}
				break;
			}
			case JsonContainerType.Array:
			case JsonContainerType.Constructor:
				sb.Append('[');
				sb.Append(Position);
				sb.Append(']');
				break;
			}
		}

		internal static bool TypeHasIndex(JsonContainerType type)
		{
			if (type != JsonContainerType.Array)
			{
				return type == JsonContainerType.Constructor;
			}
			return true;
		}

		internal static string BuildPath(List<JsonPosition> positions, JsonPosition? currentPosition)
		{
			int num = 0;
			if (positions != null)
			{
				for (int i = 0; i < positions.Count; i++)
				{
					num += positions[i].CalculateLength();
				}
			}
			if (currentPosition.HasValue)
			{
				num += currentPosition.GetValueOrDefault().CalculateLength();
			}
			StringBuilder stringBuilder = new StringBuilder(num);
			StringWriter writer = null;
			char[] buffer = null;
			if (positions != null)
			{
				foreach (JsonPosition position in positions)
				{
					position.WriteTo(stringBuilder, ref writer, ref buffer);
				}
			}
			currentPosition?.WriteTo(stringBuilder, ref writer, ref buffer);
			return stringBuilder.ToString();
		}

		internal static string FormatMessage(IJsonLineInfo? lineInfo, string path, string message)
		{
			if (!message.EndsWith(Environment.NewLine, StringComparison.Ordinal))
			{
				message = message.Trim();
				if (!StringUtils.EndsWith(message, '.'))
				{
					message += ".";
				}
				message += " ";
			}
			message += "Path '{0}'".FormatWith(CultureInfo.InvariantCulture, path);
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				message += ", line {0}, position {1}".FormatWith(CultureInfo.InvariantCulture, lineInfo.LineNumber, lineInfo.LinePosition);
			}
			message += ".";
			return message;
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter, AllowMultiple = false)]
	public sealed class JsonPropertyAttribute : Attribute
	{
		internal NullValueHandling? _nullValueHandling;

		internal DefaultValueHandling? _defaultValueHandling;

		internal ReferenceLoopHandling? _referenceLoopHandling;

		internal ObjectCreationHandling? _objectCreationHandling;

		internal TypeNameHandling? _typeNameHandling;

		internal bool? _isReference;

		internal int? _order;

		internal Required? _required;

		internal bool? _itemIsReference;

		internal ReferenceLoopHandling? _itemReferenceLoopHandling;

		internal TypeNameHandling? _itemTypeNameHandling;

		public Type? ItemConverterType { get; set; }

		public object[]? ItemConverterParameters { get; set; }

		public Type? NamingStrategyType { get; set; }

		public object[]? NamingStrategyParameters { get; set; }

		public NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling.GetValueOrDefault();
			}
			set
			{
				_nullValueHandling = value;
			}
		}

		public DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling.GetValueOrDefault();
			}
			set
			{
				_defaultValueHandling = value;
			}
		}

		public ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_referenceLoopHandling = value;
			}
		}

		public ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling.GetValueOrDefault();
			}
			set
			{
				_objectCreationHandling = value;
			}
		}

		public TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling.GetValueOrDefault();
			}
			set
			{
				_typeNameHandling = value;
			}
		}

		public bool IsReference
		{
			get
			{
				return _isReference.GetValueOrDefault();
			}
			set
			{
				_isReference = value;
			}
		}

		public int Order
		{
			get
			{
				return _order.GetValueOrDefault();
			}
			set
			{
				_order = value;
			}
		}

		public Required Required
		{
			get
			{
				return _required.GetValueOrDefault();
			}
			set
			{
				_required = value;
			}
		}

		public string? PropertyName { get; set; }

		public ReferenceLoopHandling ItemReferenceLoopHandling
		{
			get
			{
				return _itemReferenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_itemReferenceLoopHandling = value;
			}
		}

		public TypeNameHandling ItemTypeNameHandling
		{
			get
			{
				return _itemTypeNameHandling.GetValueOrDefault();
			}
			set
			{
				_itemTypeNameHandling = value;
			}
		}

		public bool ItemIsReference
		{
			get
			{
				return _itemIsReference.GetValueOrDefault();
			}
			set
			{
				_itemIsReference = value;
			}
		}

		public JsonPropertyAttribute()
		{
		}

		public JsonPropertyAttribute(string propertyName)
		{
			PropertyName = propertyName;
		}
	}
	public abstract class JsonReader : IDisposable
	{
		protected internal enum State
		{
			Start,
			Complete,
			Property,
			ObjectStart,
			Object,
			ArrayStart,
			Array,
			Closed,
			PostValue,
			ConstructorStart,
			Constructor,
			Error,
			Finished
		}

		private JsonToken _tokenType;

		private object? _value;

		internal char _quoteChar;

		internal State _currentState;

		private JsonPosition _currentPosition;

		private CultureInfo? _culture;

		private DateTimeZoneHandling _dateTimeZoneHandling;

		private int? _maxDepth;

		private bool _hasExceededMaxDepth;

		internal DateParseHandling _dateParseHandling;

		internal FloatParseHandling _floatParseHandling;

		private string? _dateFormatString;

		private List<JsonPosition>? _stack;

		protected State CurrentState => _currentState;

		public bool CloseInput { get; set; }

		public bool SupportMultipleContent { get; set; }

		public virtual char QuoteChar
		{
			get
			{
				return _quoteChar;
			}
			protected internal set
			{
				_quoteChar = value;
			}
		}

		public DateTimeZoneHandling DateTimeZoneHandling
		{
			get
			{
				return _dateTimeZoneHandling;
			}
			set
			{
				if (value < DateTimeZoneHandling.Local || value > DateTimeZoneHandling.RoundtripKind)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_dateTimeZoneHandling = value;
			}
		}

		public DateParseHandling DateParseHandling
		{
			get
			{
				return _dateParseHandling;
			}
			set
			{
				if (value < DateParseHandling.None || value > DateParseHandling.DateTimeOffset)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_dateParseHandling = value;
			}
		}

		public FloatParseHandling FloatParseHandling
		{
			get
			{
				return _floatParseHandling;
			}
			set
			{
				if (value < FloatParseHandling.Double || value > FloatParseHandling.Decimal)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_floatParseHandling = value;
			}
		}

		public string? DateFormatString
		{
			get
			{
				return _dateFormatString;
			}
			set
			{
				_dateFormatString = value;
			}
		}

		public int? MaxDepth
		{
			get
			{
				return _maxDepth;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentException("Value must be positive.", "value");
				}
				_maxDepth = value;
			}
		}

		public virtual JsonToken TokenType => _tokenType;

		public virtual object? Value => _value;

		public virtual Type? ValueType => _value?.GetType();

		public virtual int Depth
		{
			get
			{
				int num = _stack?.Count ?? 0;
				if (JsonTokenUtils.IsStartToken(TokenType) || _currentPosition.Type == JsonContainerType.None)
				{
					return num;
				}
				return num + 1;
			}
		}

		public virtual string Path
		{
			get
			{
				if (_currentPosition.Type == JsonContainerType.None)
				{
					return string.Empty;
				}
				JsonPosition? currentPosition = ((_currentState != State.ArrayStart && _currentState != State.ConstructorStart && _currentState != State.ObjectStart) ? new JsonPosition?(_currentPosition) : null);
				return JsonPosition.BuildPath(_stack, currentPosition);
			}
		}

		public CultureInfo Culture
		{
			get
			{
				return _culture ?? CultureInfo.InvariantCulture;
			}
			set
			{
				_culture = value;
			}
		}

		public virtual Task<bool> ReadAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<bool>() ?? Read().ToAsync();
		}

		public async Task SkipAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			if (TokenType == JsonToken.PropertyName)
			{
				await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			}
			if (JsonTokenUtils.IsStartToken(TokenType))
			{
				int depth = Depth;
				while (await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false) && depth < Depth)
				{
				}
			}
		}

		internal async Task ReaderReadAndAssertAsync(CancellationToken cancellationToken)
		{
			if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
			{
				throw CreateUnexpectedEndException();
			}
		}

		public virtual Task<bool?> ReadAsBooleanAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<bool?>() ?? Task.FromResult(ReadAsBoolean());
		}

		public virtual Task<byte[]?> ReadAsBytesAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<byte[]>() ?? Task.FromResult(ReadAsBytes());
		}

		internal async Task<byte[]?> ReadArrayIntoByteArrayAsync(CancellationToken cancellationToken)
		{
			List<byte> buffer = new List<byte>();
			do
			{
				if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
				{
					SetToken(JsonToken.None);
				}
			}
			while (!ReadArrayElementIntoByteArrayReportDone(buffer));
			byte[] array = buffer.ToArray();
			SetToken(JsonToken.Bytes, array, updateIndex: false);
			return array;
		}

		public virtual Task<DateTime?> ReadAsDateTimeAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<DateTime?>() ?? Task.FromResult(ReadAsDateTime());
		}

		public virtual Task<DateTimeOffset?> ReadAsDateTimeOffsetAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<DateTimeOffset?>() ?? Task.FromResult(ReadAsDateTimeOffset());
		}

		public virtual Task<decimal?> ReadAsDecimalAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<decimal?>() ?? Task.FromResult(ReadAsDecimal());
		}

		public virtual Task<double?> ReadAsDoubleAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return Task.FromResult(ReadAsDouble());
		}

		public virtual Task<int?> ReadAsInt32Async(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<int?>() ?? Task.FromResult(ReadAsInt32());
		}

		public virtual Task<string?> ReadAsStringAsync(CancellationToken cancellationToken = default(CancellationToken))
		{
			return cancellationToken.CancelIfRequestedAsync<string>() ?? Task.FromResult(ReadAsString());
		}

		internal async Task<bool> ReadAndMoveToContentAsync(CancellationToken cancellationToken)
		{
			bool flag = await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			if (flag)
			{
				flag = await MoveToContentAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false);
			}
			return flag;
		}

		internal Task<bool> MoveToContentAsync(CancellationToken cancellationToken)
		{
			JsonToken tokenType = TokenType;
			if (tokenType == JsonToken.None || tokenType == JsonToken.Comment)
			{
				return MoveToContentFromNonContentAsync(cancellationToken);
			}
			return AsyncUtils.True;
		}

		private async Task<bool> MoveToContentFromNonContentAsync(CancellationToken cancellationToken)
		{
			JsonToken tokenType;
			do
			{
				if (!(await ReadAsync(cancellationToken).ConfigureAwait(continueOnCapturedContext: false)))
				{
					return false;
				}
				tokenType = TokenType;
			}
			while (tokenType == JsonToken.None || tokenType == JsonToken.Comment);
			return true;
		}

		internal JsonPosition GetPosition(int depth)
		{
			if (_stack != null && depth < _stack.Count)
			{
				return _stack[depth];
			}
			return _currentPosition;
		}

		protected JsonReader()
		{
			_currentState = State.Start;
			_dateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;
			_dateParseHandling = DateParseHandling.DateTime;
			_floatParseHandling = FloatParseHandling.Double;
			CloseInput = true;
		}

		private void Push(JsonContainerType value)
		{
			UpdateScopeWithFinishedValue();
			if (_currentPosition.Type == JsonContainerType.None)
			{
				_currentPosition = new JsonPosition(value);
				return;
			}
			if (_stack == null)
			{
				_stack = new List<JsonPosition>();
			}
			_stack.Add(_currentPosition);
			_currentPosition = new JsonPosition(value);
			if (!_maxDepth.HasValue || !(Depth + 1 > _maxDepth) || _hasExceededMaxDepth)
			{
				return;
			}
			_hasExceededMaxDepth = true;
			throw JsonReaderException.Create(this, "The reader's MaxDepth of {0} has been exceeded.".FormatWith(CultureInfo.InvariantCulture, _maxDepth));
		}

		private JsonContainerType Pop()
		{
			JsonPosition currentPosition;
			if (_stack != null && _stack.Count > 0)
			{
				currentPosition = _currentPosition;
				_currentPosition = _stack[_stack.Count - 1];
				_stack.RemoveAt(_stack.Count - 1);
			}
			else
			{
				currentPosition = _currentPosition;
				_currentPosition = default(JsonPosition);
			}
			if (_maxDepth.HasValue && Depth <= _maxDepth)
			{
				_hasExceededMaxDepth = false;
			}
			return currentPosition.Type;
		}

		private JsonContainerType Peek()
		{
			return _currentPosition.Type;
		}

		public abstract bool Read();

		public virtual int? ReadAsInt32()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is int)
				{
					return (int)value;
				}
				int num;
				if (value is BigInteger bigInteger)
				{
					num = (int)bigInteger;
				}
				else
				{
					try
					{
						num = Convert.ToInt32(value, CultureInfo.InvariantCulture);
					}
					catch (Exception ex)
					{
						throw JsonReaderException.Create(this, "Could not convert to integer: {0}.".FormatWith(CultureInfo.InvariantCulture, value), ex);
					}
				}
				SetToken(JsonToken.Integer, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
			{
				string s = (string)Value;
				return ReadInt32String(s);
			}
			default:
				throw JsonReaderException.Create(this, "Error reading integer. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal int? ReadInt32String(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (int.TryParse(s, NumberStyles.Integer, Culture, out var result))
			{
				SetToken(JsonToken.Integer, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to integer: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual string? ReadAsString()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.String:
				return (string)Value;
			default:
				if (JsonTokenUtils.IsPrimitiveToken(contentToken))
				{
					object value = Value;
					if (value != null)
					{
						string text = ((!(value is IFormattable formattable)) ? ((value is Uri uri) ? uri.OriginalString : value.ToString()) : formattable.ToString(null, Culture));
						SetToken(JsonToken.String, text, updateIndex: false);
						return text;
					}
				}
				throw JsonReaderException.Create(this, "Error reading string. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		public virtual byte[]? ReadAsBytes()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.StartObject:
			{
				ReadIntoWrappedTypeObject();
				byte[] array2 = ReadAsBytes();
				ReaderReadAndAssert();
				if (TokenType != JsonToken.EndObject)
				{
					throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
				}
				SetToken(JsonToken.Bytes, array2, updateIndex: false);
				return array2;
			}
			case JsonToken.String:
			{
				string text = (string)Value;
				Guid g;
				byte[] array3 = ((text.Length == 0) ? CollectionUtils.ArrayEmpty<byte>() : ((!ConvertUtils.TryConvertGuid(text, out g)) ? Convert.FromBase64String(text) : g.ToByteArray()));
				SetToken(JsonToken.Bytes, array3, updateIndex: false);
				return array3;
			}
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Bytes:
				if (Value is Guid guid)
				{
					byte[] array = guid.ToByteArray();
					SetToken(JsonToken.Bytes, array, updateIndex: false);
					return array;
				}
				return (byte[])Value;
			case JsonToken.StartArray:
				return ReadArrayIntoByteArray();
			default:
				throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal byte[] ReadArrayIntoByteArray()
		{
			List<byte> list = new List<byte>();
			do
			{
				if (!Read())
				{
					SetToken(JsonToken.None);
				}
			}
			while (!ReadArrayElementIntoByteArrayReportDone(list));
			byte[] array = list.ToArray();
			SetToken(JsonToken.Bytes, array, updateIndex: false);
			return array;
		}

		private bool ReadArrayElementIntoByteArrayReportDone(List<byte> buffer)
		{
			switch (TokenType)
			{
			case JsonToken.None:
				throw JsonReaderException.Create(this, "Unexpected end when reading bytes.");
			case JsonToken.Integer:
				buffer.Add(Convert.ToByte(Value, CultureInfo.InvariantCulture));
				return false;
			case JsonToken.EndArray:
				return true;
			case JsonToken.Comment:
				return false;
			default:
				throw JsonReaderException.Create(this, "Unexpected token when reading bytes: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
			}
		}

		public virtual double? ReadAsDouble()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is double)
				{
					return (double)value;
				}
				double num = ((!(value is BigInteger bigInteger)) ? Convert.ToDouble(value, CultureInfo.InvariantCulture) : ((double)bigInteger));
				SetToken(JsonToken.Float, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
				return ReadDoubleString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading double. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal double? ReadDoubleString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (double.TryParse(s, NumberStyles.Float | NumberStyles.AllowThousands, Culture, out var result))
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to double: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual bool? ReadAsBoolean()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				bool flag = ((!(Value is BigInteger bigInteger)) ? Convert.ToBoolean(Value, CultureInfo.InvariantCulture) : (bigInteger != 0L));
				SetToken(JsonToken.Boolean, flag, updateIndex: false);
				return flag;
			}
			case JsonToken.String:
				return ReadBooleanString((string)Value);
			case JsonToken.Boolean:
				return (bool)Value;
			default:
				throw JsonReaderException.Create(this, "Error reading boolean. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal bool? ReadBooleanString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (bool.TryParse(s, out var result))
			{
				SetToken(JsonToken.Boolean, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to boolean: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual decimal? ReadAsDecimal()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Integer:
			case JsonToken.Float:
			{
				object value = Value;
				if (value is decimal)
				{
					return (decimal)value;
				}
				decimal num;
				if (value is BigInteger bigInteger)
				{
					num = (decimal)bigInteger;
				}
				else
				{
					try
					{
						num = Convert.ToDecimal(value, CultureInfo.InvariantCulture);
					}
					catch (Exception ex)
					{
						throw JsonReaderException.Create(this, "Could not convert to decimal: {0}.".FormatWith(CultureInfo.InvariantCulture, value), ex);
					}
				}
				SetToken(JsonToken.Float, num, updateIndex: false);
				return num;
			}
			case JsonToken.String:
				return ReadDecimalString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading decimal. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal decimal? ReadDecimalString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (decimal.TryParse(s, NumberStyles.Number, Culture, out var result))
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			if (ConvertUtils.DecimalTryParse(s.ToCharArray(), 0, s.Length, out result) == ParseResult.Success)
			{
				SetToken(JsonToken.Float, result, updateIndex: false);
				return result;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to decimal: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual DateTime? ReadAsDateTime()
		{
			switch (GetContentToken())
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Date:
				if (Value is DateTimeOffset dateTimeOffset)
				{
					SetToken(JsonToken.Date, dateTimeOffset.DateTime, updateIndex: false);
				}
				return (DateTime)Value;
			case JsonToken.String:
				return ReadDateTimeString((string)Value);
			default:
				throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, TokenType));
			}
		}

		internal DateTime? ReadDateTimeString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (DateTimeUtils.TryParseDateTime(s, DateTimeZoneHandling, _dateFormatString, Culture, out var dt))
			{
				dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			if (DateTime.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))
			{
				dt = DateTimeUtils.EnsureDateTime(dt, DateTimeZoneHandling);
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			throw JsonReaderException.Create(this, "Could not convert string to DateTime: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		public virtual DateTimeOffset? ReadAsDateTimeOffset()
		{
			JsonToken contentToken = GetContentToken();
			switch (contentToken)
			{
			case JsonToken.None:
			case JsonToken.Null:
			case JsonToken.EndArray:
				return null;
			case JsonToken.Date:
				if (Value is DateTime dateTime)
				{
					SetToken(JsonToken.Date, new DateTimeOffset(dateTime), updateIndex: false);
				}
				return (DateTimeOffset)Value;
			case JsonToken.String:
			{
				string s = (string)Value;
				return ReadDateTimeOffsetString(s);
			}
			default:
				throw JsonReaderException.Create(this, "Error reading date. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, contentToken));
			}
		}

		internal DateTimeOffset? ReadDateTimeOffsetString(string? s)
		{
			if (StringUtils.IsNullOrEmpty(s))
			{
				SetToken(JsonToken.Null, null, updateIndex: false);
				return null;
			}
			if (DateTimeUtils.TryParseDateTimeOffset(s, _dateFormatString, Culture, out var dt))
			{
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			if (DateTimeOffset.TryParse(s, Culture, DateTimeStyles.RoundtripKind, out dt))
			{
				SetToken(JsonToken.Date, dt, updateIndex: false);
				return dt;
			}
			SetToken(JsonToken.String, s, updateIndex: false);
			throw JsonReaderException.Create(this, "Could not convert string to DateTimeOffset: {0}.".FormatWith(CultureInfo.InvariantCulture, s));
		}

		internal void ReaderReadAndAssert()
		{
			if (!Read())
			{
				throw CreateUnexpectedEndException();
			}
		}

		internal JsonReaderException CreateUnexpectedEndException()
		{
			return JsonReaderException.Create(this, "Unexpected end when reading JSON.");
		}

		internal void ReadIntoWrappedTypeObject()
		{
			ReaderReadAndAssert();
			if (Value != null && Value.ToString() == "$type")
			{
				ReaderReadAndAssert();
				if (Value != null && Value.ToString().StartsWith("System.Byte[]", StringComparison.Ordinal))
				{
					ReaderReadAndAssert();
					if (Value.ToString() == "$value")
					{
						return;
					}
				}
			}
			throw JsonReaderException.Create(this, "Error reading bytes. Unexpected token: {0}.".FormatWith(CultureInfo.InvariantCulture, JsonToken.StartObject));
		}

		public void Skip()
		{
			if (TokenType == JsonToken.PropertyName)
			{
				Read();
			}
			if (JsonTokenUtils.IsStartToken(TokenType))
			{
				int depth = Depth;
				while (Read() && depth < Depth)
				{
				}
			}
		}

		protected void SetToken(JsonToken newToken)
		{
			SetToken(newToken, null, updateIndex: true);
		}

		protected void SetToken(JsonToken newToken, object? value)
		{
			SetToken(newToken, value, updateIndex: true);
		}

		protected void SetToken(JsonToken newToken, object? value, bool updateIndex)
		{
			_tokenType = newToken;
			_value = value;
			switch (newToken)
			{
			case JsonToken.StartObject:
				_currentState = State.ObjectStart;
				Push(JsonContainerType.Object);
				break;
			case JsonToken.StartArray:
				_currentState = State.ArrayStart;
				Push(JsonContainerType.Array);
				break;
			case JsonToken.StartConstructor:
				_currentState = State.ConstructorStart;
				Push(JsonContainerType.Constructor);
				break;
			case JsonToken.EndObject:
				ValidateEnd(JsonToken.EndObject);
				break;
			case JsonToken.EndArray:
				ValidateEnd(JsonToken.EndArray);
				break;
			case JsonToken.EndConstructor:
				ValidateEnd(JsonToken.EndConstructor);
				break;
			case JsonToken.PropertyName:
				_currentState = State.Property;
				_currentPosition.PropertyName = (string)value;
				break;
			case JsonToken.Raw:
			case JsonToken.Integer:
			case JsonToken.Float:
			case JsonToken.String:
			case JsonToken.Boolean:
			case JsonToken.Null:
			case JsonToken.Undefined:
			case JsonToken.Date:
			case JsonToken.Bytes:
				SetPostValueState(updateIndex);
				break;
			case JsonToken.Comment:
				break;
			}
		}

		internal void SetPostValueState(bool updateIndex)
		{
			if (Peek() != 0 || SupportMultipleContent)
			{
				_currentState = State.PostValue;
			}
			else
			{
				SetFinished();
			}
			if (updateIndex)
			{
				UpdateScopeWithFinishedValue();
			}
		}

		private void UpdateScopeWithFinishedValue()
		{
			if (_currentPosition.HasIndex)
			{
				_currentPosition.Position++;
			}
		}

		private void ValidateEnd(JsonToken endToken)
		{
			JsonContainerType jsonContainerType = Pop();
			if (GetTypeForCloseToken(endToken) != jsonContainerType)
			{
				throw JsonReaderException.Create(this, "JsonToken {0} is not valid for closing JsonType {1}.".FormatWith(CultureInfo.InvariantCulture, endToken, jsonContainerType));
			}
			if (Peek() != 0 || SupportMultipleContent)
			{
				_currentState = State.PostValue;
			}
			else
			{
				SetFinished();
			}
		}

		protected void SetStateBasedOnCurrent()
		{
			JsonContainerType jsonContainerType = Peek();
			switch (jsonContainerType)
			{
			case JsonContainerType.Object:
				_currentState = State.Object;
				break;
			case JsonContainerType.Array:
				_currentState = State.Array;
				break;
			case JsonContainerType.Constructor:
				_currentState = State.Constructor;
				break;
			case JsonContainerType.None:
				SetFinished();
				break;
			default:
				throw JsonReaderException.Create(this, "While setting the reader state back to current object an unexpected JsonType was encountered: {0}".FormatWith(CultureInfo.InvariantCulture, jsonContainerType));
			}
		}

		private void SetFinished()
		{
			_currentState = ((!SupportMultipleContent) ? State.Finished : State.Start);
		}

		private JsonContainerType GetTypeForCloseToken(JsonToken token)
		{
			return token switch
			{
				JsonToken.EndObject => JsonContainerType.Object, 
				JsonToken.EndArray => JsonContainerType.Array, 
				JsonToken.EndConstructor => JsonContainerType.Constructor, 
				_ => throw JsonReaderException.Create(this, "Not a valid close JsonToken: {0}".FormatWith(CultureInfo.InvariantCulture, token)), 
			};
		}

		void IDisposable.Dispose()
		{
			Dispose(disposing: true);
			GC.SuppressFinalize(this);
		}

		protected virtual void Dispose(bool disposing)
		{
			if (_currentState != State.Closed && disposing)
			{
				Close();
			}
		}

		public virtual void Close()
		{
			_currentState = State.Closed;
			_tokenType = JsonToken.None;
			_value = null;
		}

		internal void ReadAndAssert()
		{
			if (!Read())
			{
				throw JsonSerializationException.Create(this, "Unexpected end when reading JSON.");
			}
		}

		internal void ReadForTypeAndAssert(JsonContract? contract, bool hasConverter)
		{
			if (!ReadForType(contract, hasConverter))
			{
				throw JsonSerializationException.Create(this, "Unexpected end when reading JSON.");
			}
		}

		internal bool ReadForType(JsonContract? contract, bool hasConverter)
		{
			if (hasConverter)
			{
				return Read();
			}
			switch (contract?.InternalReadType ?? ReadType.Read)
			{
			case ReadType.Read:
				return ReadAndMoveToContent();
			case ReadType.ReadAsInt32:
				ReadAsInt32();
				break;
			case ReadType.ReadAsInt64:
			{
				bool result = ReadAndMoveToContent();
				if (TokenType == JsonToken.Undefined)
				{
					throw JsonReaderException.Create(this, "An undefined token is not a valid {0}.".FormatWith(CultureInfo.InvariantCulture, contract?.UnderlyingType ?? typeof(long)));
				}
				return result;
			}
			case ReadType.ReadAsDecimal:
				ReadAsDecimal();
				break;
			case ReadType.ReadAsDouble:
				ReadAsDouble();
				break;
			case ReadType.ReadAsBytes:
				ReadAsBytes();
				break;
			case ReadType.ReadAsBoolean:
				ReadAsBoolean();
				break;
			case ReadType.ReadAsString:
				ReadAsString();
				break;
			case ReadType.ReadAsDateTime:
				ReadAsDateTime();
				break;
			case ReadType.ReadAsDateTimeOffset:
				ReadAsDateTimeOffset();
				break;
			default:
				throw new ArgumentOutOfRangeException();
			}
			return TokenType != JsonToken.None;
		}

		internal bool ReadAndMoveToContent()
		{
			if (Read())
			{
				return MoveToContent();
			}
			return false;
		}

		internal bool MoveToContent()
		{
			JsonToken tokenType = TokenType;
			while (tokenType == JsonToken.None || tokenType == JsonToken.Comment)
			{
				if (!Read())
				{
					return false;
				}
				tokenType = TokenType;
			}
			return true;
		}

		private JsonToken GetContentToken()
		{
			JsonToken tokenType;
			do
			{
				if (!Read())
				{
					SetToken(JsonToken.None);
					return JsonToken.None;
				}
				tokenType = TokenType;
			}
			while (tokenType == JsonToken.Comment);
			return tokenType;
		}
	}
	[Serializable]
	public class JsonReaderException : JsonException
	{
		public int LineNumber { get; }

		public int LinePosition { get; }

		public string? Path { get; }

		public JsonReaderException()
		{
		}

		public JsonReaderException(string message)
			: base(message)
		{
		}

		public JsonReaderException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		public JsonReaderException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		public JsonReaderException(string message, string path, int lineNumber, int linePosition, Exception? innerException)
			: base(message, innerException)
		{
			Path = path;
			LineNumber = lineNumber;
			LinePosition = linePosition;
		}

		internal static JsonReaderException Create(JsonReader reader, string message)
		{
			return Create(reader, message, null);
		}

		internal static JsonReaderException Create(JsonReader reader, string message, Exception? ex)
		{
			return Create(reader as IJsonLineInfo, reader.Path, message, ex);
		}

		internal static JsonReaderException Create(IJsonLineInfo? lineInfo, string path, string message, Exception? ex)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			int lineNumber;
			int linePosition;
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				lineNumber = lineInfo.LineNumber;
				linePosition = lineInfo.LinePosition;
			}
			else
			{
				lineNumber = 0;
				linePosition = 0;
			}
			return new JsonReaderException(message, path, lineNumber, linePosition, ex);
		}
	}
	[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
	public sealed class JsonRequiredAttribute : Attribute
	{
	}
	[Serializable]
	public class JsonSerializationException : JsonException
	{
		public int LineNumber { get; }

		public int LinePosition { get; }

		public string? Path { get; }

		public JsonSerializationException()
		{
		}

		public JsonSerializationException(string message)
			: base(message)
		{
		}

		public JsonSerializationException(string message, Exception innerException)
			: base(message, innerException)
		{
		}

		public JsonSerializationException(SerializationInfo info, StreamingContext context)
			: base(info, context)
		{
		}

		public JsonSerializationException(string message, string path, int lineNumber, int linePosition, Exception? innerException)
			: base(message, innerException)
		{
			Path = path;
			LineNumber = lineNumber;
			LinePosition = linePosition;
		}

		internal static JsonSerializationException Create(JsonReader reader, string message)
		{
			return Create(reader, message, null);
		}

		internal static JsonSerializationException Create(JsonReader reader, string message, Exception? ex)
		{
			return Create(reader as IJsonLineInfo, reader.Path, message, ex);
		}

		internal static JsonSerializationException Create(IJsonLineInfo? lineInfo, string path, string message, Exception? ex)
		{
			message = JsonPosition.FormatMessage(lineInfo, path, message);
			int lineNumber;
			int linePosition;
			if (lineInfo != null && lineInfo.HasLineInfo())
			{
				lineNumber = lineInfo.LineNumber;
				linePosition = lineInfo.LinePosition;
			}
			else
			{
				lineNumber = 0;
				linePosition = 0;
			}
			return new JsonSerializationException(message, path, lineNumber, linePosition, ex);
		}
	}
	public class JsonSerializer
	{
		internal TypeNameHandling _typeNameHandling;

		internal TypeNameAssemblyFormatHandling _typeNameAssemblyFormatHandling;

		internal PreserveReferencesHandling _preserveReferencesHandling;

		internal ReferenceLoopHandling _referenceLoopHandling;

		internal MissingMemberHandling _missingMemberHandling;

		internal ObjectCreationHandling _objectCreationHandling;

		internal NullValueHandling _nullValueHandling;

		internal DefaultValueHandling _defaultValueHandling;

		internal ConstructorHandling _constructorHandling;

		internal MetadataPropertyHandling _metadataPropertyHandling;

		internal JsonConverterCollection? _converters;

		internal IContractResolver _contractResolver;

		internal ITraceWriter? _traceWriter;

		internal IEqualityComparer? _equalityComparer;

		internal ISerializationBinder _serializationBinder;

		internal StreamingContext _context;

		private IReferenceResolver? _referenceResolver;

		private Formatting? _formatting;

		private DateFormatHandling? _dateFormatHandling;

		private DateTimeZoneHandling? _dateTimeZoneHandling;

		private DateParseHandling? _dateParseHandling;

		private FloatFormatHandling? _floatFormatHandling;

		private FloatParseHandling? _floatParseHandling;

		private StringEscapeHandling? _stringEscapeHandling;

		private CultureInfo _culture;

		private int? _maxDepth;

		private bool _maxDepthSet;

		private bool? _checkAdditionalContent;

		private string? _dateFormatString;

		private bool _dateFormatStringSet;

		public virtual IReferenceResolver? ReferenceResolver
		{
			get
			{
				return GetReferenceResolver();
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Reference resolver cannot be null.");
				}
				_referenceResolver = value;
			}
		}

		[Obsolete("Binder is obsolete. Use SerializationBinder instead.")]
		public virtual SerializationBinder Binder
		{
			get
			{
				if (_serializationBinder is SerializationBinder result)
				{
					return result;
				}
				if (_serializationBinder is SerializationBinderAdapter serializationBinderAdapter)
				{
					return serializationBinderAdapter.SerializationBinder;
				}
				throw new InvalidOperationException("Cannot get SerializationBinder because an ISerializationBinder was previously set.");
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Serialization binder cannot be null.");
				}
				_serializationBinder = (value as ISerializationBinder) ?? new SerializationBinderAdapter(value);
			}
		}

		public virtual ISerializationBinder SerializationBinder
		{
			get
			{
				return _serializationBinder;
			}
			set
			{
				if (value == null)
				{
					throw new ArgumentNullException("value", "Serialization binder cannot be null.");
				}
				_serializationBinder = value;
			}
		}

		public virtual ITraceWriter? TraceWriter
		{
			get
			{
				return _traceWriter;
			}
			set
			{
				_traceWriter = value;
			}
		}

		public virtual IEqualityComparer? EqualityComparer
		{
			get
			{
				return _equalityComparer;
			}
			set
			{
				_equalityComparer = value;
			}
		}

		public virtual TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling;
			}
			set
			{
				if (value < TypeNameHandling.None || value > TypeNameHandling.Auto)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameHandling = value;
			}
		}

		[Obsolete("TypeNameAssemblyFormat is obsolete. Use TypeNameAssemblyFormatHandling instead.")]
		public virtual FormatterAssemblyStyle TypeNameAssemblyFormat
		{
			get
			{
				return (FormatterAssemblyStyle)_typeNameAssemblyFormatHandling;
			}
			set
			{
				if (value < FormatterAssemblyStyle.Simple || value > FormatterAssemblyStyle.Full)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameAssemblyFormatHandling = (TypeNameAssemblyFormatHandling)value;
			}
		}

		public virtual TypeNameAssemblyFormatHandling TypeNameAssemblyFormatHandling
		{
			get
			{
				return _typeNameAssemblyFormatHandling;
			}
			set
			{
				if (value < TypeNameAssemblyFormatHandling.Simple || value > TypeNameAssemblyFormatHandling.Full)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_typeNameAssemblyFormatHandling = value;
			}
		}

		public virtual PreserveReferencesHandling PreserveReferencesHandling
		{
			get
			{
				return _preserveReferencesHandling;
			}
			set
			{
				if (value < PreserveReferencesHandling.None || value > PreserveReferencesHandling.All)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_preserveReferencesHandling = value;
			}
		}

		public virtual ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling;
			}
			set
			{
				if (value < ReferenceLoopHandling.Error || value > ReferenceLoopHandling.Serialize)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_referenceLoopHandling = value;
			}
		}

		public virtual MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling;
			}
			set
			{
				if (value < MissingMemberHandling.Ignore || value > MissingMemberHandling.Error)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_missingMemberHandling = value;
			}
		}

		public virtual NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling;
			}
			set
			{
				if (value < NullValueHandling.Include || value > NullValueHandling.Ignore)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_nullValueHandling = value;
			}
		}

		public virtual DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling;
			}
			set
			{
				if (value < DefaultValueHandling.Include || value > DefaultValueHandling.IgnoreAndPopulate)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_defaultValueHandling = value;
			}
		}

		public virtual ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling;
			}
			set
			{
				if (value < ObjectCreationHandling.Auto || value > ObjectCreationHandling.Replace)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_objectCreationHandling = value;
			}
		}

		public virtual ConstructorHandling ConstructorHandling
		{
			get
			{
				return _constructorHandling;
			}
			set
			{
				if (value < ConstructorHandling.Default || value > ConstructorHandling.AllowNonPublicDefaultConstructor)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_constructorHandling = value;
			}
		}

		public virtual MetadataPropertyHandling MetadataPropertyHandling
		{
			get
			{
				return _metadataPropertyHandling;
			}
			set
			{
				if (value < MetadataPropertyHandling.Default || value > MetadataPropertyHandling.Ignore)
				{
					throw new ArgumentOutOfRangeException("value");
				}
				_metadataPropertyHandling = value;
			}
		}

		public virtual JsonConverterCollection Converters
		{
			get
			{
				if (_converters == null)
				{
					_converters = new JsonConverterCollection();
				}
				return _converters;
			}
		}

		public virtual IContractResolver ContractResolver
		{
			get
			{
				return _contractResolver;
			}
			set
			{
				_contractResolver = value ?? DefaultContractResolver.Instance;
			}
		}

		public virtual StreamingContext Context
		{
			get
			{
				return _context;
			}
			set
			{
				_context = value;
			}
		}

		public virtual Formatting Formatting
		{
			get
			{
				return _formatting.GetValueOrDefault();
			}
			set
			{
				_formatting = value;
			}
		}

		public virtual DateFormatHandling DateFormatHandling
		{
			get
			{
				return _dateFormatHandling.GetValueOrDefault();
			}
			set
			{
				_dateFormatHandling = value;
			}
		}

		public virtual DateTimeZoneHandling DateTimeZoneHandling
		{
			get
			{
				return _dateTimeZoneHandling ?? DateTimeZoneHandling.RoundtripKind;
			}
			set
			{
				_dateTimeZoneHandling = value;
			}
		}

		public virtual DateParseHandling DateParseHandling
		{
			get
			{
				return _dateParseHandling ?? DateParseHandling.DateTime;
			}
			set
			{
				_dateParseHandling = value;
			}
		}

		public virtual FloatParseHandling FloatParseHandling
		{
			get
			{
				return _floatParseHandling.GetValueOrDefault();
			}
			set
			{
				_floatParseHandling = value;
			}
		}

		public virtual FloatFormatHandling FloatFormatHandling
		{
			get
			{
				return _floatFormatHandling.GetValueOrDefault();
			}
			set
			{
				_floatFormatHandling = value;
			}
		}

		public virtual StringEscapeHandling StringEscapeHandling
		{
			get
			{
				return _stringEscapeHandling.GetValueOrDefault();
			}
			set
			{
				_stringEscapeHandling = value;
			}
		}

		public virtual string DateFormatString
		{
			get
			{
				return _dateFormatString ?? "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";
			}
			set
			{
				_dateFormatString = value;
				_dateFormatStringSet = true;
			}
		}

		public virtual CultureInfo Culture
		{
			get
			{
				return _culture ?? JsonSerializerSettings.DefaultCulture;
			}
			set
			{
				_culture = value;
			}
		}

		public virtual int? MaxDepth
		{
			get
			{
				return _maxDepth;
			}
			set
			{
				if (value <= 0)
				{
					throw new ArgumentException("Value must be positive.", "value");
				}
				_maxDepth = value;
				_maxDepthSet = true;
			}
		}

		public virtual bool CheckAdditionalContent
		{
			get
			{
				return _checkAdditionalContent.GetValueOrDefault();
			}
			set
			{
				_checkAdditionalContent = value;
			}
		}

		public virtual event EventHandler<Newtonsoft.Json.Serialization.ErrorEventArgs>? Error;

		internal bool IsCheckAdditionalContentSet()
		{
			return _checkAdditionalContent.HasValue;
		}

		public JsonSerializer()
		{
			_referenceLoopHandling = ReferenceLoopHandling.Error;
			_missingMemberHandling = MissingMemberHandling.Ignore;
			_nullValueHandling = NullValueHandling.Include;
			_defaultValueHandling = DefaultValueHandling.Include;
			_objectCreationHandling = ObjectCreationHandling.Auto;
			_preserveReferencesHandling = PreserveReferencesHandling.None;
			_constructorHandling = ConstructorHandling.Default;
			_typeNameHandling = TypeNameHandling.None;
			_metadataPropertyHandling = MetadataPropertyHandling.Default;
			_context = JsonSerializerSettings.DefaultContext;
			_serializationBinder = DefaultSerializationBinder.Instance;
			_culture = JsonSerializerSettings.DefaultCulture;
			_contractResolver = DefaultContractResolver.Instance;
		}

		public static JsonSerializer Create()
		{
			return new JsonSerializer();
		}

		public static JsonSerializer Create(JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = Create();
			if (settings != null)
			{
				ApplySerializerSettings(jsonSerializer, settings);
			}
			return jsonSerializer;
		}

		public static JsonSerializer CreateDefault()
		{
			return Create(JsonConvert.DefaultSettings?.Invoke());
		}

		public static JsonSerializer CreateDefault(JsonSerializerSettings? settings)
		{
			JsonSerializer jsonSerializer = CreateDefault();
			if (settings != null)
			{
				ApplySerializerSettings(jsonSerializer, settings);
			}
			return jsonSerializer;
		}

		private static void ApplySerializerSettings(JsonSerializer serializer, JsonSerializerSettings settings)
		{
			if (!CollectionUtils.IsNullOrEmpty(settings.Converters))
			{
				for (int i = 0; i < settings.Converters.Count; i++)
				{
					serializer.Converters.Insert(i, settings.Converters[i]);
				}
			}
			if (settings._typeNameHandling.HasValue)
			{
				serializer.TypeNameHandling = settings.TypeNameHandling;
			}
			if (settings._metadataPropertyHandling.HasValue)
			{
				serializer.MetadataPropertyHandling = settings.MetadataPropertyHandling;
			}
			if (settings._typeNameAssemblyFormatHandling.HasValue)
			{
				serializer.TypeNameAssemblyFormatHandling = settings.TypeNameAssemblyFormatHandling;
			}
			if (settings._preserveReferencesHandling.HasValue)
			{
				serializer.PreserveReferencesHandling = settings.PreserveReferencesHandling;
			}
			if (settings._referenceLoopHandling.HasValue)
			{
				serializer.ReferenceLoopHandling = settings.ReferenceLoopHandling;
			}
			if (settings._missingMemberHandling.HasValue)
			{
				serializer.MissingMemberHandling = settings.MissingMemberHandling;
			}
			if (settings._objectCreationHandling.HasValue)
			{
				serializer.ObjectCreationHandling = settings.ObjectCreationHandling;
			}
			if (settings._nullValueHandling.HasValue)
			{
				serializer.NullValueHandling = settings.NullValueHandling;
			}
			if (settings._defaultValueHandling.HasValue)
			{
				serializer.DefaultValueHandling = settings.DefaultValueHandling;
			}
			if (settings._constructorHandling.HasValue)
			{
				serializer.ConstructorHandling = settings.ConstructorHandling;
			}
			if (settings._context.HasValue)
			{
				serializer.Context = settings.Context;
			}
			if (settings._checkAdditionalContent.HasValue)
			{
				serializer._checkAdditionalContent = settings._checkAdditionalContent;
			}
			if (settings.Error != null)
			{
				serializer.Error += settings.Error;
			}
			if (settings.ContractResolver != null)
			{
				serializer.ContractResolver = settings.ContractResolver;
			}
			if (settings.ReferenceResolverProvider != null)
			{
				serializer.ReferenceResolver = settings.ReferenceResolverProvider();
			}
			if (settings.TraceWriter != null)
			{
				serializer.TraceWriter = settings.TraceWriter;
			}
			if (settings.EqualityComparer != null)
			{
				serializer.EqualityComparer = settings.EqualityComparer;
			}
			if (settings.SerializationBinder != null)
			{
				serializer.SerializationBinder = settings.SerializationBinder;
			}
			if (settings._formatting.HasValue)
			{
				serializer._formatting = settings._formatting;
			}
			if (settings._dateFormatHandling.HasValue)
			{
				serializer._dateFormatHandling = settings._dateFormatHandling;
			}
			if (settings._dateTimeZoneHandling.HasValue)
			{
				serializer._dateTimeZoneHandling = settings._dateTimeZoneHandling;
			}
			if (settings._dateParseHandling.HasValue)
			{
				serializer._dateParseHandling = settings._dateParseHandling;
			}
			if (settings._dateFormatStringSet)
			{
				serializer._dateFormatString = settings._dateFormatString;
				serializer._dateFormatStringSet = settings._dateFormatStringSet;
			}
			if (settings._floatFormatHandling.HasValue)
			{
				serializer._floatFormatHandling = settings._floatFormatHandling;
			}
			if (settings._floatParseHandling.HasValue)
			{
				serializer._floatParseHandling = settings._floatParseHandling;
			}
			if (settings._stringEscapeHandling.HasValue)
			{
				serializer._stringEscapeHandling = settings._stringEscapeHandling;
			}
			if (settings._culture != null)
			{
				serializer._culture = settings._culture;
			}
			if (settings._maxDepthSet)
			{
				serializer._maxDepth = settings._maxDepth;
				serializer._maxDepthSet = settings._maxDepthSet;
			}
		}

		[DebuggerStepThrough]
		public void Populate(TextReader reader, object target)
		{
			Populate(new JsonTextReader(reader), target);
		}

		[DebuggerStepThrough]
		public void Populate(JsonReader reader, object target)
		{
			PopulateInternal(reader, target);
		}

		internal virtual void PopulateInternal(JsonReader reader, object target)
		{
			ValidationUtils.ArgumentNotNull(reader, "reader");
			ValidationUtils.ArgumentNotNull(target, "target");
			SetupReader(reader, out CultureInfo previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string previousDateFormatString);
			TraceJsonReader traceJsonReader = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? CreateTraceJsonReader(reader) : null);
			new JsonSerializerInternalReader(this).Populate(traceJsonReader ?? reader, target);
			if (traceJsonReader != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonReader.GetDeserializedJsonMessage(), null);
			}
			ResetReader(reader, previousCulture, previousDateTimeZoneHandling, previousDateParseHandling, previousFloatParseHandling, previousMaxDepth, previousDateFormatString);
		}

		[DebuggerStepThrough]
		public object? Deserialize(JsonReader reader)
		{
			return Deserialize(reader, null);
		}

		[DebuggerStepThrough]
		public object? Deserialize(TextReader reader, Type objectType)
		{
			return Deserialize(new JsonTextReader(reader), objectType);
		}

		[DebuggerStepThrough]
		[return: MaybeNull]
		public T Deserialize<T>(JsonReader reader)
		{
			return (T)Deserialize(reader, typeof(T));
		}

		[DebuggerStepThrough]
		public object? Deserialize(JsonReader reader, Type? objectType)
		{
			return DeserializeInternal(reader, objectType);
		}

		internal virtual object? DeserializeInternal(JsonReader reader, Type? objectType)
		{
			ValidationUtils.ArgumentNotNull(reader, "reader");
			SetupReader(reader, out CultureInfo previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string previousDateFormatString);
			TraceJsonReader traceJsonReader = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? CreateTraceJsonReader(reader) : null);
			object? result = new JsonSerializerInternalReader(this).Deserialize(traceJsonReader ?? reader, objectType, CheckAdditionalContent);
			if (traceJsonReader != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonReader.GetDeserializedJsonMessage(), null);
			}
			ResetReader(reader, previousCulture, previousDateTimeZoneHandling, previousDateParseHandling, previousFloatParseHandling, previousMaxDepth, previousDateFormatString);
			return result;
		}

		private void SetupReader(JsonReader reader, out CultureInfo? previousCulture, out DateTimeZoneHandling? previousDateTimeZoneHandling, out DateParseHandling? previousDateParseHandling, out FloatParseHandling? previousFloatParseHandling, out int? previousMaxDepth, out string? previousDateFormatString)
		{
			if (_culture != null && !_culture.Equals(reader.Culture))
			{
				previousCulture = reader.Culture;
				reader.Culture = _culture;
			}
			else
			{
				previousCulture = null;
			}
			if (_dateTimeZoneHandling.HasValue && reader.DateTimeZoneHandling != _dateTimeZoneHandling)
			{
				previousDateTimeZoneHandling = reader.DateTimeZoneHandling;
				reader.DateTimeZoneHandling = _dateTimeZoneHandling.GetValueOrDefault();
			}
			else
			{
				previousDateTimeZoneHandling = null;
			}
			if (_dateParseHandling.HasValue && reader.DateParseHandling != _dateParseHandling)
			{
				previousDateParseHandling = reader.DateParseHandling;
				reader.DateParseHandling = _dateParseHandling.GetValueOrDefault();
			}
			else
			{
				previousDateParseHandling = null;
			}
			if (_floatParseHandling.HasValue && reader.FloatParseHandling != _floatParseHandling)
			{
				previousFloatParseHandling = reader.FloatParseHandling;
				reader.FloatParseHandling = _floatParseHandling.GetValueOrDefault();
			}
			else
			{
				previousFloatParseHandling = null;
			}
			if (_maxDepthSet && reader.MaxDepth != _maxDepth)
			{
				previousMaxDepth = reader.MaxDepth;
				reader.MaxDepth = _maxDepth;
			}
			else
			{
				previousMaxDepth = null;
			}
			if (_dateFormatStringSet && reader.DateFormatString != _dateFormatString)
			{
				previousDateFormatString = reader.DateFormatString;
				reader.DateFormatString = _dateFormatString;
			}
			else
			{
				previousDateFormatString = null;
			}
			if (reader is JsonTextReader jsonTextReader && jsonTextReader.PropertyNameTable == null && _contractResolver is DefaultContractResolver defaultContractResolver)
			{
				jsonTextReader.PropertyNameTable = defaultContractResolver.GetNameTable();
			}
		}

		private void ResetReader(JsonReader reader, CultureInfo? previousCulture, DateTimeZoneHandling? previousDateTimeZoneHandling, DateParseHandling? previousDateParseHandling, FloatParseHandling? previousFloatParseHandling, int? previousMaxDepth, string? previousDateFormatString)
		{
			if (previousCulture != null)
			{
				reader.Culture = previousCulture;
			}
			if (previousDateTimeZoneHandling.HasValue)
			{
				reader.DateTimeZoneHandling = previousDateTimeZoneHandling.GetValueOrDefault();
			}
			if (previousDateParseHandling.HasValue)
			{
				reader.DateParseHandling = previousDateParseHandling.GetValueOrDefault();
			}
			if (previousFloatParseHandling.HasValue)
			{
				reader.FloatParseHandling = previousFloatParseHandling.GetValueOrDefault();
			}
			if (_maxDepthSet)
			{
				reader.MaxDepth = previousMaxDepth;
			}
			if (_dateFormatStringSet)
			{
				reader.DateFormatString = previousDateFormatString;
			}
			if (reader is JsonTextReader jsonTextReader && jsonTextReader.PropertyNameTable != null && _contractResolver is DefaultContractResolver defaultContractResolver && jsonTextReader.PropertyNameTable == defaultContractResolver.GetNameTable())
			{
				jsonTextReader.PropertyNameTable = null;
			}
		}

		public void Serialize(TextWriter textWriter, object? value)
		{
			Serialize(new JsonTextWriter(textWriter), value);
		}

		public void Serialize(JsonWriter jsonWriter, object? value, Type? objectType)
		{
			SerializeInternal(jsonWriter, value, objectType);
		}

		public void Serialize(TextWriter textWriter, object? value, Type objectType)
		{
			Serialize(new JsonTextWriter(textWriter), value, objectType);
		}

		public void Serialize(JsonWriter jsonWriter, object? value)
		{
			SerializeInternal(jsonWriter, value, null);
		}

		private TraceJsonReader CreateTraceJsonReader(JsonReader reader)
		{
			TraceJsonReader traceJsonReader = new TraceJsonReader(reader);
			if (reader.TokenType != 0)
			{
				traceJsonReader.WriteCurrentToken();
			}
			return traceJsonReader;
		}

		internal virtual void SerializeInternal(JsonWriter jsonWriter, object? value, Type? objectType)
		{
			ValidationUtils.ArgumentNotNull(jsonWriter, "jsonWriter");
			Formatting? formatting = null;
			if (_formatting.HasValue && jsonWriter.Formatting != _formatting)
			{
				formatting = jsonWriter.Formatting;
				jsonWriter.Formatting = _formatting.GetValueOrDefault();
			}
			DateFormatHandling? dateFormatHandling = null;
			if (_dateFormatHandling.HasValue && jsonWriter.DateFormatHandling != _dateFormatHandling)
			{
				dateFormatHandling = jsonWriter.DateFormatHandling;
				jsonWriter.DateFormatHandling = _dateFormatHandling.GetValueOrDefault();
			}
			DateTimeZoneHandling? dateTimeZoneHandling = null;
			if (_dateTimeZoneHandling.HasValue && jsonWriter.DateTimeZoneHandling != _dateTimeZoneHandling)
			{
				dateTimeZoneHandling = jsonWriter.DateTimeZoneHandling;
				jsonWriter.DateTimeZoneHandling = _dateTimeZoneHandling.GetValueOrDefault();
			}
			FloatFormatHandling? floatFormatHandling = null;
			if (_floatFormatHandling.HasValue && jsonWriter.FloatFormatHandling != _floatFormatHandling)
			{
				floatFormatHandling = jsonWriter.FloatFormatHandling;
				jsonWriter.FloatFormatHandling = _floatFormatHandling.GetValueOrDefault();
			}
			StringEscapeHandling? stringEscapeHandling = null;
			if (_stringEscapeHandling.HasValue && jsonWriter.StringEscapeHandling != _stringEscapeHandling)
			{
				stringEscapeHandling = jsonWriter.StringEscapeHandling;
				jsonWriter.StringEscapeHandling = _stringEscapeHandling.GetValueOrDefault();
			}
			CultureInfo cultureInfo = null;
			if (_culture != null && !_culture.Equals(jsonWriter.Culture))
			{
				cultureInfo = jsonWriter.Culture;
				jsonWriter.Culture = _culture;
			}
			string dateFormatString = null;
			if (_dateFormatStringSet && jsonWriter.DateFormatString != _dateFormatString)
			{
				dateFormatString = jsonWriter.DateFormatString;
				jsonWriter.DateFormatString = _dateFormatString;
			}
			TraceJsonWriter traceJsonWriter = ((TraceWriter != null && TraceWriter.LevelFilter >= TraceLevel.Verbose) ? new TraceJsonWriter(jsonWriter) : null);
			new JsonSerializerInternalWriter(this).Serialize(traceJsonWriter ?? jsonWriter, value, objectType);
			if (traceJsonWriter != null)
			{
				TraceWriter.Trace(TraceLevel.Verbose, traceJsonWriter.GetSerializedJsonMessage(), null);
			}
			if (formatting.HasValue)
			{
				jsonWriter.Formatting = formatting.GetValueOrDefault();
			}
			if (dateFormatHandling.HasValue)
			{
				jsonWriter.DateFormatHandling = dateFormatHandling.GetValueOrDefault();
			}
			if (dateTimeZoneHandling.HasValue)
			{
				jsonWriter.DateTimeZoneHandling = dateTimeZoneHandling.GetValueOrDefault();
			}
			if (floatFormatHandling.HasValue)
			{
				jsonWriter.FloatFormatHandling = floatFormatHandling.GetValueOrDefault();
			}
			if (stringEscapeHandling.HasValue)
			{
				jsonWriter.StringEscapeHandling = stringEscapeHandling.GetValueOrDefault();
			}
			if (_dateFormatStringSet)
			{
				jsonWriter.DateFormatString = dateFormatString;
			}
			if (cultureInfo != null)
			{
				jsonWriter.Culture = cultureInfo;
			}
		}

		internal IReferenceResolver GetReferenceResolver()
		{
			if (_referenceResolver == null)
			{
				_referenceResolver = new DefaultReferenceResolver();
			}
			return _referenceResolver;
		}

		internal JsonConverter? GetMatchingConverter(Type type)
		{
			return GetMatchingConverter(_converters, type);
		}

		internal static JsonConverter? GetMatchingConverter(IList<JsonConverter>? converters, Type objectType)
		{
			if (converters != null)
			{
				for (int i = 0; i < converters.Count; i++)
				{
					JsonConverter jsonConverter = converters[i];
					if (jsonConverter.CanConvert(objectType))
					{
						return jsonConverter;
					}
				}
			}
			return null;
		}

		internal void OnError(Newtonsoft.Json.Serialization.ErrorEventArgs e)
		{
			this.Error?.Invoke(this, e);
		}
	}
	public class JsonSerializerSettings
	{
		internal const ReferenceLoopHandling DefaultReferenceLoopHandling = ReferenceLoopHandling.Error;

		internal const MissingMemberHandling DefaultMissingMemberHandling = MissingMemberHandling.Ignore;

		internal const NullValueHandling DefaultNullValueHandling = NullValueHandling.Include;

		internal const DefaultValueHandling DefaultDefaultValueHandling = DefaultValueHandling.Include;

		internal const ObjectCreationHandling DefaultObjectCreationHandling = ObjectCreationHandling.Auto;

		internal const PreserveReferencesHandling DefaultPreserveReferencesHandling = PreserveReferencesHandling.None;

		internal const ConstructorHandling DefaultConstructorHandling = ConstructorHandling.Default;

		internal const TypeNameHandling DefaultTypeNameHandling = TypeNameHandling.None;

		internal const MetadataPropertyHandling DefaultMetadataPropertyHandling = MetadataPropertyHandling.Default;

		internal static readonly StreamingContext DefaultContext;

		internal const Formatting DefaultFormatting = Formatting.None;

		internal const DateFormatHandling DefaultDateFormatHandling = DateFormatHandling.IsoDateFormat;

		internal const DateTimeZoneHandling DefaultDateTimeZoneHandling = DateTimeZoneHandling.RoundtripKind;

		internal const DateParseHandling DefaultDateParseHandling = DateParseHandling.DateTime;

		internal const FloatParseHandling DefaultFloatParseHandling = FloatParseHandling.Double;

		internal const FloatFormatHandling DefaultFloatFormatHandling = FloatFormatHandling.String;

		internal const StringEscapeHandling DefaultStringEscapeHandling = StringEscapeHandling.Default;

		internal const TypeNameAssemblyFormatHandling DefaultTypeNameAssemblyFormatHandling = TypeNameAssemblyFormatHandling.Simple;

		internal static readonly CultureInfo DefaultCulture;

		internal const bool DefaultCheckAdditionalContent = false;

		internal const string DefaultDateFormatString = "yyyy'-'MM'-'dd'T'HH':'mm':'ss.FFFFFFFK";

		internal Formatting? _formatting;

		internal DateFormatHandling? _dateFormatHandling;

		internal DateTimeZoneHandling? _dateTimeZoneHandling;

		internal DateParseHandling? _dateParseHandling;

		internal FloatFormatHandling? _floatFormatHandling;

		internal FloatParseHandling? _floatParseHandling;

		internal StringEscapeHandling? _stringEscapeHandling;

		internal CultureInfo? _culture;

		internal bool? _checkAdditionalContent;

		internal int? _maxDepth;

		internal bool _maxDepthSet;

		internal string? _dateFormatString;

		internal bool _dateFormatStringSet;

		internal TypeNameAssemblyFormatHandling? _typeNameAssemblyFormatHandling;

		internal DefaultValueHandling? _defaultValueHandling;

		internal PreserveReferencesHandling? _preserveReferencesHandling;

		internal NullValueHandling? _nullValueHandling;

		internal ObjectCreationHandling? _objectCreationHandling;

		internal MissingMemberHandling? _missingMemberHandling;

		internal ReferenceLoopHandling? _referenceLoopHandling;

		internal StreamingContext? _context;

		internal ConstructorHandling? _constructorHandling;

		internal TypeNameHandling? _typeNameHandling;

		internal MetadataPropertyHandling? _metadataPropertyHandling;

		public ReferenceLoopHandling ReferenceLoopHandling
		{
			get
			{
				return _referenceLoopHandling.GetValueOrDefault();
			}
			set
			{
				_referenceLoopHandling = value;
			}
		}

		public MissingMemberHandling MissingMemberHandling
		{
			get
			{
				return _missingMemberHandling.GetValueOrDefault();
			}
			set
			{
				_missingMemberHandling = value;
			}
		}

		public ObjectCreationHandling ObjectCreationHandling
		{
			get
			{
				return _objectCreationHandling.GetValueOrDefault();
			}
			set
			{
				_objectCreationHandling = value;
			}
		}

		public NullValueHandling NullValueHandling
		{
			get
			{
				return _nullValueHandling.GetValueOrDefault();
			}
			set
			{
				_nullValueHandling = value;
			}
		}

		public DefaultValueHandling DefaultValueHandling
		{
			get
			{
				return _defaultValueHandling.GetValueOrDefault();
			}
			set
			{
				_defaultValueHandling = value;
			}
		}

		public IList<JsonConverter> Converters { get; set; }

		public PreserveReferencesHandling PreserveReferencesHandling
		{
			get
			{
				return _preserveReferencesHandling.GetValueOrDefault();
			}
			set
			{
				_preserveReferencesHandling = value;
			}
		}

		public TypeNameHandling TypeNameHandling
		{
			get
			{
				return _typeNameHandling.GetValueOrDefault();
			}
			set
			{
				_typeNameHandling = value;
			}
		}

		public MetadataPropertyHandling MetadataPropertyHandling
		{
		

UnityNamedPipe.dll

Decompiled 2 weeks ago
using System;
using System.Diagnostics;
using System.IO;
using System.IO.Pipes;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using Lachee.IO.Exceptions;

[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.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("UnityNamedPipe")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("UnityNamedPipe")]
[assembly: AssemblyTitle("UnityNamedPipe")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace Lachee.IO
{
	public class NamedPipeClientStream : Stream
	{
		private static class Native
		{
			private const string LIBRARY_NAME = "NativeNamedPipe";

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "createClient")]
			public static extern IntPtr CreateClient();

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "destroyClient")]
			public static extern void DestroyClient(IntPtr client);

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "isConnected")]
			public static extern bool IsConnected([MarshalAs(UnmanagedType.SysInt)] IntPtr client);

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "open")]
			public static extern int Open(IntPtr client, [MarshalAs(UnmanagedType.LPStr)] string pipename);

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, EntryPoint = "close")]
			public static extern void Close(IntPtr client);

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "readFrame")]
			public static extern int ReadFrame(IntPtr client, IntPtr buffer, int length);

			[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl, EntryPoint = "writeFrame")]
			public static extern int WriteFrame(IntPtr client, IntPtr buffer, int length);
		}

		private IntPtr ptr;

		private bool _isDisposed;

		private static readonly string s_pipePrefix = Path.Combine(Path.GetTempPath(), "CoreFxPipe_");

		public override bool CanRead => true;

		public override bool CanSeek => false;

		public override bool CanWrite => true;

		public override long Length => 0L;

		public override long Position
		{
			get
			{
				return 0L;
			}
			set
			{
			}
		}

		public bool IsConnected => Native.IsConnected(ptr);

		public string PipeName { get; }

		public NamedPipeClientStream(string server, string pipeName)
		{
			ptr = Native.CreateClient();
			PipeName = FormatPipe(server, pipeName);
			Console.WriteLine("Created new NamedPipeClientStream '{0}' => '{1}'", pipeName, PipeName);
		}

		~NamedPipeClientStream()
		{
			Dispose(disposing: false);
		}

		protected override void Dispose(bool disposing)
		{
			base.Dispose(disposing);
			if (!_isDisposed)
			{
				Disconnect();
				Native.DestroyClient(ptr);
				_isDisposed = true;
			}
		}

		private static string FormatPipe(string server, string pipeName)
		{
			PlatformID platform = Environment.OSVersion.Platform;
			if (platform == PlatformID.Win32NT || platform != PlatformID.Unix)
			{
				return $"\\\\{server}\\pipe\\{pipeName}";
			}
			if (server != ".")
			{
				throw new PlatformNotSupportedException("Remote pipes are not supported on this platform.");
			}
			return s_pipePrefix + pipeName;
		}

		public void Connect()
		{
			int err = Native.Open(ptr, PipeName);
			if (!IsConnected)
			{
				throw new NamedPipeOpenException(err);
			}
		}

		public void Disconnect()
		{
			Native.Close(ptr);
		}

		public override int Read(byte[] buffer, int offset, int count)
		{
			if (!IsConnected)
			{
				throw new NamedPipeConnectionException("Cannot read stream as pipe is not connected");
			}
			if (offset + count > buffer.Length)
			{
				throw new ArgumentOutOfRangeException("count", "Cannot read as the count exceeds the buffer size");
			}
			int num = 0;
			int cb = Marshal.SizeOf(buffer[0]) * count;
			IntPtr intPtr = Marshal.AllocHGlobal(cb);
			try
			{
				num = Native.ReadFrame(ptr, intPtr, count);
				if (num <= 0)
				{
					if (num < 0)
					{
						throw new NamedPipeReadException(num);
					}
					return 0;
				}
				Marshal.Copy(intPtr, buffer, offset, num);
				return num;
			}
			finally
			{
				Marshal.FreeHGlobal(intPtr);
			}
		}

		public override void Write(byte[] buffer, int offset, int count)
		{
			if (!IsConnected)
			{
				throw new NamedPipeConnectionException("Cannot write stream as pipe is not connected");
			}
			int cb = Marshal.SizeOf(buffer[0]) * count;
			IntPtr intPtr = Marshal.AllocHGlobal(cb);
			try
			{
				Marshal.Copy(buffer, offset, intPtr, count);
				int num = Native.WriteFrame(ptr, intPtr, count);
				if (num < 0)
				{
					throw new NamedPipeWriteException(num);
				}
			}
			finally
			{
				Marshal.FreeHGlobal(intPtr);
			}
		}

		public override void Flush()
		{
			throw new NotSupportedException();
		}

		public override long Seek(long offset, SeekOrigin origin)
		{
			throw new NotSupportedException();
		}

		public override void SetLength(long value)
		{
			throw new NotSupportedException();
		}
	}
	internal class Program
	{
		private const string LIBRARY_NAME = "NativeNamedPipe";

		private const string PIPE_NAME = "testpipe";

		private static CancellationTokenSource source;

		[DllImport("NativeNamedPipe", CallingConvention = CallingConvention.Cdecl)]
		private static extern bool test(int a, int b, IntPtr @out);

		private static void TestPipe()
		{
			using NamedPipeClientStream namedPipeClientStream = new NamedPipeClientStream(".", "testpipe");
			try
			{
				Console.WriteLine("CLIENT: Connecting...");
				namedPipeClientStream.Connect();
				string text = "Hello World!";
				Console.WriteLine("CLIENT: Sending '{0}'...", text);
				byte[] bytes = Encoding.ASCII.GetBytes(text);
				namedPipeClientStream.Write(bytes, 0, bytes.Length);
				Console.WriteLine("CLIENT: Sent. Reading message...");
				text = "";
				int num = 0;
				byte[] array = new byte[2048];
				while ((num = namedPipeClientStream.Read(array, 0, array.Length)) == 0)
				{
					Console.Write(".");
					Thread.Sleep(1);
				}
				Console.WriteLine();
				text = Encoding.ASCII.GetString(array, 0, num);
				Console.WriteLine("CLIENT: Server said '{0}'", text);
			}
			catch (Exception ex)
			{
				Console.WriteLine("Failed pipe test: {0}", ex.Message);
			}
		}

		private static void Main(string[] args)
		{
			if (ValidateDll())
			{
				Console.WriteLine("Starting Server...");
				source = new CancellationTokenSource();
				Task.Factory.StartNew((Func<Task>)async delegate
				{
					await ServerIO(source.Token);
				}, source.Token);
				Console.WriteLine("How many times do you wish the test to be run?");
				string text = Console.ReadLine();
				if (string.IsNullOrWhiteSpace(text))
				{
					text = "1";
				}
				int num = int.Parse(text);
				for (int i = 0; i < num; i++)
				{
					Console.WriteLine("Testing Pipe #{0}....", i);
					TestPipe();
				}
				Console.WriteLine("Canceling Token...");
				source.Cancel();
				source.Dispose();
				Console.WriteLine("Press any key to exit.");
				Console.ReadKey(intercept: true);
			}
		}

		private static async Task ServerIO(CancellationToken token)
		{
			using NamedPipeServerStream server = new NamedPipeServerStream("testpipe", PipeDirection.InOut);
			while (!token.IsCancellationRequested)
			{
				Console.WriteLine("SERVER: Waiting for connection...");
				string message3 = "";
				await server.WaitForConnectionAsync(token);
				Console.WriteLine("SERVER: Connection established. Reading message...");
				byte[] buffer = new byte[2048];
				int bytesRead = await server.ReadAsync(buffer, 0, buffer.Length);
				Console.WriteLine("SERVER: Read {0} bytes", bytesRead);
				string msg = Encoding.ASCII.GetString(buffer, 0, bytesRead);
				message3 += msg;
				char[] chars = message3.ToCharArray();
				Array.Reverse((Array)chars);
				message3 = new string(chars);
				Console.WriteLine("SERVER: Message read. Returning message '{0}'...", message3);
				byte[] msgbytes = Encoding.ASCII.GetBytes(message3);
				await server.WriteAsync(msgbytes, 0, msgbytes.Length);
				Console.WriteLine("SERVER: Disconnecting...");
				server.Disconnect();
			}
		}

		private static bool ValidateDll()
		{
			IntPtr intPtr = Marshal.AllocHGlobal(4);
			try
			{
				return test(-10, 10, intPtr) && Marshal.ReadInt32(intPtr) == 0;
			}
			catch (Exception ex)
			{
				Console.WriteLine("Failed DLL Test!");
				Console.WriteLine(ex.Message);
				return false;
			}
			finally
			{
				Marshal.FreeHGlobal(intPtr);
			}
		}
	}
}
namespace Lachee.IO.Exceptions
{
	public class NamedPipeConnectionException : Exception
	{
		internal NamedPipeConnectionException(string message)
			: base(message)
		{
		}
	}
	public class NamedPipeOpenException : Exception
	{
		public int ErrorCode { get; private set; }

		internal NamedPipeOpenException(int err)
			: base("An exception has occured while trying to open the pipe. Error Code: " + err)
		{
			ErrorCode = err;
		}
	}
	public class NamedPipeReadException : Exception
	{
		public int ErrorCode { get; private set; }

		internal NamedPipeReadException(int err)
			: base("An exception occured while reading from the pipe. Error Code: " + err)
		{
			ErrorCode = err;
		}
	}
	public class NamedPipeWriteException : Exception
	{
		public int ErrorCode { get; private set; }

		internal NamedPipeWriteException(int err)
			: base("An exception occured while reading from the pipe. Error Code: " + err)
		{
			ErrorCode = err;
		}
	}
}