Decompiled source of DiscordRichPresence v1.3.4
DiscordRichPresence.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
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 System.Text.RegularExpressions; 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+652e1bbaaa04313d1ee507c64d4c7771747ed7be")] [assembly: AssemblyProduct("DiscordRichPresence")] [assembly: AssemblyTitle("DiscordRichPresence")] [assembly: AssemblyVersion("1.0.0.0")] namespace DiscordRichPresence { [BepInPlugin("com.cuno.discord", "Discord Rich Presence", "1.3.4")] [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; public void ChangeActivity() { ActivityManager activityManager = Client.GetActivityManager(); Activity richPresence = default(Activity); richPresence.State = "Starting game..."; RichPresence = richPresence; activityManager.UpdateActivity(RichPresence, delegate { }); } 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, 1uL); 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 { }); ((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> { "anarbiter", "unknown", "cosmicchampion", "deputy", "johnny", "redmist", "BANDIT2_BODY_NAME", "BLAKE_Rifter_NAME", "BOG_MORRIS_BODY_NAME", "BOG_PATHFINDER_BODY_NAME", "BOMBER_NAME", "CAPTAIN_BODY_NAME", "CHEESEWITHHOLES_BASICTANK_BODY_NAME", "CHEF_BODY_NAME", "CLOUDBURST_WYATT_NAME", "COMMANDO_BODY_NAME", "CROCO_BODY_NAME", "DS_GAMING_SONIC_THE_HEDGEHOG_BODY_NAME", "ENFORCER_NAME", "ENGI_BODY_NAME", "FALSESON_BODY_NAME", "FROSTHEX_ASTERIA_NAME", "GNOMECHEF_NAME", "HABIBI_CHRONO_NAME", "HABIBI_DESOLATOR_BODY_NAME", "HABIBI_MATCHER_NAME", "HABIBI_TESLA_BODY_NAME", "HERETIC_BODY_NAME", "HUNTRESS_BODY_NAME", "KENKO_BANSHEE_NAME", "KENKO_CADET_NAME", "KENKO_INTERROGATOR_NAME", "KENKO_SCOUT_NAME", "KENKO_SEAMSTRESS_NAME", "KENKO_SUBMARINER_NAME", "KENKO_UNFORGIVEN_NAME", "LOADER_BODY_NAME", "MAGE_BODY_NAME", "MERC_BODY_NAME", "MINER_NAME", "MOFFEIN_HAND_BODY_NAME", "MOFFEIN_PILOT_BODY_NAME", "MOFFEIN_ROCKET_BODY_NAME", "NDP_DANCER_BODY_NAME", "NEMFORCER_NAME", "PALADIN_NAME", "RAILGUNNER_BODY_NAME", "RAT_ROBOMANDO_NAME", "RL_BLMERC_NAME", "RL_EGO_GRINDER_BODY_NAME", "RL_EGO_JUSTITIA_NAME", "RL_EGO_LAMENT_NAME", "RL_EGO_LAMP_NAME", "RL_EGO_MAGICBULLET_NAME", "RL_EGO_MIMICRY_NAME", "RL_SWEEPER_NAME", "ROB_BELMONT_BODY_NAME", "ROB_DANTE_BODY_NAME", "ROB_DRIVER_BODY_NAME", "ROB_RAVAGER_BODY_NAME", "SANDSWEPT_ELECTR_NAME", "SEEKER_BODY_NAME", "SNIPERCLASSIC_BODY_NAME", "SS2_CHIRR_BODY_NAME", "SS2_EXECUTIONER2_NAME", "SS2_NEMMANDO_NAME", "SS2_NEMESIS_MERCENARY_BODY_NAME", "SS2UCHIRR_NAME", "SS2UCYBORG_NAME", "SS2UEXECUTIONER_NAME", "SS2UNEMMANDO_NAME", "SS2UNUCLEATOR_NAME", "SS2UPYRO_NAME", "SS_RANGER_BODY_NAME", "TOOLBOT_BODY_NAME", "TREEBOT_BODY_NAME", "VOIDSURVIVOR_BODY_NAME" }; public static List<string> StagesWithAssets = new List<string> { "riskofrain2", "BulwarksHaunt_GhostWave", "forgottenhaven", "drybasin", "slumberingsatellite", "MAP_AGATE_VILLAGE_NAME", "MAP_ANCIENTLOFT_TITLE", "MAP_ARENA_TITLE", "MAP_ARTIFACTWORLD_TITLE", "MAP_BAZAAR_TITLE", "MAP_BLACKBEACH_TITLE", "MAP_DAMPCAVE_TITLE", "MAP_FOGGYSWAMP_TITLE", "MAP_FROZENWALL_TITLE", "MAP_GOLDSHORES_TITLE", "MAP_GOLEMPLAINS_TITLE", "MAP_GOOLAKE_TITLE", "MAP_HABITATFALL_TITLE", "MAP_HABITAT_TITLE", "MAP_HELMINTHROOST_TITLE", "MAP_itancientloft_NAME", "MAP_itdampcave_NAME", "MAP_itfrozenwall_NAME", "MAP_itgolemplains_NAME", "MAP_itgoolake_NAME", "MAP_itmoon_NAME", "MAP_itskymeadow_NAME", "MAP_LAKESNIGHT_TITLE", "MAP_LAKES_TITLE", "MAP_LEMURIANTEMPLE_TITLE", "MAP_LIMBO_TITLE", "MAP_MERIDIAN_TITLE", "MAP_MOON_TITLE", "MAP_MYSTERYSPACE_TITLE", "MAP_ROOTJUNGLE_TITLE", "MAP_SHIPGRAVEYARD_TITLE", "MAP_SKYMEADOW_TITLE", "MAP_SNOWYFOREST_TITLE", "MAP_SULFURPOOLS_TITLE", "MAP_VILLAGENIGHT_TITLE", "MAP_VILLAGE_TITLE", "MAP_VOIDRAID_TITLE", "MAP_VOIDSTAGE_TITLE", "MAP_WISPGRAVEYARD_TITLE", "SNOWTIME_MAP_BLOODGULCH_0", "SNOWTIME_MAP_CITY_0", "SNOWTIME_MAP_DEATHISLAND_0", "SNOWTIME_MAP_DHALO_0", "SNOWTIME_MAP_FLAT_0", "SNOWTIME_MAP_GPH_0", "SNOWTIME_MAP_HALO_0", "SNOWTIME_MAP_HC_0", "SNOWTIME_MAP_HIGHTOWER_0", "SNOWTIME_MAP_IF_0", "SNOWTIME_MAP_NMB_0", "SNOWTIME_MAP_SHRINE_0", "SNOWTIME_MAP_SW_0", "SNOWTIME_MAP_GMC_0", "FOGBOUND_SCENEDEF_NAME_TOKEN", "CATACOMBS_MAP_DS1_CATACOMBS_NAME", "SM64_BBF_MAP_SM64_BBF_NAME" }; public static string GetCharacterInternalName(string name) { if (CharactersWithAssets.Contains(name)) { return CharactersWithAssets.Find((string c) => c == name); } 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_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0389: Unknown result type (might be due to invalid IL or missing references) //IL_038f: 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:"); } string text = "riskofrain2"; if (InfoTextUtils.StagesWithAssets.Contains(scene.nameToken)) { text = scene.nameToken; } else if (InfoTextUtils.StagesWithAssets.Contains(scene.baseSceneName)) { text = scene.baseSceneName; } richPresence.Assets.LargeImage = "https://raw.githubusercontent.com/gamrtiem/RoR2-Discord-RP/refs/heads/master/Assets/" + text + ".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); @string = Regex.Replace(@string, "<.*?>", string.Empty); 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 { }); } 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 { }); } 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 { }); } 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 { }); } 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 { }); PresenceUtils.SetStagePresence(DiscordRichPresencePlugin.Client, richPresence, DiscordRichPresencePlugin.CurrentScene, Run.instance); } private static void Stage_onStageStartGlobal(Stage obj) { //IL_00af: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) 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) { return; } string characterInternalName = InfoTextUtils.GetCharacterInternalName(val.baseNameToken); if (characterInternalName == "unknown") { if (InfoTextUtils.CharactersWithAssets.Contains(val.GetDisplayName().ToLower().Replace(" ", ""))) { characterInternalName = InfoTextUtils.GetCharacterInternalName(val.GetDisplayName().ToLower().Replace(" ", "")); } else { string text = SurvivorCatalog.GetSurvivorDef(SurvivorCatalog.GetSurvivorIndexFromBodyIndex(val.bodyIndex))?.displayNameToken; if (text != null && InfoTextUtils.CharactersWithAssets.Contains(text)) { characterInternalName = InfoTextUtils.GetCharacterInternalName(text); } } } Activity richPresence = DiscordRichPresencePlugin.RichPresence; richPresence.Assets.SmallImage = "https://raw.githubusercontent.com/gamrtiem/RoR2-Discord-RP/refs/heads/master/Assets/Characters/" + characterInternalName + ".png"; richPresence.Assets.SmallText = val.GetDisplayName(); ActivityManager activityManager = DiscordRichPresencePlugin.Client.GetActivityManager(); activityManager.UpdateActivity(richPresence, delegate { }); 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 { }); 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(Calling
UnityNamedPipe.dll
Decompiled 2 weeks agousing 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; } } }
Facepunch.Steamworks.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
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
EOS.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
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