diff --git a/.gitignore b/.gitignore index 5bafc8c..7c12d51 100644 --- a/.gitignore +++ b/.gitignore @@ -73,4 +73,5 @@ mscorlib.dll packages Generator/bin *.XML -.vs \ No newline at end of file +.vs +Facepunch.Steamworks.Test/bin/** diff --git a/CompileFix.bat b/CompileFix.bat new file mode 100644 index 0000000..3580950 --- /dev/null +++ b/CompileFix.bat @@ -0,0 +1,5 @@ +cd Facepunch.Steamworks +dotnet restore .\Facepunch.Steamworks.Posix32.csproj +dotnet restore .\Facepunch.Steamworks.Posix64.csproj +dotnet restore .\Facepunch.Steamworks.Win32.csproj +dotnet restore .\Facepunch.Steamworks.Win64.csproj \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/AppTest.cs b/Facepunch.Steamworks.Test/AppTest.cs new file mode 100644 index 0000000..5ef8213 --- /dev/null +++ b/Facepunch.Steamworks.Test/AppTest.cs @@ -0,0 +1,114 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + [DeploymentItem( "steam_api.dll" )] + public class AppTest + { + [AssemblyInitialize] + public static void AssemblyInit( TestContext context ) + { + Steamworks.SteamClient.OnCallbackException = ( e ) => + { + Console.Error.WriteLine( e.Message ); + Console.Error.WriteLine( e.StackTrace ); + Assert.Fail( e.Message ); + }; + + // + // Init Client + // + Steamworks.SteamClient.Init( 252490 ); + + // + // Init Server + // + var serverInit = new SteamServerInit( "rust", "Rusty Mode" ) + { + GamePort = 28015, + Secure = true, + QueryPort = 28016 + }; + + Steamworks.SteamServer.Init( 252490, serverInit ); + + SteamServer.LogOnAnonymous(); + + } + + static void OnNewUrlLaunchParameters() + { + // Wow! + } + + [TestMethod] + public void GameLangauge() + { + var gl = SteamApps.GameLanguage; + Assert.IsNotNull( gl ); + Assert.IsTrue( gl.Length > 3 ); + + Console.WriteLine( $"{gl}" ); + } + + [TestMethod] + public void AppInstallDir() + { + var str = SteamApps.AppInstallDir(); + Assert.IsNotNull( str ); + Assert.IsTrue( str.Length > 3 ); + + Console.WriteLine( $"{str}" ); + } + + [TestMethod] + public void AppOwner() + { + var steamid = SteamApps.AppOwner; + Assert.IsTrue( steamid.Value > 70561197960279927 ); + Assert.IsTrue( steamid.Value < 80561197960279927 ); + + Console.WriteLine( $"{steamid.Value}" ); + } + + [TestMethod] + public void InstalledDepots() + { + var depots = SteamApps.InstalledDepots().ToArray(); + + Assert.IsNotNull( depots ); + Assert.IsTrue( depots.Length > 0 ); + + foreach ( var depot in depots ) + { + Console.WriteLine( $"{depot.Value}" ); + } + } + + [TestMethod] + public async Task GetFileDetails() + { + var fileinfo = await SteamApps.GetFileDetailsAsync( "hl2.exe" ); + + Console.WriteLine( $"fileinfo.SizeInBytes: {fileinfo?.SizeInBytes}" ); + Console.WriteLine( $"fileinfo.Sha1: {fileinfo?.Sha1}" ); + Console.WriteLine( $"fileinfo.Flags: {fileinfo?.Flags}" ); + } + + [TestMethod] + public void CommandLine() + { + var cl = SteamApps.CommandLine; + + Console.WriteLine( $"CommandLine: {cl}" ); + } + } + +} diff --git a/Facepunch.Steamworks.Test/Client/AchievementsTest.cs b/Facepunch.Steamworks.Test/Client/AchievementsTest.cs deleted file mode 100644 index 5cbbbe8..0000000 --- a/Facepunch.Steamworks.Test/Client/AchievementsTest.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class Achievements - { - [TestMethod] - public void GetCount() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var gotStats = false; - client.Achievements.OnUpdated += () => { gotStats = true; }; - - while ( !gotStats ) - { - client.Update(); - } - - Console.WriteLine( "Found " + client.Achievements.All.Length + " Achievements" ); - - Assert.AreNotEqual( 0, client.Achievements.All.Length ); - } - } - - [TestMethod] - public void GetNames() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var gotStats = false; - client.Achievements.OnUpdated += () => { gotStats = true; }; - - while ( !gotStats ) - { - client.Update(); - } - - foreach( var ach in client.Achievements.All ) - { - Assert.IsNotNull( ach.Id ); - - Console.WriteLine( " " + ach.Id ); - Console.WriteLine( " - - " + ach.Name ); - Console.WriteLine( " - - " + ach.Description ); - Console.WriteLine( " - - " + ach.State ); - Console.WriteLine( " - - " + ach.UnlockTime ); - Console.WriteLine( " - - " + ach.GlobalUnlockedPercentage ); - - if ( ach.Icon != null ) - { - Console.WriteLine( " - - " + ach.Icon.Width + " x " + ach.Icon.Height ); - } - - Console.WriteLine( "" ); - } - } - } - - [TestMethod] - public void Trigger() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var gotStats = false; - client.Achievements.OnUpdated += () => { gotStats = true; }; - - while ( !gotStats ) - { - client.Update(); - } - - foreach ( var ach in client.Achievements.All ) - { - ach.Trigger(); - } - } - } - - } -} diff --git a/Facepunch.Steamworks.Test/Client/AppTest.cs b/Facepunch.Steamworks.Test/Client/AppTest.cs deleted file mode 100644 index fb3e71f..0000000 --- a/Facepunch.Steamworks.Test/Client/AppTest.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class App - { - [TestMethod] - public void IsSubscribed() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Console.WriteLine("This test assumes you own Garry's Mod and not Charles III of Spain and the antiquity"); - - Assert.IsTrue( client.App.IsSubscribed( 4000 ) ); - Assert.IsFalse( client.App.IsSubscribed( 590440 )); - } - } - - [TestMethod] - public void IsInstalled() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Console.WriteLine("This test assumes you have Garry's Mod installed but not Charles III of Spain and the antiquity"); - - Assert.IsTrue(client.App.IsInstalled(4000)); - Assert.IsFalse(client.App.IsInstalled(590440)); - } - } - - [TestMethod] - public void PurchaseTime() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Console.WriteLine("This test assumes you own Garry's Mod but not Charles III of Spain and the antiquity"); - - var gmodBuyTime = client.App.PurchaseTime( 4000 ); - Assert.AreNotEqual( gmodBuyTime, DateTime.MinValue ); - - Console.WriteLine($"You bought Garry's Mod {gmodBuyTime}"); - - var otherBuyTime = client.App.PurchaseTime(590440); - Assert.AreEqual(otherBuyTime, DateTime.MinValue); - } - } - - [TestMethod] - public void AppName() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var name = client.App.GetName( 4000 ); - Console.WriteLine( name ); - } - } - - } -} diff --git a/Facepunch.Steamworks.Test/Client/ClientTest.cs b/Facepunch.Steamworks.Test/Client/ClientTest.cs deleted file mode 100644 index 0835a0d..0000000 --- a/Facepunch.Steamworks.Test/Client/ClientTest.cs +++ /dev/null @@ -1,187 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using System.Linq; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public partial class Client - { - [TestMethod] - public void Init() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - } - } - - [TestMethod] - public void Init_10() - { - for ( int i = 0; i < 10; i++ ) - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - } - - GC.Collect(); - } - } - - [TestMethod] - public void Name() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var username = client.Username; - Console.WriteLine( username ); - Assert.IsNotNull( username ); - } - } - - [TestMethod] - public void SteamId() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var steamid = client.SteamId; - Console.WriteLine( steamid ); - Assert.AreNotEqual( 0, steamid ); - } - } - - [TestMethod] - public void AuthSessionTicket() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var ticket = client.Auth.GetAuthSessionTicket(); - - Assert.IsTrue( ticket != null ); - Assert.IsTrue( ticket.Handle != 0 ); - Assert.IsTrue( ticket.Data.Length > 0 ); - - ticket.Cancel(); - - Assert.IsTrue( ticket.Handle == 0 ); - } - } - - [TestMethod] - public void Update() - { - var sw = new Stopwatch(); - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue(client.IsValid); - - for( int i=0; i<1024; i++ ) - { - sw.Restart(); - client.Update(); - Console.WriteLine( $"{sw.Elapsed.TotalMilliseconds}ms" ); - - } - } - } - - [TestMethod] - public void Subscribed() - { - var sw = new Stopwatch(); - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - Assert.IsTrue(client.IsSubscribed); - } - } - - [TestMethod] - public void Owner() - { - var sw = new Stopwatch(); - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - Assert.AreEqual(client.OwnerSteamId, client.SteamId); - } - } - - [TestMethod] - public void InstallFolder() - { - var sw = new Stopwatch(); - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - Assert.IsTrue(client.InstallFolder.Exists); - - Console.Write($"Install Folder: {client.InstallFolder}"); - } - } - - [TestMethod] - public void CurrentLanguage() - { - var sw = new Stopwatch(); - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - Assert.IsTrue( client.CurrentLanguage != null ); - Assert.IsTrue( client.CurrentLanguage.Length > 0 ); - - Console.Write( $"CurrentLanguage: {client.CurrentLanguage}" ); - } - } - - [TestMethod] - public void AvailableLanguages() - { - var sw = new Stopwatch(); - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - Assert.IsTrue( client.AvailableLanguages != null ); - Assert.IsTrue( client.AvailableLanguages.Length > 0 ); - - foreach ( var lang in client.AvailableLanguages ) - { - Console.Write( $"AvailableLanguages: {lang}" ); - } - - } - } - - [TestMethod] - public void Cybercafe() - { - var sw = new Stopwatch(); - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - Assert.IsFalse(client.IsCybercafe); - } - } - - [TestMethod] - public void LowViolence() - { - var sw = new Stopwatch(); - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - Assert.IsFalse(client.IsLowViolence); - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/FriendsTest.cs b/Facepunch.Steamworks.Test/Client/FriendsTest.cs deleted file mode 100644 index bcaf8a4..0000000 --- a/Facepunch.Steamworks.Test/Client/FriendsTest.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq; - -namespace Facepunch.Steamworks.Test -{ - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - [TestClass] - public class Friends - { - [TestMethod] - public void FriendList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - client.Friends.Refresh(); - - Assert.IsNotNull( client.Friends.All ); - - foreach ( var friend in client.Friends.All ) - { - Console.WriteLine( "{0}: {1} (Friend:{2}) (Blocked:{3})", friend.Id, friend.Name, friend.IsFriend, friend.IsBlocked ); - - Assert.IsNotNull(friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium )); - } - } - } - - [TestMethod] - public void FriendListWithoutRefresh() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - foreach ( var friend in client.Friends.All ) - { - Console.WriteLine( "{0}: {1} (Friend:{2}) (Blocked:{3})", friend.Id, friend.Name, friend.IsFriend, friend.IsBlocked ); - } - } - } - - [TestMethod] - public void Avatar() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - ulong id = (ulong)( 76561197960279927 + (new Random().Next() % 10000)); - bool passed = false; - - client.Friends.GetAvatar( Steamworks.Friends.AvatarSize.Medium, id, ( avatar) => - { - if ( avatar == null ) - { - Console.WriteLine( "No Avatar" ); - } - else - { - Assert.AreEqual( avatar.Width, 64 ); - Assert.AreEqual( avatar.Height, 64 ); - Assert.AreEqual( avatar.Data.Length, avatar.Width * avatar.Height * 4 ); - - DrawImage( avatar ); - } - passed = true; - }); - - while (passed == false ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - } - } - - [TestMethod] - public void CachedAvatar() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - var friend = client.Friends.All.First(); - - var image = client.Friends.GetCachedAvatar( Steamworks.Friends.AvatarSize.Medium, friend.Id ); - - if (image != null) - { - Assert.AreEqual(image.Width, 64); - Assert.AreEqual(image.Height, 64); - Assert.AreEqual(image.Data.Length, image.Width * image.Height * 4); - } - } - } - - public static void DrawImage( Image img ) - { - var grad = " -:+#"; - - for ( int y = 0; y 3 ) c = 3; - str += grad[c]; - - } - - Console.WriteLine( str ); - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/InventoryTest.cs b/Facepunch.Steamworks.Test/Client/InventoryTest.cs deleted file mode 100644 index 837b1b8..0000000 --- a/Facepunch.Steamworks.Test/Client/InventoryTest.cs +++ /dev/null @@ -1,295 +0,0 @@ -using System; -using System.Diagnostics; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq; - -namespace Facepunch.Steamworks.Test -{ - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - [TestClass] - public class Inventory - { - [TestMethod] - public void InventoryDefinitions() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsNotNull( client.Inventory.Definitions ); - Assert.AreNotEqual( 0, client.Inventory.Definitions.Length ); - - foreach ( var i in client.Inventory.Definitions.Where( x => x.PriceCategory != "" ) ) - { - Console.WriteLine( "{0}: {1} ({2})", i.Id, i.Name, i.Type ); - Console.WriteLine( " itemshortname: {0}", i.GetStringProperty( "itemshortname" ) ); - Console.WriteLine( " workshopdownload: {0}", i.GetStringProperty( "workshopdownload" ) ); - Console.WriteLine( " IconUrl: {0}", i.IconUrl ); - Console.WriteLine( " IconLargeUrl: {0}", i.IconLargeUrl ); - Console.WriteLine( " PriceRaw: {0}", i.PriceCategory ); - Console.WriteLine( " PriceDollars: {0}", i.PriceDollars ); - } - } - } - - [TestMethod] - public void InventoryDefinitionExchange() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsNotNull( client.Inventory.Definitions ); - Assert.AreNotEqual( 0, client.Inventory.Definitions.Length ); - - foreach ( var i in client.Inventory.Definitions ) - { - if ( i.Recipes == null ) continue; - - Console.WriteLine( "Ways To Create " + i.Name ); - - foreach ( var r in i.Recipes ) - { - Console.WriteLine( " " + string.Join( ", ", r.Ingredients.Select( x => x.Count + " x " + x.Definition.Name ) ) ); - } - } - } - } - - [TestMethod] - public void InventoryDefinitionIngredients() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsNotNull( client.Inventory.Definitions ); - Assert.AreNotEqual( 0, client.Inventory.Definitions.Length ); - - foreach ( var i in client.Inventory.Definitions ) - { - if ( i.IngredientFor == null ) continue; - - Console.WriteLine( i.Name + " Can Be Used to Make" ); - - foreach ( var r in i.IngredientFor ) - { - Console.WriteLine( " " + r.Result.Name ); - } - } - } - } - - [TestMethod] - public void InventoryItemList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - bool CallbackCalled = false; - - // OnUpdate hsould be called when we receive a list of our items - client.Inventory.OnUpdate = () => { CallbackCalled = true; }; - - // tell steam to download the items - client.Inventory.Refresh(); - - // Wait for the items - var timeout = Stopwatch.StartNew(); - while ( client.Inventory.Items == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 1000 ); - - if ( timeout.Elapsed.TotalSeconds > 10 ) - break; - } - - // make sure callback was called - Assert.IsTrue( CallbackCalled ); - - // Make sure items are valid - foreach ( var item in client.Inventory.Items ) - { - Assert.IsNotNull( item ); - Assert.IsNotNull( item.Definition ); - - Console.WriteLine( item.Definition.Name + " - " + item.Id ); - } - } - } - - [TestMethod] - public void InventoryItemProperties() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - while ( true ) - { - client.Update(); - - if (client.Inventory.Items == null) continue; - - foreach (var item in client.Inventory.Items) - { - Console.WriteLine($"{item.Id} ({item.Definition.Name})"); - - foreach (var property in item.Properties) - { - Console.WriteLine($" {property.Key} = {property.Value}"); - } - - Console.WriteLine(""); - } - - return; - } - } - } - - [TestMethod] - public void Deserialize() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsTrue( client.IsValid ); - Assert.IsNotNull(client.Inventory.Definitions); - Assert.AreNotEqual(0, client.Inventory.Definitions.Length); - - client.Inventory.Refresh(); - - var stopwatch = Stopwatch.StartNew(); - - // - // Block until we have the items - // - while ( client.Inventory.SerializedItems == null ) - { - client.Update(); - - if (stopwatch.Elapsed.Seconds > 10) - throw new System.Exception("Getting SerializedItems took too long"); - } - - Assert.IsNotNull( client.Inventory.SerializedItems ); - Assert.IsTrue( client.Inventory.SerializedItems.Length > 4 ); - - using ( var server = new Facepunch.Steamworks.Server( 252490, new ServerInit( "rust", "Rust" ) ) ) - { - server.LogOnAnonymous(); - Assert.IsTrue( server.IsValid ); - - var result = server.Inventory.Deserialize( client.Inventory.SerializedItems ); - - stopwatch = Stopwatch.StartNew(); - - while (result.IsPending) - { - server.Update(); - - if (stopwatch.Elapsed.Seconds > 10) - throw new System.Exception("result took too long"); - } - - Assert.IsFalse( result.IsPending ); - Assert.IsNotNull( result.Items ); - - foreach ( var item in result.Items ) - { - Console.WriteLine( "Item: {0} ({1})", item.Id, item.DefinitionId ); - Console.WriteLine( "Item: {0} ({1})", item.Id, item.DefinitionId ); - } - } - } - } - - [TestMethod] - public void PurchaseItems() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsNotNull(client.Inventory.Definitions); - Assert.AreNotEqual(0, client.Inventory.Definitions.Length); - - while ( client.Inventory.Currency == null ) - { - client.Update(); - } - - var shoppingList = client.Inventory.DefinitionsWithPrices.Take(2).ToArray(); - bool waitingForCallback = true; - - if ( !client.Inventory.StartPurchase(shoppingList, ( order, tran ) => - { - Console.WriteLine($"Order: {order}, Transaction {tran}"); - waitingForCallback = false; - - } ) ) - { - throw new Exception("Couldn't Buy!"); - } - - while ( waitingForCallback ) - { - client.Update(); - } - } - } - - [TestMethod] - public void ListPrices() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - while ( client.Inventory.Definitions == null ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.IsNotNull(client.Inventory.Definitions); - Assert.AreNotEqual(0, client.Inventory.Definitions.Length); - - while (client.Inventory.Currency == null) - { - client.Update(); - } - - foreach ( var i in client.Inventory.Definitions.Where( x => x.LocalPrice > 0 ) ) - { - Console.WriteLine( $" {i.Name} - {i.LocalPriceFormatted} ({client.Inventory.Currency})" ); - } - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs b/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs deleted file mode 100644 index 3628d11..0000000 --- a/Facepunch.Steamworks.Test/Client/LeaderboardTest.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class Leaderboard - { - [TestMethod] - public void GetLeaderboard() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric ); - - var time = Stopwatch.StartNew(); - while ( !board.IsValid ) - { - Thread.Sleep( 10 ); - client.Update(); - - if (time.Elapsed.TotalSeconds > 10 ) - { - throw new Exception("board.IsValid took too long"); - } - } - - Assert.IsTrue( board.IsValid ); - Assert.IsFalse( board.IsError ); - Assert.IsNotNull( board.Name ); - - Console.WriteLine( $"Board name is \"{board.Name}\"" ); - Console.WriteLine( $"Board has \"{board.TotalEntries}\" entries" ); - - board.AddScore( true, 86275309, 7, 8, 9 ); - - board.FetchScores( Steamworks.Leaderboard.RequestType.Global, 0, 20 ); - - time = Stopwatch.StartNew(); - while ( board.IsQuerying ) - { - Thread.Sleep( 10 ); - client.Update(); - - if (time.Elapsed.TotalSeconds > 10) - { - throw new Exception("board.IsQuerying took too long"); - } - } - - Assert.IsFalse( board.IsError ); - Assert.IsNotNull( board.Results ); - - foreach ( var entry in board.Results ) - { - Console.WriteLine( $"{entry.GlobalRank}: {entry.SteamId} ({entry.Name}) with {entry.Score}" ); - - if ( entry.SubScores != null ) - Console.WriteLine( " - " + string.Join( ";", entry.SubScores.Select( x => x.ToString() ).ToArray() ) ); - } - } - } - - [TestMethod] - public void GetLeaderboardCallback() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric ); - - var time = Stopwatch.StartNew(); - while ( !board.IsValid ) - { - Thread.Sleep( 10 ); - client.Update(); - - if (time.Elapsed.TotalSeconds > 10) - { - throw new Exception("board.IsValid took too long"); - } - } - - Assert.IsTrue( board.IsValid ); - Assert.IsFalse( board.IsError ); - Assert.IsNotNull( board.Name ); - - board.AddScore( true, 86275309, 7, 8, 9 ); - - var done = false; - - board.FetchScores( Steamworks.Leaderboard.RequestType.Global, 0, 20, results => - { - foreach ( var entry in results ) - { - Console.WriteLine( $"{entry.GlobalRank}: {entry.SteamId} ({entry.Name}) with {entry.Score}" ); - - if ( entry.SubScores != null ) - Console.WriteLine( " - " + string.Join( ";", entry.SubScores.Select( x => x.ToString() ).ToArray() ) ); - } - - done = true; - }, error => Assert.Fail( error.ToString() ) ); - - while ( !done ) - { - Thread.Sleep( 10 ); - client.Update(); - } - } - } - - [TestMethod] - public void AddScores() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric ); - - var time = Stopwatch.StartNew(); - while (!board.IsValid) - { - Thread.Sleep(10); - client.Update(); - - if (time.Elapsed.TotalSeconds > 10) - { - throw new Exception("board.IsValid took too long"); - } - } - - Assert.IsTrue( board.IsValid ); - Assert.IsFalse( board.IsError ); - - board.AddScore( true, 1234 ); - - Thread.Sleep( 10 ); - client.Update(); - - board.AddScore( true, 34566 ); - - Thread.Sleep( 10 ); - client.Update(); - - board.AddScore( true, 86275309, 7, 8, 9, 7, 4, 7, 98, 24, 5, 76, 124, 6 ); - - Thread.Sleep( 10 ); - client.Update(); - - board.AddScore( false, 86275309, 7, 8, 9, 7, 4, 7, 98, 24, 5, 76, 124, 6 ); - - Thread.Sleep( 10 ); - client.Update(); - } - } - - [TestMethod] - public void AddScoresCallback() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric ); - - var time = Stopwatch.StartNew(); - while (!board.IsValid) - { - Thread.Sleep(10); - client.Update(); - - if ( board.IsError ) - { - throw new Exception( "Board is Error" ); - } - - if (time.Elapsed.TotalSeconds > 10) - { - throw new Exception("board.IsValid took too long"); - } - } - - Assert.IsTrue( board.IsValid ); - Assert.IsFalse( board.IsError ); - - var done = false; - - const int score = 5678; - - board.AddScore( false, score, null, result => - { - Assert.IsTrue( result.ScoreChanged ); - Assert.AreEqual( result.Score, score ); - - done = true; - }, error => Assert.Fail( error.ToString() ) ); - - while ( !done ) - { - Thread.Sleep( 10 ); - client.Update(); - } - } - } - - [TestMethod] - public void AddFileAttachment() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var board = client.GetLeaderboard( "TestLeaderboard", Steamworks.Client.LeaderboardSortMethod.Ascending, Steamworks.Client.LeaderboardDisplayType.Numeric ); - - var time = Stopwatch.StartNew(); - while (!board.IsValid) - { - Thread.Sleep(10); - client.Update(); - - if (time.Elapsed.TotalSeconds > 10) - { - throw new Exception("board.IsValid took too long"); - } - } - - Assert.IsTrue( board.IsValid ); - Assert.IsFalse( board.IsError ); - - var done = false; - - const int score = 5678; - const string attachment = "Hello world!"; - - var file = client.RemoteStorage.CreateFile( "score/example.txt" ); - file.WriteAllText( attachment ); - - Assert.IsTrue( board.AddScore( false, score, null, result => - { - Assert.IsTrue( result.ScoreChanged ); - - Assert.IsTrue( board.AttachRemoteFile( file, () => - { - done = true; - }, error => Assert.Fail( error.ToString() ) ) ); - }, error => Assert.Fail( error.ToString() ) ) ); - - while ( !done ) - { - Thread.Sleep( 10 ); - client.Update(); - } - - done = false; - - Assert.IsTrue( board.FetchScores( Steamworks.Leaderboard.RequestType.GlobalAroundUser, 0, 0, entries => - { - Assert.AreEqual( 1, entries.Length ); - Assert.IsNotNull( entries[0].AttachedFile ); - - Assert.IsTrue( entries[0].AttachedFile.Download( () => - { - Assert.AreEqual( attachment, entries[0].AttachedFile.ReadAllText() ); - - done = true; - }, error => Assert.Fail( error.ToString() ) ) ); - }, error => Assert.Fail( error.ToString() ) ) ); - - while ( !done ) - { - Thread.Sleep( 10 ); - client.Update(); - } - } - } - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/Client/LobbyTest.cs b/Facepunch.Steamworks.Test/Client/LobbyTest.cs deleted file mode 100644 index 17241a3..0000000 --- a/Facepunch.Steamworks.Test/Client/LobbyTest.cs +++ /dev/null @@ -1,390 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using Facepunch.Steamworks; -using System.Text; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem("steam_api.dll")] - [DeploymentItem("steam_api64.dll")] - public class Lobby - { - [TestMethod] - public void CreateLobby() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - Console.WriteLine($"Owner: {client.Lobby.Owner}"); - Console.WriteLine($"Max Members: {client.Lobby.MaxMembers}"); - Console.WriteLine($"Num Members: {client.Lobby.NumMembers}"); - client.Lobby.Leave(); - }; - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 3) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - } - } - - [TestMethod] - public void GetCreatedLobbyData() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - foreach (KeyValuePair data in client.Lobby.CurrentLobbyData.GetAllData()) - { - if (data.Key == "appid") - { - Assert.IsTrue(data.Value == "252490"); - } - Console.WriteLine($"{data.Key} {data.Value}"); - } - client.Lobby.Leave(); - }; - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 3) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - } - } - - [TestMethod] - public void UpdateLobbyData() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - - client.Lobby.Name = "My Updated Lobby Name"; - client.Lobby.CurrentLobbyData.SetData("testkey", "testvalue"); - client.Lobby.LobbyType = Steamworks.Lobby.Type.Private; - client.Lobby.MaxMembers = 5; - client.Lobby.Joinable = false; - - foreach (KeyValuePair data in client.Lobby.CurrentLobbyData.GetAllData()) - { - if (data.Key == "appid") - { - Assert.IsTrue(data.Value == "252490"); - } - - if (data.Key == "testkey") - { - Assert.IsTrue(data.Value == "testvalue"); - } - - if (data.Key == "lobbytype") - { - Assert.IsTrue(data.Value == Steamworks.Lobby.Type.Private.ToString()); - } - - Console.WriteLine($"{data.Key} {data.Value}"); - } - - - - }; - - - client.Lobby.OnLobbyDataUpdated = () => - { - Console.WriteLine("lobby data updated"); - Console.WriteLine(client.Lobby.MaxMembers); - Console.WriteLine(client.Lobby.Joinable); - }; - - - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 3) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - client.Lobby.Leave(); - - } - } - - [TestMethod] - public void RefreshLobbyList() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - client.LobbyList.Refresh(); - }; - - client.LobbyList.OnLobbiesUpdated = () => - { - Console.WriteLine("lobbies updating"); - if (client.LobbyList.Finished) - { - Console.WriteLine("lobbies finished updating"); - Console.WriteLine($"found {client.LobbyList.Lobbies.Count} lobbies"); - - foreach (LobbyList.Lobby lobby in client.LobbyList.Lobbies) - { - Console.WriteLine($"Found Lobby: {lobby.Name}"); - } - - client.Lobby.Leave(); - - } - - }; - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 3) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - } - } - - [TestMethod] - public void RefreshLobbyListWithFilter() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - client.Lobby.CurrentLobbyData.SetData("testkey", "testvalue"); - }; - - client.Lobby.OnLobbyDataUpdated = () => - { - var filter = new LobbyList.Filter(); - filter.StringFilters.Add("testkey", "testvalue"); - client.LobbyList.Refresh(filter); - }; - - client.LobbyList.OnLobbiesUpdated = () => - { - Console.WriteLine("lobbies updating"); - if (client.LobbyList.Finished) - { - Console.WriteLine("lobbies finished updating"); - Console.WriteLine($"found {client.LobbyList.Lobbies.Count} lobbies"); - - foreach (LobbyList.Lobby lobby in client.LobbyList.Lobbies) - { - Console.WriteLine($"Found Lobby: {lobby.Name}"); - } - - } - - }; - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 5) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - client.Lobby.Leave(); - - } - } - - [TestMethod] - public void RefreshLobbyListWithFilterAndGetLobbyDataFromListLobby() - { - using (var client = new Facepunch.Steamworks.Client(755870)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - client.Lobby.CurrentLobbyData.SetData("testkey", "testvalue"); - }; - - client.Lobby.OnLobbyDataUpdated = () => - { - var filter = new LobbyList.Filter(); - filter.StringFilters.Add("testkey", "testvalue"); - client.LobbyList.Refresh(filter); - }; - - client.LobbyList.OnLobbiesUpdated = () => - { - Console.WriteLine("lobbies updating"); - if (client.LobbyList.Finished) - { - Console.WriteLine("lobbies finished updating"); - Console.WriteLine($"found {client.LobbyList.Lobbies.Count} lobbies"); - - foreach (LobbyList.Lobby lobby in client.LobbyList.Lobbies) - { - foreach (var pair in lobby.GetAllData()) - { - Console.WriteLine(string.Format("Key: {0,-36} Value: {1}", pair.Key, pair.Value)); - } - } - } - }; - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 5) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - client.Lobby.Leave(); - - } - } - - [TestMethod] - public void SendChatMessage() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - string testString = "Hello, World"; - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - client.Lobby.CurrentLobbyData.SetData("testkey", "testvalue"); - client.Lobby.SendChatMessage(testString); - }; - - client.Lobby.OnChatMessageRecieved = (steamID, bytes, length) => - { - string message = Encoding.UTF8.GetString(bytes, 0, length); - Console.WriteLine("message recieved"); - Assert.IsTrue(message == testString); - }; - - client.Lobby.OnChatStringRecieved = (steamID, message) => - { - Console.WriteLine("message recieved"); - Assert.IsTrue(message == testString); - }; - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 5) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - client.Lobby.Leave(); - - } - } - - [TestMethod] - public void SetGetUserMetadata() - { - using (var client = new Facepunch.Steamworks.Client(252490)) - { - Assert.IsTrue(client.IsValid); - - client.Lobby.OnLobbyCreated = (success) => - { - Assert.IsTrue(success); - Assert.IsTrue(client.Lobby.IsValid); - Console.WriteLine("lobby created: " + client.Lobby.CurrentLobby); - client.Lobby.SetMemberData("testkey", "testvalue"); - }; - - client.Lobby.OnLobbyMemberDataUpdated = (steamID) => - { - string name = client.Friends.GetName(steamID); - Console.WriteLine(name + " updated data"); - Assert.IsTrue(client.Lobby.GetMemberData(steamID, "testkey") == "testvalue"); - Console.WriteLine("testkey is now: " + client.Lobby.GetMemberData(steamID, "testkey")); - }; - - client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); - - var sw = Stopwatch.StartNew(); - - while (sw.Elapsed.TotalSeconds < 5) - { - client.Update(); - System.Threading.Thread.Sleep(10); - } - - client.Lobby.Leave(); - - } - } - - } -} diff --git a/Facepunch.Steamworks.Test/Client/NetworkingTest.cs b/Facepunch.Steamworks.Test/Client/NetworkingTest.cs deleted file mode 100644 index 34c7fbd..0000000 --- a/Facepunch.Steamworks.Test/Client/NetworkingTest.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System; -using System.Diagnostics; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public partial class Networking - { - [TestMethod] - public void PeerToPeerSend() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var TestString = "This string will be transformed to bytes, sent over the Steam P2P network, then converted back to a string."; - var OutputReceived = false; - var data = Encoding.UTF8.GetBytes( TestString ); - - // - // Enable listening on this channel - // - client.Networking.SetListenChannel( 0, true ); - - client.Networking.OnP2PData = ( steamid, bytes, length, channel ) => - { - var str = Encoding.UTF8.GetString( bytes, 0, length ); - Assert.AreEqual( str, TestString ); - Assert.AreEqual( steamid, client.SteamId ); - OutputReceived = true; - - Console.WriteLine( "Got: " + str ); - }; - - client.Networking.OnIncomingConnection = ( steamid ) => - { - Console.WriteLine( "Incoming P2P Connection: " + steamid ); - return true; - }; - - client.Networking.OnConnectionFailed = ( steamid, error ) => - { - Console.WriteLine( "Connection Error: " + steamid + " - " + error ); - }; - - client.Networking.SendP2PPacket( client.SteamId, data, data.Length ); - - while( true ) - { - Thread.Sleep( 10 ); - client.Update(); - - if ( OutputReceived ) - break; - } - } - } - - [TestMethod] - public void PeerToPeerFailure() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var TestString = "This string will be transformed to bytes, sent over the Steam P2P network, then converted back to a string."; - var TimeoutReceived = false; - var data = Encoding.UTF8.GetBytes( TestString ); - - client.Networking.OnIncomingConnection = ( steamid ) => - { - Console.WriteLine( "Incoming P2P Connection: " + steamid ); - - return true; - }; - - client.Networking.OnConnectionFailed = ( steamid, error ) => - { - Console.WriteLine( "Connection Error: " + steamid + " - " + error ); - TimeoutReceived = true; - }; - - ulong rand = (ulong) new Random().Next( 1024 * 16 ); - - // Send to an invalid, not listening steamid - if ( !client.Networking.SendP2PPacket( client.SteamId + rand, data, data.Length ) ) - { - Console.WriteLine( "Couldn't send packet" ); - return; - } - - var sw = Stopwatch.StartNew(); - - while ( true ) - { - Thread.Sleep( 10 ); - client.Update(); - - // - // Timout is usually around 15 seconds - // - if ( TimeoutReceived ) - break; - - if ( sw.Elapsed.TotalSeconds > 30 ) - { - Assert.Fail( "Didn't time out" ); - } - } - } - } - - } -} diff --git a/Facepunch.Steamworks.Test/Client/RemoteStorageTest.cs b/Facepunch.Steamworks.Test/Client/RemoteStorageTest.cs deleted file mode 100644 index 15c31c3..0000000 --- a/Facepunch.Steamworks.Test/Client/RemoteStorageTest.cs +++ /dev/null @@ -1,85 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class RemoteStorage - { - [TestMethod] - public void GetQuota() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - ulong total = client.RemoteStorage.QuotaTotal; - var available = client.RemoteStorage.QuotaRemaining; - - Console.WriteLine( $"Total quota: {total} bytes" ); - Console.WriteLine( $"Available: {available} bytes" ); - } - } - - [TestMethod] - public void WriteFile() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var file = client.RemoteStorage.CreateFile( "test.txt" ); - - const string text = "Hello world!"; - - file.WriteAllText( text ); - - Assert.IsTrue( file.Exists ); - - var read = file.ReadAllText(); - Assert.AreEqual( text, read ); - } - } - - [TestMethod] - public void ReadText() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var text = client.RemoteStorage.ReadString( "test.txt" ); - - Assert.IsNotNull( text ); - Assert.AreEqual( text, "Hello world!" ); - } - } - - [TestMethod] - public void WriteText() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var result = client.RemoteStorage.WriteString( "test.txt", "Hello world!" ); - Assert.IsTrue( result ); - } - } - - [TestMethod] - public void WriteFiles() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - for ( var i = 0; i < 10; ++i ) - { - client.RemoteStorage - .CreateFile( $"test_{i}/example.txt" ) - .WriteAllText( Guid.NewGuid().ToString() ); - } - - Console.WriteLine( $"File count: {client.RemoteStorage.FileCount}" ); - - foreach ( var file in client.RemoteStorage.Files ) - { - Console.WriteLine( $"- {file.FileName} ({file.SizeInBytes} bytes)" ); - } - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/RichPresenceTest.cs b/Facepunch.Steamworks.Test/Client/RichPresenceTest.cs deleted file mode 100644 index b261979..0000000 --- a/Facepunch.Steamworks.Test/Client/RichPresenceTest.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System; -using System.Diagnostics; -using System.Linq; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class RichPresence - { - [TestMethod] - public void MissingKeyIsNull() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - var key = client.User.GetRichPresence( "Missing Key" ); - Assert.IsNull( key ); - } - } - - [TestMethod] - public void ReadBackSetKey() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - client.User.SetRichPresence( "One", "Two" ); - - var value = client.User.GetRichPresence( "One" ); - Assert.IsNotNull( value ); - Assert.AreEqual( value, "Two" ); - } - } - - [TestMethod] - public void ClearingKeys() - { - using ( var client = new Steamworks.Client( 252490 ) ) - { - client.User.SetRichPresence( "One", "Two" ); - - var value = client.User.GetRichPresence( "One" ); - Assert.IsNotNull( value ); - Assert.AreEqual( value, "Two" ); - - client.User.ClearRichPresence(); - - value = client.User.GetRichPresence( "One" ); - Assert.IsNull( value ); - } - } - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/Client/Server/ServerTest.cs b/Facepunch.Steamworks.Test/Client/Server/ServerTest.cs deleted file mode 100644 index 09dc2e0..0000000 --- a/Facepunch.Steamworks.Test/Client/Server/ServerTest.cs +++ /dev/null @@ -1,154 +0,0 @@ -using System; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - [DeploymentItem( "tier0_s.dll" )] - [DeploymentItem( "vstdlib_s.dll" )] - [DeploymentItem( "steamclient.dll" )] - [DeploymentItem( "tier0_s64.dll" )] - [DeploymentItem( "vstdlib_s64.dll" )] - [DeploymentItem( "steamclient64.dll" )] - [TestClass] - public partial class Server - { - [TestMethod] - public void Init() - { - var serverInit = new ServerInit( "rust", "Rust" ); - serverInit.GamePort = 28015; - serverInit.Secure = true; - serverInit.QueryPort = 28016; - - using ( var server = new Facepunch.Steamworks.Server( 252490, serverInit ) ) - { - server.ServerName = "My Test Server"; - server.LogOnAnonymous(); - - Assert.IsTrue( server.IsValid ); - } - } - - [TestMethod] - public void PublicIp() - { - using ( var server = new Facepunch.Steamworks.Server( 252490, new ServerInit( "rust", "Rust" ) ) ) - { - server.LogOnAnonymous(); - - Assert.IsTrue( server.IsValid ); - - while ( true ) - { - var ip = server.PublicIp; - - if ( ip == null ) - { - System.Threading.Thread.Sleep( 100 ); - server.Update(); - continue; - } - - Assert.IsNotNull( ip ); - Console.WriteLine( ip.ToString() ); - break; - } - - } - } - - [TestMethod] - public void AuthCallback() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - var ticket = client.Auth.GetAuthSessionTicket(); - var ticketBinary = ticket.Data; - - using ( var server = new Facepunch.Steamworks.Server( 252490, new ServerInit( "rust", "Rust" ) ) ) - { - server.LogOnAnonymous(); - - Assert.IsTrue( server.IsValid ); - - var auth = server.Auth; - - var Authed = false; - - server.Auth.OnAuthChange = ( steamid, ownerid, status ) => - { - Authed = status == ServerAuth.Status.OK; - - Assert.AreEqual( steamid, client.SteamId ); - Assert.AreEqual( steamid, ownerid ); - - Console.WriteLine( "steamid: {0}", steamid ); - Console.WriteLine( "ownerid: {0}", ownerid ); - Console.WriteLine( "status: {0}", status ); - }; - - for ( int i = 0; i < 16; i++ ) - { - System.Threading.Thread.Sleep( 10 ); - GC.Collect(); - server.Update(); - GC.Collect(); - client.Update(); - GC.Collect(); - } - - GC.Collect(); - if ( !server.Auth.StartSession( ticketBinary, client.SteamId ) ) - { - Assert.Fail( "Start Session returned false" ); - } - GC.Collect(); - - // - // Server should receive a ServerAuth.Status.OK - // message via the OnAuthChange callback - // - - for ( int i = 0; i< 100; i++ ) - { - GC.Collect(); - System.Threading.Thread.Sleep( 100 ); - GC.Collect(); - server.Update(); - client.Update(); - - if ( Authed ) - break; - } - - Assert.IsTrue( Authed ); - - // - // Client cancels ticket - // - ticket.Cancel(); - - // - // Server should receive a ticket cancelled message - // - - for ( int i = 0; i < 100; i++ ) - { - System.Threading.Thread.Sleep( 100 ); - server.Update(); - client.Update(); - - if ( !Authed ) - break; - } - - Assert.IsTrue( !Authed ); - - } - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/Server/StatsTest.cs b/Facepunch.Steamworks.Test/Client/Server/StatsTest.cs index e870ff1..030b278 100644 --- a/Facepunch.Steamworks.Test/Client/Server/StatsTest.cs +++ b/Facepunch.Steamworks.Test/Client/Server/StatsTest.cs @@ -2,7 +2,7 @@ using System.Text; using System.Threading; using Microsoft.VisualStudio.TestTools.UnitTesting; - +/* namespace Facepunch.Steamworks.Test { public partial class Server @@ -40,3 +40,4 @@ namespace Facepunch.Steamworks.Test } } +*/ \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs b/Facepunch.Steamworks.Test/Client/ServerlistTest.cs deleted file mode 100644 index c96c19c..0000000 --- a/Facepunch.Steamworks.Test/Client/ServerlistTest.cs +++ /dev/null @@ -1,470 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public partial class ServerList - { - [TestMethod] - public void IpAddressConversions() - { - var ipstr = "185.38.150.40"; - var ip = IPAddress.Parse( ipstr ); - - var ip_int = Facepunch.Steamworks.Utility.IpToInt32( ip ); - - var ip_back = Facepunch.Steamworks.Utility.Int32ToIp( ip_int ); - - Console.WriteLine( "ipstr: " + ipstr ); - Console.WriteLine( "ip: " + ip ); - Console.WriteLine( "ip int: " + ip_int ); - Console.WriteLine( "ip_back: " + ip_back ); - } - - - [TestMethod] - public void InternetList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "appid", client.AppId.ToString() ); - filter.Add( "gamedir", "rust" ); - filter.Add( "secure", "1" ); - - var query = client.ServerList.Internet( filter ); - - for ( int i = 0; i < 1000; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 100 ); - - foreach ( var s in query.Responded ) - { - Assert.AreEqual( s.AppId, client.AppId ); - Assert.AreEqual( s.GameDir, "rust" ); - } - - if ( query.Finished ) - break; - } - - Assert.IsTrue( query.Responded.Count > 0 ); - - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - foreach ( var server in query.Responded.Take( 20 ) ) - { - Console.WriteLine( "{0} {1}", server.Address, server.Name ); - } - - query.Dispose(); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 1 ); - } - } - } - - [TestMethod] - public void MultipleInternetList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var queries = new List(); - - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "map", "barren" ); - - for ( int i = 0; i < 10; i++ ) - queries.Add( client.ServerList.Internet( filter ) ); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 5 ); - - if ( queries.Any( x => x.Finished ) ) - break; - } - - foreach ( var query in queries ) - { - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - client.Update(); - query.Dispose(); - client.Update(); - } - } - } - - [TestMethod] - public void Filters() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "map", "barren" ); - - - var query = client.ServerList.Internet( filter ); - - while ( true ) - { - client.Update(); - System.Threading.Thread.Sleep( 2 ); - - if ( query.Finished ) - break; - } - - foreach ( var x in query.Responded ) - { - Assert.AreEqual( x.Map.ToLower(), "barren" ); - } - - query.Dispose(); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 1 ); - } - } - } - - [TestMethod] - public void HistoryList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "appid", client.AppId.ToString() ); - filter.Add( "gamedir", "rust" ); - filter.Add( "secure", "1" ); - - var query = client.ServerList.History( filter ); - - while ( true ) - { - client.Update(); - System.Threading.Thread.Sleep( 2 ); - - if ( query.Finished ) - break; - } - - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - foreach ( var x in query.Responded ) - { - Console.WriteLine( x.Map ); - } - - query.Dispose(); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 1 ); - } - } - } - - [TestMethod] - public void FavouriteList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "appid", client.AppId.ToString() ); - filter.Add( "gamedir", "rust" ); - filter.Add( "secure", "1" ); - - var query = client.ServerList.Favourites( filter ); - - while ( true ) - { - client.Update(); - System.Threading.Thread.Sleep( 2 ); - - if ( query.Finished ) - break; - } - - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - foreach ( var x in query.Responded ) - { - Console.WriteLine( x.Map ); - } - - query.Dispose(); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 1 ); - } - } - } - - [TestMethod] - public void LocalList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "appid", client.AppId.ToString() ); - filter.Add( "gamedir", "rust" ); - filter.Add( "secure", "1" ); - - var query = client.ServerList.Local( filter ); - - while ( true ) - { - client.Update(); - System.Threading.Thread.Sleep( 2 ); - - if ( query.Finished ) - break; - } - - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - foreach ( var x in query.Responded ) - { - Console.WriteLine( x.Map ); - } - - query.Dispose(); - - for ( int i = 0; i < 100; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 1 ); - } - } - } - - [TestMethod] - public void CustomList() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var servers = new List(); - - servers.Add( "158.85.101.20:28015" ); - servers.Add( "158.85.101.20:28022" ); - servers.Add( "173.192.176.171:28615" ); - servers.Add( "109.95.212.35:28215" ); - servers.Add( "109.95.212.35:28115" ); - servers.Add( "27.50.72.176:28015" ); - servers.Add( "109.95.212.40:28015" ); - servers.Add( "212.38.168.149:28215" ); - servers.Add( "27.50.72.167:28215" ); - servers.Add( "85.236.105.7:28215" ); - servers.Add( "107.182.233.216:28215" ); - servers.Add( "85.236.105.11:28215" ); - servers.Add( "109.95.211.198:28215" ); - servers.Add( "8.26.94.190:28015" ); - servers.Add( "221.121.151.37:28215" ); - servers.Add( "161.202.144.216:28215" ); - servers.Add( "107.182.230.181:28215" ); - servers.Add( "107.182.231.134:27101" ); - servers.Add( "107.182.233.181:27101" ); - servers.Add( "78.129.153.47:27101" ); - servers.Add( "109.95.211.206:27101" ); - servers.Add( "169.57.142.73:27101" ); - servers.Add( "221.121.154.147:27101" ); - servers.Add( "31.216.52.44:30015" ); - servers.Add( "109.169.94.17:28215" ); - servers.Add( "109.169.94.17:28315" ); - servers.Add( "109.169.94.17:28015" ); - servers.Add( "41.0.11.167:27141" ); - servers.Add( "78.129.153.47:27131" ); - servers.Add( "109.95.211.206:27111" ); - servers.Add( "107.182.231.134:27111" ); - servers.Add( "198.27.70.162:28015" ); - servers.Add( "198.27.70.162:28215" ); - servers.Add( "198.27.70.162:28115" ); - servers.Add( "169.57.142.73:27111" ); - servers.Add( "221.121.154.147:27111" ); - servers.Add( "107.182.233.181:27111" ); - servers.Add( "78.129.153.47:27111" ); - servers.Add( "109.95.211.215:28015" ); - servers.Add( "50.23.131.208:28015" ); - servers.Add( "50.23.131.208:28115" ); - servers.Add( "50.23.131.208:28215" ); - servers.Add( "63.251.114.37:28215" ); - servers.Add( "63.251.114.37:28115" ); - servers.Add( "63.251.114.37:28015" ); - servers.Add( "149.202.89.85:27101" ); - servers.Add( "149.202.89.85:27111" ); - servers.Add( "149.202.89.85:27131" ); - servers.Add( "8.26.94.147:27101" ); - servers.Add( "8.26.94.147:27111" ); - servers.Add( "8.26.94.147:27121" ); - servers.Add( "159.8.147.197:28025" ); - servers.Add( "162.248.88.203:27038" ); - servers.Add( "162.248.88.203:28091" ); - servers.Add( "74.91.119.142:28069" ); - servers.Add( "162.248.88.203:25063" ); - servers.Add( "64.251.7.189:28115" ); - servers.Add( "64.251.7.189:28015" ); - servers.Add( "216.52.0.170:28215" ); - servers.Add( "217.147.91.80:28215" ); - servers.Add( "63.251.112.121:28215" ); - servers.Add( "162.248.88.203:28074" ); - servers.Add( "74.91.119.142:27095" ); - servers.Add( "95.172.92.176:28065" ); - servers.Add( "192.223.26.55:26032" ); - servers.Add( "40.114.199.6:28085" ); - servers.Add( "95.172.92.176:27095" ); - servers.Add( "216.52.0.172:28015" ); - servers.Add( "216.52.0.171:28115" ); - servers.Add( "27.50.72.179:28015" ); - servers.Add( "27.50.72.180:28115" ); - servers.Add( "221.121.158.203:28015" ); - servers.Add( "63.251.242.246:28015" ); - servers.Add( "85.236.105.51:28015" ); - servers.Add( "85.236.105.47:28015" ); - servers.Add( "209.95.60.216:28015" ); - servers.Add( "212.38.168.14:28015" ); - servers.Add( "217.147.91.138:28015" ); - servers.Add( "31.216.52.42:28015" ); - servers.Add( "107.182.226.225:28015" ); - servers.Add( "109.95.211.69:28015" ); - servers.Add( "209.95.56.13:28015" ); - servers.Add( "173.244.192.101:28015" ); - servers.Add( "221.121.158.201:28115" ); - servers.Add( "63.251.242.245:28115" ); - servers.Add( "85.236.105.50:28115" ); - servers.Add( "85.236.105.46:28115" ); - servers.Add( "209.95.60.217:28115" ); - servers.Add( "212.38.168.13:28115" ); - servers.Add( "217.147.91.139:28115" ); - servers.Add( "107.182.226.224:28115" ); - servers.Add( "109.95.211.14:28115" ); - servers.Add( "109.95.211.16:28115" ); - servers.Add( "109.95.211.17:28115" ); - servers.Add( "209.95.56.14:28115" ); - servers.Add( "173.244.192.100:28115" ); - servers.Add( "209.95.60.218:28215" ); - servers.Add( "109.95.211.13:28215" ); - servers.Add( "109.95.211.15:28215" ); - servers.Add( "31.216.52.41:29015" ); - - var query = client.ServerList.Custom( servers ); - - for ( int i = 0; i < 1000; i++ ) - { - client.Update(); - System.Threading.Thread.Sleep( 20 ); - - if ( query.Finished ) - break; - } - - Console.WriteLine( "Responded: " + query.Responded.Count.ToString() ); - Console.WriteLine( "Unresponsive: " + query.Unresponsive.Count.ToString() ); - - foreach ( var s in query.Responded ) - { - Console.WriteLine( "{0} - {1}", s.Address, s.Name ); - - Assert.IsTrue( servers.Contains( $"{s.Address}:{s.QueryPort}" ) ); - } - - query.Dispose(); - } - } - - [TestMethod] - public void Rules() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var filter = new Facepunch.Steamworks.ServerList.Filter(); - filter.Add( "appid", client.AppId.ToString() ); - filter.Add( "gamedir", "rust" ); - filter.Add( "secure", "1" ); - - filter.Add( "addr", "185.97.254.146" ); - - using ( var query = client.ServerList.Internet( filter ) ) - { - for ( int i = 0; i < 1000; i++ ) - { - GC.Collect(); - client.Update(); - GC.Collect(); - System.Threading.Thread.Sleep( 10 ); - - // if ( query.Responded.Count > 20 ) - // break; - - if ( query.Finished ) - break; - } - - query.Dispose(); - - var servers = query.Responded.Take( 100 ); - - foreach ( var server in servers ) - { - server.FetchRules(); - - int i = 0; - while ( !server.HasRules ) - { - i++; - client.Update(); - System.Threading.Thread.Sleep( 10 ); - - if ( i > 100 ) - break; - } - - if ( server.HasRules ) - { - Console.WriteLine( "" ); - Console.WriteLine( "" ); - Console.WriteLine( server.Address ); - Console.WriteLine( "" ); - - foreach ( var rule in server.Rules ) - { - Console.WriteLine( rule.Key + " = " + rule.Value ); - } - } - else - { - Console.WriteLine( "SERVER HAS NO RULES :(" ); - } - } - - - - } - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/StatsTest.cs b/Facepunch.Steamworks.Test/Client/StatsTest.cs deleted file mode 100644 index 1a40967..0000000 --- a/Facepunch.Steamworks.Test/Client/StatsTest.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class Stats - { - [TestMethod] - public void UpdateStats() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - client.Stats.UpdateStats(); - } - } - - [TestMethod] - public void UpdateSUpdateGlobalStatstats() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - client.Stats.UpdateGlobalStats( 1 ); - client.Stats.UpdateGlobalStats( 3 ); - client.Stats.UpdateGlobalStats( 7 ); - } - } - - [TestMethod] - public void GetClientFloat() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var v = client.Stats.GetFloat( "deaths" ); - Console.WriteLine( v ); - } - } - - [TestMethod] - public void GetClientInt() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var v = client.Stats.GetInt( "deaths" ); - Console.WriteLine( v ); - } - } - - [TestMethod] - public void GetGlobalFloat() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var v = client.Stats.GetGlobalFloat( "deaths" ); - Console.WriteLine( v ); - } - } - - [TestMethod] - public void GetGlobalInt() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var v = client.Stats.GetGlobalInt( "deaths" ); - Console.WriteLine( v ); - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/VoiceTest.cs b/Facepunch.Steamworks.Test/Client/VoiceTest.cs deleted file mode 100644 index 9deb023..0000000 --- a/Facepunch.Steamworks.Test/Client/VoiceTest.cs +++ /dev/null @@ -1,124 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Facepunch.Steamworks.Test -{ - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - [TestClass] - public class Voice - { - static readonly MemoryStream decompressStream = new MemoryStream(); - - [TestMethod] - public void GetVoice() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - int unCompressed = 0; - int compressed = 0; - - client.Voice.OnCompressedData = ( buffer, length ) => - { - compressed += length; - - if ( !client.Voice.Decompress( buffer, length, decompressStream ) ) - { - Assert.Fail( "Decompress returned false" ); - } - }; - - client.Voice.OnUncompressedData = ( buffer, length ) => - { - unCompressed += length; - }; - - client.Voice.WantsRecording = true; - - var sw = Stopwatch.StartNew(); - - while ( sw.Elapsed.TotalSeconds < 3 ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.AreNotEqual( unCompressed, 0 ); - Assert.AreNotEqual( compressed, 0 ); - - // Should really be > 0 if the mic was getting audio - Console.WriteLine( "unCompressed: {0}", unCompressed ); - Console.WriteLine( "compressed: {0}", compressed ); - } - } - - [TestMethod] - public void CompressedOnly() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - int compressed = 0; - - client.Voice.OnCompressedData = ( buffer, length ) => - { - compressed += length; - }; - - client.Voice.WantsRecording = true; - - var sw = Stopwatch.StartNew(); - - while ( sw.Elapsed.TotalSeconds < 3 ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.AreNotEqual( compressed, 0 ); - Console.WriteLine( "compressed: {0}", compressed ); - } - } - - [TestMethod] - public void UnCompressedOnly() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - int unCompressed = 0; - - client.Voice.OnUncompressedData = ( buffer, length ) => - { - unCompressed += length; - }; - - client.Voice.WantsRecording = true; - - var sw = Stopwatch.StartNew(); - - while ( sw.Elapsed.TotalSeconds < 3 ) - { - client.Update(); - System.Threading.Thread.Sleep( 10 ); - } - - Assert.AreNotEqual( unCompressed, 0 ); - - // Should really be > 0 if the mic was getting audio - Console.WriteLine( "unCompressed: {0}", unCompressed ); - - } - } - - [TestMethod] - public void OptimalSampleRate() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - var rate = client.Voice.OptimalSampleRate; - Assert.AreNotEqual( rate, 0 ); - } - } - } -} diff --git a/Facepunch.Steamworks.Test/Client/WorkshopTest.cs b/Facepunch.Steamworks.Test/Client/WorkshopTest.cs deleted file mode 100644 index 39b6b93..0000000 --- a/Facepunch.Steamworks.Test/Client/WorkshopTest.cs +++ /dev/null @@ -1,535 +0,0 @@ -using System; -using System.Text; -using System.Threading; -using Microsoft.VisualStudio.TestTools.UnitTesting; -using System.Linq; -using System.Diagnostics; - -namespace Facepunch.Steamworks.Test -{ - [TestClass] - [DeploymentItem( "steam_api.dll" )] - [DeploymentItem( "steam_api64.dll" )] - public class WorkshopTest - { - [TestMethod] - public void Query() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var Query = client.Workshop.CreateQuery(); - Query.Order = Workshop.Order.RankedByTrend; - - Query.Run(); - - // Block, wait for result - // (don't do this in realtime) - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - // results - - Console.WriteLine( "Searching" ); - - Query.Order = Workshop.Order.RankedByTextSearch; - Query.QueryType = Workshop.QueryType.MicrotransactionItems; - Query.SearchText = "black"; - Query.RequireTags.Add( "LongTShirt Skin" ); - Query.Run(); - - // Block, wait for result - // (don't do this in realtime) - Query.Block(); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "\t WebsiteViews: {0}", item.WebsiteViews ); - Console.WriteLine( "\t VotesUp: {0}", item.VotesUp ); - Console.WriteLine( "\t PreviewUrl: {0}", item.PreviewImageUrl ); - - Assert.IsTrue( item.PreviewImageUrl.Contains( "http" ) ); - } - } - } - - [TestMethod] - public void QueryMyFiles() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var Query = client.Workshop.CreateQuery(); - - Query.UserId = client.SteamId; - Query.UserQueryType = Workshop.UserQueryType.Published; - - Query.Run(); - - // Block, wait for result - // (don't do this in realtime) - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "\t WebsiteViews: {0}", item.WebsiteViews ); - Console.WriteLine( "\t VotesUp: {0}", item.VotesUp ); - Console.WriteLine( "\t PreviewUrl: {0}", item.PreviewImageUrl ); - Console.WriteLine( "\t Directory: {0}", item.Directory ); - - Assert.IsTrue( item.PreviewImageUrl.Contains( "http" ) ); - } - } - } - - [TestMethod] - public void QueryTagRequire() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.RequireTags.Add( "LongTShirt Skin" ); - Query.Run(); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "\t{0}", string.Join( ";", item.Tags ) ); - - Assert.IsTrue( item.Tags.Contains( "longtshirt skin" ) ); - } - } - } - } - - [TestMethod] - public void QueryTagRequireMultiple() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.RequireTags.Add( "LongTShirt Skin" ); - Query.RequireTags.Add( "version2" ); - Query.RequireAllTags = true; - Query.Run(); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "\t{0}", string.Join( ";", item.Tags ) ); - - Assert.IsTrue( item.Tags.Contains( "longtshirt skin" ) ); - Assert.IsTrue( item.Tags.Contains( "version2" ) ); - } - } - } - } - - [TestMethod] - public void QueryTagExclude() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.RequireTags.Add( "LongTShirt Skin" ); - Query.ExcludeTags.Add( "version2" ); - Query.Run(); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Console.WriteLine( "\t{0}", string.Join( ";", item.Tags ) ); - - Assert.IsTrue( item.Tags.Contains( "longtshirt skin" ) ); - Assert.IsFalse( item.Tags.Contains( "version2" ) ); - } - } - } - } - - [TestMethod] - public void QueryFile() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.FileId.Add( 751993251 ); - Query.Run(); - - Assert.IsTrue( Query.IsRunning ); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.AreEqual( Query.TotalResults, 1 ); - Assert.AreEqual( Query.Items.Length, 1 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.AreEqual( Query.Items[0].Id, 751993251 ); - } - } - } - - [TestMethod] - public void QueryCallback() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - var gotCallback = false; - - Query.OnResult = ( q ) => - { - Assert.AreEqual( q.Items.Length, 1 ); - Console.WriteLine( "Query.TotalResults: {0}", q.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", q.Items.Length ); - - gotCallback = true; - }; - - Query.FileId.Add( 751993251 ); - Query.Run(); - - Assert.IsTrue( Query.IsRunning ); - - client.UpdateWhile( () => gotCallback == false ); - - Assert.IsFalse( Query.IsRunning ); - Assert.AreEqual( Query.TotalResults, 1 ); - - Assert.AreEqual( Query.Items[0].Id, 751993251 ); - } - } - } - - [TestMethod] - public void QueryFiles() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.FileId.Add( 751993251 ); - Query.FileId.Add( 747266909 ); - Query.Run(); - - Assert.IsTrue( Query.IsRunning ); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.AreEqual( Query.TotalResults, 2 ); - Assert.AreEqual( Query.Items.Length, 2 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - Assert.IsTrue( Query.Items.Any( x => x.Id == 751993251 ) ); - Assert.IsTrue( Query.Items.Any( x => x.Id == 747266909 ) ); - } - } - } - - [TestMethod] - public void Query_255() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.PerPage = 255; - Query.Run(); - - Assert.IsTrue( Query.IsRunning ); - - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.AreEqual( Query.Items.Length, 255 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - } - } - } - - [TestMethod] - public void Query_28() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.PerPage = 28; - Query.Run(); - Query.Block(); - - var firstPage = Query.Items; - Assert.AreEqual( firstPage.Length, 28 ); - - Console.WriteLine( "Page 2" ); - Query.Page++; - Query.Run(); - Query.Block(); - - - var secondPage = Query.Items; - Assert.AreEqual( secondPage.Length, 28 ); - - Console.WriteLine( "Page 3" ); - Query.Page++; - Query.Run(); - Query.Block(); - - var thirdPage = Query.Items; - Assert.AreEqual( thirdPage.Length, 28 ); - - foreach ( var i in firstPage ) - { - Assert.IsFalse( secondPage.Any( x => x.Id == i.Id ) ); - Assert.IsFalse( thirdPage.Any( x => x.Id == i.Id ) ); - } - - foreach ( var i in secondPage ) - { - Assert.IsFalse( firstPage.Any( x => x.Id == i.Id ) ); - Assert.IsFalse( thirdPage.Any( x => x.Id == i.Id ) ); - } - - foreach ( var i in thirdPage ) - { - Assert.IsFalse( secondPage.Any( x => x.Id == i.Id ) ); - Assert.IsFalse( firstPage.Any( x => x.Id == i.Id ) ); - } - } - } - } - - [TestMethod] - public void DownloadFile() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var item = client.Workshop.GetItem( 844466101 ); - - var time = Stopwatch.StartNew(); - if ( !item.Installed ) - { - item.Download(); - - while ( !item.Installed ) - { - Thread.Sleep( 500 ); - client.Update(); - Console.WriteLine( "Download Progress: {0}", item.DownloadProgress ); - - if (time.Elapsed.Seconds > 30) - throw new Exception("item.Installed Took Too Long"); - } - } - - Assert.IsNotNull( item.Directory ); - Assert.AreNotEqual( 0, item.Size ); - - Console.WriteLine( "item.Installed: {0}", item.Installed ); - Console.WriteLine( "item.Downloading: {0}", item.Downloading ); - Console.WriteLine( "item.DownloadPending: {0}", item.DownloadPending ); - Console.WriteLine( "item.Directory: {0}", item.Directory ); - Console.WriteLine( "item.Size: {0}mb", (item.Size / 1024 / 1024) ); - } - } - - [TestMethod] - [TestCategory( "Run Manually" )] - public void CreatePublish() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var item = client.Workshop.CreateItem( Workshop.ItemType.Microtransaction ); - - item.Title = "Facepunch.Steamworks Unit test"; - item.Tags.Add( "Apple" ); - item.Tags.Add( "Banana" ); - - // Make a folder - var testFolder = new System.IO.DirectoryInfo("BlahBlah"); - if (!testFolder.Exists) testFolder.Create(); - - item.Folder = testFolder.FullName; - - // Upload a file of random bytes - var rand = new Random(); - var testFile = new byte[1024 * 1024 * 32]; - rand.NextBytes(testFile); - System.IO.File.WriteAllBytes( testFolder.FullName + "/testfile1.bin", testFile); - - - Console.WriteLine(item.Folder); - - try - { - item.Publish(); - - while ( item.Publishing ) - { - client.Update(); - Thread.Sleep( 10 ); - - Console.WriteLine("Progress: " + item.Progress); - Console.WriteLine("BytesUploaded: " + item.BytesUploaded); - Console.WriteLine("BytesTotal: " + item.BytesTotal); - } - - Assert.IsFalse( item.Publishing ); - Assert.AreNotEqual( 0, item.Id ); - Assert.IsNull( item.Error, item.Error ); - - Console.WriteLine( "item.Id: {0}", item.Id ); - - using ( var Query = client.Workshop.CreateQuery() ) - { - Query.FileId.Add( item.Id ); - Query.Run(); - - Query.Block(); - - var itemInfo = Query.Items[0]; - - Assert.AreEqual( itemInfo.Id, item.Id ); - Assert.AreEqual( itemInfo.OwnerId, client.SteamId ); - Assert.AreEqual( itemInfo.Title, item.Title ); - Assert.IsTrue( itemInfo.Tags.Contains( "apple" ), "Missing Tag" ); - Assert.IsTrue( itemInfo.Tags.Contains( "banana" ), "Missing Tag" ); - } - } - finally - { - Console.WriteLine( "Deleting: {0}", item.Id ); - item.Delete(); - - System.IO.File.Delete(testFolder.FullName + "/testfile.bin"); - } - } - } - - [TestMethod] - public void UserQuery() - { - using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) - { - Assert.IsTrue( client.IsValid ); - - var Query = client.Workshop.CreateQuery(); - - Query.UserId = 76561197960279927; - Query.UserQueryType = Workshop.UserQueryType.Published; - - Query.Run(); - - // Block, wait for result - // (don't do this in realtime) - Query.Block(); - - Assert.IsFalse( Query.IsRunning ); - Assert.IsTrue( Query.TotalResults > 0 ); - Assert.IsTrue( Query.Items.Length > 0 ); - - Console.WriteLine( "Query.TotalResults: {0}", Query.TotalResults ); - Console.WriteLine( "Query.Items.Length: {0}", Query.Items.Length ); - - foreach ( var item in Query.Items ) - { - Console.WriteLine( "{0}", item.Title ); - Assert.AreEqual( item.OwnerId, 76561197960279927 ); - } - } - } - - } -} diff --git a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj similarity index 56% rename from Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj rename to Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj index c1a3b16..03f2d4b 100644 --- a/Facepunch.Steamworks.Test/Facepunch.Steamworks.Test.csproj +++ b/Facepunch.Steamworks.Test/Facepunch.Steamworks.TestWin32.csproj @@ -1,14 +1,15 @@  + Debug AnyCPU {3F6183AD-D966-44F2-A6EB-42E61E591B49} Library Properties - Facepunch.Steamworks.Test - Facepunch.Steamworks.Test - v4.5.2 + Facepunch.Steamworks.TestWin32 + Facepunch.Steamworks.TestWin32 + v4.6 512 {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} 10.0 @@ -16,23 +17,30 @@ $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages False UnitTest + + + true full false bin\Debug\ - DEBUG;TRACE + TRACE;DEBUG;TEST_WIN32 prompt 4 + x86 + true pdbonly true bin\Release\ - TRACE + TRACE;TEST_WIN32 prompt 4 + x64 + true true @@ -42,6 +50,7 @@ x64 prompt MinimumRecommendedRules.ruleset + true bin\x64\Release\ @@ -51,96 +60,83 @@ x64 prompt MinimumRecommendedRules.ruleset + true true bin\x86\Debug\ DEBUG;TRACE full - x86 + x64 prompt MinimumRecommendedRules.ruleset + true bin\x86\Release\ TRACE true pdbonly - x86 + x64 prompt MinimumRecommendedRules.ruleset + true + + ..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.0.0-beta4\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + ..\packages\Newtonsoft.Json.9.0.2-beta1\lib\net45\Newtonsoft.Json.dll True - - - - - - - - - - False - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + - - + - - {91962664-eb42-472a-94c8-c4ffeb44cc4b} - Facepunch.Steamworks + + {2d6247f6-8ab2-405f-a00e-3a364b808a55} + Facepunch.Steamworks.Win32 - - - - - False - - - False - - - False - - - False - - - - + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/FriendsTest.cs b/Facepunch.Steamworks.Test/FriendsTest.cs new file mode 100644 index 0000000..f8183f9 --- /dev/null +++ b/Facepunch.Steamworks.Test/FriendsTest.cs @@ -0,0 +1,176 @@ +using System; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System.Linq; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + [DeploymentItem( "steam_api64.dll" )] + [TestClass] + public class FriendsTest + { + [TestMethod] + public void GetFriends() + { + foreach ( var friend in SteamFriends.GetFriends() ) + { + Console.WriteLine( $"{friend.Id.Value}: {friend.Name} (Friend:{friend.IsFriend}) (Blocked:{friend.IsBlocked})" ); + Console.WriteLine( $" {string.Join( ", ", friend.NameHistory )}" ); + + // Assert.IsNotNull( friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium ) ); + } + } + + [TestMethod] + public void GetBlocked() + { + foreach ( var friend in SteamFriends.GetBlocked() ) + { + Console.WriteLine( $"{friend.Id.Value}: {friend.Name} (Friend:{friend.IsFriend}) (Blocked:{friend.IsBlocked})" ); + Console.WriteLine( $" {string.Join( ", ", friend.NameHistory )}" ); + + // Assert.IsNotNull( friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium ) ); + } + } + + [TestMethod] + public async Task GetPlayedWith() + { + foreach ( var friend in SteamFriends.GetPlayedWith() ) + { + await friend.RequestInfoAsync(); + + Console.WriteLine( $"{friend.Id.Value}: {friend.Name} (Friend:{friend.IsFriend}) (Blocked:{friend.IsBlocked})" ); + Console.WriteLine( $" {string.Join( ", ", friend.NameHistory )}" ); + + // Assert.IsNotNull( friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium ) ); + } + } + + [TestMethod] + public async Task LargeAvatar() + { + ulong id = (ulong)(76561197960279927 + (new Random().Next() % 10000)); + + var image = await SteamFriends.GetLargeAvatarAsync( id ); + if ( !image.HasValue ) + return; + + Console.WriteLine( $"image.Width {image.Value.Width}" ); + Console.WriteLine( $"image.Height {image.Value.Height}" ); + + DrawImage( image.Value ); + } + + [TestMethod] + public async Task MediumAvatar() + { + ulong id = (ulong)(76561197960279927 + (new Random().Next() % 10000)); + + Console.WriteLine( $"Steam: http://steamcommunity.com/profiles/{id}" ); + + var image = await SteamFriends.GetMediumAvatarAsync( id ); + if ( !image.HasValue ) + return; + + Console.WriteLine( $"image.Width {image.Value.Width}" ); + Console.WriteLine( $"image.Height {image.Value.Height}" ); + + DrawImage( image.Value ); + } + + [TestMethod] + public async Task SmallAvatar() + { + ulong id = (ulong)(76561197960279927 + (new Random().Next() % 10000)); + + var image = await SteamFriends.GetSmallAvatarAsync( id ); + if ( !image.HasValue ) + return; + + Console.WriteLine( $"image.Width {image.Value.Width}" ); + Console.WriteLine( $"image.Height {image.Value.Height}" ); + + DrawImage( image.Value ); + } + + [TestMethod] + public async Task GetFriendsAvatars() + { + foreach ( var friend in SteamFriends.GetFriends() ) + { + Console.WriteLine( $"{friend.Id.Value}: {friend.Name}" ); + + var image = await friend.GetSmallAvatarAsync(); + if ( image.HasValue ) + { + DrawImage( image.Value ); + } + + // Assert.IsNotNull( friend.GetAvatar( Steamworks.Friends.AvatarSize.Medium ) ); + } + } + + /* + [TestMethod] + public void FriendListWithoutRefresh() + { + using ( var client = new Facepunch.Steamworks.Client( 252490 ) ) + { + Assert.IsTrue( client.IsValid ); + + foreach ( var friend in client.Friends.All ) + { + Console.WriteLine( "{0}: {1} (Friend:{2}) (Blocked:{3})", friend.Id, friend.Name, friend.IsFriend, friend.IsBlocked ); + } + } + } + + + + [TestMethod] + public void CachedAvatar() + { + using (var client = new Facepunch.Steamworks.Client(252490)) + { + Assert.IsTrue(client.IsValid); + + var friend = client.Friends.All.First(); + + var image = client.Friends.GetCachedAvatar( Steamworks.Friends.AvatarSize.Medium, friend.Id ); + + if (image != null) + { + Assert.AreEqual(image.Width, 64); + Assert.AreEqual(image.Height, 64); + Assert.AreEqual(image.Data.Length, image.Width * image.Height * 4); + } + } + } + */ + public static void DrawImage( Image img ) + { + var grad = " -:+#"; + + for ( int y = 0; y < img.Height; y++ ) + { + var str = ""; + + for ( int x = 0; x < img.Width; x++ ) + { + var p = img.GetPixel( x, y ); + + var brightness = 1 - ((float)(p.r + p.g + p.b) / (255.0f * 3.0f)); + var c = (int)((grad.Length) * brightness); + if ( c > 3 ) c = 3; + str += grad[c]; + + } + + Console.WriteLine( str ); + } + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/GameServerTest.cs b/Facepunch.Steamworks.Test/GameServerTest.cs new file mode 100644 index 0000000..6ed4150 --- /dev/null +++ b/Facepunch.Steamworks.Test/GameServerTest.cs @@ -0,0 +1,126 @@ +using System; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [DeploymentItem( "steam_api64.dll" )] + [TestClass] + public partial class GameServerTest + { + [TestMethod] + public void Init() + { + SteamServer.DedicatedServer = true; + SteamServer.DedicatedServer = false; + } + + [TestMethod] + public async Task PublicIp() + { + while ( true ) + { + var ip = SteamServer.PublicIp; + + if ( ip == null ) + { + await Task.Delay( 10 ); + continue; + } + + Assert.IsNotNull( ip ); + Console.WriteLine( ip.ToString() ); + break; + } + } + + [TestMethod] + public async Task BeginAuthSession() + { + var stopwatch = System.Diagnostics.Stopwatch.StartNew(); + bool finished = false; + string failed = null; + AuthResponse response = AuthResponse.AuthTicketInvalidAlreadyUsed; + + // + // Clientside calls this function, gets ticket + // + var clientTicket = SteamUser.GetAuthSessionTicket(); + + // + // The client sends this data to the server along with their steamid + // + var ticketData = clientTicket.Data; + var clientSteamId = SteamClient.SteamId; + + // + // Server listens to auth responses from Gabe + // + SteamServer.OnValidateAuthTicketResponse += ( steamid, ownerid, rsponse ) => + { + finished = true; + response = rsponse; + + if ( steamid == 0 ) + failed = $"steamid is 0! {steamid} != {ownerid} ({rsponse})"; + + if ( ownerid == 0 ) + failed = $"ownerid is 0! {steamid} != {ownerid} ({rsponse})"; + + if ( steamid != ownerid ) + failed = $"Steamid and Ownerid are different! {steamid} != {ownerid} ({rsponse})"; + }; + + // + // Server gets the ticket, starts authing + // + if ( !SteamServer.BeginAuthSession( ticketData, clientSteamId ) ) + { + Assert.Fail( "BeginAuthSession returned false, called bullshit without even having to check with Gabe" ); + } + + // + // Wait for that to go through steam + // + while ( !finished ) + { + if ( stopwatch.Elapsed.TotalSeconds > 5 ) + throw new System.Exception( "Took too long waiting for AuthSessionResponse.OK" ); + + await Task.Delay( 10 ); + } + + Assert.AreEqual( response, AuthResponse.OK ); + + if ( failed != null ) + Assert.Fail( failed ); + + finished = false; + stopwatch = System.Diagnostics.Stopwatch.StartNew(); + + // + // The client is leaving, and now wants to cancel the ticket + // + + Assert.AreNotEqual( 0, clientTicket.Handle ); + clientTicket.Cancel(); + + // + // We should get another callback + // + while ( !finished ) + { + if ( stopwatch.Elapsed.TotalSeconds > 5 ) + throw new System.Exception( "Took too long waiting for AuthSessionResponse.AuthTicketCanceled" ); + + await Task.Delay( 10 ); + } + + if ( failed != null ) + Assert.Fail( failed ); + + //Assert.AreEqual( response, AuthResponse.AuthTicketCanceled ); + + } + } +} diff --git a/Facepunch.Steamworks.Test/InputTest.cs b/Facepunch.Steamworks.Test/InputTest.cs new file mode 100644 index 0000000..0c425db --- /dev/null +++ b/Facepunch.Steamworks.Test/InputTest.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + [DeploymentItem( "controller_config/game_actions_252490.vdf" )] + public class InputTest + { + [TestMethod] + public void ControllerList() + { + foreach ( var controller in SteamInput.Controllers ) + { + Console.Write( $"Controller: {controller}" ); + + var dstate = controller.GetDigitalState( "fire" ); + var astate = controller.GetAnalogState( "Move" ); + } + } + } + +} + \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/InventoryTest.cs b/Facepunch.Steamworks.Test/InventoryTest.cs new file mode 100644 index 0000000..27f04fe --- /dev/null +++ b/Facepunch.Steamworks.Test/InventoryTest.cs @@ -0,0 +1,222 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class InventoryTest + { + [TestMethod] + public async Task LoadItemDefinitionsAsync() + { + var result = await SteamInventory.WaitForDefinitions( 5 ); + Assert.IsTrue( result ); + + result = await SteamInventory.WaitForDefinitions( 5 ); + Assert.IsTrue( result ); + } + + [TestMethod] + public async Task GetDefinitions() + { + await SteamInventory.WaitForDefinitions(); + + Assert.IsNotNull( SteamInventory.Definitions ); + + foreach ( var def in SteamInventory.Definitions ) + { + Console.WriteLine( $"[{def.Id:0000000000}] {def.Name} [{def.Type}]" ); + } + } + + [TestMethod] + public async Task GetDefinitionsWithPrices() + { + var defs = await SteamInventory.GetDefinitionsWithPricesAsync(); + + foreach ( var def in defs ) + { + Console.WriteLine( $"[{def.Id:0000000000}] {def.Name} [{def.LocalPriceFormatted}]" ); + } + } + + [TestMethod] + public async Task GetAllItems() + { + await SteamInventory.WaitForDefinitions(); + + var result = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( result.HasValue ); + Assert.IsTrue( result.Value.ItemCount > 0 ); + + using ( result ) + { + var items = result.Value.GetItems( true ); + + Assert.IsNotNull( items ); + + foreach ( var item in items ) + { + Console.WriteLine( $"{item.Id} / {item.DefId} / {item.Quantity} / {item.Def?.Name} /[{item.IsNoTrade}|{item.IsRemoved}|{item.IsConsumed}] " ); + + foreach ( var prop in item.Properties ) + { + Console.WriteLine( $" {prop.Key} : {prop.Value}" ); + } + } + } + } + + [TestMethod] + public async Task GetItemSpecialProperties() + { + await SteamInventory.WaitForDefinitions(); + + var result = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( result.HasValue ); + Assert.IsTrue( result.Value.ItemCount > 0 ); + + using ( result ) + { + var items = result.Value.GetItems( true ); + + Assert.IsNotNull( items ); + + foreach ( var item in items ) + { + Console.WriteLine( $"{item.Id} / {item.DefId} / {item.Quantity} / {item.Def?.Name} " ); + + Console.WriteLine( $" Acquired: {item.Acquired}" ); + Console.WriteLine( $" Origin: {item.Origin}" ); + } + } + } + + [TestMethod] + public async Task GetAllItemsMultipleTimes() + { + await SteamInventory.WaitForDefinitions(); + + var fresult = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( fresult.HasValue ); + Assert.IsTrue( fresult.Value.ItemCount > 0 ); + + await Task.Delay( 1000 ); + + var result = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( result.HasValue ); + Assert.IsTrue( result.Value.GetItems().Length == fresult.Value.ItemCount ); + + + await Task.Delay( 1000 ); + + result = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( result.HasValue ); + Assert.IsTrue( result.Value.ItemCount == fresult.Value.ItemCount ); + + } + + [TestMethod] + public async Task Items() + { + SteamInventory.GetAllItems(); + await SteamInventory.WaitForDefinitions(); + + while ( SteamInventory.Items == null ) + { + await Task.Delay( 10 ); + } + + Assert.IsNotNull( SteamInventory.Items ); + + foreach ( var item in SteamInventory.Items ) + { + Console.WriteLine( $"{item.Id} / {item.DefId} / {item.Quantity} / {item.Def.Name}" ); + } + } + + [TestMethod] + public async Task GetExchanges() + { + var result = await SteamInventory.WaitForDefinitions( 5 ); + Assert.IsTrue( result ); + + foreach ( var def in SteamInventory.Definitions ) + { + var exchangelist = def.GetRecipes(); + if ( exchangelist == null ) continue; + + foreach ( var exchange in exchangelist ) + { + Assert.AreEqual( exchange.Result, def ); + + Console.WriteLine( $"{def.Name}:" ); + + foreach ( var item in exchange.Ingredients ) + { + Console.WriteLine( $" {item.Count} x {item.Definition.Name}" ); + } + + Console.WriteLine( $"" ); + } + } + } + + [TestMethod] + public async Task Serialize() + { + await SteamInventory.WaitForDefinitions(); + + var result = await SteamInventory.GetAllItemsAsync(); + + Assert.IsTrue( result.HasValue ); + + var data = result.Value.Serialize(); + + Assert.IsNotNull( data ); + + Console.WriteLine( string.Join( "", data.Select( x => x.ToString( "x" ) ) ) ); + } + + [TestMethod] + public async Task Deserialize() + { + await SteamInventory.WaitForDefinitions(); + + byte[] data = null; + int itemCount = 0; + + // Serialize + { + var result = await SteamInventory.GetAllItemsAsync(); + Assert.IsTrue( result.HasValue ); + itemCount = result.Value.ItemCount; + data = result.Value.Serialize(); + Assert.IsNotNull( data ); + result.Value.Dispose(); + } + + await Task.Delay( 2000 ); + + // Deserialize + { + var result = await SteamInventory.DeserializeAsync( data ); + Assert.IsTrue( result.HasValue ); + Assert.AreEqual( itemCount, result.Value.ItemCount ); + result.Value.Dispose(); + } + } + } + +} diff --git a/Facepunch.Steamworks.Test/NetworkingSockets.cs b/Facepunch.Steamworks.Test/NetworkingSockets.cs new file mode 100644 index 0000000..9fca88b --- /dev/null +++ b/Facepunch.Steamworks.Test/NetworkingSockets.cs @@ -0,0 +1,287 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class NetworkingSocketsTest + { + + [TestMethod] + public async Task CreateRelayServer() + { + var si = SteamNetworkingSockets.CreateRelaySocket(); + + Console.WriteLine( $"Created Socket: {si}" ); + + // Give it a second for something to happen + await Task.Delay( 1000 ); + + si.Close(); + } + + [TestMethod] + public async Task CreateNormalServer() + { + var si = SteamNetworkingSockets.CreateNormalSocket( Data.NetAddress.AnyIp( 21893 ) ); + + Console.WriteLine( $"Created Socket: {si}" ); + + // Give it a second for something to happen + await Task.Delay( 1000 ); + + si.Close(); + } + + [TestMethod] + public async Task RelayEndtoEnd() + { + var socket = SteamNetworkingSockets.CreateRelaySocket( 7788 ); + var server = socket.RunAsync(); + + await Task.Delay( 1000 ); + + var connection = SteamNetworkingSockets.ConnectRelay( SteamClient.SteamId, 7788 ); + var client = connection.RunAsync(); + + await Task.WhenAll( server, client ); + } + + [TestMethod] + public async Task NormalEndtoEnd() + { + var socket = SteamNetworkingSockets.CreateNormalSocket( NetAddress.AnyIp( 12445 ) ); + var server = socket.RunAsync(); + + await Task.Delay( 1000 ); + + var connection = SteamNetworkingSockets.ConnectNormal( NetAddress.From( System.Net.IPAddress.Parse( "127.0.0.1" ), 12445 ) ); + var client = connection.RunAsync(); + + await Task.WhenAll( server, client ); + } + + private class TestConnectionInterface : ConnectionInterface + { + public override void OnConnectionChanged( ConnectionInfo data ) + { + Console.WriteLine( $"[Connection][{Connection}] [{data.State}]" ); + + base.OnConnectionChanged( data ); + } + + public override void OnConnecting( ConnectionInfo data ) + { + Console.WriteLine( $" - OnConnecting" ); + base.OnConnecting( data ); + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public override void OnConnected( ConnectionInfo data ) + { + Console.WriteLine( $" - OnConnected" ); + base.OnConnected( data ); + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public override void OnDisconnected( ConnectionInfo data ) + { + Console.WriteLine( $" - OnDisconnected" ); + base.OnDisconnected( data ); + } + + internal async Task RunAsync() + { + Console.WriteLine( "[Connection] RunAsync" ); + + var sw = System.Diagnostics.Stopwatch.StartNew(); + + while ( Connecting ) + { + await Task.Delay( 10 ); + + if ( sw.Elapsed.TotalSeconds > 30 ) + break; + } + + if ( !Connected ) + { + Console.WriteLine( "[Connection] Couldn't connect!" ); + Console.WriteLine( Connection.DetailedStatus() ); + return; + } + + Console.WriteLine( "[Connection] Hey We're Connected!" ); + + + sw = System.Diagnostics.Stopwatch.StartNew(); + while ( Connected ) + { + Receive(); + await Task.Delay( 100 ); + + if ( sw.Elapsed.TotalSeconds > 10 ) + { + Assert.Fail( "Client Took Too Long" ); + break; + } + } + } + + public override unsafe void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + // We're only sending strings, so it's fine to read this like this + var str = UTF8Encoding.UTF8.GetString( (byte*) data, size ); + + Console.WriteLine( $"[Connection][{messageNum}][{recvTime}][{channel}] \"{str}\"" ); + + if ( str.Contains( "Hello" ) ) + { + Connection.SendMessage( "Hello, How are you!?" ); + + Connection.SendMessage( "How do you like 20 messages in a row?" ); + + for ( int i=0; i<20; i++ ) + { + Connection.SendMessage( $"BLAMMO!" ); + } + } + + if ( str.Contains( "status" )) + { + Console.WriteLine( Connection.DetailedStatus() ); + } + + if ( str.Contains( "how about yourself" ) ) + { + Connection.SendMessage( "I'm great, but I have to go now, bye." ); + } + + if ( str.Contains( "hater" ) ) + { + Close(); + } + + } + } + + + private class TestSocketInterface : SocketInterface + { + public bool HasFinished = false; + + public override void OnConnectionChanged( Connection connection, ConnectionInfo data ) + { + Console.WriteLine( $"[Socket{Socket}][{connection}] [{data.State}]" ); + + base.OnConnectionChanged( connection, data ); + } + + public override void OnConnecting( Connection connection, ConnectionInfo data ) + { + Console.WriteLine( $" - OnConnecting" ); + base.OnConnecting( connection, data ); + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public override void OnConnected( Connection connection, ConnectionInfo data ) + { + Console.WriteLine( $" - OnConnected" ); + base.OnConnected( connection, data ); + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public override void OnDisconnected( Connection connection, ConnectionInfo data ) + { + Console.WriteLine( $" - OnDisconnected" ); + base.OnDisconnected( connection, data ); + } + + internal async Task RunAsync() + { + var sw = System.Diagnostics.Stopwatch.StartNew(); + + while ( Connected.Count == 0 ) + { + await Task.Delay( 10 ); + + if ( sw.Elapsed.TotalSeconds > 2 ) + { + Assert.Fail( "Client Took Too Long To Connect" ); + break; + } + } + + await Task.Delay( 1000 ); + + var singleClient = Connected.First(); + + singleClient.SendMessage( "Hey?" ); + await Task.Delay( 100 ); + singleClient.SendMessage( "Anyone?" ); + await Task.Delay( 100 ); + singleClient.SendMessage( "What's this?" ); + await Task.Delay( 100 ); + singleClient.SendMessage( "What's your status?" ); + await Task.Delay( 10 ); + singleClient.SendMessage( "Greetings!!??" ); + await Task.Delay( 100 ); + singleClient.SendMessage( "Hello Client!?" ); + + sw = System.Diagnostics.Stopwatch.StartNew(); + + while ( Connected.Contains( singleClient ) ) + { + Receive(); + await Task.Delay( 100 ); + + if ( sw.Elapsed.TotalSeconds > 10 ) + { + Assert.Fail( "Socket Took Too Long" ); + break; + } + } + + await Task.Delay( 1000 ); + + Close(); + } + + public override unsafe void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + // We're only sending strings, so it's fine to read this like this + var str = UTF8Encoding.UTF8.GetString( (byte*)data, size ); + + Console.WriteLine( $"[SOCKET][{connection}[{identity}][{messageNum}][{recvTime}][{channel}] \"{str}\"" ); + + if ( str.Contains( "Hello, How are you" ) ) + { + connection.SendMessage( "I'm great thanks, how about yourself?" ); + } + + if ( str.Contains( "bye" ) ) + { + connection.SendMessage( "See you later, hater." ); + connection.Flush(); + connection.Close( true, 10, "Said Bye" ); + } + } + } + } + +} diff --git a/Facepunch.Steamworks.Test/NetworkingUtils.cs b/Facepunch.Steamworks.Test/NetworkingUtils.cs new file mode 100644 index 0000000..6f8d974 --- /dev/null +++ b/Facepunch.Steamworks.Test/NetworkingUtils.cs @@ -0,0 +1,62 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class NetworkUtilsTest + { + static string GarrysLocation = "lhr=19+1,ams=25+2/25+1,par=29+2,fra=31+3/30+1,lux=33+3,vie=44+4/41+1,waw=47+4/45+1,sto2=48+4/46+2,sto=50+5/46+2,iad=107+10/91+1,sgp=186+18,gru=252+25/234+1"; + + [TestMethod] + public async Task LocalPingLocation() + { + await SteamNetworkingUtils.WaitForPingDataAsync(); + + for ( int i = 0; i < 10; i++ ) + { + var pl = SteamNetworkingUtils.LocalPingLocation; + if ( !pl.HasValue ) + { + await Task.Delay( 1000 ); + continue; + } + + Console.WriteLine( $"{i} Seconds Until Result: {pl}" ); + return; + } + + Assert.Fail(); + } + + [TestMethod] + public void PingLocationParse() + { + var pl = Data.PingLocation.TryParseFromString( GarrysLocation ); + + Assert.IsTrue( pl.HasValue ); + + Console.WriteLine( $"Parsed OKAY! {pl}" ); + } + + [TestMethod] + public async Task GetEstimatedPing() + { + await SteamNetworkingUtils.WaitForPingDataAsync(); + + var garrysping = Data.PingLocation.TryParseFromString( GarrysLocation ); + Assert.IsTrue( garrysping.HasValue ); + + var ping = SteamNetworkingUtils.EstimatePingTo( garrysping.Value ); + Assert.IsTrue( ping > 0 ); + + Console.WriteLine( $"Ping returned: {ping}" ); + } + } + +} diff --git a/Facepunch.Steamworks.Test/RemoteStorageTest.cs b/Facepunch.Steamworks.Test/RemoteStorageTest.cs new file mode 100644 index 0000000..157315d --- /dev/null +++ b/Facepunch.Steamworks.Test/RemoteStorageTest.cs @@ -0,0 +1,78 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class RemoteStorageTest + { + [TestMethod] + public void Quotas() + { + Console.WriteLine( $"SteamRemoteStorage.QuotaBytes: {SteamRemoteStorage.QuotaBytes}" ); + Console.WriteLine( $"SteamRemoteStorage.QuotaRemainingBytes: {SteamRemoteStorage.QuotaRemainingBytes}" ); + Console.WriteLine( $"SteamRemoteStorage.QuotaUsedBytes: {SteamRemoteStorage.QuotaUsedBytes}" ); + } + + [TestMethod] + public void IsCloudEnabled() + { + Console.WriteLine( $"SteamRemoteStorage.IsCloudEnabled: {SteamRemoteStorage.IsCloudEnabled}" ); + Console.WriteLine( $"SteamRemoteStorage.IsCloudEnabledForAccount: {SteamRemoteStorage.IsCloudEnabledForAccount}" ); + Console.WriteLine( $"SteamRemoteStorage.IsCloudEnabledForApp: {SteamRemoteStorage.IsCloudEnabledForApp}" ); + } + + [TestMethod] + public void FileWrite() + { + var rand = new Random(); + var testFile = new byte[1024 * 1024 * 100]; + + for( int i=0; i< testFile.Length; i++ ) + { + testFile[i] = (byte) i; + } + + var written = SteamRemoteStorage.FileWrite( "testfile", testFile ); + + Assert.IsTrue( written ); + Assert.IsTrue( SteamRemoteStorage.FileExists( "testfile" ) ); + Assert.AreEqual( SteamRemoteStorage.FileSize( "testfile" ), testFile.Length ); + } + + [TestMethod] + public void FileRead() + { + FileWrite(); + + var data = SteamRemoteStorage.FileRead( "testfile" ); + + Assert.IsNotNull( data ); + + for ( int i = 0; i < data.Length; i++ ) + { + Assert.AreEqual( data[i], (byte)i ); + } + + Assert.AreEqual( SteamRemoteStorage.FileSize( "testfile" ), data.Length ); + Assert.AreEqual( SteamRemoteStorage.FileSize( "testfile" ), 1024 * 1024 * 100 ); + } + + [TestMethod] + public void Files() + { + foreach ( var file in SteamRemoteStorage.Files ) + { + Console.WriteLine( $"{file} ({SteamRemoteStorage.FileSize(file)} {SteamRemoteStorage.FileTime( file )})" ); + } + + } + } + +} diff --git a/Facepunch.Steamworks.Test/ServerlistTest.cs b/Facepunch.Steamworks.Test/ServerlistTest.cs new file mode 100644 index 0000000..2568564 --- /dev/null +++ b/Facepunch.Steamworks.Test/ServerlistTest.cs @@ -0,0 +1,229 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public partial class ServerListTest + { + [TestMethod] + public void IpAddressConversions() + { + var ipstr = "185.38.150.40"; + var ip = IPAddress.Parse( ipstr ); + + var ip_int = Utility.IpToInt32( ip ); + + var ip_back = Utility.Int32ToIp( ip_int ); + + Console.WriteLine( "ipstr: " + ipstr ); + Console.WriteLine( "ip: " + ip ); + Console.WriteLine( "ip int: " + ip_int ); + Console.WriteLine( "ip_back: " + ip_back ); + } + + + [TestMethod] + public async Task ServerListInternetInterupted() + { + using ( var list = new ServerList.Internet() ) + { + var task = list.RunQueryAsync(); + + await Task.Delay( 1000 ); + + Console.WriteLine( $"Querying.." ); + + list.Cancel(); + + foreach ( var s in list.Responsive ) + { + Console.WriteLine( $"{s.Address} {s.Name}" ); + } + + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + Console.WriteLine( $"task.IsCompleted {task.IsCompleted}" ); + + } + } + + [TestMethod] + public async Task ServerListInternet() + { + using ( var list = new ServerList.Internet() ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + } + } + + [TestMethod] + public async Task SourceQuery() + { + using ( var list = new ServerList.Internet() ) + { + var task = list.RunQueryAsync(); + await Task.Delay( 1000 ); + list.Cancel(); + + foreach ( var s in list.Responsive.Take( 10 ).ToArray() ) + { + Console.WriteLine( $"{s.Name} [{s.Address}]" ); + + var rules = await s.QueryRulesAsync(); + Assert.IsNotNull( rules ); + + foreach ( var rule in rules ) + { + Console.WriteLine( $" {rule.Key} = {rule.Value}" ); + } + } + } + } + + [TestMethod] + public async Task ServerListLan() + { + using ( var list = new ServerList.LocalNetwork() ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + } + } + + [TestMethod] + public async Task ServerListFavourites() + { + using ( var list = new ServerList.Favourites() ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + } + } + + [TestMethod] + public async Task ServerListFriends() + { + using ( var list = new ServerList.Friends() ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + } + } + + [TestMethod] + public async Task ServerListHistory() + { + using ( var list = new ServerList.History() ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + } + } + + [TestMethod] + public async Task FilterByMap() + { + using ( var list = new ServerList.Internet() ) + { + list.AddFilter( "map", "de_dust" ); + + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + + foreach ( var server in list.Responsive ) + { + Assert.AreEqual( server.Map.ToLower(), "de_dust" ); + + Console.WriteLine( $"[{server.Map}] - {server.Name}" ); + } + } + } + + [TestMethod] + public async Task ServerListIps() + { + var ips = new string[] + { + "31.186.251.76", + "31.186.251.76", + "31.186.251.76", + "31.186.251.76", + "31.186.251.76", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "139.99.144.70", + "139.99.144.70", + "139.99.144.70", + "139.99.144.70", + "139.99.144.70", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "74.91.119.142", + "95.172.92.176", + "95.172.92.176", + "95.172.92.176", + "95.172.92.176", + "95.172.92.176", + "164.132.205.154", + "164.132.205.154", + "164.132.205.154", + "164.132.205.154", + "164.132.205.154", + }; + + using ( var list = new ServerList.IpList( ips ) ) + { + var success = await list.RunQueryAsync(); + + Console.WriteLine( $"success {success}" ); + Console.WriteLine( $"Found {list.Responsive.Count} Responsive Servers" ); + Console.WriteLine( $"Found {list.Unresponsive.Count} Unresponsive Servers" ); + + Assert.AreNotEqual( list.Responsive.Count, 0 ); + + foreach ( var server in list.Responsive ) + { + Console.WriteLine( $"[{server.Address}:{server.ConnectionPort}] - {server.Name}" ); + } + } + } + } +} diff --git a/Facepunch.Steamworks.Test/SteamMatchmakingTest.cs b/Facepunch.Steamworks.Test/SteamMatchmakingTest.cs new file mode 100644 index 0000000..abfe446 --- /dev/null +++ b/Facepunch.Steamworks.Test/SteamMatchmakingTest.cs @@ -0,0 +1,105 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class SteamMatchmakingTest + { + [TestMethod] + public async Task LobbyList() + { + await CreateLobby(); + + var list = await SteamMatchmaking.LobbyList + .RequestAsync(); + + if ( list == null ) + { + Console.WriteLine( "No Lobbies Found!" ); + return; + } + + foreach ( var lobby in list ) + { + Console.WriteLine( $"[{lobby.Id}] owned by {lobby.Owner} ({lobby.MemberCount}/{lobby.MaxMembers})" ); + } + } + + [TestMethod] + public async Task LobbyListWithAtLeastOne() + { + await CreateLobby(); + await LobbyList(); + } + + [TestMethod] + public async Task CreateLobby() + { + var lobbyr = await SteamMatchmaking.CreateLobbyAsync( 32 ); + if ( !lobbyr.HasValue ) + { + Assert.Fail(); + } + + var lobby = lobbyr.Value; + lobby.SetPublic(); + lobby.SetData( "gametype", "sausage" ); + lobby.SetData( "dicks", "unlicked" ); + + Console.WriteLine( $"lobby: {lobby.Id}" ); + + foreach ( var entry in lobby.Data ) + { + Console.WriteLine( $" - {entry.Key} {entry.Value}" ); + } + + Console.WriteLine( $"members: {lobby.MemberCount}/{lobby.MaxMembers}" ); + + Console.WriteLine( $"Owner: {lobby.Owner}" ); + Console.WriteLine( $"Owner Is Local Player: {lobby.Owner.IsMe}" ); + + lobby.SendChatString( "Hello I Love Lobbies" ); + } + + [TestMethod] + public async Task LobbyChat() + { + SteamMatchmaking.OnChatMessage += ( lbby, member, message ) => + { + Console.WriteLine( $"[{lbby}] {member}: {message}" ); + }; + + var lobbyr = await SteamMatchmaking.CreateLobbyAsync( 10 ); + if ( !lobbyr.HasValue ) + Assert.Fail(); + + var lobby = lobbyr.Value; + lobby.SetPublic(); + lobby.SetData( "name", "Dave's Chat Room" ); + Console.WriteLine( $"lobby: {lobby.Id}" ); + + lobby.SendChatString( "Hello Friends, It's me - your big fat daddy" ); + + await Task.Delay( 50 ); + + lobby.SendChatString( "What? No love for daddy?" ); + + await Task.Delay( 500 ); + + lobby.SendChatString( "Okay I will LEAVE" ); + lobby.SendChatString( "BYE FOREVER" ); + + await Task.Delay( 1000 ); + + lobby.Leave(); + } + } + +} diff --git a/Facepunch.Steamworks.Test/SteamNetworkingTest.cs b/Facepunch.Steamworks.Test/SteamNetworkingTest.cs new file mode 100644 index 0000000..c07d15e --- /dev/null +++ b/Facepunch.Steamworks.Test/SteamNetworkingTest.cs @@ -0,0 +1,37 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class SteamNetworkingTest + { + [TestMethod] + public async Task SendP2PPacket() + { + var sent = SteamNetworking.SendP2PPacket( SteamClient.SteamId, new byte[] { 1, 2, 3 } ); + + Assert.IsTrue( sent ); + + while ( !SteamNetworking.IsP2PPacketAvailable() ) + { + await Task.Delay( 10 ); + } + + var packet = SteamNetworking.ReadP2PPacket(); + + Assert.IsTrue( packet.HasValue ); + + Assert.AreEqual( packet.Value.SteamId, SteamClient.SteamId ); + Assert.AreEqual( packet.Value.Data[1], 2 ); + Assert.AreEqual( packet.Value.Data.Length, 3 ); + } + } + +} diff --git a/Facepunch.Steamworks.Test/UgcEditor.cs b/Facepunch.Steamworks.Test/UgcEditor.cs new file mode 100644 index 0000000..6edba5d --- /dev/null +++ b/Facepunch.Steamworks.Test/UgcEditor.cs @@ -0,0 +1,182 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UgcEditor + { + [TestMethod] + public async Task CreateFile() + { + var result = await Ugc.Editor.NewCommunityFile + .WithTitle( "Unit Test Created Item" ) + .WithDescription( "This item was created by Facepunch Steamworks unit tests.\n\n" + + "It should have technically been deleted so you should never get to " + + "read this unless something terrible has happened." ) + .WithTag( "Arsehole" ) + .WithTag( "Spiteful" ) + .WithTag( "Fat-Head" ) + .SubmitAsync(); + + Assert.IsTrue( result.Success ); + Assert.AreNotEqual( result.FileId.Value, 0 ); + + var deleted = await SteamUGC.DeleteFileAsync( result.FileId ); + Assert.IsTrue( deleted ); + + } + + [TestMethod] + public async Task CreateChineseFile() + { + string fileName = "这是我的项目"; + string description = "此项目由Facepunch Steamworks单元测试创​​建"; + + var result = await Ugc.Editor.NewCommunityFile + .WithTitle( fileName ) + .WithDescription( description ) + .WithTag( "Arsehole" ) + .WithTag( "Spiteful" ) + .WithTag( "Fat-Head" ) + .SubmitAsync(); + + Console.WriteLine( $"Title: {fileName}" ); + Console.WriteLine( $"Description: {description}" ); + + Assert.IsTrue( result.Success ); + Assert.AreNotEqual( result.FileId.Value, 0 ); + + var file = await Steamworks.SteamUGC.QueryFileAsync( result.FileId ); + + Console.WriteLine( $"FileId: {result.FileId}" ); + Console.WriteLine( $"Title: {file.Value.Title}" ); + Console.WriteLine( $"Description: {file.Value.Description}" ); + + Assert.AreEqual( file.Value.Title, fileName ); + Assert.AreEqual( file.Value.Description, description ); + + var deleted = await SteamUGC.DeleteFileAsync( result.FileId ); + Assert.IsTrue( deleted ); + + } + + class ProgressBar : IProgress + { + float Value = 0; + + public void Report( float value ) + { + if ( Value >= value ) return; + + Value = value; + + Console.WriteLine( value ); + } + } + + [TestMethod] + public async Task UploadBigishFile() + { + var created = Ugc.Editor.NewCommunityFile + .WithTitle( "Unit Test Upload Item" ) + .WithDescription( "This item was created by Facepunch Steamworks unit tests.\n\n" + + "It should have technically been deleted so you should never get to " + + "read this unless something terrible has happened." ) + //.WithTag( "Apple" ) + //.WithTag( "Banana" ) + ; + + + // Make a folder + var testFolder = new System.IO.DirectoryInfo( "WorkshopUpload" ); + if ( !testFolder.Exists ) testFolder.Create(); + + created = created.WithContent( testFolder.FullName ); + + // Upload a file of random bytes + var rand = new Random(); + var testFile = new byte[1024 * 1024 * 32]; + rand.NextBytes( testFile ); + System.IO.File.WriteAllBytes( testFolder.FullName + "/testfile1.bin", testFile ); + + Console.WriteLine( testFolder.FullName ); + + try + { + var done = await created.SubmitAsync( new ProgressBar() ); + + Assert.IsTrue( done.Success ); + Console.WriteLine( "item.Id: {0}", done.FileId ); + + var deleted = await SteamUGC.DeleteFileAsync( done.FileId ); + Assert.IsTrue( deleted ); + } + finally + { + System.IO.File.Delete( testFolder.FullName + "/testfile.bin" ); + } + + } + + + [TestMethod] + public async Task CreateAndThenEditFile() + { + PublishedFileId fileid = default; + + // + // Make a file + // + { + var result = await Ugc.Editor.NewCommunityFile + .WithTitle( "Unedited File" ) + .SubmitAsync(); + + Assert.IsTrue( result.Success ); + Assert.AreNotEqual( result.FileId.Value, 0 ); + + fileid = result.FileId; + } + + await Task.Delay( 1000 ); + + // + // Edit it + // + { + var editor = new Ugc.Editor( fileid ); + editor = editor.WithTitle( "An Edited File" ); + var result = await editor.SubmitAsync(); + + Assert.IsTrue( result.Success ); + Assert.AreEqual( result.FileId, fileid ); + } + + await Task.Delay( 1000 ); + + // + // Make sure the edited file matches + // + { + var details = await SteamUGC.QueryFileAsync( fileid ) ?? throw new Exception( "Somethign went wrong" ); + Assert.AreEqual( details.Id, fileid ); + Assert.AreEqual( details.Title, "An Edited File" ); + } + + // + // Clean up + // + var deleted = await SteamUGC.DeleteFileAsync( fileid ); + Assert.IsTrue( deleted ); + + } + } + +} diff --git a/Facepunch.Steamworks.Test/UgcQuery.cs b/Facepunch.Steamworks.Test/UgcQuery.cs new file mode 100644 index 0000000..041e4f5 --- /dev/null +++ b/Facepunch.Steamworks.Test/UgcQuery.cs @@ -0,0 +1,130 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UgcQueryTests + { + [TestMethod] + public async Task QueryAll() + { + var q = Ugc.Query.All; + + var result = await q.GetPageAsync( 1 ); + Assert.IsNotNull( result ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + } + + [TestMethod] + public async Task QueryWithTags() + { + var q = Ugc.Query.All + .WithTag( "Version3" ) + .WithTag( "Hunting Bow" ) + .MatchAllTags(); + + var result = await q.GetPageAsync( 1 ); + Assert.IsNotNull( result ); + Assert.IsTrue( result?.ResultCount > 0 ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + + foreach ( var entry in result.Value.Entries ) + { + Assert.IsTrue( entry.HasTag( "Version3" ), "Has Tag Version3" ); + Assert.IsTrue( entry.HasTag( "Hunting Bow" ), "Has Tag HuntingBow" ); + + } + } + + [TestMethod] + public async Task QueryAllFromFriends() + { + var q = Ugc.Query.All + .CreatedByFriends(); + + var result = await q.GetPageAsync( 1 ); + Assert.IsNotNull( result ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + + foreach ( var entry in result.Value.Entries ) + { + Console.WriteLine( $" {entry.Title}" ); + } + } + + [TestMethod] + public async Task QueryUserOwn() + { + var q = Ugc.Query.All + .WhereUserPublished(); + + var result = await q.GetPageAsync( 1 ); + Assert.IsNotNull( result ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + + foreach ( var entry in result.Value.Entries ) + { + Console.WriteLine( $" {entry.Title}" ); + } + } + + [TestMethod] + public async Task QueryGarry() + { + var q = Ugc.Query.All + .WhereUserPublished( 76561197960279927 ); + + var result = await q.GetPageAsync( 1 ); + Assert.IsNotNull( result ); + Assert.IsTrue( result?.ResultCount > 0 ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + + foreach ( var entry in result.Value.Entries ) + { + Console.WriteLine( $" {entry.Title}" ); + } + } + + [TestMethod] + public async Task QuerySpecificFile() + { + var item = await SteamUGC.QueryFileAsync( 1734427277 ); + + Assert.IsTrue( item.HasValue ); + Assert.IsNotNull( item.Value.Title ); + + Console.WriteLine( $"Title: {item?.Title}" ); + Console.WriteLine( $"Desc: {item?.Description}" ); + Console.WriteLine( $"Tags: {string.Join( ",", item?.Tags )}" ); + Console.WriteLine( $"Author: {item?.Owner.Name} [{item?.Owner.Id}]" ); + Console.WriteLine( $"PreviewImageUrl: {item?.PreviewImageUrl}" ); + Console.WriteLine( $"NumComments: {item?.NumComments}" ); + Console.WriteLine( $"Url: {item?.Url}" ); + Console.WriteLine( $"Directory: {item?.Directory}" ); + Console.WriteLine( $"IsInstalled: {item?.IsInstalled}" ); + Console.WriteLine( $"IsAcceptedForUse: {item?.IsAcceptedForUse}" ); + Console.WriteLine( $"IsPublic: {item?.IsPublic}" ); + Console.WriteLine( $"Created: {item?.Created}" ); + Console.WriteLine( $"Updated: {item?.Updated}" ); + Console.WriteLine( $"Score: {item?.Score}" ); + } + } + +} diff --git a/Facepunch.Steamworks.Test/UgcTest.cs b/Facepunch.Steamworks.Test/UgcTest.cs new file mode 100644 index 0000000..9c15019 --- /dev/null +++ b/Facepunch.Steamworks.Test/UgcTest.cs @@ -0,0 +1,39 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UgcTest + { + [TestMethod] + public void Download() + { + SteamUGC.Download( 1717844711 ); + } + + [TestMethod] + public async Task GetInformation() + { + var itemInfo = await Ugc.Item.GetAsync( 1720164672 ); + + Assert.IsTrue( itemInfo.HasValue ); + + Console.WriteLine( $"Title: {itemInfo?.Title}" ); + Console.WriteLine( $"IsInstalled: {itemInfo?.IsInstalled}" ); + Console.WriteLine( $"IsDownloading: {itemInfo?.IsDownloading}" ); + Console.WriteLine( $"IsDownloadPending: {itemInfo?.IsDownloadPending}" ); + Console.WriteLine( $"IsSubscribed: {itemInfo?.IsSubscribed}" ); + Console.WriteLine( $"NeedsUpdate: {itemInfo?.NeedsUpdate}" ); + Console.WriteLine( $"Description: {itemInfo?.Description}" ); + Console.WriteLine( $"Owner: {itemInfo?.Owner}" ); + Console.WriteLine( $"Score: {itemInfo?.Score}" ); + } + } +} diff --git a/Facepunch.Steamworks.Test/UserStatsTest.cs b/Facepunch.Steamworks.Test/UserStatsTest.cs new file mode 100644 index 0000000..1f41180 --- /dev/null +++ b/Facepunch.Steamworks.Test/UserStatsTest.cs @@ -0,0 +1,197 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using Steamworks.Data; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UserStatsTest + { + [TestMethod] + public async Task AchievementList() + { + foreach ( var a in SteamUserStats.Achievements ) + { + Console.WriteLine( $"{a.Identifier}" ); + Console.WriteLine( $" a.State: {a.State}" ); + Console.WriteLine( $" a.UnlockTime: {a.UnlockTime}" ); + Console.WriteLine( $" a.Name: {a.Name}" ); + Console.WriteLine( $" a.Description: {a.Description}" ); + Console.WriteLine( $" a.GlobalUnlocked: {a.GlobalUnlocked}" ); + + var icon = await a.GetIconAsync(); + + Console.WriteLine( $" a.Icon: {icon}" ); + } + } + + [TestMethod] + public async Task PlayerCountAsync() + { + var players = await SteamUserStats.PlayerCountAsync(); + Assert.AreNotEqual( players, -1 ); + Console.WriteLine( $"players: {players}" ); + } + + public async Task StoreStats() + { + var result = Result.NotSettled; + + SteamUserStats.OnUserStatsStored += ( r ) => + { + result = r; + }; + + SteamUserStats.StoreStats(); + + while ( result == Result.NotSettled ) + { + await Task.Delay( 10 ); + } + + Assert.AreEqual( result, Result.OK ); + + } + + [TestMethod] + public async Task CreateLeaderboard() + { + var leaderboard = await SteamUserStats.FindOrCreateLeaderboardAsync( "Testleaderboard", Data.LeaderboardSort.Ascending, Data.LeaderboardDisplay.Numeric ); + + Assert.IsTrue( leaderboard.HasValue ); + } + + [TestMethod] + public async Task FindLeaderboard() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + Assert.IsTrue( leaderboard.HasValue ); + } + + [TestMethod] + public async Task SubmitScore() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + Assert.IsTrue( leaderboard.HasValue ); + + var result = await leaderboard.Value.SubmitScoreAsync( 576 ); + Assert.IsTrue( result.HasValue ); + + Console.WriteLine( $"result.Changed: {result?.Changed}" ); + Console.WriteLine( $"result.OldGlobalRank: {result?.OldGlobalRank}" ); + Console.WriteLine( $"result.NewGlobalRank: {result?.NewGlobalRank}" ); + Console.WriteLine( $"result.RankChange: {result?.RankChange}" ); + Console.WriteLine( $"result.Score: {result?.Score}" ); + } + + [TestMethod] + public async Task ReplaceScore() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + Assert.IsTrue( leaderboard.HasValue ); + + var result = await leaderboard.Value.ReplaceScore( 576 ); + Assert.IsTrue( result.HasValue ); + + Console.WriteLine( $"result.Changed: {result?.Changed}" ); + Console.WriteLine( $"result.OldGlobalRank: {result?.OldGlobalRank}" ); + Console.WriteLine( $"result.NewGlobalRank: {result?.NewGlobalRank}" ); + Console.WriteLine( $"result.RankChange: {result?.RankChange}" ); + Console.WriteLine( $"result.Score: {result?.Score}" ); + } + + [TestMethod] + public async Task GetScoresFromFriends() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + + var friendScores = await leaderboard.Value.GetScoresFromFriendsAsync(); + + foreach ( var e in friendScores ) + { + Console.WriteLine( $"{e.GlobalRank}: {e.Score} {e.User}" ); + } + } + + [TestMethod] + public async Task GetScoresAroundUserAsync() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + Assert.IsTrue( leaderboard.HasValue ); + + for ( int i = 1; i < 10; i++ ) + { + // Get entries around user + var relativeScores = await leaderboard.Value.GetScoresAroundUserAsync( -i, i ); + Assert.IsNotNull( relativeScores ); + + Console.WriteLine( $"" ); + Console.WriteLine( $"Relative Scores:" ); + foreach ( var e in relativeScores ) + { + Console.WriteLine( $"{e.GlobalRank}: {e.Score} {e.User}" ); + } + } + } + + [TestMethod] + public async Task GetScoresAsync() + { + var leaderboard = await SteamUserStats.FindLeaderboardAsync( "Testleaderboard" ); + Assert.IsTrue( leaderboard.HasValue ); + + // Get top 20 global scores + var globalsScores = await leaderboard.Value.GetScoresAsync( 20 ); + Assert.IsNotNull( globalsScores ); + + Console.WriteLine( $"" ); + Console.WriteLine( $"Global Scores:" ); + foreach ( var e in globalsScores ) + { + Console.WriteLine( $"{e.GlobalRank}: {e.Score} {e.User}" ); + } + } + + [TestMethod] + public void GetStatInt() + { + var deaths = new Stat( "deaths" ); + Console.WriteLine( $"{deaths.Name} {deaths.GetInt()} times" ); + Console.WriteLine( $"{deaths.Name} {deaths.GetFloat()} times" ); + + Assert.AreNotEqual( 0, deaths.GetInt() ); + } + + [TestMethod] + public async Task GetStatGlobalInt() + { + var deaths = new Stat( "deaths" ); + await deaths.GetGlobalIntDaysAsync( 5 ); + + var totalStartups = deaths.GetGlobalInt(); + Assert.AreNotEqual( 0, totalStartups ); + Console.WriteLine( $"Rust has had {totalStartups} deaths" ); + } + + [TestMethod] + public async Task GetStatGlobalHistoryInt() + { + var deaths = new Stat( "deaths" ); + + var history = await deaths.GetGlobalIntDaysAsync( 10 ); + Assert.AreNotEqual( 0, history.Length ); + + for ( int i=0; i< history.Length; i++ ) + { + Console.WriteLine( $"{i} : {history[i]}" ); + } + } + + } + +} diff --git a/Facepunch.Steamworks.Test/UserTest.cs b/Facepunch.Steamworks.Test/UserTest.cs new file mode 100644 index 0000000..48ef38e --- /dev/null +++ b/Facepunch.Steamworks.Test/UserTest.cs @@ -0,0 +1,155 @@ +using System; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UserTest + { + [TestMethod] + public void GetVoice() + { + using ( var stream = new MemoryStream() ) + { + int compressed = 0; + + SteamUser.VoiceRecord = true; + + var sw = Stopwatch.StartNew(); + + while ( sw.Elapsed.TotalSeconds < 3 ) + { + System.Threading.Thread.Sleep( 10 ); + compressed += SteamUser.ReadVoiceData( stream ); + } + + Assert.AreEqual( compressed, stream.Length ); + Console.WriteLine( $"compressed: {compressed}", compressed ); + Console.WriteLine( $"stream.Length: {stream.Length}", stream.Length ); + } + } + [TestMethod] + public void OptimalSampleRate() + { + var rate = SteamUser.OptimalSampleRate; + Assert.AreNotEqual( rate, 0 ); + Console.WriteLine( $"User.OptimalSampleRate: {SteamUser.OptimalSampleRate}" ); + } + + [TestMethod] + public void IsLoggedOn() + { + Assert.AreNotEqual( false, SteamClient.IsLoggedOn ); + Console.WriteLine( $"User.IsLoggedOn: {SteamClient.IsLoggedOn}" ); + } + + [TestMethod] + public void SteamID() + { + Assert.AreNotEqual( 0, SteamClient.SteamId.Value ); + Console.WriteLine( $"User.SteamID: {SteamClient.SteamId.Value}" ); + } + + [TestMethod] + public void AuthSession() + { + var ticket = SteamUser.GetAuthSessionTicket(); + + Assert.AreNotEqual( 0, ticket.Handle ); + Assert.AreNotEqual( 0, ticket.Data.Length ); + Console.WriteLine( $"ticket.Handle: {ticket.Handle}" ); + Console.WriteLine( $"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }" ); + + var result = SteamUser.BeginAuthSession( ticket.Data, SteamClient.SteamId ); + Console.WriteLine( $"result: { result }" ); + Assert.AreEqual( result, BeginAuthResult.OK ); + + SteamUser.EndAuthSession( SteamClient.SteamId ); + } + + [TestMethod] + public async Task AuthSessionAsync() + { + var ticket = await SteamUser.GetAuthSessionTicketAsync( 5.0 ); + + Assert.AreNotEqual( 0, ticket.Handle ); + Assert.AreNotEqual( 0, ticket.Data.Length ); + Console.WriteLine( $"ticket.Handle: {ticket.Handle}" ); + Console.WriteLine( $"ticket.Data: { string.Join( "", ticket.Data.Select( x => x.ToString( "x" ) ) ) }" ); + } + + [TestMethod] + public void SteamLevel() + { + Assert.AreNotEqual( 0, SteamUser.SteamLevel ); + Console.WriteLine( $"User.SteamLevel: {SteamUser.SteamLevel}" ); + } + + [TestMethod] + public void Name() + { + Console.WriteLine( $"SteamClient.Name: {SteamClient.Name}" ); + } + + [TestMethod] + public async Task GetStoreAuthUrlAsync() + { + var rustskins = await SteamUser.GetStoreAuthUrlAsync( "https://store.steampowered.com/itemstore/252490/" ); + + Assert.IsNotNull( rustskins ); + Console.WriteLine( $"rustskins: {rustskins}" ); + } + + [TestMethod] + public void IsPhoneVerified() + { + Console.WriteLine( $"User.IsPhoneVerified: {SteamUser.IsPhoneVerified}" ); + } + + [TestMethod] + public void IsTwoFactorEnabled() + { + Console.WriteLine( $"User.IsTwoFactorEnabled: {SteamUser.IsTwoFactorEnabled}" ); + } + + [TestMethod] + public void IsPhoneIdentifying() + { + Console.WriteLine( $"User.IsPhoneIdentifying: {SteamUser.IsPhoneIdentifying}" ); + } + + [TestMethod] + public void IsPhoneRequiringVerification() + { + Console.WriteLine( $"User.IsPhoneRequiringVerification: {SteamUser.IsPhoneRequiringVerification}" ); + } + + + [TestMethod] + public async Task RequestEncryptedAppTicketAsyncWithData() + { + var data = await SteamUser.RequestEncryptedAppTicketAsync( new byte[] { 0, 1, 2, 3, 4, 5, 6, 7 } ); + Assert.IsNotNull( data ); + + Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ))}" ); + } + + [TestMethod] + public async Task RequestEncryptedAppTicketAsync() + { + var data = await SteamUser.RequestEncryptedAppTicketAsync(); + Assert.IsNotNull( data ); + + Console.WriteLine( $"data: {string.Join( "", data.Select( x => x.ToString( "x" ) ) )}" ); + } + + } + +} diff --git a/Facepunch.Steamworks.Test/UtilsTest.cs b/Facepunch.Steamworks.Test/UtilsTest.cs new file mode 100644 index 0000000..05b4cf7 --- /dev/null +++ b/Facepunch.Steamworks.Test/UtilsTest.cs @@ -0,0 +1,117 @@ +using System; +using System.Linq; +using System.Text; +using System.Threading; +using System.Threading.Tasks; +using Microsoft.VisualStudio.TestTools.UnitTesting; + +namespace Steamworks +{ + [TestClass] + [DeploymentItem( "steam_api64.dll" )] + public class UtilsTest + { + [TestMethod] + public void SecondsSinceAppActive() + { + var time = SteamUtils.SecondsSinceAppActive; + Console.WriteLine( $"{time}" ); + } + + [TestMethod] + public void SecondsSinceComputerActive() + { + var time = SteamUtils.SecondsSinceComputerActive; + Console.WriteLine( $"{time}" ); + } + + [TestMethod] + public void ConnectedUniverse() + { + var u = SteamUtils.ConnectedUniverse; + Console.WriteLine( $"{u}" ); + } + + [TestMethod] + public void SteamServerTime() + { + var time = SteamUtils.SteamServerTime; + Console.WriteLine( $"{time}" ); + } + + [TestMethod] + public void IpCountry() + { + var cnt = SteamUtils.IpCountry; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void UsingBatteryPower() + { + var cnt = SteamUtils.UsingBatteryPower; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void CurrentBatteryPower() + { + var cnt = SteamUtils.CurrentBatteryPower; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void AppId() + { + var cnt = SteamClient.AppId; + + Assert.IsTrue( cnt.Value > 0 ); + + Console.WriteLine( $"{cnt.Value}" ); + } + + [TestMethod] + public void IsOverlayEnabled() + { + var cnt = SteamUtils.IsOverlayEnabled; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public async Task CheckFileSignature() + { + var sig = await SteamUtils.CheckFileSignatureAsync( "hl2.exe" ); + Console.WriteLine( $"{sig}" ); + } + + [TestMethod] + public void SteamUILanguage() + { + var cnt = SteamUtils.SteamUILanguage; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void IsSteamRunningInVR() + { + var cnt = SteamUtils.IsSteamRunningInVR; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void IsSteamInBigPictureMode() + { + var cnt = SteamUtils.IsSteamInBigPictureMode; + Console.WriteLine( $"{cnt}" ); + } + + [TestMethod] + public void VrHeadsetStreaming() + { + var cnt = SteamUtils.VrHeadsetStreaming; + Console.WriteLine( $"{cnt}" ); + } + + } + +} diff --git a/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf b/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf new file mode 100644 index 0000000..b0672eb --- /dev/null +++ b/Facepunch.Steamworks.Test/bin/Debug/controller_config/game_actions_252490.vdf @@ -0,0 +1,74 @@ +"In Game Actions" +{ + "actions" + { + "InGameControls" + { + "title" "#Set_Ingame" + "StickPadGyro" + { + "Move" + { + "title" "#Action_Move" + "input_mode" "joystick_move" + } + "Camera" + { + "title" "#Action_Camera" + "input_mode" "absolute_mouse" + } + } + "AnalogTrigger" + { + "Throttle" "#Action_Throttle" + } + "Button" + { + "fire" "#Action_Fire" + "Jump" "#Action_Jump" + "pause_menu" "#Action_Menu" + } + } + "MenuControls" + { + "title" "#Set_Menu" + "StickPadGyro" + { + } + "AnalogTrigger" + { + } + "Button" + { + "menu_up" "#Menu_Up" + "menu_down" "#Menu_Down" + "menu_left" "#Menu_Left" + "menu_right" "#Menu_Right" + "menu_select" "#Menu_Select" + "menu_cancel" "#Menu_Cancel" + "pause_menu" "#Action_ReturnToGame" + } + } + } + "localization" + { + "english" + { + "Set_Ingame" "In-Game Controls" + "Set_Menu" "Menu Controls" + "Action_Move" "Movement" + "Action_Camera" "Camera" + "Action_Throttle" "Throttle" + "Action_Fire" "Fire Weapon" + "Action_Jump" "Jump" + "Action_Menu" "Pause Menu" + "Action_ReturnToGame" "Return To Game" + "Menu_Up" "Up" + "Menu_Down" "Down" + "Menu_Left" "Left" + "Menu_Right" "Right" + "Menu_Select" "Select" + "Menu_Cancel" "Cancel" + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/bin/Debug/steam_api.dll b/Facepunch.Steamworks.Test/bin/Debug/steam_api.dll index 97158ab..060b6b9 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steam_api.dll and b/Facepunch.Steamworks.Test/bin/Debug/steam_api.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/steam_api64.dll b/Facepunch.Steamworks.Test/bin/Debug/steam_api64.dll deleted file mode 100644 index 0013288..0000000 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steam_api64.dll and /dev/null differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll b/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll index 9c0d682..b01cd7a 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll and b/Facepunch.Steamworks.Test/bin/Debug/steamclient.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll b/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll index dd028d9..451bb46 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll and b/Facepunch.Steamworks.Test/bin/Debug/steamclient64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll b/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll index 0753754..311c469 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll and b/Facepunch.Steamworks.Test/bin/Debug/tier0_s.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll b/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll index 76ff230..d51e145 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll and b/Facepunch.Steamworks.Test/bin/Debug/tier0_s64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll index 4e62fcb..096945e 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll and b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll index 3be2af0..dfcfaa4 100644 Binary files a/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll and b/Facepunch.Steamworks.Test/bin/Debug/vstdlib_s64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf b/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf new file mode 100644 index 0000000..b0672eb --- /dev/null +++ b/Facepunch.Steamworks.Test/bin/Release/controller_config/game_actions_252490.vdf @@ -0,0 +1,74 @@ +"In Game Actions" +{ + "actions" + { + "InGameControls" + { + "title" "#Set_Ingame" + "StickPadGyro" + { + "Move" + { + "title" "#Action_Move" + "input_mode" "joystick_move" + } + "Camera" + { + "title" "#Action_Camera" + "input_mode" "absolute_mouse" + } + } + "AnalogTrigger" + { + "Throttle" "#Action_Throttle" + } + "Button" + { + "fire" "#Action_Fire" + "Jump" "#Action_Jump" + "pause_menu" "#Action_Menu" + } + } + "MenuControls" + { + "title" "#Set_Menu" + "StickPadGyro" + { + } + "AnalogTrigger" + { + } + "Button" + { + "menu_up" "#Menu_Up" + "menu_down" "#Menu_Down" + "menu_left" "#Menu_Left" + "menu_right" "#Menu_Right" + "menu_select" "#Menu_Select" + "menu_cancel" "#Menu_Cancel" + "pause_menu" "#Action_ReturnToGame" + } + } + } + "localization" + { + "english" + { + "Set_Ingame" "In-Game Controls" + "Set_Menu" "Menu Controls" + "Action_Move" "Movement" + "Action_Camera" "Camera" + "Action_Throttle" "Throttle" + "Action_Fire" "Fire Weapon" + "Action_Jump" "Jump" + "Action_Menu" "Pause Menu" + "Action_ReturnToGame" "Return To Game" + "Menu_Up" "Up" + "Menu_Down" "Down" + "Menu_Left" "Left" + "Menu_Right" "Right" + "Menu_Select" "Select" + "Menu_Cancel" "Cancel" + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks.Test/bin/Release/steam_api.dll b/Facepunch.Steamworks.Test/bin/Release/steam_api.dll index 97158ab..060b6b9 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/steam_api.dll and b/Facepunch.Steamworks.Test/bin/Release/steam_api.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/steam_api64.dll b/Facepunch.Steamworks.Test/bin/Release/steam_api64.dll index 0013288..328dade 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/steam_api64.dll and b/Facepunch.Steamworks.Test/bin/Release/steam_api64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/steamclient.dll b/Facepunch.Steamworks.Test/bin/Release/steamclient.dll index 9c0d682..b01cd7a 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/steamclient.dll and b/Facepunch.Steamworks.Test/bin/Release/steamclient.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll b/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll index dd028d9..451bb46 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll and b/Facepunch.Steamworks.Test/bin/Release/steamclient64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll b/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll index 0753754..311c469 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll and b/Facepunch.Steamworks.Test/bin/Release/tier0_s.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll b/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll index 76ff230..d51e145 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll and b/Facepunch.Steamworks.Test/bin/Release/tier0_s64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll index 4e62fcb..096945e 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll and b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll index 3be2af0..dfcfaa4 100644 Binary files a/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll and b/Facepunch.Steamworks.Test/bin/Release/vstdlib_s64.dll differ diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll new file mode 100644 index 0000000..ba15291 Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTest.TestAdapter.dll differ diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll new file mode 100644 index 0000000..39bd4f3 Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.Interface.dll differ diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll new file mode 100644 index 0000000..a4db1c1 Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.MSTestAdapter.PlatformServices.dll differ diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll new file mode 100644 index 0000000..c426bea Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll differ diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.dll new file mode 100644 index 0000000..d4afc5e Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/Microsoft.VisualStudio.TestPlatform.TestFramework.dll differ diff --git a/Facepunch.Steamworks.Test/bin/Debug/Newtonsoft.Json.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/Newtonsoft.Json.dll similarity index 100% rename from Facepunch.Steamworks.Test/bin/Debug/Newtonsoft.Json.dll rename to Facepunch.Steamworks.Test/bin/x64/Debug/Newtonsoft.Json.dll diff --git a/Facepunch.Steamworks.Test/bin/x64/Debug/steam_api64.dll b/Facepunch.Steamworks.Test/bin/x64/Debug/steam_api64.dll new file mode 100644 index 0000000..328dade Binary files /dev/null and b/Facepunch.Steamworks.Test/bin/x64/Debug/steam_api64.dll differ diff --git a/Facepunch.Steamworks.Test/packages.config b/Facepunch.Steamworks.Test/packages.config index af81a38..dd2a57a 100644 --- a/Facepunch.Steamworks.Test/packages.config +++ b/Facepunch.Steamworks.Test/packages.config @@ -1,4 +1,6 @@  + + \ No newline at end of file diff --git a/Facepunch.Steamworks.sln b/Facepunch.Steamworks.sln index 7974e3c..62426b9 100644 --- a/Facepunch.Steamworks.sln +++ b/Facepunch.Steamworks.sln @@ -1,32 +1,116 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.29009.5 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks", "Facepunch.Steamworks\Facepunch.Steamworks.csproj", "{91962664-EB42-472A-94C8-C4FFEB44CC4B}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facepunch.Steamworks.Test", "Facepunch.Steamworks.Test\Facepunch.Steamworks.Test.csproj", "{3F6183AD-D966-44F2-A6EB-42E61E591B49}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Generator", "Generator\Generator.csproj", "{B7225D11-2AAA-49D6-AE93-A73696EA35FE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Win64", "Facepunch.Steamworks\Facepunch.Steamworks.Win64.csproj", "{8C73DA93-73AD-4445-9A2C-15D4A44337D3}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Posix64", "Facepunch.Steamworks\Facepunch.Steamworks.Posix64.csproj", "{12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Win32", "Facepunch.Steamworks\Facepunch.Steamworks.Win32.csproj", "{2D6247F6-8AB2-405F-A00E-3A364B808A55}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Facepunch.Steamworks.Posix32", "Facepunch.Steamworks\Facepunch.Steamworks.Posix32.csproj", "{C62FF421-BE44-4DB0-B99A-E13E007A30B9}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facepunch.Steamworks.TestWin32", "Facepunch.Steamworks.Test\Facepunch.Steamworks.TestWin32.csproj", "{3F6183AD-D966-44F2-A6EB-42E61E591B49}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facepunch.Steamworks.TestWin64", "Facepunch.Steamworks.Test\Facepunch.Steamworks.TestWin64.csproj", "{165081E3-BD96-404B-B83E-A635F1AF7CDE}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 Release|Any CPU = Release|Any CPU + Release|x64 = Release|x64 + Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {91962664-EB42-472A-94C8-C4FFEB44CC4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91962664-EB42-472A-94C8-C4FFEB44CC4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91962664-EB42-472A-94C8-C4FFEB44CC4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91962664-EB42-472A-94C8-C4FFEB44CC4B}.Release|Any CPU.Build.0 = Release|Any CPU - {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|Any CPU.Build.0 = Release|Any CPU {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|x64.ActiveCfg = Debug|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|x64.Build.0 = Debug|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|x86.ActiveCfg = Debug|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Debug|x86.Build.0 = Debug|Any CPU {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|Any CPU.ActiveCfg = Release|Any CPU {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|Any CPU.Build.0 = Release|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|x64.ActiveCfg = Release|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|x64.Build.0 = Release|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|x86.ActiveCfg = Release|Any CPU + {B7225D11-2AAA-49D6-AE93-A73696EA35FE}.Release|x86.Build.0 = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|x64.ActiveCfg = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|x64.Build.0 = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|x86.ActiveCfg = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Debug|x86.Build.0 = Debug|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|Any CPU.Build.0 = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|x64.ActiveCfg = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|x64.Build.0 = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|x86.ActiveCfg = Release|Any CPU + {8C73DA93-73AD-4445-9A2C-15D4A44337D3}.Release|x86.Build.0 = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|x64.ActiveCfg = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|x64.Build.0 = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|x86.ActiveCfg = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Debug|x86.Build.0 = Debug|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|Any CPU.Build.0 = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|x64.ActiveCfg = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|x64.Build.0 = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|x86.ActiveCfg = Release|Any CPU + {12478BAE-7C1F-4FFD-B903-E1DDA6426DDF}.Release|x86.Build.0 = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|x64.ActiveCfg = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|x64.Build.0 = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|x86.ActiveCfg = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Debug|x86.Build.0 = Debug|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|Any CPU.Build.0 = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|x64.ActiveCfg = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|x64.Build.0 = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|x86.ActiveCfg = Release|Any CPU + {2D6247F6-8AB2-405F-A00E-3A364B808A55}.Release|x86.Build.0 = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|x64.ActiveCfg = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|x64.Build.0 = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|x86.ActiveCfg = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Debug|x86.Build.0 = Debug|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|Any CPU.Build.0 = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|x64.ActiveCfg = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|x64.Build.0 = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|x86.ActiveCfg = Release|Any CPU + {C62FF421-BE44-4DB0-B99A-E13E007A30B9}.Release|x86.Build.0 = Release|Any CPU + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|x64.ActiveCfg = Debug|x64 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|x64.Build.0 = Debug|x64 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|x86.ActiveCfg = Debug|x86 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Debug|x86.Build.0 = Debug|x86 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|Any CPU.Build.0 = Release|Any CPU + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|x64.ActiveCfg = Release|x64 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|x64.Build.0 = Release|x64 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|x86.ActiveCfg = Release|x86 + {3F6183AD-D966-44F2-A6EB-42E61E591B49}.Release|x86.Build.0 = Release|x86 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|x64.ActiveCfg = Debug|x64 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|x64.Build.0 = Debug|x64 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|x86.ActiveCfg = Debug|x86 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Debug|x86.Build.0 = Debug|x86 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|Any CPU.Build.0 = Release|Any CPU + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|x64.ActiveCfg = Release|x64 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|x64.Build.0 = Release|x64 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|x86.ActiveCfg = Release|x86 + {165081E3-BD96-404B-B83E-A635F1AF7CDE}.Release|x86.Build.0 = Release|x86 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Facepunch.Steamworks/BaseSteamworks.cs b/Facepunch.Steamworks/BaseSteamworks.cs deleted file mode 100644 index e32744c..0000000 --- a/Facepunch.Steamworks/BaseSteamworks.cs +++ /dev/null @@ -1,219 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using Facepunch.Steamworks.Interop; - -namespace Facepunch.Steamworks -{ - /// - /// Implements shared functionality between Steamworks.Client and Steamworks.Server - /// - public class BaseSteamworks : IDisposable - { - /// - /// Current running program's AppId - /// - public uint AppId { get; internal set; } - - public Networking Networking { get; internal set; } - public Inventory Inventory { get; internal set; } - public Workshop Workshop { get; internal set; } - - internal event Action OnUpdate; - - internal Interop.NativeInterface native; - - private List CallbackHandles = new List(); - private List CallResults = new List(); - protected bool disposed = false; - - - protected BaseSteamworks( uint appId ) - { - AppId = appId; - - // - // No need for the "steam_appid.txt" file any more - // - System.Environment.SetEnvironmentVariable("SteamAppId", AppId.ToString()); - System.Environment.SetEnvironmentVariable("SteamGameId", AppId.ToString()); - } - - ~BaseSteamworks() - { - Dispose(); - } - - public virtual void Dispose() - { - if ( disposed ) return; - - Callbacks.Clear(); - - foreach ( var h in CallbackHandles ) - { - h.Dispose(); - } - CallbackHandles.Clear(); - - foreach ( var h in CallResults ) - { - h.Dispose(); - } - CallResults.Clear(); - - if ( Workshop != null ) - { - Workshop.Dispose(); - Workshop = null; - } - - if ( Inventory != null ) - { - Inventory.Dispose(); - Inventory = null; - } - - if ( Networking != null ) - { - Networking.Dispose(); - Networking = null; - } - - if ( native != null ) - { - native.Dispose(); - native = null; - } - - System.Environment.SetEnvironmentVariable("SteamAppId", null ); - System.Environment.SetEnvironmentVariable("SteamGameId", null ); - disposed = true; - } - - protected void SetupCommonInterfaces() - { - Networking = new Steamworks.Networking( this, native.networking ); - Inventory = new Steamworks.Inventory( this, native.inventory, IsGameServer ); - Workshop = new Steamworks.Workshop( this, native.ugc, native.remoteStorage ); - } - - /// - /// Returns true if this instance has initialized properly. - /// If this returns false you should Dispose and throw an error. - /// - public bool IsValid - { - get { return native != null; } - } - - - internal virtual bool IsGameServer { get { return false; } } - - internal void RegisterCallbackHandle( SteamNative.CallbackHandle handle ) - { - CallbackHandles.Add( handle ); - } - - internal void RegisterCallResult( SteamNative.CallResult handle ) - { - CallResults.Add( handle ); - } - - internal void UnregisterCallResult( SteamNative.CallResult handle ) - { - CallResults.Remove( handle ); - } - - public virtual void Update() - { - Networking.Update(); - - RunUpdateCallbacks(); - } - - /// - /// This gets called automatically in Update. Only call it manually if you know why you're doing it. - /// - public void RunUpdateCallbacks() - { - if ( OnUpdate != null ) - OnUpdate(); - - for( int i=0; i < CallResults.Count; i++ ) - { - CallResults[i].Try(); - } - - // - // The SourceServerQuery's happen in another thread, so we - // query them to see if they're finished, and if so post a callback - // in our main thread. This will all suck less once we have async. - // - Facepunch.Steamworks.SourceServerQuery.Cycle(); - } - - /// - /// Run Update until func returns false. - /// This will cause your program to lock up until it finishes. - /// This is useful for things like tests or command line utilities etc. - /// - public void UpdateWhile( Func func ) - { - const int sleepMs = 1; - - while ( func() ) - { - Update(); -#if NET_CORE - System.Threading.Tasks.Task.Delay( sleepMs ).Wait(); -#else - System.Threading.Thread.Sleep( sleepMs ); -#endif - } - } - - /// - /// Debug function, called for every callback. Only really used to confirm that callbacks are working properly. - /// - public Action OnAnyCallback; - - Dictionary>> Callbacks = new Dictionary>>(); - - internal List> CallbackList( Type T ) - { - List> list = null; - - if ( !Callbacks.TryGetValue( T, out list ) ) - { - list = new List>(); - Callbacks[T] = list; - } - - return list; - } - - internal void OnCallback( T data ) - { - var list = CallbackList( typeof( T ) ); - - foreach ( var i in list ) - { - i( data ); - } - - if ( OnAnyCallback != null ) - { - OnAnyCallback.Invoke( data ); - } - } - - internal void RegisterCallback( Action func ) - { - var list = CallbackList( typeof( T ) ); - list.Add( ( o ) => func( (T) o ) ); - } - - } -} \ No newline at end of file diff --git a/Facepunch.Steamworks/Callbacks/Callback.cs b/Facepunch.Steamworks/Callbacks/Callback.cs new file mode 100644 index 0000000..a5cc3c9 --- /dev/null +++ b/Facepunch.Steamworks/Callbacks/Callback.cs @@ -0,0 +1,43 @@ +using System; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using Steamworks.Data; + +namespace Steamworks +{ + [StructLayout( LayoutKind.Sequential )] + internal partial class Callback + { + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void Run( IntPtr thisptr, IntPtr pvParam ); + + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate void RunCall( IntPtr thisptr, IntPtr pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); + + [UnmanagedFunctionPointer( CallingConvention.ThisCall )] + public delegate int GetCallbackSizeBytes( IntPtr thisptr ); + + internal enum Flags : byte + { + Registered = 0x01, + GameServer = 0x02 + } + + public IntPtr vTablePtr; + public byte CallbackFlags; + public int CallbackId; + + // + // These are functions that are on CCallback but are never called + // We could just send a IntPtr.Zero but it's probably safer to throw a + // big apeshit message if steam changes its behaviour at some point + // + [MonoPInvokeCallback] + internal static void RunStub( IntPtr self, IntPtr param, bool failure, SteamAPICall_t call ) => + throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the CallResult function [Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall )]" ); + + [MonoPInvokeCallback] + internal static int SizeStub( IntPtr self ) => + throw new System.Exception( "Something changed in the Steam API and now CCallbackBack is calling the GetSize function [GetCallbackSizeBytes()]" ); + }; +} diff --git a/Facepunch.Steamworks/Callbacks/Event.cs b/Facepunch.Steamworks/Callbacks/Event.cs new file mode 100644 index 0000000..181ba50 --- /dev/null +++ b/Facepunch.Steamworks/Callbacks/Event.cs @@ -0,0 +1,135 @@ +using Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Steamworks +{ + // + // Created on registration of a callback + // + internal class Event : IDisposable + { + internal static List AllClient = new List(); + internal static List AllServer = new List(); + + internal static void DisposeAllClient() + { + foreach ( var a in AllClient.ToArray() ) + { + a.Dispose(); + } + + AllClient.Clear(); + } + + internal static void DisposeAllServer() + { + foreach ( var a in AllServer.ToArray() ) + { + a.Dispose(); + } + + AllServer.Clear(); + } + + internal static void Register( Callback.Run func, int size, int callbackId, bool gameserver ) + { + var r = new Event(); + r.vTablePtr = BuildVTable( func, r.Allocations ); + + // + // Create the callback object + // + var cb = new Callback(); + cb.vTablePtr = r.vTablePtr; + cb.CallbackFlags = gameserver ? (byte)0x02 : (byte)0; + cb.CallbackId = callbackId; + + // + // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native + // + r.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); + + // + // Register the callback with Steam + // + SteamClient.RegisterCallback( r.PinnedCallback.AddrOfPinnedObject(), cb.CallbackId ); + + r.IsAllocated = true; + + if ( gameserver ) + Event.AllServer.Add( r ); + else + Event.AllClient.Add( r ); + } + + static IntPtr BuildVTable( Callback.Run run, List allocations ) + { + var RunStub = (Callback.RunCall)Callback.RunStub; + var SizeStub = (Callback.GetCallbackSizeBytes)Callback.SizeStub; + + allocations.Add( GCHandle.Alloc( run ) ); + allocations.Add( GCHandle.Alloc( RunStub ) ); + allocations.Add( GCHandle.Alloc( SizeStub ) ); + + var a = Marshal.GetFunctionPointerForDelegate( run ); + var b = Marshal.GetFunctionPointerForDelegate( RunStub ); + var c = Marshal.GetFunctionPointerForDelegate( SizeStub ); + + var vt = Marshal.AllocHGlobal( IntPtr.Size * 3 ); + + // Windows switches the function positions + #if PLATFORM_WIN + Marshal.WriteIntPtr( vt, IntPtr.Size * 0, b ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 1, a ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); + #else + Marshal.WriteIntPtr( vt, IntPtr.Size * 0, a ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 1, b ); + Marshal.WriteIntPtr( vt, IntPtr.Size * 2, c ); + #endif + + return vt; + } + + bool IsAllocated; + List Allocations = new List(); + internal IntPtr vTablePtr; + internal GCHandle PinnedCallback; + + + public void Dispose() + { + if ( !IsAllocated ) return; + IsAllocated = false; + + if ( !PinnedCallback.IsAllocated ) + throw new System.Exception( "Callback isn't allocated!?" ); + + SteamClient.UnregisterCallback( PinnedCallback.AddrOfPinnedObject() ); + + foreach ( var a in Allocations ) + { + if ( a.IsAllocated ) + a.Free(); + } + + Allocations = null; + + PinnedCallback.Free(); + + if ( vTablePtr != IntPtr.Zero ) + { + Marshal.FreeHGlobal( vTablePtr ); + vTablePtr = IntPtr.Zero; + } + } + + ~Event() + { + Dispose(); + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Callbacks/Index.cs b/Facepunch.Steamworks/Callbacks/Index.cs deleted file mode 100644 index 97d5ef5..0000000 --- a/Facepunch.Steamworks/Callbacks/Index.cs +++ /dev/null @@ -1,118 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks.Callbacks -{ - public delegate void FailureCallback( Result reason ); - - public enum Result : int - { - OK = 1, // success - Fail = 2, // generic failure - NoConnection = 3, // no/failed network connection - // k_EResultNoConnectionRetry = 4, // OBSOLETE - removed - InvalidPassword = 5, // password/ticket is invalid - LoggedInElsewhere = 6, // same user logged in elsewhere - InvalidProtocolVer = 7, // protocol version is incorrect - InvalidParam = 8, // a parameter is incorrect - FileNotFound = 9, // file was not found - Busy = 10, // called method busy - action not taken - InvalidState = 11, // called object was in an invalid state - InvalidName = 12, // name is invalid - InvalidEmail = 13, // email is invalid - DuplicateName = 14, // name is not unique - AccessDenied = 15, // access is denied - Timeout = 16, // operation timed out - Banned = 17, // VAC2 banned - AccountNotFound = 18, // account not found - InvalidSteamID = 19, // steamID is invalid - ServiceUnavailable = 20, // The requested service is currently unavailable - NotLoggedOn = 21, // The user is not logged on - Pending = 22, // Request is pending (may be in process, or waiting on third party) - EncryptionFailure = 23, // Encryption or Decryption failed - InsufficientPrivilege = 24, // Insufficient privilege - LimitExceeded = 25, // Too much of a good thing - Revoked = 26, // Access has been revoked (used for revoked guest passes) - Expired = 27, // License/Guest pass the user is trying to access is expired - AlreadyRedeemed = 28, // Guest pass has already been redeemed by account, cannot be acked again - DuplicateRequest = 29, // The request is a duplicate and the action has already occurred in the past, ignored this time - AlreadyOwned = 30, // All the games in this guest pass redemption request are already owned by the user - IPNotFound = 31, // IP address not found - PersistFailed = 32, // failed to write change to the data store - LockingFailed = 33, // failed to acquire access lock for this operation - LogonSessionReplaced = 34, - ConnectFailed = 35, - HandshakeFailed = 36, - IOFailure = 37, - RemoteDisconnect = 38, - ShoppingCartNotFound = 39, // failed to find the shopping cart requested - Blocked = 40, // a user didn't allow it - Ignored = 41, // target is ignoring sender - NoMatch = 42, // nothing matching the request found - AccountDisabled = 43, - ServiceReadOnly = 44, // this service is not accepting content changes right now - AccountNotFeatured = 45, // account doesn't have value, so this feature isn't available - AdministratorOK = 46, // allowed to take this action, but only because requester is admin - ContentVersion = 47, // A Version mismatch in content transmitted within the Steam protocol. - TryAnotherCM = 48, // The current CM can't service the user making a request, user should try another. - PasswordRequiredToKickSession = 49,// You are already logged in elsewhere, this cached credential login has failed. - AlreadyLoggedInElsewhere = 50, // You are already logged in elsewhere, you must wait - Suspended = 51, // Long running operation (content download) suspended/paused - Cancelled = 52, // Operation canceled (typically by user: content download) - DataCorruption = 53, // Operation canceled because data is ill formed or unrecoverable - DiskFull = 54, // Operation canceled - not enough disk space. - RemoteCallFailed = 55, // an remote call or IPC call failed - PasswordUnset = 56, // Password could not be verified as it's unset server side - ExternalAccountUnlinked = 57, // External account (PSN, Facebook...) is not linked to a Steam account - PSNTicketInvalid = 58, // PSN ticket was invalid - ExternalAccountAlreadyLinked = 59, // External account (PSN, Facebook...) is already linked to some other account, must explicitly request to replace/delete the link first - RemoteFileConflict = 60, // The sync cannot resume due to a conflict between the local and remote files - IllegalPassword = 61, // The requested new password is not legal - SameAsPreviousValue = 62, // new value is the same as the old one ( secret question and answer ) - AccountLogonDenied = 63, // account login denied due to 2nd factor authentication failure - CannotUseOldPassword = 64, // The requested new password is not legal - InvalidLoginAuthCode = 65, // account login denied due to auth code invalid - AccountLogonDeniedNoMail = 66, // account login denied due to 2nd factor auth failure - and no mail has been sent - HardwareNotCapableOfIPT = 67, // - IPTInitError = 68, // - ParentalControlRestricted = 69, // operation failed due to parental control restrictions for current user - FacebookQueryError = 70, // Facebook query returned an error - ExpiredLoginAuthCode = 71, // account login denied due to auth code expired - IPLoginRestrictionFailed = 72, - AccountLockedDown = 73, - AccountLogonDeniedVerifiedEmailRequired = 74, - NoMatchingURL = 75, - BadResponse = 76, // parse failure, missing field, etc. - RequirePasswordReEntry = 77, // The user cannot complete the action until they re-enter their password - ValueOutOfRange = 78, // the value entered is outside the acceptable range - UnexpectedError = 79, // something happened that we didn't expect to ever happen - Disabled = 80, // The requested service has been configured to be unavailable - InvalidCEGSubmission = 81, // The set of files submitted to the CEG server are not valid ! - RestrictedDevice = 82, // The device being used is not allowed to perform this action - RegionLocked = 83, // The action could not be complete because it is region restricted - RateLimitExceeded = 84, // Temporary rate limit exceeded, try again later, different from k_EResultLimitExceeded which may be permanent - AccountLoginDeniedNeedTwoFactor = 85, // Need two-factor code to login - ItemDeleted = 86, // The thing we're trying to access has been deleted - AccountLoginDeniedThrottle = 87, // login attempt failed, try to throttle response to possible attacker - TwoFactorCodeMismatch = 88, // two factor code mismatch - TwoFactorActivationCodeMismatch = 89, // activation code for two-factor didn't match - AccountAssociatedToMultiplePartners = 90, // account has been associated with multiple partners - NotModified = 91, // data not modified - NoMobileDevice = 92, // the account does not have a mobile device associated with it - TimeNotSynced = 93, // the time presented is out of range or tolerance - SmsCodeFailed = 94, // SMS code failure (no match, none pending, etc.) - AccountLimitExceeded = 95, // Too many accounts access this resource - AccountActivityLimitExceeded = 96, // Too many changes to this account - PhoneActivityLimitExceeded = 97, // Too many changes to this phone - RefundToWallet = 98, // Cannot refund to payment method, must use wallet - EmailSendFailure = 99, // Cannot send an email - NotSettled = 100, // Can't perform operation till payment has settled - NeedCaptcha = 101, // Needs to provide a valid captcha - GSLTDenied = 102, // a game server login token owned by this token's owner has been banned - GSOwnerDenied = 103, // game server owner is denied for other reason (account lock, community ban, vac ban, missing phone) - InvalidItemType = 104, // the type of thing we were requested to act on is invalid - IPBanned = 105, // the ip address has been banned from taking this action - }; -} diff --git a/Facepunch.Steamworks/Classes/AuthTicket.cs b/Facepunch.Steamworks/Classes/AuthTicket.cs new file mode 100644 index 0000000..9ca64ea --- /dev/null +++ b/Facepunch.Steamworks/Classes/AuthTicket.cs @@ -0,0 +1,30 @@ +using System; + +namespace Steamworks +{ + public class AuthTicket : IDisposable + { + public byte[] Data; + public uint Handle; + + /// + /// Cancels a ticket. + /// You should cancel your ticket when you close the game or leave a server. + /// + public void Cancel() + { + if ( Handle != 0 ) + { + SteamUser.Internal.CancelAuthTicket( Handle ); + } + + Handle = 0; + Data = null; + } + + public void Dispose() + { + Cancel(); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Classes/ConnectionInterface.cs b/Facepunch.Steamworks/Classes/ConnectionInterface.cs new file mode 100644 index 0000000..2d116aa --- /dev/null +++ b/Facepunch.Steamworks/Classes/ConnectionInterface.cs @@ -0,0 +1,120 @@ +using Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Steamworks +{ + public class ConnectionInterface + { + public Connection Connection; + public bool Connected = false; + public bool Connecting = true; + + public string ConnectionName + { + get => Connection.ConnectionName; + set => Connection.ConnectionName = value; + } + + public long UserData + { + get => Connection.UserData; + set => Connection.UserData = value; + } + + public void Close() => Connection.Close(); + + public override string ToString() => Connection.ToString(); + + public virtual void OnConnectionChanged( ConnectionInfo data ) + { + switch ( data.State ) + { + case ConnectionState.Connecting: + OnConnecting( data ); + break; + case ConnectionState.Connected: + OnConnected( data ); + break; + case ConnectionState.ClosedByPeer: + case ConnectionState.ProblemDetectedLocally: + case ConnectionState.None: + OnDisconnected( data ); + break; + } + } + + /// + /// We're trying to connect! + /// + public virtual void OnConnecting( ConnectionInfo data ) + { + Connecting = true; + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public virtual void OnConnected( ConnectionInfo data ) + { + Connected = true; + Connecting = false; + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public virtual void OnDisconnected( ConnectionInfo data ) + { + Connected = false; + Connecting = false; + } + + public void Receive( int bufferSize = 32 ) + { + int processed = 0; + IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize ); + + try + { + processed = SteamNetworkingSockets.Internal.ReceiveMessagesOnConnection( Connection, messageBuffer, bufferSize ); + + for ( int i = 0; i < processed; i++ ) + { + ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) ); + } + } + finally + { + Marshal.FreeHGlobal( messageBuffer ); + } + + // + // Overwhelmed our buffer, keep going + // + if ( processed == bufferSize ) + Receive( bufferSize ); + } + + internal unsafe void ReceiveMessage( IntPtr msgPtr ) + { + var msg = Marshal.PtrToStructure( msgPtr ); + try + { + OnMessage( msg.DataPtr, msg.DataSize, msg.RecvTime, msg.MessageNumber, msg.Channel ); + } + finally + { + // + // Releases the message + // + msg.Release( msgPtr ); + } + } + + public virtual void OnMessage( IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Classes/SocketInterface.cs b/Facepunch.Steamworks/Classes/SocketInterface.cs new file mode 100644 index 0000000..813d082 --- /dev/null +++ b/Facepunch.Steamworks/Classes/SocketInterface.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using Steamworks.Data; + +namespace Steamworks +{ + public class SocketInterface + { + public List Connecting = new List(); + public List Connected = new List(); + public Socket Socket { get; internal set; } + + public bool Close() => Socket.Close(); + + public override string ToString() => Socket.ToString(); + + public virtual void OnConnectionChanged( Connection connection, ConnectionInfo data ) + { + switch ( data.State ) + { + case ConnectionState.Connecting: + OnConnecting( connection, data ); + break; + case ConnectionState.Connected: + OnConnected( connection, data ); + break; + case ConnectionState.ClosedByPeer: + case ConnectionState.ProblemDetectedLocally: + case ConnectionState.None: + OnDisconnected( connection, data ); + break; + } + } + + /// + /// Default behaviour is to accept every connection + /// + public virtual void OnConnecting( Connection connection, ConnectionInfo data ) + { + connection.Accept(); + Connecting.Add( connection ); + } + + /// + /// Client is connected. They move from connecting to Connections + /// + public virtual void OnConnected( Connection connection, ConnectionInfo data ) + { + Connecting.Remove( connection ); + Connected.Add( connection ); + } + + /// + /// The connection has been closed remotely or disconnected locally. Check data.State for details. + /// + public virtual void OnDisconnected( Connection connection, ConnectionInfo data ) + { + connection.Close(); + + Connecting.Remove( connection ); + Connected.Remove( connection ); + } + + public void Receive( int bufferSize = 32 ) + { + int processed = 0; + IntPtr messageBuffer = Marshal.AllocHGlobal( IntPtr.Size * bufferSize ); + + try + { + processed = SteamNetworkingSockets.Internal.ReceiveMessagesOnListenSocket( Socket, messageBuffer, bufferSize ); + + for ( int i = 0; i < processed; i++ ) + { + ReceiveMessage( Marshal.ReadIntPtr( messageBuffer, i * IntPtr.Size ) ); + } + } + finally + { + Marshal.FreeHGlobal( messageBuffer ); + } + + // + // Overwhelmed our buffer, keep going + // + if ( processed == bufferSize ) + Receive( bufferSize ); + } + + internal unsafe void ReceiveMessage( IntPtr msgPtr ) + { + var msg = Marshal.PtrToStructure( msgPtr ); + try + { + OnMessage( msg.Connection, msg.Identity, msg.DataPtr, msg.DataSize, msg.RecvTime, msg.MessageNumber, msg.Channel ); + } + finally + { + // + // Releases the message + // + msg.Release( msgPtr ); + } + } + + public virtual void OnMessage( Connection connection, NetIdentity identity, IntPtr data, int size, long messageNum, long recvTime, int channel ) + { + + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Client.cs b/Facepunch.Steamworks/Client.cs deleted file mode 100644 index 677dfaa..0000000 --- a/Facepunch.Steamworks/Client.cs +++ /dev/null @@ -1,298 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; - -namespace Facepunch.Steamworks -{ - public partial class Client : BaseSteamworks - { - /// - /// A singleton accessor to get the current client instance. - /// - public static Client Instance { get; private set; } - - /// - /// Current user's Username - /// - public string Username { get; private set; } - - /// - /// Current user's SteamId - /// - public ulong SteamId { get; private set; } - - /// - /// If we're sharing this game, this is the owner of it. - /// - public ulong OwnerSteamId { get; private set; } - - /// - /// Current Beta name, if we're using a beta branch. - /// - public string BetaName { get; private set; } - - /// - /// The BuildId of the current build - /// - public int BuildId { get; private set; } - - /// - /// The folder in which this app is installed - /// - public DirectoryInfo InstallFolder { get; private set; } - - - /// - /// The currently selected language - /// - public string CurrentLanguage { get; } - - - /// - /// List of languages available to the game - /// - public string[] AvailableLanguages { get; } - - public Voice Voice { get; private set; } - public ServerList ServerList { get; private set; } - public LobbyList LobbyList { get; private set; } - public App App { get; private set; } - public Achievements Achievements { get; private set; } - public Stats Stats { get; private set; } - public MicroTransactions MicroTransactions { get; private set; } - public User User { get; private set; } - public RemoteStorage RemoteStorage { get; private set; } - - public Client( uint appId ) : base( appId ) - { - if ( Instance != null ) - { - throw new System.Exception( "Only one Facepunch.Steamworks.Client can exist - dispose the old one before trying to create a new one." ); - } - - Instance = this; - native = new Interop.NativeInterface(); - - // - // Get other interfaces - // - if ( !native.InitClient( this ) ) - { - native.Dispose(); - native = null; - Instance = null; - return; - } - - // - // Register Callbacks - // - - SteamNative.Callbacks.RegisterCallbacks( this ); - - // - // Setup interfaces that client and server both have - // - SetupCommonInterfaces(); - - // - // Client only interfaces - // - Voice = new Voice( this ); - ServerList = new ServerList( this ); - LobbyList = new LobbyList(this); - App = new App( this ); - Stats = new Stats( this ); - Achievements = new Achievements( this ); - MicroTransactions = new MicroTransactions( this ); - User = new User( this ); - RemoteStorage = new RemoteStorage( this ); - - Workshop.friends = Friends; - - Stats.UpdateStats(); - - // - // Cache common, unchanging info - // - AppId = appId; - Username = native.friends.GetPersonaName(); - SteamId = native.user.GetSteamID(); - BetaName = native.apps.GetCurrentBetaName(); - OwnerSteamId = native.apps.GetAppOwner(); - var appInstallDir = native.apps.GetAppInstallDir(AppId); - - if (!String.IsNullOrEmpty(appInstallDir) && Directory.Exists(appInstallDir)) - InstallFolder = new DirectoryInfo(appInstallDir); - - BuildId = native.apps.GetAppBuildId(); - CurrentLanguage = native.apps.GetCurrentGameLanguage(); - AvailableLanguages = native.apps.GetAvailableGameLanguages().Split( new[] {';'}, StringSplitOptions.RemoveEmptyEntries ); // TODO: Assumed colon separated - - // - // Run update, first call does some initialization - // - Update(); - } - - ~Client() - { - Dispose(); - } - - /// - /// Should be called at least once every frame - /// - public override void Update() - { - if ( !IsValid ) - return; - - RunCallbacks(); - Voice.Update(); - Friends.Cycle(); - - base.Update(); - } - - /// - /// This is called in Update() - there's no need to call it manually unless you're running your own Update - /// - public void RunCallbacks() - { - native.api.SteamAPI_RunCallbacks(); - } - - /// - /// Call when finished to shut down the Steam client. - /// - public override void Dispose() - { - if ( disposed ) return; - - if ( Voice != null ) - { - Voice = null; - } - - if ( ServerList != null ) - { - ServerList.Dispose(); - ServerList = null; - } - - if (LobbyList != null) - { - LobbyList.Dispose(); - LobbyList = null; - } - - if ( App != null ) - { - App.Dispose(); - App = null; - } - - if ( Stats != null ) - { - Stats.Dispose(); - Stats = null; - } - - if ( Achievements != null ) - { - Achievements.Dispose(); - Achievements = null; - } - - if ( MicroTransactions != null ) - { - MicroTransactions.Dispose(); - MicroTransactions = null; - } - - if ( User != null ) - { - User.Dispose(); - User = null; - } - - if ( RemoteStorage != null ) - { - RemoteStorage.Dispose(); - RemoteStorage = null; - } - - if ( Instance == this ) - { - Instance = null; - } - - base.Dispose(); - } - - public enum LeaderboardSortMethod - { - None = 0, - Ascending = 1, // top-score is lowest number - Descending = 2, // top-score is highest number - }; - - // the display type (used by the Steam Community web site) for a leaderboard - public enum LeaderboardDisplayType - { - None = 0, - Numeric = 1, // simple numerical score - TimeSeconds = 2, // the score represents a time, in seconds - TimeMilliSeconds = 3, // the score represents a time, in milliseconds - }; - - public Leaderboard GetLeaderboard( string name, LeaderboardSortMethod sortMethod = LeaderboardSortMethod.None, LeaderboardDisplayType displayType = LeaderboardDisplayType.None ) - { - var board = new Leaderboard( this ); - native.userstats.FindOrCreateLeaderboard( name, (SteamNative.LeaderboardSortMethod)sortMethod, (SteamNative.LeaderboardDisplayType)displayType, board.OnBoardCreated ); - return board; - } - - - /// - /// True if we're subscribed/authorised to be running this app - /// - public bool IsSubscribed => native.apps.BIsSubscribed(); - - /// - /// True if we're a cybercafe account - /// - public bool IsCybercafe => native.apps.BIsCybercafe(); - - /// - /// True if we're subscribed/authorised to be running this app, but only temporarily - /// due to a free weekend etc. - /// - public bool IsSubscribedFromFreeWeekend => native.apps.BIsSubscribedFromFreeWeekend(); - - /// - /// True if we're in low violence mode (germans are only allowed to see the insides of bodies in porn) - /// - public bool IsLowViolence => native.apps.BIsLowViolence(); - - /// - /// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't. - /// If this returns true then it starts the Steam client if required and launches your game again through it, - /// and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it may - /// not relaunch the exact executable that called it, as it will always relaunch from the version installed - /// in your Steam library folder. - /// If it returns false, then your game was launched by the Steam client and no action needs to be taken. - /// One exception is if a steam_appid.txt file is present then this will return false regardless. This allows - /// you to develop and test without launching your game through the Steam client. Make sure to remove the - /// steam_appid.txt file when uploading the game to your Steam depot! - /// - public static bool RestartIfNecessary( uint appid ) - { - using ( var api = new SteamNative.SteamApi() ) - { - return api.SteamAPI_RestartAppIfNecessary( appid ); - } - } - } -} diff --git a/Facepunch.Steamworks/Client/Achievements.cs b/Facepunch.Steamworks/Client/Achievements.cs deleted file mode 100644 index 40abfc5..0000000 --- a/Facepunch.Steamworks/Client/Achievements.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class Achievements : IDisposable - { - internal Client client; - - public Achievement[] All { get; private set; } - - public event Action OnUpdated; - public event Action OnAchievementStateChanged; - - private List unlockedRecently = new List(); - - internal Achievements( Client c ) - { - client = c; - - All = new Achievement[0]; - c.RegisterCallback( UserStatsReceived ); - c.RegisterCallback( UserStatsStored ); - - Refresh(); - } - - public void Refresh() - { - var old = All; - - All = Enumerable.Range( 0, (int)client.native.userstats.GetNumAchievements() ) - .Select( x => - { - if ( old != null ) - { - var name = client.native.userstats.GetAchievementName( (uint)x ); - var found = old.FirstOrDefault( y => y.Id == name ); - if ( found != null ) - { - if ( found.Refresh() ) - { - unlockedRecently.Add( found ); - } - return found; - } - } - - return new Achievement( client, x ); - } ) - .ToArray(); - - foreach ( var i in unlockedRecently ) - { - OnUnlocked( i ); - } - - unlockedRecently.Clear(); - } - - internal void OnUnlocked( Achievement a ) - { - OnAchievementStateChanged?.Invoke( a ); - } - - public void Dispose() - { - client = null; - } - - /// - /// Find an achievement by name. Will be null if not found, or not ready. - /// - public Achievement Find( string identifier ) - { - return All.FirstOrDefault( x => x.Id == identifier ); - } - - /// - /// Unlock an achievement by identifier. If apply is true this will happen as expected - /// and the achievement overlay will popup etc. If it's false then you'll have to manually - /// call Stats.StoreStats() to actually trigger it. - /// - public bool Trigger( string identifier, bool apply = true ) - { - var a = Find( identifier ); - if ( a == null ) return false; - - return a.Trigger( apply ); - } - - /// - /// Reset an achievement by identifier - /// - public bool Reset( string identifier ) - { - return client.native.userstats.ClearAchievement( identifier ); - } - - private void UserStatsReceived( UserStatsReceived_t stats ) - { - if ( stats.GameID != client.AppId ) return; - - Refresh(); - - OnUpdated?.Invoke(); - } - - private void UserStatsStored( UserStatsStored_t stats ) - { - if ( stats.GameID != client.AppId ) return; - - Refresh(); - - OnUpdated?.Invoke(); - } - } - - public class Achievement - { - private Client client; - - public string Id { get; private set; } - public string Name { get; private set; } - public string Description { get; private set; } - - /// - /// True if unlocked - /// - public bool State { get; private set; } - - /// - /// Should hold the unlock time if State is true - /// - public DateTime UnlockTime { get; private set; } - - private int iconId { get; set; } = -1; - private int refreshCount = 0; - - /// - /// Returns the percentage of users who have unlocked the specified achievement, or -1 if no data available. - /// - public float GlobalUnlockedPercentage - { - get - { - if ( State ) - return 1; - - float pct = 0; - - if ( !client.native.userstats.GetAchievementAchievedPercent( Id, out pct ) ) - return -1.0f; - - return pct; - } - } - - private Image _icon; - - public Image Icon - { - get - { - if ( iconId <= 0 ) return null; - - if ( _icon == null ) - { - _icon = new Image(); - _icon.Id = iconId; - } - - if ( _icon.IsLoaded ) - return _icon; - - if ( !_icon.TryLoad( client.native.utils ) ) - return null; - - return _icon; - } - } - - public Achievement( Client client, int index ) - { - this.client = client; - - Id = client.native.userstats.GetAchievementName( (uint) index ); - Name = client.native.userstats.GetAchievementDisplayAttribute( Id, "name" ); - Description = client.native.userstats.GetAchievementDisplayAttribute( Id, "desc" ); - - iconId = client.native.userstats.GetAchievementIcon( Id ); - - Refresh(); - } - - /// - /// Make this achievement earned - /// - public bool Trigger( bool apply = true ) - { - if ( State ) - return false; - - State = true; - UnlockTime = DateTime.Now; - - var r = client.native.userstats.SetAchievement( Id ); - - if ( apply ) - { - client.Stats.StoreStats(); - } - - client.Achievements.OnUnlocked( this ); - - return r; - } - - /// - /// Reset this achievement to not achieved - /// - public bool Reset() - { - State = false; - UnlockTime = DateTime.Now; - - return client.native.userstats.ClearAchievement( Id ); - } - - /// - /// Refresh the unlock state. You shouldn't need to call this manually - /// but it's here if you have to for some reason. Retuns true if state changed (meaning, probably unlocked) - /// - public bool Refresh() - { - bool previousState = State; - - bool state = false; - uint unlockTime; - - State = false; - - if ( client.native.userstats.GetAchievementAndUnlockTime( Id, ref state, out unlockTime ) ) - { - State = state; - UnlockTime = Utility.Epoch.ToDateTime( unlockTime ); - } - - refreshCount++; - - if ( previousState != State && refreshCount > 1 ) - { - return true; - } - - return false; - } - } - -} diff --git a/Facepunch.Steamworks/Client/App.cs b/Facepunch.Steamworks/Client/App.cs deleted file mode 100644 index 404887b..0000000 --- a/Facepunch.Steamworks/Client/App.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class App : IDisposable - { - internal Client client; - - internal App( Client c ) - { - client = c; - - client.RegisterCallback( DlcInstalled ); - } - - public delegate void DlcInstalledDelegate( uint appid ); - - /// - /// Triggered after the current user gains ownership of DLC and that DLC is installed. - /// - public event DlcInstalledDelegate OnDlcInstalled; - - private void DlcInstalled( DlcInstalled_t data ) - { - if ( OnDlcInstalled != null ) - { - OnDlcInstalled( data.AppID ); - } - } - - public void Dispose() - { - client = null; - } - - /// - /// Mark the content as corrupt, so it will validate the downloaded files - /// once the app is closed. This is good to call when you detect a crash happening - /// or a file is missing that is meant to be there. - /// - public void MarkContentCorrupt( bool missingFilesOnly = false ) - { - client.native.apps.MarkContentCorrupt( missingFilesOnly ); - } - - /// - /// Tell steam to install the Dlc specified by the AppId - /// - public void InstallDlc( uint appId ) - { - client.native.apps.InstallDLC( appId ); - } - - /// - /// Tell steam to uninstall the Dlc specified by the AppId - /// - public void UninstallDlc(uint appId) - { - client.native.apps.UninstallDLC( appId ); - } - - /// - /// Get the purchase time for this appid. Will return DateTime.MinValue if none. - /// - public DateTime PurchaseTime(uint appId) - { - var time = client.native.apps.GetEarliestPurchaseUnixTime(appId); - if ( time == 0 ) return DateTime.MinValue; - - return Utility.Epoch.ToDateTime( time ); - } - - /// - /// Checks if the active user is subscribed to a specified AppId. - /// Only use this if you need to check ownership of another game related to yours, a demo for example. - /// - public bool IsSubscribed(uint appId) - { - return client.native.apps.BIsSubscribedApp(appId); - } - - /// - /// Returns true if specified app is installed. - /// - public bool IsInstalled(uint appId) - { - return client.native.apps.BIsAppInstalled(appId); - } - - /// - /// Returns true if specified app is installed. - /// - public bool IsDlcInstalled( uint appId ) - { - return client.native.apps.BIsDlcInstalled( appId ); - } - - /// - /// Returns the appid's name - /// Returns error if the current app Id does not have permission to use this interface - /// - public string GetName( uint appId ) - { - var str = client.native.applist.GetAppName( appId ); - if ( str == null ) return "error"; - return str; - } - - /// - /// Returns the app's install folder - /// Returns error if the current app Id does not have permission to use this interface - /// - public string GetInstallFolder( uint appId ) - { - return client.native.applist.GetAppInstallDir( appId ); - } - - /// - /// Returns the app's current build id - /// Returns 0 if the current app Id does not have permission to use this interface - /// - public int GetBuildId( uint appId ) - { - return client.native.applist.GetAppBuildId( appId ); - } - } -} diff --git a/Facepunch.Steamworks/Client/Auth.cs b/Facepunch.Steamworks/Client/Auth.cs deleted file mode 100644 index d33ff40..0000000 --- a/Facepunch.Steamworks/Client/Auth.cs +++ /dev/null @@ -1,82 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - Auth _auth; - - public Auth Auth - { - get - { - if ( _auth == null ) - _auth = new Auth{ client = this }; - - return _auth; - } - } - } - - public class Auth - { - internal Client client; - - public class Ticket : IDisposable - { - internal Client client; - - public byte[] Data; - public uint Handle; - - /// - /// Cancels a ticket. - /// You should cancel your ticket when you close the game or leave a server. - /// - public void Cancel() - { - if ( client.IsValid && Handle != 0 ) - { - client.native.user.CancelAuthTicket( Handle ); - Handle = 0; - Data = null; - } - } - - public void Dispose() - { - Cancel(); - } - } - - /// - /// Creates an auth ticket. - /// Which you can send to a server to authenticate that you are who you say you are. - /// - public unsafe Ticket GetAuthSessionTicket() - { - var data = new byte[1024]; - - fixed ( byte* b = data ) - { - uint ticketLength = 0; - uint ticket = client.native.user.GetAuthSessionTicket( (IntPtr) b, data.Length, out ticketLength ); - - if ( ticket == 0 ) - return null; - - return new Ticket() - { - client = client, - Data = data.Take( (int)ticketLength ).ToArray(), - Handle = ticket - }; - } - } - - - } -} diff --git a/Facepunch.Steamworks/Client/Friends.cs b/Facepunch.Steamworks/Client/Friends.cs deleted file mode 100644 index 0a95d0a..0000000 --- a/Facepunch.Steamworks/Client/Friends.cs +++ /dev/null @@ -1,383 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - Friends _friends; - - public Friends Friends - { - get - { - if ( _friends == null ) - _friends = new Friends( this ); - - return _friends; - } - } - } - - /// - /// Handles most interactions with people in Steam, not just friends as the name would suggest. - /// - /// - /// foreach ( var friend in client.Friends.AllFriends ) - /// { - /// Console.WriteLine( $"{friend.Id}: {friend.Name}" ); - /// } - /// - public class Friends - { - internal Client client; - private byte[] buffer = new byte[1024 * 128]; - - internal Friends( Client c ) - { - client = c; - - client.RegisterCallback( OnAvatarImageLoaded ); - client.RegisterCallback( OnPersonaStateChange ); - client.RegisterCallback( OnGameJoinRequested ); - client.RegisterCallback( OnFriendChatMessage ); - } - - public delegate void ChatMessageDelegate( SteamFriend friend, string type, string message ); - - /// - /// Called when chat message has been received from a friend. You'll need to turn on - /// ListenForFriendsMessages to recieve this. - /// - public event ChatMessageDelegate OnChatMessage; - - private unsafe void OnFriendChatMessage( GameConnectedFriendChatMsg_t data ) - { - if ( OnChatMessage == null ) return; - - var friend = Get( data.SteamIDUser ); - var type = ChatEntryType.ChatMsg; - fixed ( byte* ptr = buffer ) - { - var len = client.native.friends.GetFriendMessage( data.SteamIDUser, data.MessageID, (IntPtr)ptr, buffer.Length, out type ); - - if ( len == 0 && type == ChatEntryType.Invalid ) - return; - - var typeName = type.ToString(); - var message = Encoding.UTF8.GetString( buffer, 0, len ); - - OnChatMessage( friend, typeName, message ); - } - } - - private bool _listenForFriendsMessages; - - /// - /// Listens for Steam friends chat messages. - /// You can then show these chats inline in the game. For example with a Blizzard style chat message system or the chat system in Dota 2. - /// After enabling this you will receive callbacks when ever the user receives a chat message. - /// - public bool ListenForFriendsMessages - { - get - { - return _listenForFriendsMessages; - } - - set - { - _listenForFriendsMessages = value; - client.native.friends.SetListenForFriendsMessages( value ); - } - } - - - public delegate void JoinRequestedDelegate( SteamFriend friend, string connect ); - - // - // Called when a friend has invited you to their game (using InviteToGame) - // - public event JoinRequestedDelegate OnInvitedToGame; - - - private void OnGameJoinRequested( GameRichPresenceJoinRequested_t data ) - { - if ( OnInvitedToGame != null ) - { - OnInvitedToGame( Get( data.SteamIDFriend ), data.Connect ); - } - } - - /// - /// Try to get information about this user - which as name and avatar. - /// If returns true, we already have this user's information. - /// - public bool UpdateInformation( ulong steamid ) - { - return !client.native.friends.RequestUserInformation( steamid, false ); - } - - /// - /// Get this user's name - /// - public string GetName( ulong steamid ) - { - client.native.friends.RequestUserInformation( steamid, true ); - return client.native.friends.GetFriendPersonaName( steamid ); - } - - private List _allFriends; - - /// - /// Returns all friends, even blocked, ignored, friend requests etc - /// - public IEnumerable All - { - get - { - if ( _allFriends == null ) - { - _allFriends = new List(); - Refresh(); - } - - return _allFriends; - } - } - - /// - /// Returns only friends - /// - public IEnumerable AllFriends - { - get - { - foreach ( var friend in All ) - { - if ( !friend.IsFriend ) continue; - - yield return friend; - } - } - } - - /// - /// Returns all blocked users - /// - public IEnumerable AllBlocked - { - get - { - foreach ( var friend in All ) - { - if ( !friend.IsBlocked ) continue; - - yield return friend; - } - } - } - - public void Refresh() - { - if ( _allFriends == null ) - { - _allFriends = new List(); - } - - _allFriends.Clear(); - - var flags = (int) SteamNative.FriendFlags.All; - var count = client.native.friends.GetFriendCount( flags ); - - for ( int i=0; i - /// Should be 32x32 - but make sure to check! - /// - Small, - - /// - /// Should be 64x64 - but make sure to check! - /// - Medium, - - /// - /// Should be 184x184 - but make sure to check! - /// - Large - } - - /// - /// Try to get the avatar immediately. This should work for people on your friends list. - /// - public Image GetCachedAvatar( AvatarSize size, ulong steamid ) - { - var imageid = 0; - - switch (size) - { - case AvatarSize.Small: - imageid = client.native.friends.GetSmallFriendAvatar(steamid); - break; - case AvatarSize.Medium: - imageid = client.native.friends.GetMediumFriendAvatar(steamid); - break; - case AvatarSize.Large: - imageid = client.native.friends.GetLargeFriendAvatar(steamid); - break; - } - - if ( imageid == 1 ) return null; // Placeholder large - if ( imageid == 2 ) return null; // Placeholder medium - if ( imageid == 3 ) return null; // Placeholder small - - var img = new Image() - { - Id = imageid - }; - - if ( !img.TryLoad( client.native.utils ) ) - return null; - - return img; - } - - - /// - /// Callback will be called when the avatar is ready. If we fail to get an - /// avatar, might be called with a null Image. - /// - public void GetAvatar( AvatarSize size, ulong steamid, Action callback ) - { - // Maybe we already have it downloaded? - var image = GetCachedAvatar(size, steamid); - if ( image != null ) - { - callback(image); - return; - } - - // Lets request it from Steam - if (!client.native.friends.RequestUserInformation(steamid, false)) - { - // Steam told us to get fucked - callback(null); - return; - } - - PersonaCallbacks.Add( new PersonaCallback - { - SteamId = steamid, - Size = size, - Callback = callback, - Time = DateTime.Now - }); - } - - private class PersonaCallback - { - public ulong SteamId; - public AvatarSize Size; - public Action Callback; - public DateTime Time; - } - - List PersonaCallbacks = new List(); - - public SteamFriend Get( ulong steamid ) - { - var friend = All.Where( x => x.Id == steamid ).FirstOrDefault(); - if ( friend != null ) return friend; - - var f = new SteamFriend() - { - Id = steamid, - Client = client - }; - - f.Refresh(); - - return f; - } - - internal void Cycle() - { - if ( PersonaCallbacks.Count == 0 ) return; - - var timeOut = DateTime.Now.AddSeconds( -10 ); - - for ( int i = PersonaCallbacks.Count-1; i >= 0; i-- ) - { - var cb = PersonaCallbacks[i]; - - // Timeout - if ( cb.Time < timeOut ) - { - if ( cb.Callback != null ) - { - cb.Callback( null ); - } - - PersonaCallbacks.Remove( cb ); - continue; - } - } - } - - - private void OnPersonaStateChange( PersonaStateChange_t data ) - { - // k_EPersonaChangeAvatar - if ( (data.ChangeFlags & 0x0040) == 0x0040 ) - { - LoadAvatarForSteamId( data.SteamID ); - } - - // - // Find and refresh this friend's status - // - foreach ( var friend in All ) - { - if ( friend.Id != data.SteamID ) continue; - - friend.Refresh(); - } - } - - void LoadAvatarForSteamId( ulong Steamid ) - { - for ( int i = PersonaCallbacks.Count - 1; i >= 0; i-- ) - { - var cb = PersonaCallbacks[i]; - if ( cb.SteamId != Steamid ) continue; - - var image = GetCachedAvatar( cb.Size, cb.SteamId ); - if ( image == null ) continue; - - PersonaCallbacks.Remove( cb ); - - if ( cb.Callback != null ) - { - cb.Callback( image ); - } - } - } - - private void OnAvatarImageLoaded( AvatarImageLoaded_t data ) - { - LoadAvatarForSteamId( data.SteamID ); - } - - } -} diff --git a/Facepunch.Steamworks/Client/Image.cs b/Facepunch.Steamworks/Client/Image.cs deleted file mode 100644 index 03d3ed5..0000000 --- a/Facepunch.Steamworks/Client/Image.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public class Image - { - public int Id { get; internal set; } - public int Width { get; internal set; } - public int Height { get; internal set; } - - public byte[] Data { get; internal set; } - - public bool IsLoaded { get; internal set; } - - /// - /// Return true if this image couldn't be loaded for some reason - /// - public bool IsError { get; internal set; } - - unsafe internal bool TryLoad( SteamNative.SteamUtils utils ) - { - if ( IsLoaded ) return true; - - uint width = 0, height = 0; - - if ( utils.GetImageSize( Id, out width, out height ) == false ) - { - IsError = true; - return false; - } - - var buffer = new byte[ width * height * 4 ]; - - fixed ( byte* ptr = buffer ) - { - if ( utils.GetImageRGBA( Id, (IntPtr) ptr, buffer.Length ) == false ) - { - IsError = true; - return false; - } - } - - Width = (int) width; - Height = (int) height; - Data = buffer; - IsLoaded = true; - IsError = false; - - return true; - } - - public Color GetPixel( int x, int y ) - { - if ( !IsLoaded ) throw new System.Exception( "Image not loaded" ); - if ( x < 0 || x >= Width ) throw new System.Exception( "x out of bounds" ); - if ( y < 0 || y >= Height ) throw new System.Exception( "y out of bounds" ); - - Color c = new Color(); - - var i = ( y * Width + x ) * 4; - - c.r = Data[i + 0]; - c.g = Data[i + 1]; - c.b = Data[i + 2]; - c.a = Data[i + 3]; - - return c; - } - } - - public struct Color - { - public byte r, g, b, a; - } -} - - diff --git a/Facepunch.Steamworks/Client/Leaderboard.cs b/Facepunch.Steamworks/Client/Leaderboard.cs deleted file mode 100644 index dcd9f39..0000000 --- a/Facepunch.Steamworks/Client/Leaderboard.cs +++ /dev/null @@ -1,355 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using Facepunch.Steamworks.Callbacks; -using SteamNative; -using Result = SteamNative.Result; - -namespace Facepunch.Steamworks -{ - public class Leaderboard : IDisposable - { - /// - /// Type of leaderboard request - /// - public enum RequestType - { - /// - /// Query everyone and everything - /// - Global = LeaderboardDataRequest.Global, - - /// - /// Query entries near to this user's rank - /// - GlobalAroundUser = LeaderboardDataRequest.GlobalAroundUser, - - /// - /// Only show friends of this user - /// - Friends = LeaderboardDataRequest.Friends - } - - private static readonly int[] subEntriesBuffer = new int[512]; - - internal ulong BoardId; - internal Client client; - - private readonly Queue _onCreated = new Queue(); - - /// - /// The results from the last query. Can be null. - /// - public Entry[] Results; - - internal Leaderboard( Client c ) - { - client = c; - } - - /// - /// The name of this board, as retrieved from Steam - /// - public string Name { get; private set; } - - /// - /// The total number of entries on this board - /// - public int TotalEntries { get; private set; } - - /// - /// Returns true if this board is valid, ie, we've received - /// a positive response from Steam about it. - /// - public bool IsValid => BoardId != 0; - - /// - /// Returns true if we asked steam about this board but it returned - /// an error. - /// - public bool IsError { get; private set; } - - /// - /// Returns true if we're querying scores - /// - public bool IsQuerying { get; private set; } - - public void Dispose() - { - client = null; - } - - private void DispatchOnCreatedCallbacks() - { - while ( _onCreated.Count > 0 ) - { - _onCreated.Dequeue()(); - } - } - - private bool DeferOnCreated( Action onValid, FailureCallback onFailure = null ) - { - if ( IsValid || IsError ) return false; - - _onCreated.Enqueue( () => - { - if ( IsValid ) onValid(); - else onFailure?.Invoke( Callbacks.Result.Fail ); - } ); - - return true; - } - - /// - /// Called when the leaderboard information is successfully recieved from Steam - /// - public Action OnBoardInformation; - - internal void OnBoardCreated( LeaderboardFindResult_t result, bool error ) - { - Console.WriteLine( $"result.LeaderboardFound: {result.LeaderboardFound}" ); - Console.WriteLine( $"result.SteamLeaderboard: {result.SteamLeaderboard}" ); - - if ( error || ( result.LeaderboardFound == 0 ) ) - { - IsError = true; - } - else - { - BoardId = result.SteamLeaderboard; - - if ( IsValid ) - { - Name = client.native.userstats.GetLeaderboardName( BoardId ); - TotalEntries = client.native.userstats.GetLeaderboardEntryCount( BoardId ); - - OnBoardInformation?.Invoke(); - } - } - - DispatchOnCreatedCallbacks(); - } - - /// - /// Add a score to this leaderboard. - /// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although - /// they have no bearing on sorting at all - /// If onlyIfBeatsOldScore is true, the score will only be updated if it beats the existing score, else it will always - /// be updated. Beating the existing score is subjective - and depends on how your leaderboard was set up as to whether - /// that means higher or lower. - /// - public bool AddScore( bool onlyIfBeatsOldScore, int score, params int[] subscores ) - { - if ( IsError ) return false; - if ( !IsValid ) return DeferOnCreated( () => AddScore( onlyIfBeatsOldScore, score, subscores ) ); - - var flags = LeaderboardUploadScoreMethod.ForceUpdate; - if ( onlyIfBeatsOldScore ) flags = LeaderboardUploadScoreMethod.KeepBest; - - client.native.userstats.UploadLeaderboardScore( BoardId, flags, score, subscores, subscores.Length ); - - return true; - } - - /// - /// Callback invoked by when score submission - /// is complete. - /// - /// If successful, information about the new entry - public delegate void AddScoreCallback( AddScoreResult result ); - - /// - /// Information about a newly submitted score. - /// - public struct AddScoreResult - { - public int Score; - public bool ScoreChanged; - public int GlobalRankNew; - public int GlobalRankPrevious; - } - - /// - /// Add a score to this leaderboard. - /// Subscores are totally optional, and can be used for other game defined data such as laps etc.. although - /// they have no bearing on sorting at all - /// If onlyIfBeatsOldScore is true, the score will only be updated if it beats the existing score, else it will always - /// be updated. - /// Information about the newly submitted score is passed to the optional . - /// - public bool AddScore( bool onlyIfBeatsOldScore, int score, int[] subscores = null, AddScoreCallback onSuccess = null, FailureCallback onFailure = null ) - { - if ( IsError ) return false; - if ( !IsValid ) return DeferOnCreated( () => AddScore( onlyIfBeatsOldScore, score, subscores, onSuccess, onFailure ), onFailure ); - - if ( subscores == null ) subscores = new int[0]; - - var flags = LeaderboardUploadScoreMethod.ForceUpdate; - if ( onlyIfBeatsOldScore ) flags = LeaderboardUploadScoreMethod.KeepBest; - - client.native.userstats.UploadLeaderboardScore( BoardId, flags, score, subscores, subscores.Length, ( result, error ) => - { - if ( !error && result.Success != 0 ) - { - onSuccess?.Invoke( new AddScoreResult - { - Score = result.Score, - ScoreChanged = result.ScoreChanged != 0, - GlobalRankNew = result.GlobalRankNew, - GlobalRankPrevious = result.GlobalRankPrevious - } ); - } - else - { - onFailure?.Invoke( error ? Callbacks.Result.IOFailure : Callbacks.Result.Fail ); - } - } ); - - return true; - } - - /// - /// Callback invoked by when file attachment is complete. - /// - public delegate void AttachRemoteFileCallback(); - - /// - /// Attempt to attach a file to the current user's leaderboard entry. - /// Can be useful for storing replays along with scores. - /// - /// True if the file attachment process has started - public bool AttachRemoteFile( RemoteFile file, AttachRemoteFileCallback onSuccess = null, FailureCallback onFailure = null ) - { - if ( IsError ) return false; - if ( !IsValid ) return DeferOnCreated( () => AttachRemoteFile( file, onSuccess, onFailure ), onFailure ); - - if ( file.IsShared ) - { - var handle = client.native.userstats.AttachLeaderboardUGC( BoardId, file.UGCHandle, ( result, error ) => - { - if ( !error && result.Result == Result.OK ) - { - onSuccess?.Invoke(); - } - else - { - onFailure?.Invoke( result.Result == 0 ? Callbacks.Result.IOFailure : (Callbacks.Result) result.Result ); - } - } ); - - return handle.IsValid; - } - - file.Share( () => - { - if ( !file.IsShared || !AttachRemoteFile( file, onSuccess, onFailure ) ) - { - onFailure?.Invoke( Callbacks.Result.Fail ); - } - }, onFailure ); - return true; - } - - /// - /// Fetch a subset of scores. The scores end up in Results. - /// - /// Returns true if we have started the query - public bool FetchScores( RequestType RequestType, int start, int end ) - { - if ( !IsValid ) return false; - if ( IsQuerying ) return false; - - client.native.userstats.DownloadLeaderboardEntries( BoardId, (LeaderboardDataRequest) RequestType, start, end, OnScores ); - - Results = null; - IsQuerying = true; - return true; - } - - private unsafe void ReadScores( LeaderboardScoresDownloaded_t result, List dest ) - { - for ( var i = 0; i < result.CEntryCount; i++ ) - fixed ( int* ptr = subEntriesBuffer ) - { - var entry = new LeaderboardEntry_t(); - if ( client.native.userstats.GetDownloadedLeaderboardEntry( result.SteamLeaderboardEntries, i, ref entry, (IntPtr) ptr, subEntriesBuffer.Length ) ) - dest.Add( new Entry - { - GlobalRank = entry.GlobalRank, - Score = entry.Score, - SteamId = entry.SteamIDUser, - SubScores = entry.CDetails == 0 ? null : subEntriesBuffer.Take( entry.CDetails ).ToArray(), - Name = client.Friends.GetName( entry.SteamIDUser ), - AttachedFile = (entry.UGC >> 32) == 0xffffffff ? null : new RemoteFile( client.RemoteStorage, entry.UGC ) - } ); - } - } - - [ThreadStatic] private static List _sEntryBuffer; - - /// - /// Callback invoked by when - /// a query is complete. - /// - public delegate void FetchScoresCallback( Entry[] results ); - - /// - /// Fetch a subset of scores. The scores are passed to . - /// - /// Returns true if we have started the query - public bool FetchScores( RequestType RequestType, int start, int end, FetchScoresCallback onSuccess, FailureCallback onFailure = null ) - { - if ( IsError ) return false; - if ( !IsValid ) return DeferOnCreated( () => FetchScores( RequestType, start, end, onSuccess, onFailure ), onFailure ); - - client.native.userstats.DownloadLeaderboardEntries( BoardId, (LeaderboardDataRequest) RequestType, start, end, ( result, error ) => - { - if ( error ) - { - onFailure?.Invoke( Callbacks.Result.IOFailure ); - } - else - { - if ( _sEntryBuffer == null ) _sEntryBuffer = new List(); - else _sEntryBuffer.Clear(); - - ReadScores( result, _sEntryBuffer ); - onSuccess( _sEntryBuffer.ToArray() ); - } - } ); - - return true; - } - - private void OnScores( LeaderboardScoresDownloaded_t result, bool error ) - { - IsQuerying = false; - - if ( client == null ) return; - if ( error ) return; - - var list = new List(); - ReadScores( result, list ); - - Results = list.ToArray(); - } - - /// - /// A single entry in a leaderboard - /// - public struct Entry - { - public ulong SteamId; - public int Score; - public int[] SubScores; - public int GlobalRank; - public RemoteFile AttachedFile; - - /// - /// Note that the player's name might not be immediately available. - /// If that's the case you'll have to use Friends.GetName to find the name - /// - public string Name; - } - } -} diff --git a/Facepunch.Steamworks/Client/Lobby.LobbyData.cs b/Facepunch.Steamworks/Client/Lobby.LobbyData.cs deleted file mode 100644 index 63e4e84..0000000 --- a/Facepunch.Steamworks/Client/Lobby.LobbyData.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System.Collections.Generic; - -namespace Facepunch.Steamworks -{ - public partial class Lobby - { - /// - /// Class to hold global lobby data. This is stuff like maps/modes/etc. Data set here can be filtered by LobbyList. - /// - public class LobbyData - { - internal Client client; - internal ulong lobby; - internal Dictionary data; - - public LobbyData( Client c, ulong l ) - { - client = c; - lobby = l; - data = new Dictionary(); - } - - /// - /// Get the lobby value for the specific key - /// - /// The key to find - /// The value at key - public string GetData( string k ) - { - if ( data.ContainsKey( k ) ) - { - return data[k]; - } - - return "ERROR: key not found"; - } - - /// - /// Get a list of all the data in the Lobby - /// - /// Dictionary of all the key/value pairs in the data - public Dictionary GetAllData() - { - Dictionary returnData = new Dictionary(); - foreach ( KeyValuePair item in data ) - { - returnData.Add( item.Key, item.Value ); - } - return returnData; - } - - /// - /// Set the value for specified Key. Note that the keys "joinable", "appid", "name", and "lobbytype" are reserved for internal library use. - /// - /// The key to set the value for - /// The value of the Key - /// True if data successfully set - public bool SetData( string k, string v ) - { - if ( data.ContainsKey( k ) ) - { - if ( data[k] == v ) { return true; } - if ( client.native.matchmaking.SetLobbyData( lobby, k, v ) ) - { - data[k] = v; - return true; - } - } - else - { - if ( client.native.matchmaking.SetLobbyData( lobby, k, v ) ) - { - data.Add( k, v ); - return true; - } - } - - return false; - } - - /// - /// Remove the key from the LobbyData. Note that the keys "joinable", "appid", "name", and "lobbytype" are reserved for internal library use. - /// - /// The key to remove - /// True if Key successfully removed - public bool RemoveData( string k ) - { - if ( data.ContainsKey( k ) ) - { - if ( client.native.matchmaking.DeleteLobbyData( lobby, k ) ) - { - data.Remove( k ); - return true; - } - } - - return false; - } - - } - - /*not implemented - - //set the game server of the lobby - client.native.matchmaking.GetLobbyGameServer; - client.native.matchmaking.SetLobbyGameServer; - - //used with game server stuff - SteamNative.LobbyGameCreated_t - */ - } -} diff --git a/Facepunch.Steamworks/Client/Lobby.cs b/Facepunch.Steamworks/Client/Lobby.cs deleted file mode 100644 index fb2c163..0000000 --- a/Facepunch.Steamworks/Client/Lobby.cs +++ /dev/null @@ -1,599 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - Lobby _lobby; - - public Lobby Lobby - { - get - { - if ( _lobby == null ) - _lobby = new Steamworks.Lobby( this ); - return _lobby; - } - } - } - public partial class Lobby : IDisposable - { - //The type of lobby you are creating - public enum Type : int - { - Private = SteamNative.LobbyType.Private, - FriendsOnly = SteamNative.LobbyType.FriendsOnly, - Public = SteamNative.LobbyType.Public, - Invisible = SteamNative.LobbyType.Invisible, - Error //happens if you try to get this when you aren't in a valid lobby - } - - internal Client client; - - public Lobby( Client c ) - { - client = c; - - // For backwards compatibility - OnLobbyJoinRequested = Join; - - client.RegisterCallback( OnLobbyDataUpdatedAPI ); - client.RegisterCallback( OnLobbyChatMessageRecievedAPI ); - client.RegisterCallback( OnLobbyStateUpdatedAPI ); - client.RegisterCallback( OnLobbyJoinRequestedAPI ); - client.RegisterCallback( OnUserInvitedToLobbyAPI ); - client.RegisterCallback( OnLobbyMemberPersonaChangeAPI ); - } - - /// - /// The CSteamID of the lobby we're currently in. - /// - public ulong CurrentLobby { get; private set; } - - /// - /// The LobbyData of the CurrentLobby. Note this is the global data for the lobby. Use SetMemberData to set specific member data. - /// - public LobbyData CurrentLobbyData { get; private set; } - - /// - /// Returns true if this lobby is valid, ie, we've succesffuly created and/or joined a lobby. - /// - public bool IsValid => CurrentLobby != 0; - - /// - /// Join a Lobby through its LobbyID. OnLobbyJoined is called with the result of the Join attempt. - /// - /// CSteamID of lobby to join - public void Join( ulong lobbyID ) - { - Leave(); - client.native.matchmaking.JoinLobby( lobbyID, OnLobbyJoinedAPI ); - } - - void OnLobbyJoinedAPI( LobbyEnter_t callback, bool error ) - { - if ( error || (callback.EChatRoomEnterResponse != (uint)(SteamNative.ChatRoomEnterResponse.Success)) ) - { - if ( OnLobbyJoined != null ) { OnLobbyJoined( false ); } - return; - } - - CurrentLobby = callback.SteamIDLobby; - UpdateLobbyData(); - if ( OnLobbyJoined != null ) { OnLobbyJoined( true ); } - } - - /// - /// Called when a lobby has been attempted joined. Returns true if lobby was successfuly joined, false if not. - /// - public Action OnLobbyJoined; - - /// - /// Creates a lobby and returns the created lobby. You auto join the created lobby. The lobby is stored in Client.Lobby.CurrentLobby if successful. - /// - /// The Lobby.Type of Lobby to be created - /// The maximum amount of people you want to be able to be in this lobby, including yourself - public void Create( Lobby.Type lobbyType, int maxMembers ) - { - client.native.matchmaking.CreateLobby( (SteamNative.LobbyType)lobbyType, maxMembers, OnLobbyCreatedAPI ); - createdLobbyType = lobbyType; - } - - internal Type createdLobbyType; - - internal void OnLobbyCreatedAPI( LobbyCreated_t callback, bool error ) - { - //from SpaceWarClient.cpp 793 - if ( error || (callback.Result != Result.OK) ) - { - if ( OnLobbyCreated != null ) { OnLobbyCreated( false ); } - return; - } - - //set owner specific properties - Owner = client.SteamId; - CurrentLobby = callback.SteamIDLobby; - CurrentLobbyData = new LobbyData( client, CurrentLobby ); - Name = client.Username + "'s Lobby"; - CurrentLobbyData.SetData( "appid", client.AppId.ToString() ); - LobbyType = createdLobbyType; - CurrentLobbyData.SetData( "lobbytype", LobbyType.ToString() ); - Joinable = true; - if ( OnLobbyCreated != null ) { OnLobbyCreated( true ); } - } - - /// - /// Callback for when lobby is created. Parameter resolves true when the Lobby was successfully created - /// - public Action OnLobbyCreated; - - /// - /// Sets user data for the Lobby. Things like Character, Skin, Ready, etc. Can only set your own member data - /// - public void SetMemberData( string key, string value ) - { - if ( CurrentLobby == 0 ) { return; } - client.native.matchmaking.SetLobbyMemberData( CurrentLobby, key, value ); - } - - /// - /// Get the per-user metadata from this lobby. Can get data from any user - /// - /// ulong SteamID of the user you want to get data from - /// String key of the type of data you want to get - /// - public string GetMemberData( ulong steamID, string key ) - { - if ( CurrentLobby == 0 ) { return "ERROR: NOT IN ANY LOBBY"; } - return client.native.matchmaking.GetLobbyMemberData( CurrentLobby, steamID, key ); - } - - internal void OnLobbyDataUpdatedAPI( LobbyDataUpdate_t callback ) - { - if ( callback.SteamIDLobby != CurrentLobby ) return; - - if ( callback.SteamIDLobby == CurrentLobby ) //actual lobby data was updated by owner - { - UpdateLobbyData(); - } - - if ( UserIsInCurrentLobby( callback.SteamIDMember ) ) //some member of this lobby updated their information - { - if ( OnLobbyMemberDataUpdated != null ) { OnLobbyMemberDataUpdated( callback.SteamIDMember ); } - } - } - - /// - /// Updates the LobbyData property to have the data for the current lobby, if any - /// - internal void UpdateLobbyData() - { - int dataCount = client.native.matchmaking.GetLobbyDataCount( CurrentLobby ); - CurrentLobbyData = new LobbyData( client, CurrentLobby ); - for ( int i = 0; i < dataCount; i++ ) - { - if ( client.native.matchmaking.GetLobbyDataByIndex( CurrentLobby, i, out string key, out string value ) ) - { - CurrentLobbyData.SetData( key, value ); - } - } - - if ( OnLobbyDataUpdated != null ) { OnLobbyDataUpdated(); } - } - - /// - /// Called when the lobby data itself has been updated. Called when someone has joined/left, Owner has updated data, etc. - /// - public Action OnLobbyDataUpdated; - - /// - /// Called when a member of the lobby has updated either their personal Lobby metadata or someone's global steam state has changed (like a display name). Parameter is the user who changed. - /// - public Action OnLobbyMemberDataUpdated; - - - public Type LobbyType - { - get - { - if ( !IsValid ) { return Type.Error; } //if we're currently in a valid server - - //we know that we've set the lobby type via the lobbydata in the creation function - //ps this is important because steam doesn't have an easy way to get lobby type (why idk) - string lobbyType = CurrentLobbyData.GetData( "lobbytype" ); - switch ( lobbyType ) - { - case "Private": - return Type.Private; - case "FriendsOnly": - return Type.FriendsOnly; - case "Invisible": - return Type.Invisible; - case "Public": - return Type.Public; - default: - return Type.Error; - } - } - set - { - if ( !IsValid ) { return; } - if ( client.native.matchmaking.SetLobbyType( CurrentLobby, (SteamNative.LobbyType)value ) ) - { - CurrentLobbyData.SetData( "lobbytype", value.ToString() ); - } - } - } - - private static byte[] chatMessageData = new byte[1024 * 4]; - - private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback ) - { - //from Client.Networking - if ( callback.SteamIDLobby != CurrentLobby ) - return; - - SteamNative.CSteamID steamid = 1; - ChatEntryType chatEntryType; // "If set then this will just always return k_EChatEntryTypeChatMsg. This can usually just be set to NULL." - int readData = 0; - fixed ( byte* p = chatMessageData ) - { - readData = client.native.matchmaking.GetLobbyChatEntry( CurrentLobby, (int)callback.ChatID, out steamid, (IntPtr)p, chatMessageData.Length, out chatEntryType ); - } - - - OnChatMessageRecieved?.Invoke( steamid, chatMessageData, readData ); - - if ( readData > 0 ) - { - OnChatStringRecieved?.Invoke( steamid, Encoding.UTF8.GetString( chatMessageData, 0, readData ) ); - } - } - - /// - /// Callback to get chat messages. Use Encoding.UTF8.GetString to retrive the message. - /// - public Action OnChatMessageRecieved; - - /// - /// Like OnChatMessageRecieved but the data is converted to a string - /// - public Action OnChatStringRecieved; - - /// - /// Broadcasts a chat message to the all the users in the lobby users in the lobby (including the local user) will receive a LobbyChatMsg_t callback. - /// - /// True if message successfully sent - public unsafe bool SendChatMessage( string message ) - { - var data = Encoding.UTF8.GetBytes( message ); - fixed ( byte* p = data ) - { - // pvMsgBody can be binary or text data, up to 4k - // if pvMsgBody is text, cubMsgBody should be strlen( text ) + 1, to include the null terminator - return client.native.matchmaking.SendLobbyChatMsg( CurrentLobby, (IntPtr)p, data.Length ); - } - } - - /// - /// Enums to catch the state of a user when their state has changed - /// - public enum MemberStateChange - { - Entered = ChatMemberStateChange.Entered, - Left = ChatMemberStateChange.Left, - Disconnected = ChatMemberStateChange.Disconnected, - Kicked = ChatMemberStateChange.Kicked, - Banned = ChatMemberStateChange.Banned, - } - - internal void OnLobbyStateUpdatedAPI( LobbyChatUpdate_t callback ) - { - if ( callback.SteamIDLobby != CurrentLobby ) - return; - - MemberStateChange change = (MemberStateChange)callback.GfChatMemberStateChange; - ulong initiator = callback.SteamIDMakingChange; - ulong affected = callback.SteamIDUserChanged; - - OnLobbyStateChanged?.Invoke( change, initiator, affected ); - } - - /// - /// Called when the state of the Lobby is somehow shifted. Usually when someone joins or leaves the lobby. - /// The first ulong is the SteamID of the user that initiated the change. - /// The second ulong is the person that was affected - /// - public Action OnLobbyStateChanged; - - /// - /// The name of the lobby as a property for easy getting/setting. Note that this is setting LobbyData, which you cannot do unless you are the Owner of the lobby - /// - public string Name - { - get - { - if ( !IsValid ) { return ""; } - return CurrentLobbyData.GetData( "name" ); - } - set - { - if ( !IsValid ) { return; } - CurrentLobbyData.SetData( "name", value ); - } - } - - /// - /// returns true if we're the current owner - /// - public bool IsOwner - { - get - { - return Owner == client.SteamId; - } - } - - /// - /// The Owner of the current lobby. Returns 0 if you are not in a valid lobby. - /// - public ulong Owner - { - get - { - if ( IsValid ) - { - return client.native.matchmaking.GetLobbyOwner( CurrentLobby ); - } - return 0; - } - set - { - if ( Owner == value ) return; - client.native.matchmaking.SetLobbyOwner( CurrentLobby, value ); - } - } - - /// - /// Is the Lobby joinable by other people? Defaults to true; - /// - public bool Joinable - { - get - { - if ( !IsValid ) { return false; } - string joinable = CurrentLobbyData.GetData( "joinable" ); - switch ( joinable ) - { - case "true": - return true; - case "false": - return false; - default: - return false; - } - } - set - { - if ( !IsValid ) { return; } - if ( client.native.matchmaking.SetLobbyJoinable( CurrentLobby, value ) ) - { - CurrentLobbyData.SetData( "joinable", value.ToString() ); - } - } - } - - /// - /// How many people can be in the Lobby - /// - public int MaxMembers - { - get - { - if ( !IsValid ) { return 0; } //0 is default, but value is inited when lobby is created. - return client.native.matchmaking.GetLobbyMemberLimit( CurrentLobby ); - } - set - { - if ( !IsValid ) { return; } - client.native.matchmaking.SetLobbyMemberLimit( CurrentLobby, value ); - } - } - - /// - /// How many people are currently in the Lobby - /// - public int NumMembers - { - get { return client.native.matchmaking.GetNumLobbyMembers( CurrentLobby ); } - } - - /// - /// Leave the CurrentLobby. - /// - public void Leave() - { - if ( CurrentLobby != 0 ) - { - client.native.matchmaking.LeaveLobby( CurrentLobby ); - } - - CurrentLobby = 0; - CurrentLobbyData = null; - } - - public void Dispose() - { - client = null; - } - - /// - /// Get an array of all the CSteamIDs in the CurrentLobby. - /// Note that you must be in the Lobby you are trying to request the MemberIDs from. - /// Returns an empty array if you aren't in a lobby. - /// - /// Array of member SteamIDs - public ulong[] GetMemberIDs() - { - ulong[] memIDs = new ulong[NumMembers]; - for ( int i = 0; i < NumMembers; i++ ) - { - memIDs[i] = client.native.matchmaking.GetLobbyMemberByIndex( CurrentLobby, i ); - } - return memIDs; - } - - /// - /// Check to see if a user is in your CurrentLobby - /// - /// SteamID of the user to check for - /// - public bool UserIsInCurrentLobby( ulong steamID ) - { - if ( CurrentLobby == 0 ) - return false; - - ulong[] mems = GetMemberIDs(); - - for ( int i = 0; i < mems.Length; i++ ) - { - if ( mems[i] == steamID ) - return true; - } - - return false; - } - - /// - /// Invites the specified user to the CurrentLobby the user is in. - /// - /// ulong ID of person to invite - public bool InviteUserToLobby( ulong friendID ) - { - return client.native.matchmaking.InviteUserToLobby( CurrentLobby, friendID ); - } - - internal void OnUserInvitedToLobbyAPI( LobbyInvite_t callback ) - { - if ( callback.GameID != client.AppId ) return; - if ( OnUserInvitedToLobby != null ) { OnUserInvitedToLobby( callback.SteamIDLobby, callback.SteamIDUser ); } - - } - - /// - /// Activates the steam overlay to invite friends to the CurrentLobby the user is in. - /// - public void OpenFriendInviteOverlay() - { - client.native.friends.ActivateGameOverlayInviteDialog(CurrentLobby); - } - - /// - /// Called when a user invites the current user to a lobby. The first parameter is the lobby the user was invited to, the second is the CSteamID of the person who invited this user - /// - public Action OnUserInvitedToLobby; - - /// - /// Called when a user accepts an invitation to a lobby while the game is running. The parameter is a lobby id. - /// - public Action OnLobbyJoinRequested; - - /// - /// Joins a lobby if a request was made to join the lobby through the friends list or an invite - /// - internal void OnLobbyJoinRequestedAPI( GameLobbyJoinRequested_t callback ) - { - if (OnLobbyJoinRequested != null) { OnLobbyJoinRequested(callback.SteamIDLobby); } - } - - /// - /// Makes sure we send an update callback if a Lobby user updates their information - /// - internal void OnLobbyMemberPersonaChangeAPI( PersonaStateChange_t callback ) - { - if ( !UserIsInCurrentLobby( callback.SteamID ) ) return; - if ( OnLobbyMemberDataUpdated != null ) { OnLobbyMemberDataUpdated( callback.SteamID ); } - } - - /// - /// Sets the game server associated with the lobby. - /// This can only be set by the owner of the lobby. - /// Either the IP/Port or the Steam ID of the game server must be valid, depending on how you want the clients to be able to connect. - /// - public bool SetGameServer( System.Net.IPAddress ip, int port, ulong serverSteamId = 0 ) - { - if ( !IsValid || !IsOwner ) return false; - - var ipint = System.Net.IPAddress.NetworkToHostOrder( ip.Address ); - client.native.matchmaking.SetLobbyGameServer( CurrentLobby, (uint)ipint, (ushort)port, serverSteamId ); - return true; - } - - /// - /// Gets the details of a game server set in a lobby. - /// - public System.Net.IPAddress GameServerIp - { - get - { - uint ip; - ushort port; - CSteamID steamid; - - if ( !client.native.matchmaking.GetLobbyGameServer( CurrentLobby, out ip, out port, out steamid ) || ip == 0 ) - return null; - - return new System.Net.IPAddress( System.Net.IPAddress.HostToNetworkOrder( ip ) ); - } - } - - /// - /// Gets the details of a game server set in a lobby. - /// - public int GameServerPort - { - get - { - uint ip; - ushort port; - CSteamID steamid; - - if ( !client.native.matchmaking.GetLobbyGameServer( CurrentLobby, out ip, out port, out steamid ) ) - return 0; - - return (int)port; - } - } - - /// - /// Gets the details of a game server set in a lobby. - /// - public ulong GameServerSteamId - { - get - { - uint ip; - ushort port; - CSteamID steamid; - - if ( !client.native.matchmaking.GetLobbyGameServer( CurrentLobby, out ip, out port, out steamid ) ) - return 0; - - return steamid; - } - } - - /*not implemented - - //set the game server of the lobby - client.native.matchmaking.GetLobbyGameServer; - client.native.matchmaking.SetLobbyGameServer; - - //used with game server stuff - SteamNative.LobbyGameCreated_t - */ - } -} diff --git a/Facepunch.Steamworks/Client/LobbyList.Lobby.cs b/Facepunch.Steamworks/Client/LobbyList.Lobby.cs deleted file mode 100644 index 43a1dbe..0000000 --- a/Facepunch.Steamworks/Client/LobbyList.Lobby.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class LobbyList - { - public class Lobby - { - private Dictionary lobbyData; - internal Client Client; - public string Name { get; private set; } - public ulong LobbyID { get; private set; } - public ulong Owner { get; private set; } - public int MemberLimit{ get; private set; } - public int NumMembers{ get; private set; } - public string LobbyType { get; private set; } - - /// - /// Get the lobby value for the specific key - /// - /// The key to find - /// The value at key - public string GetData(string k) - { - if (lobbyData.TryGetValue(k, out var v)) - return v; - - return string.Empty; - } - - /// - /// Get a list of all the data in the Lobby - /// - /// Dictionary of all the key/value pairs in the data - public Dictionary GetAllData() - { - var returnData = new Dictionary(); - - foreach ( var item in lobbyData) - { - returnData.Add(item.Key, item.Value); - } - - return returnData; - } - - internal static Lobby FromSteam(Client client, ulong lobby) - { - var lobbyData = new Dictionary(); - int dataCount = client.native.matchmaking.GetLobbyDataCount(lobby); - - for (int i = 0; i < dataCount; i++) - { - if (client.native.matchmaking.GetLobbyDataByIndex(lobby, i, out var datakey, out var datavalue)) - { - lobbyData.Add(datakey, datavalue); - } - } - - return new Lobby() - { - Client = client, - LobbyID = lobby, - Name = client.native.matchmaking.GetLobbyData(lobby, "name"), - LobbyType = client.native.matchmaking.GetLobbyData(lobby, "lobbytype"), - MemberLimit = client.native.matchmaking.GetLobbyMemberLimit(lobby), - Owner = client.native.matchmaking.GetLobbyOwner(lobby), - NumMembers = client.native.matchmaking.GetNumLobbyMembers(lobby), - lobbyData = lobbyData - }; - - } - } - } -} diff --git a/Facepunch.Steamworks/Client/LobbyList.cs b/Facepunch.Steamworks/Client/LobbyList.cs deleted file mode 100644 index 4470973..0000000 --- a/Facepunch.Steamworks/Client/LobbyList.cs +++ /dev/null @@ -1,185 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class LobbyList : IDisposable - { - internal Client client; - - //The list of retrieved lobbies - public List Lobbies { get; private set; } - - //True when all the possible lobbies have had their data updated - //if the number of lobbies is now equal to the initial request number, we've found all lobbies - public bool Finished { get; private set; } - - //The number of possible lobbies we can get data from - internal List requests; - - internal LobbyList(Client client) - { - this.client = client; - Lobbies = new List(); - requests = new List(); - } - - /// - /// Refresh the List of Lobbies. If no filter is passed in, a default one is created that filters based on AppId ("appid"). - /// - /// - public void Refresh ( Filter filter = null) - { - //init out values - Lobbies.Clear(); - requests.Clear(); - Finished = false; - - if (filter == null) - { - filter = new Filter(); - filter.StringFilters.Add("appid", client.AppId.ToString()); - client.native.matchmaking.RequestLobbyList(OnLobbyList); - return; - } - - client.native.matchmaking.AddRequestLobbyListDistanceFilter((SteamNative.LobbyDistanceFilter)filter.DistanceFilter); - - if (filter.SlotsAvailable != null) - { - client.native.matchmaking.AddRequestLobbyListFilterSlotsAvailable((int)filter.SlotsAvailable); - } - - if (filter.MaxResults != null) - { - client.native.matchmaking.AddRequestLobbyListResultCountFilter((int)filter.MaxResults); - } - - foreach (KeyValuePair fil in filter.StringFilters) - { - client.native.matchmaking.AddRequestLobbyListStringFilter(fil.Key, fil.Value, SteamNative.LobbyComparison.Equal); - } - foreach (KeyValuePair fil in filter.NearFilters) - { - client.native.matchmaking.AddRequestLobbyListNearValueFilter(fil.Key, fil.Value); - } - //foreach (KeyValuePair> fil in filter.NumericalFilters) - //{ - // client.native.matchmaking.AddRequestLobbyListNumericalFilter(fil.Key, fil.Value.Value, (SteamNative.LobbyComparison)fil.Value.Key); - //} - - - // this will never return lobbies that are full (via the actual api) - client.native.matchmaking.RequestLobbyList(OnLobbyList); - - } - - - void OnLobbyList(LobbyMatchList_t callback, bool error) - { - if (error) return; - - //how many lobbies matched - uint lobbiesMatching = callback.LobbiesMatching; - - // lobbies are returned in order of closeness to the user, so add them to the list in that order - for (int i = 0; i < lobbiesMatching; i++) - { - //add the lobby to the list of requests - ulong lobby = client.native.matchmaking.GetLobbyByIndex(i); - requests.Add(lobby); - - //cast to a LobbyList.Lobby - Lobby newLobby = Lobby.FromSteam(client, lobby); - if (newLobby.Name != "") - { - //if the lobby is valid add it to the valid return lobbies - Lobbies.Add(newLobby); - checkFinished(); - } - else - { - //else we need to get the info for the missing lobby - client.native.matchmaking.RequestLobbyData(lobby); - client.RegisterCallback( OnLobbyDataUpdated ); - } - - } - - checkFinished(); - - if (OnLobbiesUpdated != null) { OnLobbiesUpdated(); } - } - - void checkFinished() - { - if (Lobbies.Count == requests.Count) - { - Finished = true; - return; - } - Finished = false; - } - - void OnLobbyDataUpdated(LobbyDataUpdate_t callback) - { - if (callback.Success == 1) //1 if success, 0 if failure - { - //find the lobby that has been updated - Lobby lobby = Lobbies.Find(x => x.LobbyID == callback.SteamIDLobby); - - //if this lobby isn't yet in the list of lobbies, we know that we should add it - if (lobby == null) - { - Lobbies.Add(lobby); - checkFinished(); - } - - //otherwise lobby data in general was updated and you should listen to see what changed - if (OnLobbiesUpdated != null) { OnLobbiesUpdated(); } - } - - - } - - public Action OnLobbiesUpdated; - - public void Dispose() - { - client = null; - } - - public class Filter - { - // Filters that match actual metadata keys exactly - public Dictionary StringFilters = new Dictionary(); - // Filters that are of string key and int value for that key to be close to - public Dictionary NearFilters = new Dictionary(); - //Filters that are of string key and int value, with a comparison filter to say how we should relate to the value - //public Dictionary> NumericalFilters = new Dictionary>(); - public Distance DistanceFilter = Distance.Worldwide; - public int? SlotsAvailable { get; set; } - public int? MaxResults { get; set; } - - public enum Distance : int - { - Close = SteamNative.LobbyDistanceFilter.Close, - Default = SteamNative.LobbyDistanceFilter.Default, - Far = SteamNative.LobbyDistanceFilter.Far, - Worldwide = SteamNative.LobbyDistanceFilter.Worldwide - } - - public enum Comparison : int - { - EqualToOrLessThan = SteamNative.LobbyComparison.EqualToOrLessThan, - LessThan = SteamNative.LobbyComparison.LessThan, - Equal = SteamNative.LobbyComparison.Equal, - GreaterThan = SteamNative.LobbyComparison.GreaterThan, - EqualToOrGreaterThan = SteamNative.LobbyComparison.EqualToOrGreaterThan, - NotEqual = SteamNative.LobbyComparison.NotEqual - } - } - } -} diff --git a/Facepunch.Steamworks/Client/MicroTransactions.cs b/Facepunch.Steamworks/Client/MicroTransactions.cs deleted file mode 100644 index 240b35b..0000000 --- a/Facepunch.Steamworks/Client/MicroTransactions.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class MicroTransactions : IDisposable - { - internal Client client; - - public delegate void AuthorizationResponse( bool authorized, int appId, ulong orderId ); - - /// - /// Called on the MicroTxnAuthorizationResponse_t event - /// - public event AuthorizationResponse OnAuthorizationResponse; - - internal MicroTransactions( Client c ) - { - client = c; - - client.RegisterCallback( onMicroTxnAuthorizationResponse ); - } - - private void onMicroTxnAuthorizationResponse( MicroTxnAuthorizationResponse_t arg1 ) - { - if ( OnAuthorizationResponse != null ) - { - OnAuthorizationResponse( arg1.Authorized == 1, (int) arg1.AppID, arg1.OrderID ); - } - } - - public void Dispose() - { - client = null; - } - } -} diff --git a/Facepunch.Steamworks/Client/Overlay.cs b/Facepunch.Steamworks/Client/Overlay.cs deleted file mode 100644 index aefae2d..0000000 --- a/Facepunch.Steamworks/Client/Overlay.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - private Overlay _overlay; - - public Overlay Overlay - { - get - { - if ( _overlay == null ) - _overlay = new Overlay { client = this }; - - return _overlay; - } - } - } - - public class Overlay - { - internal Client client; - - /// - /// Returns true if the Steam Overlay is actually available, false if it was not injected properly. - /// Note that it may take some time after Steam_Init() until the overlay injection is complete. - /// Also note that the overlay will only work if the Steam API is initialized before the rendering device is initialized. That means that - /// for Unity3D games the overlay is only available if the game was launched directly through Steam. Calling Steam_Init() from Mono - /// code is too late. - /// - public bool Enabled - { - get { return client.native != null ? client.native.utils.IsOverlayEnabled() : false; } - } - - public void OpenUserPage( string name, ulong steamid ) { client.native.friends.ActivateGameOverlayToUser( name, steamid ); } - - public void OpenProfile( ulong steamid ) { OpenUserPage( "steamid", steamid ); } - public void OpenChat( ulong steamid ){ OpenUserPage( "chat", steamid ); } - public void OpenTrade( ulong steamid ) { OpenUserPage( "jointrade", steamid ); } - public void OpenStats( ulong steamid ) { OpenUserPage( "stats", steamid ); } - public void OpenAchievements( ulong steamid ) { OpenUserPage( "achievements", steamid ); } - public void AddFriend( ulong steamid ) { OpenUserPage( "friendadd", steamid ); } - public void RemoveFriend( ulong steamid ) { OpenUserPage( "friendremove", steamid ); } - public void AcceptFriendRequest( ulong steamid ) { OpenUserPage( "friendrequestaccept", steamid ); } - public void IgnoreFriendRequest( ulong steamid ) { OpenUserPage( "friendrequestignore", steamid ); } - - public void OpenUrl( string url ) { client.native.friends.ActivateGameOverlayToWebPage( url ); } - } -} diff --git a/Facepunch.Steamworks/Client/RemoteStorage.File.cs b/Facepunch.Steamworks/Client/RemoteStorage.File.cs deleted file mode 100644 index 58b93ae..0000000 --- a/Facepunch.Steamworks/Client/RemoteStorage.File.cs +++ /dev/null @@ -1,306 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using Facepunch.Steamworks.Callbacks; -using SteamNative; -using Result = SteamNative.Result; - -namespace Facepunch.Steamworks -{ - /// - /// Represents a file stored in a user's Steam Cloud. - /// - public class RemoteFile - { - internal readonly RemoteStorage remoteStorage; - - private readonly bool _isUgc; - private string _fileName; - private int _sizeInBytes = -1; - private UGCHandle_t _handle; - private ulong _ownerId; - - private bool _isDownloading; - private byte[] _downloadedData; - - /// - /// Check if the file exists. - /// - public bool Exists { get; internal set; } - - public bool IsDownloading { get { return _isUgc && _isDownloading && _downloadedData == null; } } - - public bool IsDownloaded { get { return !_isUgc || _downloadedData != null; } } - - /// - /// If true, the file is available for other users to download. - /// - public bool IsShared { get { return _handle.Value != 0; } } - - internal UGCHandle_t UGCHandle { get { return _handle; } } - - public ulong SharingId { get { return UGCHandle.Value; } } - - /// - /// Name and path of the file. - /// - public string FileName - { - get - { - if ( _fileName != null ) return _fileName; - GetUGCDetails(); - return _fileName; - } - } - - /// - /// Steam ID of the file's owner. - /// - public ulong OwnerId - { - get - { - if ( _ownerId != 0 ) return _ownerId; - GetUGCDetails(); - return _ownerId; - } - } - - /// - /// Total size of the file in bytes. - /// - public int SizeInBytes - { - get - { - if ( _sizeInBytes != -1 ) return _sizeInBytes; - if ( _isUgc ) throw new NotImplementedException(); - _sizeInBytes = remoteStorage.native.GetFileSize( FileName ); - return _sizeInBytes; - } - internal set { _sizeInBytes = value; } - } - - internal RemoteFile( RemoteStorage r, UGCHandle_t handle ) - { - Exists = true; - - remoteStorage = r; - - _isUgc = true; - _handle = handle; - } - - internal RemoteFile( RemoteStorage r, string name, ulong ownerId, int sizeInBytes = -1 ) - { - remoteStorage = r; - - _isUgc = false; - _fileName = name; - _ownerId = ownerId; - _sizeInBytes = sizeInBytes; - } - - /// - /// Creates a used to write to this file. - /// - public RemoteFileWriteStream OpenWrite() - { - if (_isUgc) throw new InvalidOperationException("Cannot write to a shared file."); - - return new RemoteFileWriteStream( remoteStorage, this ); - } - - /// - /// Write a byte array to this file, replacing any existing contents. - /// - public void WriteAllBytes( byte[] buffer ) - { - using ( var stream = OpenWrite() ) - { - stream.Write( buffer, 0, buffer.Length ); - } - } - - /// - /// Write a string to this file, replacing any existing contents. - /// - public void WriteAllText( string text, Encoding encoding = null ) - { - if ( encoding == null ) encoding = Encoding.UTF8; - WriteAllBytes( encoding.GetBytes( text ) ); - } - - /// - /// Callback invoked by when a file download is complete. - /// - public delegate void DownloadCallback(); - - /// - /// Gets the number of bytes downloaded and the total number of bytes expected while - /// this file is downloading. - /// - /// True if the file is downloading - public bool GetDownloadProgress( out int bytesDownloaded, out int bytesExpected ) - { - return remoteStorage.native.GetUGCDownloadProgress( _handle, out bytesDownloaded, out bytesExpected ); - } - - /// - /// Attempts to start downloading a shared file. - /// - /// True if the download has successfully started - public bool Download( DownloadCallback onSuccess = null, FailureCallback onFailure = null ) - { - if ( !_isUgc ) return false; - if ( _isDownloading ) return false; - if ( IsDownloaded ) return false; - - _isDownloading = true; - - remoteStorage.native.UGCDownload( _handle, 1000, ( result, error ) => - { - _isDownloading = false; - - if ( error || result.Result != Result.OK ) - { - onFailure?.Invoke( result.Result == 0 ? Callbacks.Result.IOFailure : (Callbacks.Result) result.Result ); - return; - } - - _ownerId = result.SteamIDOwner; - _sizeInBytes = result.SizeInBytes; - _fileName = result.PchFileName; - - unsafe - { - _downloadedData = new byte[_sizeInBytes]; - fixed ( byte* bufferPtr = _downloadedData ) - { - remoteStorage.native.UGCRead( _handle, (IntPtr) bufferPtr, _sizeInBytes, 0, UGCReadAction.ontinueReading ); - } - } - - onSuccess?.Invoke(); - } ); - - return true; - } - - /// - /// Opens a stream used to read from this file. - /// - /// - public Stream OpenRead() - { - return new MemoryStream( ReadAllBytes(), false ); - } - - /// - /// Reads the entire contents of the file as a byte array. - /// - public unsafe byte[] ReadAllBytes() - { - if ( _isUgc ) - { - if ( !IsDownloaded ) throw new Exception( "Cannot read a file that hasn't been downloaded." ); - return _downloadedData; - } - - var size = SizeInBytes; - var buffer = new byte[size]; - - fixed ( byte* bufferPtr = buffer ) - { - remoteStorage.native.FileRead( FileName, (IntPtr) bufferPtr, size ); - } - - return buffer; - } - - /// - /// Reads the entire contents of the file as a string. - /// - public string ReadAllText( Encoding encoding = null ) - { - if ( encoding == null ) encoding = Encoding.UTF8; - return encoding.GetString( ReadAllBytes() ); - } - - /// - /// Callback invoked by when file sharing is complete. - /// - public delegate void ShareCallback(); - - /// - /// Attempt to publish this file for other users to download. - /// - /// True if we have started attempting to share - public bool Share( ShareCallback onSuccess = null, FailureCallback onFailure = null ) - { - if ( _isUgc ) return false; - - // Already shared - if ( _handle.Value != 0 ) return false; - - remoteStorage.native.FileShare( FileName, ( result, error ) => - { - if ( !error && result.Result == Result.OK ) - { - _handle.Value = result.File; - onSuccess?.Invoke(); - } - else - { - onFailure?.Invoke( result.Result == 0 ? Callbacks.Result.IOFailure : (Callbacks.Result) result.Result ); - } - } ); - - return true; - } - - /// - /// Delete this file from remote storage. - /// - /// True if the file could be deleted - public bool Delete() - { - if ( !Exists ) return false; - if ( _isUgc ) return false; - if ( !remoteStorage.native.FileDelete( FileName ) ) return false; - - Exists = false; - remoteStorage.InvalidateFiles(); - - return true; - } - - /// - /// Remove this file from remote storage, while keeping a local copy. - /// Writing to this file again will re-add it to the cloud. - /// - /// True if the file was forgotten - public bool Forget() - { - if ( !Exists ) return false; - if ( _isUgc ) return false; - - return remoteStorage.native.FileForget( FileName ); - } - - private void GetUGCDetails() - { - if ( !_isUgc ) throw new InvalidOperationException(); - - var appId = new AppId_t { Value = remoteStorage.native.steamworks.AppId }; - - CSteamID ownerId; - remoteStorage.native.GetUGCDetails( _handle, ref appId, out _fileName, out ownerId ); - - _ownerId = ownerId.Value; - } - } -} diff --git a/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs b/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs deleted file mode 100644 index 6b6a7b6..0000000 --- a/Facepunch.Steamworks/Client/RemoteStorage.FileStream.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - /// - /// Stream used to write to a . - /// - public class RemoteFileWriteStream : Stream - { - internal readonly RemoteStorage remoteStorage; - - private readonly UGCFileWriteStreamHandle_t _handle; - private readonly RemoteFile _file; - - private int _written; - private bool _closed; - - internal RemoteFileWriteStream( RemoteStorage r, RemoteFile file ) - { - remoteStorage = r; - - _handle = remoteStorage.native.FileWriteStreamOpen( file.FileName ); - _file = file; - } - - public override void Flush() { } - - public override int Read( byte[] buffer, int offset, int count ) - { - throw new NotImplementedException(); - } - - public override long Seek( long offset, SeekOrigin origin ) - { - throw new NotImplementedException(); - } - - public override void SetLength( long value ) - { - throw new NotImplementedException(); - } - - public override unsafe void Write( byte[] buffer, int offset, int count ) - { - if ( _closed ) throw new ObjectDisposedException( ToString() ); - - fixed ( byte* bufferPtr = buffer ) - { - if ( remoteStorage.native.FileWriteStreamWriteChunk( _handle, (IntPtr)(bufferPtr + offset), count ) ) - { - _written += count; - } - } - } - - public override bool CanRead => false; - public override bool CanSeek => false; - public override bool CanWrite => true; - public override long Length => _written; - public override long Position { get { return _written; } set { throw new NotImplementedException(); } } - - /// - /// Close the stream without saving the file to remote storage. - /// - public void Cancel() - { - if ( _closed ) return; - - _closed = true; - remoteStorage.native.FileWriteStreamCancel( _handle ); - } - - public override void Close() - { - if ( _closed ) return; - - _closed = true; - remoteStorage.native.FileWriteStreamClose( _handle ); - - _file.remoteStorage.OnWrittenNewFile( _file ); - } - - protected override void Dispose( bool disposing ) - { - if ( disposing ) Close(); - base.Dispose( disposing ); - } - } -} diff --git a/Facepunch.Steamworks/Client/RemoteStorage.cs b/Facepunch.Steamworks/Client/RemoteStorage.cs deleted file mode 100644 index 7110d31..0000000 --- a/Facepunch.Steamworks/Client/RemoteStorage.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - /// - /// Handles Steam Cloud related actions. - /// - public class RemoteStorage : IDisposable - { - private static string NormalizePath( string path ) - { - // TODO: DUMB HACK ALERT - - return SteamNative.Platform.IsWindows - ? new FileInfo( $"x:/{path}" ).FullName.Substring( 3 ) - : new FileInfo( $"/x/{path}" ).FullName.Substring( 3 ); - } - - internal Client client; - internal SteamNative.SteamRemoteStorage native; - - private bool _filesInvalid = true; - private readonly List _files = new List(); - - internal RemoteStorage( Client c ) - { - client = c; - native = client.native.remoteStorage; - } - - /// - /// True if Steam Cloud is currently enabled by the current user. - /// - public bool IsCloudEnabledForAccount - { - get { return native.IsCloudEnabledForAccount(); } - } - - /// - /// True if Steam Cloud is currently enabled for this app by the current user. - /// - public bool IsCloudEnabledForApp - { - get { return native.IsCloudEnabledForApp(); } - } - - /// - /// Gets the total number of files in the current user's remote storage for the current game. - /// - public int FileCount - { - get { return native.GetFileCount(); } - } - - /// - /// Gets all files in the current user's remote storage for the current game. - /// - public IEnumerable Files - { - get - { - UpdateFiles(); - return _files; - } - } - - /// - /// Creates a new with the given . - /// If a file exists at that path it will be overwritten. - /// - public RemoteFile CreateFile( string path ) - { - path = NormalizePath( path ); - - InvalidateFiles(); - var existing = Files.FirstOrDefault( x => x.FileName == path ); - return existing ?? new RemoteFile( this, path, client.SteamId, 0 ); - } - - /// - /// Opens the file if it exists, else returns null; - /// - public RemoteFile OpenFile( string path ) - { - path = NormalizePath( path ); - - InvalidateFiles(); - var existing = Files.FirstOrDefault( x => x.FileName == path ); - return existing; - } - - /// - /// Opens a previously shared - /// with the given . - /// - public RemoteFile OpenSharedFile( ulong sharingId ) - { - return new RemoteFile( this, sharingId ); - } - - /// - /// Write all text to the file at the specified path. This - /// overwrites the contents - it does not append. - /// - public bool WriteString( string path, string text, Encoding encoding = null ) - { - var file = CreateFile( path ); - file.WriteAllText( text, encoding ); - return file.Exists; - } - - /// - /// Write all data to the file at the specified path. This - /// overwrites the contents - it does not append. - /// - public bool WriteBytes( string path, byte[] data ) - { - var file = CreateFile( path ); - file.WriteAllBytes( data ); - return file.Exists; - } - - /// - /// Read the entire contents of the file as a string. - /// Returns null if the file isn't found. - /// - public string ReadString( string path, Encoding encoding = null ) - { - var file = OpenFile( path ); - if ( file == null ) return null; - return file.ReadAllText( encoding ); - } - - /// - /// Read the entire contents of the file as raw data. - /// Returns null if the file isn't found. - /// - public byte[] ReadBytes( string path ) - { - var file = OpenFile( path ); - if ( file == null ) return null; - return file.ReadAllBytes(); - } - - internal void OnWrittenNewFile( RemoteFile file ) - { - if ( _files.Any( x => x.FileName == file.FileName ) ) return; - - _files.Add( file ); - file.Exists = true; - - InvalidateFiles(); - } - - internal void InvalidateFiles() - { - _filesInvalid = true; - } - - private void UpdateFiles() - { - if ( !_filesInvalid ) return; - _filesInvalid = false; - - foreach ( var file in _files ) - { - file.Exists = false; - } - - var count = FileCount; - for ( var i = 0; i < count; ++i ) - { - int size; - var name = NormalizePath( native.GetFileNameAndSize( i, out size ) ); - - var existing = _files.FirstOrDefault( x => x.FileName == name ); - if ( existing == null ) - { - existing = new RemoteFile( this, name, client.SteamId, size ); - _files.Add( existing ); - } - else - { - existing.SizeInBytes = size; - } - - existing.Exists = true; - } - - for ( var i = _files.Count - 1; i >= 0; --i ) - { - if ( !_files[i].Exists ) _files.RemoveAt( i ); - } - } - - /// - /// Gets whether a file exists in remote storage at the given . - /// - public bool FileExists( string path ) - { - return native.FileExists( path ); - } - - public void Dispose() - { - client = null; - native = null; - } - - /// - /// Number of bytes used out of the user's total quota - /// - public ulong QuotaUsed - { - get - { - ulong totalBytes = 0; - ulong availableBytes = 0; - - if ( !native.GetQuota( out totalBytes, out availableBytes ) ) - return 0; - - return totalBytes - availableBytes; - } - } - - /// - /// Total quota size in bytes - /// - public ulong QuotaTotal - { - get - { - ulong totalBytes = 0; - ulong availableBytes = 0; - - if ( !native.GetQuota( out totalBytes, out availableBytes ) ) - return 0; - - return totalBytes; - } - } - - - /// - /// Number of bytes remaining out of the user's total quota - /// - public ulong QuotaRemaining - { - get - { - ulong totalBytes = 0; - ulong availableBytes = 0; - - if ( !native.GetQuota( out totalBytes, out availableBytes ) ) - return 0; - - return availableBytes; - } - } - } -} diff --git a/Facepunch.Steamworks/Client/Screenshots.cs b/Facepunch.Steamworks/Client/Screenshots.cs deleted file mode 100644 index 32be36c..0000000 --- a/Facepunch.Steamworks/Client/Screenshots.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class Client : IDisposable - { - Screenshots _screenshots; - - public Screenshots Screenshots - { - get - { - if ( _screenshots == null ) - _screenshots = new Screenshots( this ); - - return _screenshots; - } - } - } - - public class Screenshots - { - internal Client client; - - internal Screenshots( Client c ) - { - client = c; - } - - public void Trigger() - { - client.native.screenshots.TriggerScreenshot(); - } - - public unsafe void Write( byte[] rgbData, int width, int height ) - { - if ( rgbData == null ) - { - throw new ArgumentNullException( nameof(rgbData) ); - } - - if ( width < 1 ) - { - throw new ArgumentOutOfRangeException( nameof(width), width, - $"Expected {nameof(width)} to be at least 1." ); - } - - if ( height < 1 ) - { - throw new ArgumentOutOfRangeException( nameof(height), height, - $"Expected {nameof(height)} to be at least 1." ); - } - - var size = width * height * 3; - if ( rgbData.Length < size ) - { - throw new ArgumentException( nameof(rgbData), - $"Expected {nameof(rgbData)} to contain at least {size} elements (actual size: {rgbData.Length})." ); - } - - fixed ( byte* ptr = rgbData ) - { - client.native.screenshots.WriteScreenshot( (IntPtr) ptr, (uint) rgbData.Length, width, height ); - } - } - - public unsafe void AddScreenshotToLibrary( string filename, string thumbnailFilename, int width, int height) - { - client.native.screenshots.AddScreenshotToLibrary(filename, thumbnailFilename, width, height); - } - - public unsafe void AddScreenshotToLibrary( string filename, int width, int height) - { - client.native.screenshots.AddScreenshotToLibrary(filename, null, width, height); - } - } -} diff --git a/Facepunch.Steamworks/Client/ServerList.Request.cs b/Facepunch.Steamworks/Client/ServerList.Request.cs deleted file mode 100644 index f3da876..0000000 --- a/Facepunch.Steamworks/Client/ServerList.Request.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class ServerList - { - public class Request : IDisposable - { - internal Client client; - - internal List Requests = new List(); - - internal class SubRequest - { - internal IntPtr Request; - internal int Pointer = 0; - internal List WatchList = new List(); - internal System.Diagnostics.Stopwatch Timer = System.Diagnostics.Stopwatch.StartNew(); - - internal bool Update( SteamNative.SteamMatchmakingServers servers, Action OnServer, Action OnUpdate ) - { - if ( Request == IntPtr.Zero ) - return true; - - if ( Timer.Elapsed.TotalSeconds < 0.5f ) - return false; - - Timer.Reset(); - Timer.Start(); - - bool changes = false; - - // - // Add any servers we're not watching to our watch list - // - var count = servers.GetServerCount( Request ); - if ( count != Pointer ) - { - for ( int i = Pointer; i < count; i++ ) - { - WatchList.Add( i ); - } - } - Pointer = count; - - // - // Remove any servers that respond successfully - // - WatchList.RemoveAll( x => - { - var info = servers.GetServerDetails( Request, x ); - if ( info.HadSuccessfulResponse ) - { - OnServer( info ); - changes = true; - return true; - } - - return false; - } ); - - // - // If we've finished refreshing - // - if ( servers.IsRefreshing( Request ) == false ) - { - // - // Put any other servers on the 'no response' list - // - WatchList.RemoveAll( x => - { - var info = servers.GetServerDetails( Request, x ); - OnServer( info ); - return true; - } ); - - servers.CancelQuery( Request ); - Request = IntPtr.Zero; - changes = true; - } - - if ( changes && OnUpdate != null ) - OnUpdate(); - - return Request == IntPtr.Zero; - } - } - - public Action OnUpdate; - public Action OnServerResponded; - public Action OnFinished; - - /// - /// A list of servers that responded. If you're only interested in servers that responded since you - /// last updated, then simply clear this list. - /// - public List Responded = new List(); - - /// - /// A list of servers that were in the master list but didn't respond. - /// - public List Unresponsive = new List(); - - /// - /// True when we have finished - /// - public bool Finished = false; - - internal Request( Client c ) - { - client = c; - - client.OnUpdate += Update; - } - - ~Request() - { - Dispose(); - } - - internal IEnumerable ServerList { get; set; } - internal Filter Filter { get; set; } - - internal void StartCustomQuery() - { - if ( ServerList == null ) - return; - - int blockSize = 16; - int Pointer = 0; - - while ( true ) - { - var sublist = ServerList.Skip( Pointer ).Take( blockSize ); - - if ( sublist.Count() == 0 ) - break; - - Pointer += sublist.Count(); - - var filter = new Filter(); - filter.Add( "or", sublist.Count().ToString() ); - - foreach ( var server in sublist ) - { - filter.Add( "gameaddr", server ); - } - - filter.Start(); - var id = client.native.servers.RequestInternetServerList( client.AppId, filter.NativeArray, (uint)filter.Count, IntPtr.Zero ); - filter.Free(); - - AddRequest( id ); - } - - ServerList = null; - } - - internal void AddRequest( IntPtr id ) - { - Requests.Add( new SubRequest() { Request = id } ); - } - - private void Update() - { - if ( Requests.Count == 0 ) - return; - - for( int i=0; i< Requests.Count(); i++ ) - { - if ( Requests[i].Update( client.native.servers, OnServer, OnUpdate ) ) - { - Requests.RemoveAt( i ); - i--; - } - } - - if ( Requests.Count == 0 ) - { - Finished = true; - client.OnUpdate -= Update; - - OnFinished?.Invoke(); - } - } - - private void OnServer( SteamNative.gameserveritem_t info ) - { - if ( info.HadSuccessfulResponse ) - { - if ( Filter != null && !Filter.Test( info ) ) - return; - - var s = Server.FromSteam( client, info ); - Responded.Add( s ); - - OnServerResponded?.Invoke( s ); - } - else - { - Unresponsive.Add( Server.FromSteam( client, info ) ); - } - - } - - /// - /// Disposing will end the query - /// - public void Dispose() - { - if ( client.IsValid ) - client.OnUpdate -= Update; - - // - // Cancel the query if it's still running - // - foreach( var subRequest in Requests ) - { - if ( client.IsValid ) - client.native.servers.CancelQuery( subRequest.Request ); - } - Requests.Clear(); - - } - - } - } -} diff --git a/Facepunch.Steamworks/Client/ServerList.Server.cs b/Facepunch.Steamworks/Client/ServerList.Server.cs deleted file mode 100644 index fbe10b8..0000000 --- a/Facepunch.Steamworks/Client/ServerList.Server.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class ServerList - { - public class Server - { - public string Name { get; set; } - public int Ping { get; set; } - public string GameDir { get; set; } - public string Map { get; set; } - public string Description { get; set; } - public uint AppId { get; set; } - public int Players { get; set; } - public int MaxPlayers { get; set; } - public int BotPlayers { get; set; } - public bool Passworded { get; set; } - public bool Secure { get; set; } - public uint LastTimePlayed { get; set; } - public int Version { get; set; } - public string[] Tags { get; set; } - public ulong SteamId { get; set; } - public IPAddress Address { get; set; } - public int ConnectionPort { get; set; } - public int QueryPort { get; set; } - - /// - /// Returns true if this server is in the favourites list - /// - public bool Favourite - { - get - { - return Client.ServerList.IsFavourite( this ); - } - } - - internal Client Client; - - - internal static Server FromSteam( Client client, SteamNative.gameserveritem_t item ) - { - return new Server() - { - Client = client, - Address = Utility.Int32ToIp( item.NetAdr.IP ), - ConnectionPort = item.NetAdr.ConnectionPort, - QueryPort = item.NetAdr.QueryPort, - Name = item.ServerName, - Ping = item.Ping, - GameDir = item.GameDir, - Map = item.Map, - Description = item.GameDescription, - AppId = item.AppID, - Players = item.Players, - MaxPlayers = item.MaxPlayers, - BotPlayers = item.BotPlayers, - Passworded = item.Password, - Secure = item.Secure, - LastTimePlayed = item.TimeLastPlayed, - Version = item.ServerVersion, - Tags = item.GameTags == null ? null : item.GameTags.Split( ',' ), - SteamId = item.SteamID - }; - } - - /// - /// Callback when rules are receieved. - /// The bool is true if server responded properly. - /// - public Action OnReceivedRules; - - /// - /// List of server rules. Use HasRules to see if this is safe to access. - /// - public Dictionary Rules; - - /// - /// Returns true if this server has rules - /// - public bool HasRules { get { return Rules != null && Rules.Count > 0; } } - - internal SourceServerQuery RulesRequest; - - /// - /// Populates Rules for this server - /// - public void FetchRules() - { - if ( RulesRequest != null ) - return; - - Rules = null; - RulesRequest = new SourceServerQuery( this, Address, QueryPort ); - } - - internal void OnServerRulesReceiveFinished( Dictionary rules, bool Success ) - { - RulesRequest = null; - - if ( Success ) - { - Rules = rules; - } - - if ( OnReceivedRules != null ) - { - OnReceivedRules( Success ); - } - } - - internal const uint k_unFavoriteFlagNone = 0x00; - internal const uint k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list - internal const uint k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list - - /// - /// Add this server to our history list - /// If we're already in the history list, weill set the last played time to now - /// - public void AddToHistory() - { - Client.native.matchmaking.AddFavoriteGame( AppId, Utility.IpToInt32( Address ), (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory, (uint)Utility.Epoch.Current ); - Client.ServerList.UpdateFavouriteList(); - } - - /// - /// Remove this server from our history list - /// - public void RemoveFromHistory() - { - Client.native.matchmaking.RemoveFavoriteGame( AppId, Utility.IpToInt32( Address ), (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory ); - Client.ServerList.UpdateFavouriteList(); - } - - /// - /// Add this server to our favourite list - /// - public void AddToFavourites() - { - Client.native.matchmaking.AddFavoriteGame( AppId, Utility.IpToInt32( Address ), (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite, (uint)Utility.Epoch.Current ); - Client.ServerList.UpdateFavouriteList(); - } - - /// - /// Remove this server from our favourite list - /// - public void RemoveFromFavourites() - { - Client.native.matchmaking.RemoveFavoriteGame( AppId, Utility.IpToInt32( Address ), (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite ); - Client.ServerList.UpdateFavouriteList(); - } - } - } -} diff --git a/Facepunch.Steamworks/Client/ServerList.cs b/Facepunch.Steamworks/Client/ServerList.cs deleted file mode 100644 index 407d98f..0000000 --- a/Facepunch.Steamworks/Client/ServerList.cs +++ /dev/null @@ -1,267 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class ServerList : IDisposable - { - internal Client client; - - internal ServerList( Client client ) - { - this.client = client; - - UpdateFavouriteList(); - } - - HashSet FavouriteHash = new HashSet(); - HashSet HistoryHash = new HashSet(); - - internal void UpdateFavouriteList() - { - FavouriteHash.Clear(); - HistoryHash.Clear(); - - for ( int i=0; i< client.native.matchmaking.GetFavoriteGameCount(); i++ ) - { - AppId_t appid = 0; - uint ip; - ushort conPort; - ushort queryPort; - uint lastplayed; - uint flags; - - client.native.matchmaking.GetFavoriteGame( i, ref appid, out ip, out conPort, out queryPort, out flags, out lastplayed ); - - ulong encoded = ip; - encoded = encoded << 32; - encoded = encoded | (uint)conPort; - - if ( ( flags & Server.k_unFavoriteFlagFavorite ) == Server.k_unFavoriteFlagFavorite ) - FavouriteHash.Add( encoded ); - - if ( ( flags & Server.k_unFavoriteFlagFavorite ) == Server.k_unFavoriteFlagFavorite ) - HistoryHash.Add( encoded ); - } - } - - public void Dispose() - { - client = null; - } - - public class Filter : List> - { - public void Add( string k, string v ) - { - Add( new KeyValuePair( k, v ) ); - } - - internal IntPtr NativeArray; - private IntPtr m_pArrayEntries; - - private int AppId = 0; - - internal void Start() - { - var filters = this.Select( x => - { - if ( x.Key == "appid" ) AppId = int.Parse( x.Value ); - - return new SteamNative.MatchMakingKeyValuePair_t() - { - Key = x.Key, - Value = x.Value - }; - } ).ToArray(); - - int sizeOfMMKVP = Marshal.SizeOf(typeof(SteamNative.MatchMakingKeyValuePair_t)); - NativeArray = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( IntPtr ) ) * filters.Length ); - m_pArrayEntries = Marshal.AllocHGlobal( sizeOfMMKVP * filters.Length ); - - for ( int i = 0; i < filters.Length; ++i ) - { - Marshal.StructureToPtr( filters[i], new IntPtr( m_pArrayEntries.ToInt64() + ( i * sizeOfMMKVP ) ), false ); - } - - Marshal.WriteIntPtr( NativeArray, m_pArrayEntries ); - } - - internal void Free() - { - if ( m_pArrayEntries != IntPtr.Zero ) - { - Marshal.FreeHGlobal( m_pArrayEntries ); - } - - if ( NativeArray != IntPtr.Zero ) - { - Marshal.FreeHGlobal( NativeArray ); - } - } - - internal bool Test( gameserveritem_t info ) - { - if ( AppId != 0 && AppId != info.AppID ) - return false; - - return true; - } - } - - - - [StructLayout( LayoutKind.Sequential )] - private struct MatchPair - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string key; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - public string value; - } - - - - public Request Internet( Filter filter = null ) - { - if ( filter == null ) - { - filter = new Filter(); - filter.Add( "appid", client.AppId.ToString() ); - } - - filter.Start(); - - var request = new Request( client ); - request.Filter = filter; - request.AddRequest( client.native.servers.RequestInternetServerList( client.AppId, filter.NativeArray, (uint) filter.Count, IntPtr.Zero ) ); - - filter.Free(); - - return request; - } - - /// - /// Query a list of addresses. No filters applied. - /// - public Request Custom( IEnumerable serverList ) - { - var request = new Request( client ); - request.ServerList = serverList; - request.StartCustomQuery(); - return request; - } - - /// - /// Request a list of servers we've been on. History isn't applied automatically - /// You need to call server.AddtoHistoryList() when you join a server etc. - /// - public Request History( Filter filter = null ) - { - if ( filter == null ) - { - filter = new Filter(); - filter.Add( "appid", client.AppId.ToString() ); - } - - filter.Start(); - - var request = new Request( client ); - request.Filter = filter; - request.AddRequest( client.native.servers.RequestHistoryServerList( client.AppId, filter.NativeArray, (uint)filter.Count, IntPtr.Zero ) ); - - filter.Free(); - - return request; - } - - /// - /// Request a list of servers we've favourited - /// - public Request Favourites( Filter filter = null ) - { - if ( filter == null ) - { - filter = new Filter(); - filter.Add( "appid", client.AppId.ToString() ); - } - - filter.Start(); - - var request = new Request( client ); - request.Filter = filter; - request.AddRequest( client.native.servers.RequestFavoritesServerList( client.AppId, filter.NativeArray, (uint)filter.Count, IntPtr.Zero ) ); - - filter.Free(); - - return request; - } - - /// - /// Request a list of servers that our friends are on - /// - public Request Friends( Filter filter = null ) - { - if ( filter == null ) - { - filter = new Filter(); - filter.Add( "appid", client.AppId.ToString() ); - } - - filter.Start(); - - var request = new Request( client ); - request.Filter = filter; - request.AddRequest( client.native.servers.RequestFriendsServerList( client.AppId, filter.NativeArray, (uint)filter.Count, IntPtr.Zero ) ); - - filter.Free(); - - return request; - } - - /// - /// Request a list of servers that are running on our LAN - /// - public Request Local( Filter filter = null ) - { - if ( filter == null ) - { - filter = new Filter(); - filter.Add( "appid", client.AppId.ToString() ); - } - - filter.Start(); - - var request = new Request( client ); - request.Filter = filter; - request.AddRequest( client.native.servers.RequestLANServerList( client.AppId, IntPtr.Zero ) ); - - filter.Free(); - - return request; - } - - - internal bool IsFavourite( Server server ) - { - ulong encoded = Utility.IpToInt32( server.Address ); - encoded = encoded << 32; - encoded = encoded | (uint)server.ConnectionPort; - - return FavouriteHash.Contains( encoded ); - } - - internal bool IsHistory( Server server ) - { - ulong encoded = Utility.IpToInt32( server.Address ); - encoded = encoded << 32; - encoded = encoded | (uint)server.ConnectionPort; - - return HistoryHash.Contains( encoded ); - } - } -} diff --git a/Facepunch.Steamworks/Client/Stats.cs b/Facepunch.Steamworks/Client/Stats.cs deleted file mode 100644 index ba77319..0000000 --- a/Facepunch.Steamworks/Client/Stats.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public class Stats : IDisposable - { - internal Client client; - - internal Stats( Client c ) - { - client = c; - } - - public bool StoreStats() - { - return client.native.userstats.StoreStats(); - } - - public void UpdateStats() - { - client.native.userstats.RequestCurrentStats(); - } - - public void UpdateGlobalStats( int days = 1 ) - { - client.native.userstats.GetNumberOfCurrentPlayers(); - client.native.userstats.RequestGlobalAchievementPercentages(); - client.native.userstats.RequestGlobalStats( days ); - } - - public int GetInt( string name ) - { - int data = 0; - client.native.userstats.GetStat( name, out data ); - return data; - } - - public long GetGlobalInt( string name ) - { - long data = 0; - client.native.userstats.GetGlobalStat( name, out data ); - return data; - } - - public float GetFloat( string name ) - { - float data = 0; - client.native.userstats.GetStat0( name, out data ); - return data; - } - - public double GetGlobalFloat( string name ) - { - double data = 0; - client.native.userstats.GetGlobalStat0( name, out data ); - return data; - } - - /// - /// Set a stat value. This will automatically call StoreStats() after a successful call - /// unless you pass false as the last argument. - /// - public bool Set( string name, int value, bool store = true ) - { - var r = client.native.userstats.SetStat( name, value ); - - if ( store ) - { - return r && client.native.userstats.StoreStats(); - } - - return r; - } - - /// - /// Set a stat value. This will automatically call StoreStats() after a successful call - /// unless you pass false as the last argument. - /// - public bool Set( string name, float value, bool store = true ) - { - var r = client.native.userstats.SetStat0( name, value ); - - if ( store ) - { - return r && client.native.userstats.StoreStats(); - } - - return r; - } - - /// - /// Adds this amount to the named stat. Internally this calls Get() and adds - /// to that value. Steam doesn't provide a mechanism for atomically increasing - /// stats like this, this functionality is added here as a convenience. - /// - public bool Add( string name, int amount = 1, bool store = true ) - { - var val = GetInt( name ); - val += amount; - return Set( name, val, store ); - } - - /// - /// Practically wipes the slate clean for this user. If includeAchievements is true, will wipe - /// any achievements too. - /// - /// - public bool ResetAll( bool includeAchievements ) - { - return client.native.userstats.ResetAllStats( includeAchievements ); - } - - public void Dispose() - { - client = null; - } - } -} diff --git a/Facepunch.Steamworks/Client/SteamFriend.cs b/Facepunch.Steamworks/Client/SteamFriend.cs deleted file mode 100644 index 91206dd..0000000 --- a/Facepunch.Steamworks/Client/SteamFriend.cs +++ /dev/null @@ -1,136 +0,0 @@ -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class SteamFriend - { - /// - /// Steam Id - /// - public ulong Id { get; internal set; } - - - /// - /// Return true if blocked - /// - public bool IsBlocked => relationship == FriendRelationship.Blocked; - - /// - /// Return true if is a friend. Returns false if blocked, request etc. - /// - public bool IsFriend => relationship == FriendRelationship.Friend; - - /// - /// Their current display name - /// - public string Name; - - /// - /// Returns true if this friend is online - /// - public bool IsOnline => personaState != PersonaState.Offline; - - /// - /// Returns true if this friend is marked as away - /// - public bool IsAway => personaState == PersonaState.Away; - - /// - /// Returns true if this friend is marked as busy - /// - public bool IsBusy => personaState == PersonaState.Busy; - - /// - /// Returns true if this friend is marked as snoozing - /// - public bool IsSnoozing => personaState == PersonaState.Snooze; - - /// - /// Returns true if this friend is online and playing this game - /// - public bool IsPlayingThisGame => CurrentAppId == Client.AppId; - - /// - /// Returns true if this friend is online and playing this game - /// - public bool IsPlaying => CurrentAppId != 0; - - /// - /// The AppId this guy is playing - /// - public ulong CurrentAppId { get; internal set; } - - public uint ServerIp { get; internal set; } - public int ServerGamePort { get; internal set; } - public int ServerQueryPort { get; internal set; } - public ulong ServerLobbyId { get; internal set; } - - internal Client Client { get; set; } - private PersonaState personaState; - private FriendRelationship relationship; - - /// - /// Returns null if the value doesn't exist - /// - public string GetRichPresence( string key ) - { - var val = Client.native.friends.GetFriendRichPresence( Id, key ); - if ( string.IsNullOrEmpty( val ) ) return null; - return val; - } - - /// - /// Update this friend, request the latest data from Steam's servers - /// - public void Refresh() - { - Name = Client.native.friends.GetFriendPersonaName( Id ); - - relationship = Client.native.friends.GetFriendRelationship( Id ); - personaState = Client.native.friends.GetFriendPersonaState( Id ); - - CurrentAppId = 0; - ServerIp = 0; - ServerGamePort = 0; - ServerQueryPort = 0; - ServerLobbyId = 0; - - var gameInfo = new SteamNative.FriendGameInfo_t(); - if ( Client.native.friends.GetFriendGamePlayed( Id, ref gameInfo ) && gameInfo.GameID > 0 ) - { - CurrentAppId = gameInfo.GameID; - ServerIp = gameInfo.GameIP; - ServerGamePort = gameInfo.GamePort; - ServerQueryPort = gameInfo.QueryPort; - ServerLobbyId = gameInfo.SteamIDLobby; - } - - Client.native.friends.RequestFriendRichPresence( Id ); - } - - /// - /// This will return null if you don't have the target user's avatar in your cache. - /// Which usually happens for people not on your friends list. - /// - public Image GetAvatar( Friends.AvatarSize size ) - { - return Client.Friends.GetCachedAvatar( size, Id ); - } - - /// - /// Invite this friend to the game that we are playing - /// - public bool InviteToGame(string Text) - { - return Client.native.friends.InviteUserToGame(Id, Text); - } - - /// - /// Sends a message to a Steam friend. Returns true if success - /// - public bool SendMessage( string message ) - { - return Client.native.friends.ReplyToFriendMessage( Id, message ); - } - } -} diff --git a/Facepunch.Steamworks/Client/User.cs b/Facepunch.Steamworks/Client/User.cs deleted file mode 100644 index daf3363..0000000 --- a/Facepunch.Steamworks/Client/User.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public class User : IDisposable - { - internal Client client; - internal Dictionary richPresence = new Dictionary(); - - internal User( Client c ) - { - client = c; - } - - public void Dispose() - { - client = null; - } - - public string GetRichPresence( string key ) - { - string val = null; - - if ( richPresence.TryGetValue( key, out val ) ) - return val; - - return null; - } - - public void SetRichPresence( string key, string value ) - { - richPresence[key] = value; - client.native.friends.SetRichPresence( key, value ); - } - - public void ClearRichPresence() - { - richPresence.Clear(); - client.native.friends.ClearRichPresence(); - } - } -} diff --git a/Facepunch.Steamworks/Client/Voice.cs b/Facepunch.Steamworks/Client/Voice.cs deleted file mode 100644 index fa0cf68..0000000 --- a/Facepunch.Steamworks/Client/Voice.cs +++ /dev/null @@ -1,182 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - public class Voice - { - const int ReadBufferSize = 1024 * 128; - - internal Client client; - - internal byte[] ReadCompressedBuffer = new byte[ReadBufferSize]; - internal byte[] ReadUncompressedBuffer = new byte[ReadBufferSize]; - - internal byte[] UncompressBuffer = new byte[1024 * 256]; - - public Action OnCompressedData; - public Action OnUncompressedData; - - private System.Diagnostics.Stopwatch UpdateTimer = System.Diagnostics.Stopwatch.StartNew(); - - /// - /// Returns the optimal sample rate for voice - according to Steam - /// - public uint OptimalSampleRate - { - get { return client.native.user.GetVoiceOptimalSampleRate(); } - } - - private bool _wantsrecording = false; - - - /// - /// If set to true we are listening to the mic. - /// You should usually toggle this with the press of a key for push to talk. - /// - public bool WantsRecording - { - get { return _wantsrecording; } - set - { - _wantsrecording = value; - - if ( value ) - { - client.native.user.StartVoiceRecording(); - } - else - { - client.native.user.StopVoiceRecording(); - } - } - } - - /// - /// The last time voice was detected, recorded - /// - public DateTime LastVoiceRecordTime { get; private set; } - - public TimeSpan TimeSinceLastVoiceRecord { get { return DateTime.Now.Subtract( LastVoiceRecordTime ); } } - - public bool IsRecording = false; - - /// - /// If set we will capture the audio at this rate. If unset (set to 0) will capture at OptimalSampleRate - /// - public uint DesiredSampleRate = 0; - - internal Voice( Client client ) - { - this.client = client; - } - - /// - /// This gets called inside Update - so there's no need to call this manually if you're calling update - /// - public unsafe void Update() - { - if ( OnCompressedData == null && OnUncompressedData == null ) - return; - - if ( UpdateTimer.Elapsed.TotalSeconds < 1.0f / 10.0f ) - return; - - UpdateTimer.Reset(); - UpdateTimer.Start(); - - uint bufferRegularLastWrite = 0; - uint bufferCompressedLastWrite = 0; - - var result = client.native.user.GetAvailableVoice( out bufferCompressedLastWrite, out bufferRegularLastWrite, DesiredSampleRate == 0 ? OptimalSampleRate : DesiredSampleRate ); - - if ( result == SteamNative.VoiceResult.NotRecording || result == SteamNative.VoiceResult.NotInitialized ) - { - IsRecording = false; - return; - } - - fixed (byte* compressedPtr = ReadCompressedBuffer) - fixed (byte* uncompressedPtr = ReadUncompressedBuffer) - { - result = client.native.user.GetVoice( OnCompressedData != null, (IntPtr) compressedPtr, ReadBufferSize, out bufferCompressedLastWrite, - OnUncompressedData != null, (IntPtr) uncompressedPtr, ReadBufferSize, out bufferRegularLastWrite, - DesiredSampleRate == 0 ? OptimalSampleRate : DesiredSampleRate ); - } - - IsRecording = true; - - if ( result == SteamNative.VoiceResult.OK ) - { - if ( OnCompressedData != null && bufferCompressedLastWrite > 0 ) - { - OnCompressedData( ReadCompressedBuffer, (int)bufferCompressedLastWrite ); - } - - if ( OnUncompressedData != null && bufferRegularLastWrite > 0 ) - { - OnUncompressedData( ReadUncompressedBuffer, (int)bufferRegularLastWrite ); - } - - LastVoiceRecordTime = DateTime.Now; - } - - if ( result == SteamNative.VoiceResult.NotRecording || - result == SteamNative.VoiceResult.NotInitialized ) - IsRecording = false; - - } - - public bool Decompress( byte[] input, MemoryStream output, uint samepleRate = 0 ) - { - return Decompress( input, 0, input.Length, output, samepleRate ); - } - - public bool Decompress( byte[] input, int inputsize, MemoryStream output, uint samepleRate = 0 ) - { - return Decompress( input, 0, inputsize, output, samepleRate ); - } - - public unsafe bool Decompress( byte[] input, int inputoffset, int inputsize, MemoryStream output, uint samepleRate = 0 ) - { - if ( inputoffset < 0 || inputoffset >= input.Length ) - throw new ArgumentOutOfRangeException( "inputoffset" ); - - if ( inputsize <= 0 || inputoffset + inputsize > input.Length ) - throw new ArgumentOutOfRangeException( "inputsize" ); - - fixed ( byte* p = input ) - { - return Decompress( (IntPtr)p, inputoffset, inputsize, output, samepleRate ); - } - } - - private unsafe bool Decompress( IntPtr input, int inputoffset, int inputsize, MemoryStream output, uint samepleRate = 0 ) - { - if ( samepleRate == 0 ) - samepleRate = OptimalSampleRate; - - uint bytesOut = 0; - - SteamNative.VoiceResult result = SteamNative.VoiceResult.NoData; - - fixed ( byte* outBuf = UncompressBuffer ) - { - result = client.native.user.DecompressVoice( (IntPtr)(((byte*)input) + inputoffset), (uint)inputsize, (IntPtr)outBuf, (uint)UncompressBuffer.Length, out bytesOut, samepleRate ); - } - - if ( result == SteamNative.VoiceResult.OK ) - { - output.Write( (byte[])UncompressBuffer, 0, (int)bytesOut ); - - return true; - } - - return false; - } - } -} diff --git a/Facepunch.Steamworks/Config.cs b/Facepunch.Steamworks/Config.cs deleted file mode 100644 index 8bf4f54..0000000 --- a/Facepunch.Steamworks/Config.cs +++ /dev/null @@ -1,74 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public static class Config - { - /// - /// Should be called before creating any interfaces, to configure Steam for Unity. - /// - /// Please pass in Application.platform.ToString() - public static void ForUnity( string platform ) - { - // - // Windows Config - // - if ( platform == "WindowsEditor" || platform == "WindowsPlayer" ) - { - ForcePlatform( OperatingSystem.Windows, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); - } - - if ( platform == "OSXEditor" || platform == "OSXPlayer" || platform == "OSXDashboardPlayer" ) - { - ForcePlatform( OperatingSystem.Osx, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); - } - - if ( platform == "LinuxPlayer" || platform == "LinuxEditor" ) - { - ForcePlatform( OperatingSystem.Linux, IntPtr.Size == 4 ? Architecture.x86 : Architecture.x64 ); - } - - IsUnity = true; - UseThisCall = true; - - Console.WriteLine( "Facepunch.Steamworks Unity: " + platform ); - Console.WriteLine( "Facepunch.Steamworks Os: " + SteamNative.Platform.Os ); - Console.WriteLine( "Facepunch.Steamworks Arch: " + SteamNative.Platform.Arch ); - - - } - - /// - /// Some platforms allow/need CallingConvention.ThisCall. If you're crashing with argument null - /// errors on certain platforms, try flipping this to true. - /// - /// I owe this logic to Riley Labrecque's hard work on Steamworks.net - I don't have the knowledge - /// or patience to find this shit on my own, so massive thanks to him. And also massive thanks to him - /// for releasing his shit open source under the MIT license so we can all learn and iterate. - /// - /// - public static bool UseThisCall { get; set; } = SteamNative.Platform.Os == OperatingSystem.Windows; - - - /// - /// Should be true if we're using Unity - /// - internal static bool IsUnity { get; set; } - - - /// - /// You can force the platform to a particular one here. - /// This is useful if you're on OSX because some versions of mono don't have a way - /// to tell which platform we're running - /// - public static void ForcePlatform( Facepunch.Steamworks.OperatingSystem os, Facepunch.Steamworks.Architecture arch ) - { - SteamNative.Platform.Os = os; - SteamNative.Platform.Arch = arch; - } - - } -} diff --git a/Facepunch.Steamworks/Enum/ConnectionState.cs b/Facepunch.Steamworks/Enum/ConnectionState.cs new file mode 100644 index 0000000..7b2b4ad --- /dev/null +++ b/Facepunch.Steamworks/Enum/ConnectionState.cs @@ -0,0 +1,107 @@ +namespace Steamworks.Data +{ + /// High level connection status + public enum ConnectionState + { + + /// Dummy value used to indicate an error condition in the API. + /// Specified connection doesn't exist or has already been closed. + None = 0, + + /// We are trying to establish whether peers can talk to each other, + /// whether they WANT to talk to each other, perform basic auth, + /// and exchange crypt keys. + /// + /// - For connections on the "client" side (initiated locally): + /// We're in the process of trying to establish a connection. + /// Depending on the connection type, we might not know who they are. + /// Note that it is not possible to tell if we are waiting on the + /// network to complete handshake packets, or for the application layer + /// to accept the connection. + /// + /// - For connections on the "server" side (accepted through listen socket): + /// We have completed some basic handshake and the client has presented + /// some proof of identity. The connection is ready to be accepted + /// using AcceptConnection(). + /// + /// In either case, any unreliable packets sent now are almost certain + /// to be dropped. Attempts to receive packets are guaranteed to fail. + /// You may send messages if the send mode allows for them to be queued. + /// but if you close the connection before the connection is actually + /// established, any queued messages will be discarded immediately. + /// (We will not attempt to flush the queue and confirm delivery to the + /// remote host, which ordinarily happens when a connection is closed.) + Connecting = 1, + + /// Some connection types use a back channel or trusted 3rd party + /// for earliest communication. If the server accepts the connection, + /// then these connections switch into the rendezvous state. During this + /// state, we still have not yet established an end-to-end route (through + /// the relay network), and so if you send any messages unreliable, they + /// are going to be discarded. + FindingRoute = 2, + + /// We've received communications from our peer (and we know + /// who they are) and are all good. If you close the connection now, + /// we will make our best effort to flush out any reliable sent data that + /// has not been acknowledged by the peer. (But note that this happens + /// from within the application process, so unlike a TCP connection, you are + /// not totally handing it off to the operating system to deal with it.) + Connected = 3, + + /// Connection has been closed by our peer, but not closed locally. + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. If there are any messages in the inbound queue, + /// you may retrieve them. Otherwise, nothing may be done with the connection + /// except to close it. + /// + /// This stats is similar to CLOSE_WAIT in the TCP state machine. + ClosedByPeer = 4, + + /// A disruption in the connection has been detected locally. (E.g. timeout, + /// local internet connection disrupted, etc.) + /// + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. + /// + /// Attempts to send further messages will fail. Any remaining received messages + /// in the queue are available. + ProblemDetectedLocally = 5, + + // + // The following values are used internally and will not be returned by any API. + // We document them here to provide a little insight into the state machine that is used + // under the hood. + // + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. All reliable data has been flushed, or else + /// we've given up and discarded it. We do not yet know for sure that the peer knows + /// the connection has been closed, however, so we're just hanging around so that if we do + /// get a packet from them, we can send them the appropriate packets so that they can + /// know why the connection was closed (and not have to rely on a timeout, which makes + /// it appear as if something is wrong). + FinWait = -1, + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. From a network perspective, however, on the wire, + /// we have not yet given any indication to the peer that the connection is closed. + /// We are in the process of flushing out the last bit of reliable data. Once that is done, + /// we will inform the peer that the connection has been closed, and transition to the + /// FinWait state. + /// + /// Note that no indication is given to the remote host that we have closed the connection, + /// until the data has been flushed. If the remote host attempts to send us data, we will + /// do whatever is necessary to keep the connection alive until it can be closed properly. + /// But in fact the data will be discarded, since there is no way for the application to + /// read it back. Typically this is not a problem, as application protocols that utilize + /// the lingering functionality are designed for the remote host to wait for the response + /// before sending any more data. + Linger = -2, + + /// Connection is completely inactive and ready to be destroyed + Dead = -3, + + Force32Bit = 0x7fffffff + }; +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Enum/DebugOutputType.cs b/Facepunch.Steamworks/Enum/DebugOutputType.cs new file mode 100644 index 0000000..5f36bbd --- /dev/null +++ b/Facepunch.Steamworks/Enum/DebugOutputType.cs @@ -0,0 +1,17 @@ +namespace Steamworks.Data +{ + enum DebugOutputType : int + { + None = 0, + Bug = 1, // You used the API incorrectly, or an internal error happened + Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) + Important = 3, // Nothing is wrong, but this is an important notification + Warning = 4, + Msg = 5, // Recommended amount + Verbose = 6, // Quite a bit + Debug = 7, // Practically everything + Everything = 8, // Wall of text, detailed packet contents breakdown, etc + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs b/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs new file mode 100644 index 0000000..6002297 --- /dev/null +++ b/Facepunch.Steamworks/Enum/LeaderboardDisplay.cs @@ -0,0 +1,20 @@ +namespace Steamworks.Data +{ + public enum LeaderboardDisplay : int + { + /// + /// The score is just a simple numerical value + /// + Numeric = 1, + + /// + /// The score represents a time, in seconds + /// + TimeSeconds = 2, + + /// + /// The score represents a time, in milliseconds + /// + TimeMilliSeconds = 3, + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Enum/LeaderboardSort.cs b/Facepunch.Steamworks/Enum/LeaderboardSort.cs new file mode 100644 index 0000000..4826965 --- /dev/null +++ b/Facepunch.Steamworks/Enum/LeaderboardSort.cs @@ -0,0 +1,15 @@ +namespace Steamworks.Data +{ + public enum LeaderboardSort : int + { + /// + /// The top-score is the lowest number + /// + Ascending = 1, + + /// + /// The top-score is the highest number + /// + Descending = 2, + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Enum/NetConfig.cs b/Facepunch.Steamworks/Enum/NetConfig.cs new file mode 100644 index 0000000..c45fd64 --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfig.cs @@ -0,0 +1,57 @@ +namespace Steamworks.Data +{ + internal enum NetConfig : int + { + Invalid = 0, + FakePacketLoss_Send = 2, + FakePacketLoss_Recv = 3, + FakePacketLag_Send = 4, + FakePacketLag_Recv = 5, + + FakePacketReorder_Send = 6, + FakePacketReorder_Recv = 7, + + FakePacketReorder_Time = 8, + + FakePacketDup_Send = 26, + FakePacketDup_Recv = 27, + + FakePacketDup_TimeMax = 28, + + TimeoutInitial = 24, + + TimeoutConnected = 25, + + SendBufferSize = 9, + + SendRateMin = 10, + SendRateMax = 11, + + NagleTime = 12, + + IP_AllowWithoutAuth = 23, + + SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + + SDRClient_ConsecutitivePingTimeoutsFail = 20, + + SDRClient_MinPingsBeforePingAccurate = 21, + + SDRClient_SingleSocket = 22, + + SDRClient_ForceRelayCluster = 29, + + SDRClient_DebugTicketAddress = 30, + + SDRClient_ForceProxyAddr = 31, + + LogLevel_AckRTT = 13, + LogLevel_PacketDecode = 14, + LogLevel_Message = 15, + LogLevel_PacketGaps = 16, + LogLevel_P2PRendezvous = 17, + LogLevel_SDRRelayPings = 18, + + Force32Bit = 0x7fffffff + } +} diff --git a/Facepunch.Steamworks/Enum/NetConfigResult.cs b/Facepunch.Steamworks/Enum/NetConfigResult.cs new file mode 100644 index 0000000..8f8c6a2 --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfigResult.cs @@ -0,0 +1,13 @@ +namespace Steamworks.Data +{ + enum NetConfigResult + { + BadValue = -1, // No such configuration value + BadScopeObj = -2, // Bad connection handle, etc + BufferTooSmall = -3, // Couldn't fit the result in your buffer + OK = 1, + OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/NetConfigType.cs b/Facepunch.Steamworks/Enum/NetConfigType.cs new file mode 100644 index 0000000..7e7b60d --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetConfigType.cs @@ -0,0 +1,13 @@ +namespace Steamworks.Data +{ + enum NetConfigType + { + Int32 = 1, + Int64 = 2, + Float = 3, + String = 4, + FunctionPtr = 5, // NOTE: When setting callbacks, you should put the pointer into a variable and pass a pointer to that variable. + + Force32Bit = 0x7fffffff + }; +} diff --git a/Facepunch.Steamworks/Enum/NetScope.cs b/Facepunch.Steamworks/Enum/NetScope.cs new file mode 100644 index 0000000..4d03d5b --- /dev/null +++ b/Facepunch.Steamworks/Enum/NetScope.cs @@ -0,0 +1,12 @@ +namespace Steamworks.Data +{ + internal enum NetScope : int + { + Global = 1, + SocketsInterface = 2, + ListenSocket = 3, + Connection = 4, + + Force32Bit = 0x7fffffff + } +} diff --git a/Facepunch.Steamworks/Enum/SendType.cs b/Facepunch.Steamworks/Enum/SendType.cs new file mode 100644 index 0000000..1767532 --- /dev/null +++ b/Facepunch.Steamworks/Enum/SendType.cs @@ -0,0 +1,42 @@ +using System; + +namespace Steamworks.Data +{ + [Flags] + public enum SendType : int + { + /// + /// Send the message unreliably. Can be lost. Messages *can* be larger than a + /// single MTU (UDP packet), but there is no retransmission, so if any piece + /// of the message is lost, the entire message will be dropped. + /// + /// The sending API does have some knowledge of the underlying connection, so + /// if there is no NAT-traversal accomplished or there is a recognized adjustment + /// happening on the connection, the packet will be batched until the connection + /// is open again. + /// + Unreliable = 0, + + /// + /// Disable Nagle's algorithm. + /// By default, Nagle's algorithm is applied to all outbound messages. This means + /// that the message will NOT be sent immediately, in case further messages are + /// sent soon after you send this, which can be grouped together. Any time there + /// is enough buffered data to fill a packet, the packets will be pushed out immediately, + /// but partially-full packets not be sent until the Nagle timer expires. + /// + NoNagle = 1 << 0, + + /// + /// If the message cannot be sent very soon (because the connection is still doing some initial + /// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable + /// messages. Using this flag on reliable messages is invalid. + /// + NoDelay = 1 << 2, + + /// Reliable message send. Can send up to 0.5mb in a single message. + /// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for + /// efficient sends of large chunks of data. + Reliable = 1 << 3 + } +} diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj new file mode 100644 index 0000000..e0ef778 --- /dev/null +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj @@ -0,0 +1,16 @@ + + + + Facepunch.Steamworks.Posix32 + $(DefineConstants);PLATFORM_POSIX32;PLATFORM_POSIX;PLATFORM_32 + netstandard2.0;net46 + true + 7.1 + true + false + Steamworks + + + + + diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj new file mode 100644 index 0000000..df8fd32 --- /dev/null +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj @@ -0,0 +1,16 @@ + + + + Facepunch.Steamworks.Posix64 + $(DefineConstants);PLATFORM_POSIX64;PLATFORM_POSIX;PLATFORM_64 + netstandard2.0;net46 + true + 7.1 + true + false + Steamworks + + + + + diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj new file mode 100644 index 0000000..ce68aa0 --- /dev/null +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj @@ -0,0 +1,22 @@ + + + + Facepunch.Steamworks.Win32 + $(DefineConstants);PLATFORM_WIN32;PLATFORM_WIN;PLATFORM_32 + netstandard2.0;net46 + true + 7.1 + true + true + Steamworks + + + + + Always + + + + + + \ No newline at end of file diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj new file mode 100644 index 0000000..bcfe00c --- /dev/null +++ b/Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj @@ -0,0 +1,36 @@ + + + + Facepunch.Steamworks.Win64 + $(DefineConstants);PLATFORM_WIN64;PLATFORM_WIN;PLATFORM_64 + netstandard2.0;net46 + true + 7.1 + true + false + + + + + Always + + + + + C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client + Garry Newman + Facepunch.Steamworks + Another fucking c# Steamworks implementation + https://github.com/Facepunch/Facepunch.Steamworks + https://files.facepunch.com/garry/c5edce1c-0c21-4c5d-95b6-37743be7455d.jpg + facepunch;steam;unity;steamworks;valve + 2.2.0 + latest + MIT + https://github.com/Facepunch/Facepunch.Steamworks.git + git + + + + + diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.csproj b/Facepunch.Steamworks/Facepunch.Steamworks.csproj deleted file mode 100644 index e72ed9e..0000000 --- a/Facepunch.Steamworks/Facepunch.Steamworks.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - netstandard2.0;net45;net35;net40 - true - Facepunch.Steamworks - - true - false - true - - - - - TRACE;DEBUG - 1701;1702;1705;618;1591 - - - - TRACE;RELEASE - 1701;1702;1705;618;1591 - - - - $(DefineConstants);NET_CORE - - - - - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v3.5\Profile\Client - - - - C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\Profile\Client - Garry Newman - Facepunch.Steamworks - https://github.com/Facepunch/Facepunch.Steamworks - https://github.com/Facepunch/Facepunch.Steamworks/blob/master/LICENSE - https://avatars2.githubusercontent.com/u/3371040 - facepunch;steam;unity;steamworks;valve - 0.7.5 - - - - full - true - - - diff --git a/Facepunch.Steamworks/Facepunch.Steamworks.targets b/Facepunch.Steamworks/Facepunch.Steamworks.targets new file mode 100644 index 0000000..d463e4f --- /dev/null +++ b/Facepunch.Steamworks/Facepunch.Steamworks.targets @@ -0,0 +1,36 @@ + + + + PackageReference + true + + + + $(DefineConstants);TRACE;DEBUG + 1701;1702;1705;618;1591 + + + + $(DefineConstants);TRACE;RELEASE + 1701;1702;1705;618;1591 + + + + $(DefineConstants);NET_CORE + + + + full + true + + + + + + + + + + + + diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs new file mode 100644 index 0000000..af26303 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamApps.cs @@ -0,0 +1,443 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamApps : SteamInterface + { + public override string InterfaceName => "STEAMAPPS_INTERFACE_VERSION008"; + + public override void InitInternals() + { + _BIsSubscribed = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _BIsLowViolence = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _BIsCybercafe = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _BIsVACBanned = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetCurrentGameLanguage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetAvailableGameLanguages = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _BIsSubscribedApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _BIsDlcInstalled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetEarliestPurchaseUnixTime = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _BIsSubscribedFromFreeWeekend = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetDLCCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _BGetDLCDataByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _InstallDLC = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _UninstallDLC = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _RequestAppProofOfPurchaseKey = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetCurrentBetaName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _MarkContentCorrupt = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetInstalledDepots = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetAppInstallDir = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _BIsAppInstalled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetAppOwner = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetLaunchQueryParam = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetDlcDownloadProgress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _GetAppBuildId = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _RequestAllProofOfPurchaseKeys = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _GetFileDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _GetLaunchCommandLine = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _BIsSubscribedFromFamilySharing = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _BIsSubscribed = null; + _BIsLowViolence = null; + _BIsCybercafe = null; + _BIsVACBanned = null; + _GetCurrentGameLanguage = null; + _GetAvailableGameLanguages = null; + _BIsSubscribedApp = null; + _BIsDlcInstalled = null; + _GetEarliestPurchaseUnixTime = null; + _BIsSubscribedFromFreeWeekend = null; + _GetDLCCount = null; + _BGetDLCDataByIndex = null; + _InstallDLC = null; + _UninstallDLC = null; + _RequestAppProofOfPurchaseKey = null; + _GetCurrentBetaName = null; + _MarkContentCorrupt = null; + _GetInstalledDepots = null; + _GetAppInstallDir = null; + _BIsAppInstalled = null; + _GetAppOwner = null; + _GetLaunchQueryParam = null; + _GetDlcDownloadProgress = null; + _GetAppBuildId = null; + _RequestAllProofOfPurchaseKeys = null; + _GetFileDetails = null; + _GetLaunchCommandLine = null; + _BIsSubscribedFromFamilySharing = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsSubscribed( IntPtr self ); + private FBIsSubscribed _BIsSubscribed; + + #endregion + internal bool BIsSubscribed() + { + var returnValue = _BIsSubscribed( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsLowViolence( IntPtr self ); + private FBIsLowViolence _BIsLowViolence; + + #endregion + internal bool BIsLowViolence() + { + var returnValue = _BIsLowViolence( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsCybercafe( IntPtr self ); + private FBIsCybercafe _BIsCybercafe; + + #endregion + internal bool BIsCybercafe() + { + var returnValue = _BIsCybercafe( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsVACBanned( IntPtr self ); + private FBIsVACBanned _BIsVACBanned; + + #endregion + internal bool BIsVACBanned() + { + var returnValue = _BIsVACBanned( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetCurrentGameLanguage( IntPtr self ); + private FGetCurrentGameLanguage _GetCurrentGameLanguage; + + #endregion + internal string GetCurrentGameLanguage() + { + var returnValue = _GetCurrentGameLanguage( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetAvailableGameLanguages( IntPtr self ); + private FGetAvailableGameLanguages _GetAvailableGameLanguages; + + #endregion + internal string GetAvailableGameLanguages() + { + var returnValue = _GetAvailableGameLanguages( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsSubscribedApp( IntPtr self, AppId appID ); + private FBIsSubscribedApp _BIsSubscribedApp; + + #endregion + internal bool BIsSubscribedApp( AppId appID ) + { + var returnValue = _BIsSubscribedApp( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsDlcInstalled( IntPtr self, AppId appID ); + private FBIsDlcInstalled _BIsDlcInstalled; + + #endregion + internal bool BIsDlcInstalled( AppId appID ) + { + var returnValue = _BIsDlcInstalled( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetEarliestPurchaseUnixTime( IntPtr self, AppId nAppID ); + private FGetEarliestPurchaseUnixTime _GetEarliestPurchaseUnixTime; + + #endregion + internal uint GetEarliestPurchaseUnixTime( AppId nAppID ) + { + var returnValue = _GetEarliestPurchaseUnixTime( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsSubscribedFromFreeWeekend( IntPtr self ); + private FBIsSubscribedFromFreeWeekend _BIsSubscribedFromFreeWeekend; + + #endregion + internal bool BIsSubscribedFromFreeWeekend() + { + var returnValue = _BIsSubscribedFromFreeWeekend( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetDLCCount( IntPtr self ); + private FGetDLCCount _GetDLCCount; + + #endregion + internal int GetDLCCount() + { + var returnValue = _GetDLCCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBGetDLCDataByIndex( IntPtr self, int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, IntPtr pchName, int cchNameBufferSize ); + private FBGetDLCDataByIndex _BGetDLCDataByIndex; + + #endregion + internal bool BGetDLCDataByIndex( int iDLC, ref AppId pAppID, [MarshalAs( UnmanagedType.U1 )] ref bool pbAvailable, out string pchName ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _BGetDLCDataByIndex( Self, iDLC, ref pAppID, ref pbAvailable, mempchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FInstallDLC( IntPtr self, AppId nAppID ); + private FInstallDLC _InstallDLC; + + #endregion + internal void InstallDLC( AppId nAppID ) + { + _InstallDLC( Self, nAppID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FUninstallDLC( IntPtr self, AppId nAppID ); + private FUninstallDLC _UninstallDLC; + + #endregion + internal void UninstallDLC( AppId nAppID ) + { + _UninstallDLC( Self, nAppID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRequestAppProofOfPurchaseKey( IntPtr self, AppId nAppID ); + private FRequestAppProofOfPurchaseKey _RequestAppProofOfPurchaseKey; + + #endregion + internal void RequestAppProofOfPurchaseKey( AppId nAppID ) + { + _RequestAppProofOfPurchaseKey( Self, nAppID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetCurrentBetaName( IntPtr self, IntPtr pchName, int cchNameBufferSize ); + private FGetCurrentBetaName _GetCurrentBetaName; + + #endregion + internal bool GetCurrentBetaName( out string pchName ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetCurrentBetaName( Self, mempchName, (1024 * 32) ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FMarkContentCorrupt( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ); + private FMarkContentCorrupt _MarkContentCorrupt; + + #endregion + internal bool MarkContentCorrupt( [MarshalAs( UnmanagedType.U1 )] bool bMissingFilesOnly ) + { + var returnValue = _MarkContentCorrupt( Self, bMissingFilesOnly ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetInstalledDepots( IntPtr self, AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ); + private FGetInstalledDepots _GetInstalledDepots; + + #endregion + internal uint GetInstalledDepots( AppId appID, [In,Out] DepotId_t[] pvecDepots, uint cMaxDepots ) + { + var returnValue = _GetInstalledDepots( Self, appID, pvecDepots, cMaxDepots ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetAppInstallDir( IntPtr self, AppId appID, IntPtr pchFolder, uint cchFolderBufferSize ); + private FGetAppInstallDir _GetAppInstallDir; + + #endregion + internal uint GetAppInstallDir( AppId appID, out string pchFolder ) + { + IntPtr mempchFolder = Helpers.TakeMemory(); + var returnValue = _GetAppInstallDir( Self, appID, mempchFolder, (1024 * 32) ); + pchFolder = Helpers.MemoryToString( mempchFolder ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsAppInstalled( IntPtr self, AppId appID ); + private FBIsAppInstalled _BIsAppInstalled; + + #endregion + internal bool BIsAppInstalled( AppId appID ) + { + var returnValue = _BIsAppInstalled( Self, appID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetAppOwner( IntPtr self, ref SteamId retVal ); + #else + private delegate SteamId FGetAppOwner( IntPtr self ); + #endif + private FGetAppOwner _GetAppOwner; + + #endregion + internal SteamId GetAppOwner() + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetAppOwner( Self, ref retVal ); + return retVal; + #else + var returnValue = _GetAppOwner( Self ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetLaunchQueryParam( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FGetLaunchQueryParam _GetLaunchQueryParam; + + #endregion + internal string GetLaunchQueryParam( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLaunchQueryParam( Self, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetDlcDownloadProgress( IntPtr self, AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); + private FGetDlcDownloadProgress _GetDlcDownloadProgress; + + #endregion + internal bool GetDlcDownloadProgress( AppId nAppID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) + { + var returnValue = _GetDlcDownloadProgress( Self, nAppID, ref punBytesDownloaded, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetAppBuildId( IntPtr self ); + private FGetAppBuildId _GetAppBuildId; + + #endregion + internal int GetAppBuildId() + { + var returnValue = _GetAppBuildId( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRequestAllProofOfPurchaseKeys( IntPtr self ); + private FRequestAllProofOfPurchaseKeys _RequestAllProofOfPurchaseKeys; + + #endregion + internal void RequestAllProofOfPurchaseKeys() + { + _RequestAllProofOfPurchaseKeys( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetFileDetails( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ); + private FGetFileDetails _GetFileDetails; + + #endregion + internal async Task GetFileDetails( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFileName ) + { + var returnValue = _GetFileDetails( Self, pszFileName ); + return await FileDetailsResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLaunchCommandLine( IntPtr self, IntPtr pszCommandLine, int cubCommandLine ); + private FGetLaunchCommandLine _GetLaunchCommandLine; + + #endregion + internal int GetLaunchCommandLine( out string pszCommandLine ) + { + IntPtr mempszCommandLine = Helpers.TakeMemory(); + var returnValue = _GetLaunchCommandLine( Self, mempszCommandLine, (1024 * 32) ); + pszCommandLine = Helpers.MemoryToString( mempszCommandLine ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsSubscribedFromFamilySharing( IntPtr self ); + private FBIsSubscribedFromFamilySharing _BIsSubscribedFromFamilySharing; + + #endregion + internal bool BIsSubscribedFromFamilySharing() + { + var returnValue = _BIsSubscribedFromFamilySharing( Self ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs new file mode 100644 index 0000000..d0cf691 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamFriends.cs @@ -0,0 +1,1123 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamFriends : SteamInterface + { + public override string InterfaceName => "SteamFriends017"; + + public override void InitInternals() + { + _GetPersonaName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _SetPersonaName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetPersonaState = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetFriendCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetFriendByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetFriendRelationship = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetFriendPersonaState = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetFriendPersonaName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetFriendGamePlayed = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetFriendPersonaNameHistory = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetFriendSteamLevel = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetPlayerNickname = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetFriendsGroupCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _GetFriendsGroupIDByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _GetFriendsGroupName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetFriendsGroupMembersCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _GetFriendsGroupMembersList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _HasFriend = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetClanCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetClanByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetClanName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetClanTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetClanActivityCounts = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _DownloadClanActivityCounts = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _GetFriendCountFromSource = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _GetFriendFromSourceByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _IsUserInSource = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _SetInGameVoiceSpeaking = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _ActivateGameOverlay = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _ActivateGameOverlayToUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _ActivateGameOverlayToWebPage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _ActivateGameOverlayToStore = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _SetPlayedWith = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _ActivateGameOverlayInviteDialog = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _GetSmallFriendAvatar = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _GetMediumFriendAvatar = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _GetLargeFriendAvatar = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + _RequestUserInformation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 296 ) ) ); + _RequestClanOfficerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 304 ) ) ); + _GetClanOwner = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 312 ) ) ); + _GetClanOfficerCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 320 ) ) ); + _GetClanOfficerByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 328 ) ) ); + _GetUserRestrictions = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 336 ) ) ); + _SetRichPresence = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 344 ) ) ); + _ClearRichPresence = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 352 ) ) ); + _GetFriendRichPresence = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 360 ) ) ); + _GetFriendRichPresenceKeyCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 368 ) ) ); + _GetFriendRichPresenceKeyByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 376 ) ) ); + _RequestFriendRichPresence = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 384 ) ) ); + _InviteUserToGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 392 ) ) ); + _GetCoplayFriendCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 400 ) ) ); + _GetCoplayFriend = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 408 ) ) ); + _GetFriendCoplayTime = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 416 ) ) ); + _GetFriendCoplayGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 424 ) ) ); + _JoinClanChatRoom = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 432 ) ) ); + _LeaveClanChatRoom = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 440 ) ) ); + _GetClanChatMemberCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 448 ) ) ); + _GetChatMemberByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 456 ) ) ); + _SendClanChatMessage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 464 ) ) ); + _GetClanChatMessage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 472 ) ) ); + _IsClanChatAdmin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 480 ) ) ); + _IsClanChatWindowOpenInSteam = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 488 ) ) ); + _OpenClanChatWindowInSteam = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 496 ) ) ); + _CloseClanChatWindowInSteam = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 504 ) ) ); + _SetListenForFriendsMessages = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 512 ) ) ); + _ReplyToFriendMessage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 520 ) ) ); + _GetFriendMessage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 528 ) ) ); + _GetFollowerCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 536 ) ) ); + _IsFollowing = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 544 ) ) ); + _EnumerateFollowingList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 552 ) ) ); + _IsClanPublic = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 560 ) ) ); + _IsClanOfficialGameGroup = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 568 ) ) ); + _GetNumChatsWithUnreadPriorityMessages = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 576 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetPersonaName = null; + _SetPersonaName = null; + _GetPersonaState = null; + _GetFriendCount = null; + _GetFriendByIndex = null; + _GetFriendRelationship = null; + _GetFriendPersonaState = null; + _GetFriendPersonaName = null; + _GetFriendGamePlayed = null; + _GetFriendPersonaNameHistory = null; + _GetFriendSteamLevel = null; + _GetPlayerNickname = null; + _GetFriendsGroupCount = null; + _GetFriendsGroupIDByIndex = null; + _GetFriendsGroupName = null; + _GetFriendsGroupMembersCount = null; + _GetFriendsGroupMembersList = null; + _HasFriend = null; + _GetClanCount = null; + _GetClanByIndex = null; + _GetClanName = null; + _GetClanTag = null; + _GetClanActivityCounts = null; + _DownloadClanActivityCounts = null; + _GetFriendCountFromSource = null; + _GetFriendFromSourceByIndex = null; + _IsUserInSource = null; + _SetInGameVoiceSpeaking = null; + _ActivateGameOverlay = null; + _ActivateGameOverlayToUser = null; + _ActivateGameOverlayToWebPage = null; + _ActivateGameOverlayToStore = null; + _SetPlayedWith = null; + _ActivateGameOverlayInviteDialog = null; + _GetSmallFriendAvatar = null; + _GetMediumFriendAvatar = null; + _GetLargeFriendAvatar = null; + _RequestUserInformation = null; + _RequestClanOfficerList = null; + _GetClanOwner = null; + _GetClanOfficerCount = null; + _GetClanOfficerByIndex = null; + _GetUserRestrictions = null; + _SetRichPresence = null; + _ClearRichPresence = null; + _GetFriendRichPresence = null; + _GetFriendRichPresenceKeyCount = null; + _GetFriendRichPresenceKeyByIndex = null; + _RequestFriendRichPresence = null; + _InviteUserToGame = null; + _GetCoplayFriendCount = null; + _GetCoplayFriend = null; + _GetFriendCoplayTime = null; + _GetFriendCoplayGame = null; + _JoinClanChatRoom = null; + _LeaveClanChatRoom = null; + _GetClanChatMemberCount = null; + _GetChatMemberByIndex = null; + _SendClanChatMessage = null; + _GetClanChatMessage = null; + _IsClanChatAdmin = null; + _IsClanChatWindowOpenInSteam = null; + _OpenClanChatWindowInSteam = null; + _CloseClanChatWindowInSteam = null; + _SetListenForFriendsMessages = null; + _ReplyToFriendMessage = null; + _GetFriendMessage = null; + _GetFollowerCount = null; + _IsFollowing = null; + _EnumerateFollowingList = null; + _IsClanPublic = null; + _IsClanOfficialGameGroup = null; + _GetNumChatsWithUnreadPriorityMessages = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetPersonaName( IntPtr self ); + private FGetPersonaName _GetPersonaName; + + #endregion + internal string GetPersonaName() + { + var returnValue = _GetPersonaName( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FSetPersonaName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ); + private FSetPersonaName _SetPersonaName; + + #endregion + internal async Task SetPersonaName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPersonaName ) + { + var returnValue = _SetPersonaName( Self, pchPersonaName ); + return await SetPersonaNameResponse_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate FriendState FGetPersonaState( IntPtr self ); + private FGetPersonaState _GetPersonaState; + + #endregion + internal FriendState GetPersonaState() + { + var returnValue = _GetPersonaState( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendCount( IntPtr self, int iFriendFlags ); + private FGetFriendCount _GetFriendCount; + + #endregion + internal int GetFriendCount( int iFriendFlags ) + { + var returnValue = _GetFriendCount( Self, iFriendFlags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetFriendByIndex( IntPtr self, ref SteamId retVal, int iFriend, int iFriendFlags ); + #else + private delegate SteamId FGetFriendByIndex( IntPtr self, int iFriend, int iFriendFlags ); + #endif + private FGetFriendByIndex _GetFriendByIndex; + + #endregion + internal SteamId GetFriendByIndex( int iFriend, int iFriendFlags ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetFriendByIndex( Self, ref retVal, iFriend, iFriendFlags ); + return retVal; + #else + var returnValue = _GetFriendByIndex( Self, iFriend, iFriendFlags ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Relationship FGetFriendRelationship( IntPtr self, SteamId steamIDFriend ); + private FGetFriendRelationship _GetFriendRelationship; + + #endregion + internal Relationship GetFriendRelationship( SteamId steamIDFriend ) + { + var returnValue = _GetFriendRelationship( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate FriendState FGetFriendPersonaState( IntPtr self, SteamId steamIDFriend ); + private FGetFriendPersonaState _GetFriendPersonaState; + + #endregion + internal FriendState GetFriendPersonaState( SteamId steamIDFriend ) + { + var returnValue = _GetFriendPersonaState( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFriendPersonaName( IntPtr self, SteamId steamIDFriend ); + private FGetFriendPersonaName _GetFriendPersonaName; + + #endregion + internal string GetFriendPersonaName( SteamId steamIDFriend ) + { + var returnValue = _GetFriendPersonaName( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetFriendGamePlayed( IntPtr self, SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ); + private FGetFriendGamePlayed _GetFriendGamePlayed; + + #endregion + internal bool GetFriendGamePlayed( SteamId steamIDFriend, ref FriendGameInfo_t pFriendGameInfo ) + { + var returnValue = _GetFriendGamePlayed( Self, steamIDFriend, ref pFriendGameInfo ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFriendPersonaNameHistory( IntPtr self, SteamId steamIDFriend, int iPersonaName ); + private FGetFriendPersonaNameHistory _GetFriendPersonaNameHistory; + + #endregion + internal string GetFriendPersonaNameHistory( SteamId steamIDFriend, int iPersonaName ) + { + var returnValue = _GetFriendPersonaNameHistory( Self, steamIDFriend, iPersonaName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendSteamLevel( IntPtr self, SteamId steamIDFriend ); + private FGetFriendSteamLevel _GetFriendSteamLevel; + + #endregion + internal int GetFriendSteamLevel( SteamId steamIDFriend ) + { + var returnValue = _GetFriendSteamLevel( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetPlayerNickname( IntPtr self, SteamId steamIDPlayer ); + private FGetPlayerNickname _GetPlayerNickname; + + #endregion + internal string GetPlayerNickname( SteamId steamIDPlayer ) + { + var returnValue = _GetPlayerNickname( Self, steamIDPlayer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendsGroupCount( IntPtr self ); + private FGetFriendsGroupCount _GetFriendsGroupCount; + + #endregion + internal int GetFriendsGroupCount() + { + var returnValue = _GetFriendsGroupCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate FriendsGroupID_t FGetFriendsGroupIDByIndex( IntPtr self, int iFG ); + private FGetFriendsGroupIDByIndex _GetFriendsGroupIDByIndex; + + #endregion + internal FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG ) + { + var returnValue = _GetFriendsGroupIDByIndex( Self, iFG ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFriendsGroupName( IntPtr self, FriendsGroupID_t friendsGroupID ); + private FGetFriendsGroupName _GetFriendsGroupName; + + #endregion + internal string GetFriendsGroupName( FriendsGroupID_t friendsGroupID ) + { + var returnValue = _GetFriendsGroupName( Self, friendsGroupID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendsGroupMembersCount( IntPtr self, FriendsGroupID_t friendsGroupID ); + private FGetFriendsGroupMembersCount _GetFriendsGroupMembersCount; + + #endregion + internal int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) + { + var returnValue = _GetFriendsGroupMembersCount( Self, friendsGroupID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FGetFriendsGroupMembersList( IntPtr self, FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ); + private FGetFriendsGroupMembersList _GetFriendsGroupMembersList; + + #endregion + internal void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, [In,Out] SteamId[] pOutSteamIDMembers, int nMembersCount ) + { + _GetFriendsGroupMembersList( Self, friendsGroupID, pOutSteamIDMembers, nMembersCount ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FHasFriend( IntPtr self, SteamId steamIDFriend, int iFriendFlags ); + private FHasFriend _HasFriend; + + #endregion + internal bool HasFriend( SteamId steamIDFriend, int iFriendFlags ) + { + var returnValue = _HasFriend( Self, steamIDFriend, iFriendFlags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetClanCount( IntPtr self ); + private FGetClanCount _GetClanCount; + + #endregion + internal int GetClanCount() + { + var returnValue = _GetClanCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetClanByIndex( IntPtr self, ref SteamId retVal, int iClan ); + #else + private delegate SteamId FGetClanByIndex( IntPtr self, int iClan ); + #endif + private FGetClanByIndex _GetClanByIndex; + + #endregion + internal SteamId GetClanByIndex( int iClan ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetClanByIndex( Self, ref retVal, iClan ); + return retVal; + #else + var returnValue = _GetClanByIndex( Self, iClan ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetClanName( IntPtr self, SteamId steamIDClan ); + private FGetClanName _GetClanName; + + #endregion + internal string GetClanName( SteamId steamIDClan ) + { + var returnValue = _GetClanName( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetClanTag( IntPtr self, SteamId steamIDClan ); + private FGetClanTag _GetClanTag; + + #endregion + internal string GetClanTag( SteamId steamIDClan ) + { + var returnValue = _GetClanTag( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetClanActivityCounts( IntPtr self, SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ); + private FGetClanActivityCounts _GetClanActivityCounts; + + #endregion + internal bool GetClanActivityCounts( SteamId steamIDClan, ref int pnOnline, ref int pnInGame, ref int pnChatting ) + { + var returnValue = _GetClanActivityCounts( Self, steamIDClan, ref pnOnline, ref pnInGame, ref pnChatting ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FDownloadClanActivityCounts( IntPtr self, [In,Out] SteamId[] psteamIDClans, int cClansToRequest ); + private FDownloadClanActivityCounts _DownloadClanActivityCounts; + + #endregion + internal async Task DownloadClanActivityCounts( [In,Out] SteamId[] psteamIDClans, int cClansToRequest ) + { + var returnValue = _DownloadClanActivityCounts( Self, psteamIDClans, cClansToRequest ); + return await DownloadClanActivityCountsResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendCountFromSource( IntPtr self, SteamId steamIDSource ); + private FGetFriendCountFromSource _GetFriendCountFromSource; + + #endregion + internal int GetFriendCountFromSource( SteamId steamIDSource ) + { + var returnValue = _GetFriendCountFromSource( Self, steamIDSource ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetFriendFromSourceByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDSource, int iFriend ); + #else + private delegate SteamId FGetFriendFromSourceByIndex( IntPtr self, SteamId steamIDSource, int iFriend ); + #endif + private FGetFriendFromSourceByIndex _GetFriendFromSourceByIndex; + + #endregion + internal SteamId GetFriendFromSourceByIndex( SteamId steamIDSource, int iFriend ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetFriendFromSourceByIndex( Self, ref retVal, steamIDSource, iFriend ); + return retVal; + #else + var returnValue = _GetFriendFromSourceByIndex( Self, steamIDSource, iFriend ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsUserInSource( IntPtr self, SteamId steamIDUser, SteamId steamIDSource ); + private FIsUserInSource _IsUserInSource; + + #endregion + internal bool IsUserInSource( SteamId steamIDUser, SteamId steamIDSource ) + { + var returnValue = _IsUserInSource( Self, steamIDUser, steamIDSource ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetInGameVoiceSpeaking( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ); + private FSetInGameVoiceSpeaking _SetInGameVoiceSpeaking; + + #endregion + internal void SetInGameVoiceSpeaking( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bSpeaking ) + { + _SetInGameVoiceSpeaking( Self, steamIDUser, bSpeaking ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateGameOverlay( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ); + private FActivateGameOverlay _ActivateGameOverlay; + + #endregion + internal void ActivateGameOverlay( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog ) + { + _ActivateGameOverlay( Self, pchDialog ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateGameOverlayToUser( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ); + private FActivateGameOverlayToUser _ActivateGameOverlayToUser; + + #endregion + internal void ActivateGameOverlayToUser( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDialog, SteamId steamID ) + { + _ActivateGameOverlayToUser( Self, pchDialog, steamID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateGameOverlayToWebPage( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ); + private FActivateGameOverlayToWebPage _ActivateGameOverlayToWebPage; + + #endregion + internal void ActivateGameOverlayToWebPage( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchURL, ActivateGameOverlayToWebPageMode eMode ) + { + _ActivateGameOverlayToWebPage( Self, pchURL, eMode ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateGameOverlayToStore( IntPtr self, AppId nAppID, OverlayToStoreFlag eFlag ); + private FActivateGameOverlayToStore _ActivateGameOverlayToStore; + + #endregion + internal void ActivateGameOverlayToStore( AppId nAppID, OverlayToStoreFlag eFlag ) + { + _ActivateGameOverlayToStore( Self, nAppID, eFlag ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetPlayedWith( IntPtr self, SteamId steamIDUserPlayedWith ); + private FSetPlayedWith _SetPlayedWith; + + #endregion + internal void SetPlayedWith( SteamId steamIDUserPlayedWith ) + { + _SetPlayedWith( Self, steamIDUserPlayedWith ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateGameOverlayInviteDialog( IntPtr self, SteamId steamIDLobby ); + private FActivateGameOverlayInviteDialog _ActivateGameOverlayInviteDialog; + + #endregion + internal void ActivateGameOverlayInviteDialog( SteamId steamIDLobby ) + { + _ActivateGameOverlayInviteDialog( Self, steamIDLobby ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetSmallFriendAvatar( IntPtr self, SteamId steamIDFriend ); + private FGetSmallFriendAvatar _GetSmallFriendAvatar; + + #endregion + internal int GetSmallFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetSmallFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetMediumFriendAvatar( IntPtr self, SteamId steamIDFriend ); + private FGetMediumFriendAvatar _GetMediumFriendAvatar; + + #endregion + internal int GetMediumFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetMediumFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLargeFriendAvatar( IntPtr self, SteamId steamIDFriend ); + private FGetLargeFriendAvatar _GetLargeFriendAvatar; + + #endregion + internal int GetLargeFriendAvatar( SteamId steamIDFriend ) + { + var returnValue = _GetLargeFriendAvatar( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRequestUserInformation( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ); + private FRequestUserInformation _RequestUserInformation; + + #endregion + internal bool RequestUserInformation( SteamId steamIDUser, [MarshalAs( UnmanagedType.U1 )] bool bRequireNameOnly ) + { + var returnValue = _RequestUserInformation( Self, steamIDUser, bRequireNameOnly ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestClanOfficerList( IntPtr self, SteamId steamIDClan ); + private FRequestClanOfficerList _RequestClanOfficerList; + + #endregion + internal async Task RequestClanOfficerList( SteamId steamIDClan ) + { + var returnValue = _RequestClanOfficerList( Self, steamIDClan ); + return await ClanOfficerListResponse_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetClanOwner( IntPtr self, ref SteamId retVal, SteamId steamIDClan ); + #else + private delegate SteamId FGetClanOwner( IntPtr self, SteamId steamIDClan ); + #endif + private FGetClanOwner _GetClanOwner; + + #endregion + internal SteamId GetClanOwner( SteamId steamIDClan ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetClanOwner( Self, ref retVal, steamIDClan ); + return retVal; + #else + var returnValue = _GetClanOwner( Self, steamIDClan ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetClanOfficerCount( IntPtr self, SteamId steamIDClan ); + private FGetClanOfficerCount _GetClanOfficerCount; + + #endregion + internal int GetClanOfficerCount( SteamId steamIDClan ) + { + var returnValue = _GetClanOfficerCount( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetClanOfficerByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iOfficer ); + #else + private delegate SteamId FGetClanOfficerByIndex( IntPtr self, SteamId steamIDClan, int iOfficer ); + #endif + private FGetClanOfficerByIndex _GetClanOfficerByIndex; + + #endregion + internal SteamId GetClanOfficerByIndex( SteamId steamIDClan, int iOfficer ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetClanOfficerByIndex( Self, ref retVal, steamIDClan, iOfficer ); + return retVal; + #else + var returnValue = _GetClanOfficerByIndex( Self, steamIDClan, iOfficer ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetUserRestrictions( IntPtr self ); + private FGetUserRestrictions _GetUserRestrictions; + + #endregion + internal uint GetUserRestrictions() + { + var returnValue = _GetUserRestrictions( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetRichPresence( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private FSetRichPresence _SetRichPresence; + + #endregion + internal bool SetRichPresence( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _SetRichPresence( Self, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FClearRichPresence( IntPtr self ); + private FClearRichPresence _ClearRichPresence; + + #endregion + internal void ClearRichPresence() + { + _ClearRichPresence( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFriendRichPresence( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FGetFriendRichPresence _GetFriendRichPresence; + + #endregion + internal string GetFriendRichPresence( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetFriendRichPresence( Self, steamIDFriend, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendRichPresenceKeyCount( IntPtr self, SteamId steamIDFriend ); + private FGetFriendRichPresenceKeyCount _GetFriendRichPresenceKeyCount; + + #endregion + internal int GetFriendRichPresenceKeyCount( SteamId steamIDFriend ) + { + var returnValue = _GetFriendRichPresenceKeyCount( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFriendRichPresenceKeyByIndex( IntPtr self, SteamId steamIDFriend, int iKey ); + private FGetFriendRichPresenceKeyByIndex _GetFriendRichPresenceKeyByIndex; + + #endregion + internal string GetFriendRichPresenceKeyByIndex( SteamId steamIDFriend, int iKey ) + { + var returnValue = _GetFriendRichPresenceKeyByIndex( Self, steamIDFriend, iKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRequestFriendRichPresence( IntPtr self, SteamId steamIDFriend ); + private FRequestFriendRichPresence _RequestFriendRichPresence; + + #endregion + internal void RequestFriendRichPresence( SteamId steamIDFriend ) + { + _RequestFriendRichPresence( Self, steamIDFriend ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FInviteUserToGame( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ); + private FInviteUserToGame _InviteUserToGame; + + #endregion + internal bool InviteUserToGame( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString ) + { + var returnValue = _InviteUserToGame( Self, steamIDFriend, pchConnectString ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetCoplayFriendCount( IntPtr self ); + private FGetCoplayFriendCount _GetCoplayFriendCount; + + #endregion + internal int GetCoplayFriendCount() + { + var returnValue = _GetCoplayFriendCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetCoplayFriend( IntPtr self, ref SteamId retVal, int iCoplayFriend ); + #else + private delegate SteamId FGetCoplayFriend( IntPtr self, int iCoplayFriend ); + #endif + private FGetCoplayFriend _GetCoplayFriend; + + #endregion + internal SteamId GetCoplayFriend( int iCoplayFriend ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetCoplayFriend( Self, ref retVal, iCoplayFriend ); + return retVal; + #else + var returnValue = _GetCoplayFriend( Self, iCoplayFriend ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendCoplayTime( IntPtr self, SteamId steamIDFriend ); + private FGetFriendCoplayTime _GetFriendCoplayTime; + + #endregion + internal int GetFriendCoplayTime( SteamId steamIDFriend ) + { + var returnValue = _GetFriendCoplayTime( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate AppId FGetFriendCoplayGame( IntPtr self, SteamId steamIDFriend ); + private FGetFriendCoplayGame _GetFriendCoplayGame; + + #endregion + internal AppId GetFriendCoplayGame( SteamId steamIDFriend ) + { + var returnValue = _GetFriendCoplayGame( Self, steamIDFriend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FJoinClanChatRoom( IntPtr self, SteamId steamIDClan ); + private FJoinClanChatRoom _JoinClanChatRoom; + + #endregion + internal async Task JoinClanChatRoom( SteamId steamIDClan ) + { + var returnValue = _JoinClanChatRoom( Self, steamIDClan ); + return await JoinClanChatRoomCompletionResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FLeaveClanChatRoom( IntPtr self, SteamId steamIDClan ); + private FLeaveClanChatRoom _LeaveClanChatRoom; + + #endregion + internal bool LeaveClanChatRoom( SteamId steamIDClan ) + { + var returnValue = _LeaveClanChatRoom( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetClanChatMemberCount( IntPtr self, SteamId steamIDClan ); + private FGetClanChatMemberCount _GetClanChatMemberCount; + + #endregion + internal int GetClanChatMemberCount( SteamId steamIDClan ) + { + var returnValue = _GetClanChatMemberCount( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetChatMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDClan, int iUser ); + #else + private delegate SteamId FGetChatMemberByIndex( IntPtr self, SteamId steamIDClan, int iUser ); + #endif + private FGetChatMemberByIndex _GetChatMemberByIndex; + + #endregion + internal SteamId GetChatMemberByIndex( SteamId steamIDClan, int iUser ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetChatMemberByIndex( Self, ref retVal, steamIDClan, iUser ); + return retVal; + #else + var returnValue = _GetChatMemberByIndex( Self, steamIDClan, iUser ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSendClanChatMessage( IntPtr self, SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ); + private FSendClanChatMessage _SendClanChatMessage; + + #endregion + internal bool SendClanChatMessage( SteamId steamIDClanChat, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchText ) + { + var returnValue = _SendClanChatMessage( Self, steamIDClanChat, pchText ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetClanChatMessage( IntPtr self, SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ); + private FGetClanChatMessage _GetClanChatMessage; + + #endregion + internal int GetClanChatMessage( SteamId steamIDClanChat, int iMessage, IntPtr prgchText, int cchTextMax, ref ChatEntryType peChatEntryType, ref SteamId psteamidChatter ) + { + var returnValue = _GetClanChatMessage( Self, steamIDClanChat, iMessage, prgchText, cchTextMax, ref peChatEntryType, ref psteamidChatter ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsClanChatAdmin( IntPtr self, SteamId steamIDClanChat, SteamId steamIDUser ); + private FIsClanChatAdmin _IsClanChatAdmin; + + #endregion + internal bool IsClanChatAdmin( SteamId steamIDClanChat, SteamId steamIDUser ) + { + var returnValue = _IsClanChatAdmin( Self, steamIDClanChat, steamIDUser ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsClanChatWindowOpenInSteam( IntPtr self, SteamId steamIDClanChat ); + private FIsClanChatWindowOpenInSteam _IsClanChatWindowOpenInSteam; + + #endregion + internal bool IsClanChatWindowOpenInSteam( SteamId steamIDClanChat ) + { + var returnValue = _IsClanChatWindowOpenInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FOpenClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); + private FOpenClanChatWindowInSteam _OpenClanChatWindowInSteam; + + #endregion + internal bool OpenClanChatWindowInSteam( SteamId steamIDClanChat ) + { + var returnValue = _OpenClanChatWindowInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCloseClanChatWindowInSteam( IntPtr self, SteamId steamIDClanChat ); + private FCloseClanChatWindowInSteam _CloseClanChatWindowInSteam; + + #endregion + internal bool CloseClanChatWindowInSteam( SteamId steamIDClanChat ) + { + var returnValue = _CloseClanChatWindowInSteam( Self, steamIDClanChat ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetListenForFriendsMessages( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ); + private FSetListenForFriendsMessages _SetListenForFriendsMessages; + + #endregion + internal bool SetListenForFriendsMessages( [MarshalAs( UnmanagedType.U1 )] bool bInterceptEnabled ) + { + var returnValue = _SetListenForFriendsMessages( Self, bInterceptEnabled ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FReplyToFriendMessage( IntPtr self, SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ); + private FReplyToFriendMessage _ReplyToFriendMessage; + + #endregion + internal bool ReplyToFriendMessage( SteamId steamIDFriend, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMsgToSend ) + { + var returnValue = _ReplyToFriendMessage( Self, steamIDFriend, pchMsgToSend ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFriendMessage( IntPtr self, SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); + private FGetFriendMessage _GetFriendMessage; + + #endregion + internal int GetFriendMessage( SteamId steamIDFriend, int iMessageID, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) + { + var returnValue = _GetFriendMessage( Self, steamIDFriend, iMessageID, pvData, cubData, ref peChatEntryType ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetFollowerCount( IntPtr self, SteamId steamID ); + private FGetFollowerCount _GetFollowerCount; + + #endregion + internal async Task GetFollowerCount( SteamId steamID ) + { + var returnValue = _GetFollowerCount( Self, steamID ); + return await FriendsGetFollowerCount_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FIsFollowing( IntPtr self, SteamId steamID ); + private FIsFollowing _IsFollowing; + + #endregion + internal async Task IsFollowing( SteamId steamID ) + { + var returnValue = _IsFollowing( Self, steamID ); + return await FriendsIsFollowing_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FEnumerateFollowingList( IntPtr self, uint unStartIndex ); + private FEnumerateFollowingList _EnumerateFollowingList; + + #endregion + internal async Task EnumerateFollowingList( uint unStartIndex ) + { + var returnValue = _EnumerateFollowingList( Self, unStartIndex ); + return await FriendsEnumerateFollowingList_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsClanPublic( IntPtr self, SteamId steamIDClan ); + private FIsClanPublic _IsClanPublic; + + #endregion + internal bool IsClanPublic( SteamId steamIDClan ) + { + var returnValue = _IsClanPublic( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsClanOfficialGameGroup( IntPtr self, SteamId steamIDClan ); + private FIsClanOfficialGameGroup _IsClanOfficialGameGroup; + + #endregion + internal bool IsClanOfficialGameGroup( SteamId steamIDClan ) + { + var returnValue = _IsClanOfficialGameGroup( Self, steamIDClan ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetNumChatsWithUnreadPriorityMessages( IntPtr self ); + private FGetNumChatsWithUnreadPriorityMessages _GetNumChatsWithUnreadPriorityMessages; + + #endregion + internal int GetNumChatsWithUnreadPriorityMessages() + { + var returnValue = _GetNumChatsWithUnreadPriorityMessages( Self ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs new file mode 100644 index 0000000..50bb040 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServer.cs @@ -0,0 +1,642 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamGameServer : SteamInterface + { + public override string InterfaceName => "SteamGameServer012"; + + public override void InitInternals() + { + _InitGameServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _SetProduct = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _SetGameDescription = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _SetModDir = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _SetDedicatedServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _LogOn = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _LogOnAnonymous = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _LogOff = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _BLoggedOn = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _BSecure = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetSteamID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _WasRestartRequested = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _SetMaxPlayerCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _SetBotPlayerCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _SetServerName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _SetMapName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _SetPasswordProtected = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _SetSpectatorPort = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _SetSpectatorServerName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _ClearAllKeyValues = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _SetKeyValue = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _SetGameTags = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _SetGameData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _SetRegion = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _SendUserConnectAndAuthenticate = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _CreateUnauthenticatedUserConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _SendUserDisconnect = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _BUpdateUserData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _GetAuthSessionTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _BeginAuthSession = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _EndAuthSession = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _CancelAuthTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _UserHasLicenseForApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _RequestUserGroupStatus = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _GetGameplayStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _GetServerReputation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _GetPublicIP = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + _HandleIncomingPacket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 296 ) ) ); + _GetNextOutgoingPacket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 304 ) ) ); + _EnableHeartbeats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 312 ) ) ); + _SetHeartbeatInterval = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 320 ) ) ); + _ForceHeartbeat = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 328 ) ) ); + _AssociateWithClan = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 336 ) ) ); + _ComputeNewPlayerCompatibility = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 344 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _InitGameServer = null; + _SetProduct = null; + _SetGameDescription = null; + _SetModDir = null; + _SetDedicatedServer = null; + _LogOn = null; + _LogOnAnonymous = null; + _LogOff = null; + _BLoggedOn = null; + _BSecure = null; + _GetSteamID = null; + _WasRestartRequested = null; + _SetMaxPlayerCount = null; + _SetBotPlayerCount = null; + _SetServerName = null; + _SetMapName = null; + _SetPasswordProtected = null; + _SetSpectatorPort = null; + _SetSpectatorServerName = null; + _ClearAllKeyValues = null; + _SetKeyValue = null; + _SetGameTags = null; + _SetGameData = null; + _SetRegion = null; + _SendUserConnectAndAuthenticate = null; + _CreateUnauthenticatedUserConnection = null; + _SendUserDisconnect = null; + _BUpdateUserData = null; + _GetAuthSessionTicket = null; + _BeginAuthSession = null; + _EndAuthSession = null; + _CancelAuthTicket = null; + _UserHasLicenseForApp = null; + _RequestUserGroupStatus = null; + _GetGameplayStats = null; + _GetServerReputation = null; + _GetPublicIP = null; + _HandleIncomingPacket = null; + _GetNextOutgoingPacket = null; + _EnableHeartbeats = null; + _SetHeartbeatInterval = null; + _ForceHeartbeat = null; + _AssociateWithClan = null; + _ComputeNewPlayerCompatibility = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FInitGameServer( IntPtr self, uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId nGameAppId, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ); + private FInitGameServer _InitGameServer; + + #endregion + internal bool InitGameServer( uint unIP, ushort usGamePort, ushort usQueryPort, uint unFlags, AppId nGameAppId, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ) + { + var returnValue = _InitGameServer( Self, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetProduct( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ); + private FSetProduct _SetProduct; + + #endregion + internal void SetProduct( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszProduct ) + { + _SetProduct( Self, pszProduct ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetGameDescription( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ); + private FSetGameDescription _SetGameDescription; + + #endregion + internal void SetGameDescription( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszGameDescription ) + { + _SetGameDescription( Self, pszGameDescription ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetModDir( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ); + private FSetModDir _SetModDir; + + #endregion + internal void SetModDir( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszModDir ) + { + _SetModDir( Self, pszModDir ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetDedicatedServer( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bDedicated ); + private FSetDedicatedServer _SetDedicatedServer; + + #endregion + internal void SetDedicatedServer( [MarshalAs( UnmanagedType.U1 )] bool bDedicated ) + { + _SetDedicatedServer( Self, bDedicated ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FLogOn( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ); + private FLogOn _LogOn; + + #endregion + internal void LogOn( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszToken ) + { + _LogOn( Self, pszToken ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FLogOnAnonymous( IntPtr self ); + private FLogOnAnonymous _LogOnAnonymous; + + #endregion + internal void LogOnAnonymous() + { + _LogOnAnonymous( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FLogOff( IntPtr self ); + private FLogOff _LogOff; + + #endregion + internal void LogOff() + { + _LogOff( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBLoggedOn( IntPtr self ); + private FBLoggedOn _BLoggedOn; + + #endregion + internal bool BLoggedOn() + { + var returnValue = _BLoggedOn( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBSecure( IntPtr self ); + private FBSecure _BSecure; + + #endregion + internal bool BSecure() + { + var returnValue = _BSecure( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); + #else + private delegate SteamId FGetSteamID( IntPtr self ); + #endif + private FGetSteamID _GetSteamID; + + #endregion + internal SteamId GetSteamID() + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetSteamID( Self, ref retVal ); + return retVal; + #else + var returnValue = _GetSteamID( Self ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FWasRestartRequested( IntPtr self ); + private FWasRestartRequested _WasRestartRequested; + + #endregion + internal bool WasRestartRequested() + { + var returnValue = _WasRestartRequested( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetMaxPlayerCount( IntPtr self, int cPlayersMax ); + private FSetMaxPlayerCount _SetMaxPlayerCount; + + #endregion + internal void SetMaxPlayerCount( int cPlayersMax ) + { + _SetMaxPlayerCount( Self, cPlayersMax ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetBotPlayerCount( IntPtr self, int cBotplayers ); + private FSetBotPlayerCount _SetBotPlayerCount; + + #endregion + internal void SetBotPlayerCount( int cBotplayers ) + { + _SetBotPlayerCount( Self, cBotplayers ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ); + private FSetServerName _SetServerName; + + #endregion + internal void SetServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszServerName ) + { + _SetServerName( Self, pszServerName ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetMapName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ); + private FSetMapName _SetMapName; + + #endregion + internal void SetMapName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszMapName ) + { + _SetMapName( Self, pszMapName ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetPasswordProtected( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ); + private FSetPasswordProtected _SetPasswordProtected; + + #endregion + internal void SetPasswordProtected( [MarshalAs( UnmanagedType.U1 )] bool bPasswordProtected ) + { + _SetPasswordProtected( Self, bPasswordProtected ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetSpectatorPort( IntPtr self, ushort unSpectatorPort ); + private FSetSpectatorPort _SetSpectatorPort; + + #endregion + internal void SetSpectatorPort( ushort unSpectatorPort ) + { + _SetSpectatorPort( Self, unSpectatorPort ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetSpectatorServerName( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ); + private FSetSpectatorServerName _SetSpectatorServerName; + + #endregion + internal void SetSpectatorServerName( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszSpectatorServerName ) + { + _SetSpectatorServerName( Self, pszSpectatorServerName ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FClearAllKeyValues( IntPtr self ); + private FClearAllKeyValues _ClearAllKeyValues; + + #endregion + internal void ClearAllKeyValues() + { + _ClearAllKeyValues( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetKeyValue( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + private FSetKeyValue _SetKeyValue; + + #endregion + internal void SetKeyValue( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + { + _SetKeyValue( Self, pKey, pValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetGameTags( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ); + private FSetGameTags _SetGameTags; + + #endregion + internal void SetGameTags( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameTags ) + { + _SetGameTags( Self, pchGameTags ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetGameData( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ); + private FSetGameData _SetGameData; + + #endregion + internal void SetGameData( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchGameData ) + { + _SetGameData( Self, pchGameData ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetRegion( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ); + private FSetRegion _SetRegion; + + #endregion + internal void SetRegion( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszRegion ) + { + _SetRegion( Self, pszRegion ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSendUserConnectAndAuthenticate( IntPtr self, uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ); + private FSendUserConnectAndAuthenticate _SendUserConnectAndAuthenticate; + + #endregion + internal bool SendUserConnectAndAuthenticate( uint unIPClient, IntPtr pvAuthBlob, uint cubAuthBlobSize, ref SteamId pSteamIDUser ) + { + var returnValue = _SendUserConnectAndAuthenticate( Self, unIPClient, pvAuthBlob, cubAuthBlobSize, ref pSteamIDUser ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FCreateUnauthenticatedUserConnection( IntPtr self, ref SteamId retVal ); + #else + private delegate SteamId FCreateUnauthenticatedUserConnection( IntPtr self ); + #endif + private FCreateUnauthenticatedUserConnection _CreateUnauthenticatedUserConnection; + + #endregion + internal SteamId CreateUnauthenticatedUserConnection() + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _CreateUnauthenticatedUserConnection( Self, ref retVal ); + return retVal; + #else + var returnValue = _CreateUnauthenticatedUserConnection( Self ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSendUserDisconnect( IntPtr self, SteamId steamIDUser ); + private FSendUserDisconnect _SendUserDisconnect; + + #endregion + internal void SendUserDisconnect( SteamId steamIDUser ) + { + _SendUserDisconnect( Self, steamIDUser ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBUpdateUserData( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ); + private FBUpdateUserData _BUpdateUserData; + + #endregion + internal bool BUpdateUserData( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPlayerName, uint uScore ) + { + var returnValue = _BUpdateUserData( Self, steamIDUser, pchPlayerName, uScore ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HAuthTicket FGetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + private FGetAuthSessionTicket _GetAuthSessionTicket; + + #endregion + internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate BeginAuthResult FBeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); + private FBeginAuthSession _BeginAuthSession; + + #endregion + internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) + { + var returnValue = _BeginAuthSession( Self, pAuthTicket, cbAuthTicket, steamID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FEndAuthSession( IntPtr self, SteamId steamID ); + private FEndAuthSession _EndAuthSession; + + #endregion + internal void EndAuthSession( SteamId steamID ) + { + _EndAuthSession( Self, steamID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FCancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); + private FCancelAuthTicket _CancelAuthTicket; + + #endregion + internal void CancelAuthTicket( HAuthTicket hAuthTicket ) + { + _CancelAuthTicket( Self, hAuthTicket ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UserHasLicenseForAppResult FUserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); + private FUserHasLicenseForApp _UserHasLicenseForApp; + + #endregion + internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) + { + var returnValue = _UserHasLicenseForApp( Self, steamID, appID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRequestUserGroupStatus( IntPtr self, SteamId steamIDUser, SteamId steamIDGroup ); + private FRequestUserGroupStatus _RequestUserGroupStatus; + + #endregion + internal bool RequestUserGroupStatus( SteamId steamIDUser, SteamId steamIDGroup ) + { + var returnValue = _RequestUserGroupStatus( Self, steamIDUser, steamIDGroup ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FGetGameplayStats( IntPtr self ); + private FGetGameplayStats _GetGameplayStats; + + #endregion + internal void GetGameplayStats() + { + _GetGameplayStats( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetServerReputation( IntPtr self ); + private FGetServerReputation _GetServerReputation; + + #endregion + internal async Task GetServerReputation() + { + var returnValue = _GetServerReputation( Self ); + return await GSReputation_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetPublicIP( IntPtr self ); + private FGetPublicIP _GetPublicIP; + + #endregion + internal uint GetPublicIP() + { + var returnValue = _GetPublicIP( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FHandleIncomingPacket( IntPtr self, IntPtr pData, int cbData, uint srcIP, ushort srcPort ); + private FHandleIncomingPacket _HandleIncomingPacket; + + #endregion + internal bool HandleIncomingPacket( IntPtr pData, int cbData, uint srcIP, ushort srcPort ) + { + var returnValue = _HandleIncomingPacket( Self, pData, cbData, srcIP, srcPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetNextOutgoingPacket( IntPtr self, IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ); + private FGetNextOutgoingPacket _GetNextOutgoingPacket; + + #endregion + internal int GetNextOutgoingPacket( IntPtr pOut, int cbMaxOut, ref uint pNetAdr, ref ushort pPort ) + { + var returnValue = _GetNextOutgoingPacket( Self, pOut, cbMaxOut, ref pNetAdr, ref pPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FEnableHeartbeats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bActive ); + private FEnableHeartbeats _EnableHeartbeats; + + #endregion + internal void EnableHeartbeats( [MarshalAs( UnmanagedType.U1 )] bool bActive ) + { + _EnableHeartbeats( Self, bActive ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetHeartbeatInterval( IntPtr self, int iHeartbeatInterval ); + private FSetHeartbeatInterval _SetHeartbeatInterval; + + #endregion + internal void SetHeartbeatInterval( int iHeartbeatInterval ) + { + _SetHeartbeatInterval( Self, iHeartbeatInterval ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FForceHeartbeat( IntPtr self ); + private FForceHeartbeat _ForceHeartbeat; + + #endregion + internal void ForceHeartbeat() + { + _ForceHeartbeat( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FAssociateWithClan( IntPtr self, SteamId steamIDClan ); + private FAssociateWithClan _AssociateWithClan; + + #endregion + internal async Task AssociateWithClan( SteamId steamIDClan ) + { + var returnValue = _AssociateWithClan( Self, steamIDClan ); + return await AssociateWithClanResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FComputeNewPlayerCompatibility( IntPtr self, SteamId steamIDNewPlayer ); + private FComputeNewPlayerCompatibility _ComputeNewPlayerCompatibility; + + #endregion + internal async Task ComputeNewPlayerCompatibility( SteamId steamIDNewPlayer ) + { + var returnValue = _ComputeNewPlayerCompatibility( Self, steamIDNewPlayer ); + return await ComputeNewPlayerCompatibilityResult_t.GetResultAsync( returnValue ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs new file mode 100644 index 0000000..108b728 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamGameServerStats.cs @@ -0,0 +1,180 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamGameServerStats : SteamInterface + { + public override string InterfaceName => "SteamGameServerStats001"; + + public override void InitInternals() + { + _RequestUserStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _GetUserAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _UpdateUserAvgRateStat = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _SetUserAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _ClearUserAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _StoreUserStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + + #if PLATFORM_WIN + _GetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _SetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _SetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + #else + _GetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _SetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _SetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + #endif + } + internal override void Shutdown() + { + base.Shutdown(); + + _RequestUserStats = null; + _GetUserStat1 = null; + _GetUserStat2 = null; + _GetUserAchievement = null; + _SetUserStat1 = null; + _SetUserStat2 = null; + _UpdateUserAvgRateStat = null; + _SetUserAchievement = null; + _ClearUserAchievement = null; + _StoreUserStats = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestUserStats( IntPtr self, SteamId steamIDUser ); + private FRequestUserStats _RequestUserStats; + + #endregion + internal async Task RequestUserStats( SteamId steamIDUser ) + { + var returnValue = _RequestUserStats( Self, steamIDUser ); + return await GSStatsReceived_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private FGetUserStat1 _GetUserStat1; + + #endregion + internal bool GetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetUserStat1( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private FGetUserStat2 _GetUserStat2; + + #endregion + internal bool GetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetUserStat2( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private FGetUserAchievement _GetUserAchievement; + + #endregion + internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + private FSetUserStat1 _SetUserStat1; + + #endregion + internal bool SetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + { + var returnValue = _SetUserStat1( Self, steamIDUser, pchName, nData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + private FSetUserStat2 _SetUserStat2; + + #endregion + internal bool SetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + { + var returnValue = _SetUserStat2( Self, steamIDUser, pchName, fData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FUpdateUserAvgRateStat( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + private FUpdateUserAvgRateStat _UpdateUserAvgRateStat; + + #endregion + internal bool UpdateUserAvgRateStat( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + { + var returnValue = _UpdateUserAvgRateStat( Self, steamIDUser, pchName, flCountThisSession, dSessionLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private FSetUserAchievement _SetUserAchievement; + + #endregion + internal bool SetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _SetUserAchievement( Self, steamIDUser, pchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FClearUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private FClearUserAchievement _ClearUserAchievement; + + #endregion + internal bool ClearUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _ClearUserAchievement( Self, steamIDUser, pchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FStoreUserStats( IntPtr self, SteamId steamIDUser ); + private FStoreUserStats _StoreUserStats; + + #endregion + internal async Task StoreUserStats( SteamId steamIDUser ) + { + var returnValue = _StoreUserStats( Self, steamIDUser ); + return await GSStatsStored_t.GetResultAsync( returnValue ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs new file mode 100644 index 0000000..3f68640 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInput.cs @@ -0,0 +1,509 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamInput : SteamInterface + { + public override string InterfaceName => "SteamInput001"; + + public override void InitInternals() + { + _DoInit = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _DoShutdown = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _RunFrame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetConnectedControllers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetActionSetHandle = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _ActivateActionSet = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetCurrentActionSet = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _ActivateActionSetLayer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _DeactivateActionSetLayer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _DeactivateAllActionSetLayers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetActiveActionSetLayers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetDigitalActionHandle = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetDigitalActionData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _GetDigitalActionOrigins = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _GetAnalogActionHandle = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetAnalogActionData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _GetAnalogActionOrigins = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetGlyphForActionOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetStringForActionOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _StopAnalogActionMomentum = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetMotionData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _TriggerVibration = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _SetLEDColor = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _TriggerHapticPulse = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _TriggerRepeatedHapticPulse = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _ShowBindingPanel = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _GetInputTypeForHandle = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _GetControllerForGamepadIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _GetGamepadIndexForController = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _GetStringForXboxOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _GetGlyphForXboxOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _GetActionOriginFromXboxOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _TranslateActionOrigin = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _DoInit = null; + _DoShutdown = null; + _RunFrame = null; + _GetConnectedControllers = null; + _GetActionSetHandle = null; + _ActivateActionSet = null; + _GetCurrentActionSet = null; + _ActivateActionSetLayer = null; + _DeactivateActionSetLayer = null; + _DeactivateAllActionSetLayers = null; + _GetActiveActionSetLayers = null; + _GetDigitalActionHandle = null; + _GetDigitalActionData = null; + _GetDigitalActionOrigins = null; + _GetAnalogActionHandle = null; + _GetAnalogActionData = null; + _GetAnalogActionOrigins = null; + _GetGlyphForActionOrigin = null; + _GetStringForActionOrigin = null; + _StopAnalogActionMomentum = null; + _GetMotionData = null; + _TriggerVibration = null; + _SetLEDColor = null; + _TriggerHapticPulse = null; + _TriggerRepeatedHapticPulse = null; + _ShowBindingPanel = null; + _GetInputTypeForHandle = null; + _GetControllerForGamepadIndex = null; + _GetGamepadIndexForController = null; + _GetStringForXboxOrigin = null; + _GetGlyphForXboxOrigin = null; + _GetActionOriginFromXboxOrigin = null; + _TranslateActionOrigin = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDoInit( IntPtr self ); + private FDoInit _DoInit; + + #endregion + internal bool DoInit() + { + var returnValue = _DoInit( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDoShutdown( IntPtr self ); + private FDoShutdown _DoShutdown; + + #endregion + internal bool DoShutdown() + { + var returnValue = _DoShutdown( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRunFrame( IntPtr self ); + private FRunFrame _RunFrame; + + #endregion + internal void RunFrame() + { + _RunFrame( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetConnectedControllers( IntPtr self, [In,Out] InputHandle_t[] handlesOut ); + private FGetConnectedControllers _GetConnectedControllers; + + #endregion + internal int GetConnectedControllers( [In,Out] InputHandle_t[] handlesOut ) + { + var returnValue = _GetConnectedControllers( Self, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputActionSetHandle_t FGetActionSetHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ); + private FGetActionSetHandle _GetActionSetHandle; + + #endregion + internal InputActionSetHandle_t GetActionSetHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionSetName ) + { + var returnValue = _GetActionSetHandle( Self, pszActionSetName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateActionSet( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ); + private FActivateActionSet _ActivateActionSet; + + #endregion + internal void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) + { + _ActivateActionSet( Self, inputHandle, actionSetHandle ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputActionSetHandle_t FGetCurrentActionSet( IntPtr self, InputHandle_t inputHandle ); + private FGetCurrentActionSet _GetCurrentActionSet; + + #endregion + internal InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) + { + var returnValue = _GetCurrentActionSet( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FActivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); + private FActivateActionSetLayer _ActivateActionSetLayer; + + #endregion + internal void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) + { + _ActivateActionSetLayer( Self, inputHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FDeactivateActionSetLayer( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ); + private FDeactivateActionSetLayer _DeactivateActionSetLayer; + + #endregion + internal void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) + { + _DeactivateActionSetLayer( Self, inputHandle, actionSetLayerHandle ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FDeactivateAllActionSetLayers( IntPtr self, InputHandle_t inputHandle ); + private FDeactivateAllActionSetLayers _DeactivateAllActionSetLayers; + + #endregion + internal void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) + { + _DeactivateAllActionSetLayers( Self, inputHandle ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetActiveActionSetLayers( IntPtr self, InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ); + private FGetActiveActionSetLayers _GetActiveActionSetLayers; + + #endregion + internal int GetActiveActionSetLayers( InputHandle_t inputHandle, [In,Out] InputActionSetHandle_t[] handlesOut ) + { + var returnValue = _GetActiveActionSetLayers( Self, inputHandle, handlesOut ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputDigitalActionHandle_t FGetDigitalActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private FGetDigitalActionHandle _GetDigitalActionHandle; + + #endregion + internal InputDigitalActionHandle_t GetDigitalActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetDigitalActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetDigitalActionData( IntPtr self, ref DigitalState retVal, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); + #else + private delegate DigitalState FGetDigitalActionData( IntPtr self, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ); + #endif + private FGetDigitalActionData _GetDigitalActionData; + + #endregion + internal DigitalState GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) + { + #if PLATFORM_WIN + var retVal = default( DigitalState ); + _GetDigitalActionData( Self, ref retVal, inputHandle, digitalActionHandle ); + return retVal; + #else + var returnValue = _GetDigitalActionData( Self, inputHandle, digitalActionHandle ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetDigitalActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ); + private FGetDigitalActionOrigins _GetDigitalActionOrigins; + + #endregion + internal int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, ref InputActionOrigin originsOut ) + { + var returnValue = _GetDigitalActionOrigins( Self, inputHandle, actionSetHandle, digitalActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputAnalogActionHandle_t FGetAnalogActionHandle( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ); + private FGetAnalogActionHandle _GetAnalogActionHandle; + + #endregion + internal InputAnalogActionHandle_t GetAnalogActionHandle( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszActionName ) + { + var returnValue = _GetAnalogActionHandle( Self, pszActionName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetAnalogActionData( IntPtr self, ref AnalogState retVal, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); + #else + private delegate AnalogState FGetAnalogActionData( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ); + #endif + private FGetAnalogActionData _GetAnalogActionData; + + #endregion + internal AnalogState GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) + { + #if PLATFORM_WIN + var retVal = default( AnalogState ); + _GetAnalogActionData( Self, ref retVal, inputHandle, analogActionHandle ); + return retVal; + #else + var returnValue = _GetAnalogActionData( Self, inputHandle, analogActionHandle ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetAnalogActionOrigins( IntPtr self, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ); + private FGetAnalogActionOrigins _GetAnalogActionOrigins; + + #endregion + internal int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, ref InputActionOrigin originsOut ) + { + var returnValue = _GetAnalogActionOrigins( Self, inputHandle, actionSetHandle, analogActionHandle, ref originsOut ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetGlyphForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); + private FGetGlyphForActionOrigin _GetGlyphForActionOrigin; + + #endregion + internal string GetGlyphForActionOrigin( InputActionOrigin eOrigin ) + { + var returnValue = _GetGlyphForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetStringForActionOrigin( IntPtr self, InputActionOrigin eOrigin ); + private FGetStringForActionOrigin _GetStringForActionOrigin; + + #endregion + internal string GetStringForActionOrigin( InputActionOrigin eOrigin ) + { + var returnValue = _GetStringForActionOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FStopAnalogActionMomentum( IntPtr self, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ); + private FStopAnalogActionMomentum _StopAnalogActionMomentum; + + #endregion + internal void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) + { + _StopAnalogActionMomentum( Self, inputHandle, eAction ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetMotionData( IntPtr self, ref MotionState retVal, InputHandle_t inputHandle ); + #else + private delegate MotionState FGetMotionData( IntPtr self, InputHandle_t inputHandle ); + #endif + private FGetMotionData _GetMotionData; + + #endregion + internal MotionState GetMotionData( InputHandle_t inputHandle ) + { + #if PLATFORM_WIN + var retVal = default( MotionState ); + _GetMotionData( Self, ref retVal, inputHandle ); + return retVal; + #else + var returnValue = _GetMotionData( Self, inputHandle ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTriggerVibration( IntPtr self, InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ); + private FTriggerVibration _TriggerVibration; + + #endregion + internal void TriggerVibration( InputHandle_t inputHandle, ushort usLeftSpeed, ushort usRightSpeed ) + { + _TriggerVibration( Self, inputHandle, usLeftSpeed, usRightSpeed ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetLEDColor( IntPtr self, InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ); + private FSetLEDColor _SetLEDColor; + + #endregion + internal void SetLEDColor( InputHandle_t inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags ) + { + _SetLEDColor( Self, inputHandle, nColorR, nColorG, nColorB, nFlags ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTriggerHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ); + private FTriggerHapticPulse _TriggerHapticPulse; + + #endregion + internal void TriggerHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec ) + { + _TriggerHapticPulse( Self, inputHandle, eTargetPad, usDurationMicroSec ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTriggerRepeatedHapticPulse( IntPtr self, InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ); + private FTriggerRepeatedHapticPulse _TriggerRepeatedHapticPulse; + + #endregion + internal void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, SteamControllerPad eTargetPad, ushort usDurationMicroSec, ushort usOffMicroSec, ushort unRepeat, uint nFlags ) + { + _TriggerRepeatedHapticPulse( Self, inputHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FShowBindingPanel( IntPtr self, InputHandle_t inputHandle ); + private FShowBindingPanel _ShowBindingPanel; + + #endregion + internal bool ShowBindingPanel( InputHandle_t inputHandle ) + { + var returnValue = _ShowBindingPanel( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputType FGetInputTypeForHandle( IntPtr self, InputHandle_t inputHandle ); + private FGetInputTypeForHandle _GetInputTypeForHandle; + + #endregion + internal InputType GetInputTypeForHandle( InputHandle_t inputHandle ) + { + var returnValue = _GetInputTypeForHandle( Self, inputHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputHandle_t FGetControllerForGamepadIndex( IntPtr self, int nIndex ); + private FGetControllerForGamepadIndex _GetControllerForGamepadIndex; + + #endregion + internal InputHandle_t GetControllerForGamepadIndex( int nIndex ) + { + var returnValue = _GetControllerForGamepadIndex( Self, nIndex ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetGamepadIndexForController( IntPtr self, InputHandle_t ulinputHandle ); + private FGetGamepadIndexForController _GetGamepadIndexForController; + + #endregion + internal int GetGamepadIndexForController( InputHandle_t ulinputHandle ) + { + var returnValue = _GetGamepadIndexForController( Self, ulinputHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetStringForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + private FGetStringForXboxOrigin _GetStringForXboxOrigin; + + #endregion + internal string GetStringForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetStringForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetGlyphForXboxOrigin( IntPtr self, XboxOrigin eOrigin ); + private FGetGlyphForXboxOrigin _GetGlyphForXboxOrigin; + + #endregion + internal string GetGlyphForXboxOrigin( XboxOrigin eOrigin ) + { + var returnValue = _GetGlyphForXboxOrigin( Self, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputActionOrigin FGetActionOriginFromXboxOrigin( IntPtr self, InputHandle_t inputHandle, XboxOrigin eOrigin ); + private FGetActionOriginFromXboxOrigin _GetActionOriginFromXboxOrigin; + + #endregion + internal InputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, XboxOrigin eOrigin ) + { + var returnValue = _GetActionOriginFromXboxOrigin( Self, inputHandle, eOrigin ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate InputActionOrigin FTranslateActionOrigin( IntPtr self, InputType eDestinationInputType, InputActionOrigin eSourceOrigin ); + private FTranslateActionOrigin _TranslateActionOrigin; + + #endregion + internal InputActionOrigin TranslateActionOrigin( InputType eDestinationInputType, InputActionOrigin eSourceOrigin ) + { + var returnValue = _TranslateActionOrigin( Self, eDestinationInputType, eSourceOrigin ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs new file mode 100644 index 0000000..e1a4d34 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamInventory.cs @@ -0,0 +1,572 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamInventory : SteamInterface + { + public override string InterfaceName => "STEAMINVENTORY_INTERFACE_V003"; + + public override void InitInternals() + { + _GetResultStatus = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _GetResultItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetResultItemProperty = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetResultTimestamp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _CheckResultSteamID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _DestroyResult = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetAllItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetItemsByID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _SerializeResult = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _DeserializeResult = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GenerateItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GrantPromoItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _AddPromoItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _AddPromoItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _ConsumeItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _ExchangeItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _TransferItemQuantity = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _SendItemDropHeartbeat = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _TriggerItemDrop = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _TradeItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _LoadItemDefinitions = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetItemDefinitionIDs = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetItemDefinitionProperty = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _RequestEligiblePromoItemDefinitionsIDs = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _GetEligiblePromoItemDefinitionIDs = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _StartPurchase = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _RequestPrices = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _GetNumItemsWithPrices = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _GetItemsWithPrices = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _GetItemPrice = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _StartUpdateProperties = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _RemoveProperty = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _SetProperty1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _SetProperty2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _SetProperty3 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _SetProperty4 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _SubmitUpdateProperties = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetResultStatus = null; + _GetResultItems = null; + _GetResultItemProperty = null; + _GetResultTimestamp = null; + _CheckResultSteamID = null; + _DestroyResult = null; + _GetAllItems = null; + _GetItemsByID = null; + _SerializeResult = null; + _DeserializeResult = null; + _GenerateItems = null; + _GrantPromoItems = null; + _AddPromoItem = null; + _AddPromoItems = null; + _ConsumeItem = null; + _ExchangeItems = null; + _TransferItemQuantity = null; + _SendItemDropHeartbeat = null; + _TriggerItemDrop = null; + _TradeItems = null; + _LoadItemDefinitions = null; + _GetItemDefinitionIDs = null; + _GetItemDefinitionProperty = null; + _RequestEligiblePromoItemDefinitionsIDs = null; + _GetEligiblePromoItemDefinitionIDs = null; + _StartPurchase = null; + _RequestPrices = null; + _GetNumItemsWithPrices = null; + _GetItemsWithPrices = null; + _GetItemPrice = null; + _StartUpdateProperties = null; + _RemoveProperty = null; + _SetProperty1 = null; + _SetProperty2 = null; + _SetProperty3 = null; + _SetProperty4 = null; + _SubmitUpdateProperties = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Result FGetResultStatus( IntPtr self, SteamInventoryResult_t resultHandle ); + private FGetResultStatus _GetResultStatus; + + #endregion + internal Result GetResultStatus( SteamInventoryResult_t resultHandle ) + { + var returnValue = _GetResultStatus( Self, resultHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetResultItems( IntPtr self, SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ); + private FGetResultItems _GetResultItems; + + #endregion + internal bool GetResultItems( SteamInventoryResult_t resultHandle, [In,Out] SteamItemDetails_t[] pOutItemsArray, ref uint punOutItemsArraySize ) + { + var returnValue = _GetResultItems( Self, resultHandle, pOutItemsArray, ref punOutItemsArraySize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetResultItemProperty( IntPtr self, SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + private FGetResultItemProperty _GetResultItemProperty; + + #endregion + internal bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint unItemIndex, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) + { + IntPtr mempchValueBuffer = Helpers.TakeMemory(); + var returnValue = _GetResultItemProperty( Self, resultHandle, unItemIndex, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetResultTimestamp( IntPtr self, SteamInventoryResult_t resultHandle ); + private FGetResultTimestamp _GetResultTimestamp; + + #endregion + internal uint GetResultTimestamp( SteamInventoryResult_t resultHandle ) + { + var returnValue = _GetResultTimestamp( Self, resultHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCheckResultSteamID( IntPtr self, SteamInventoryResult_t resultHandle, SteamId steamIDExpected ); + private FCheckResultSteamID _CheckResultSteamID; + + #endregion + internal bool CheckResultSteamID( SteamInventoryResult_t resultHandle, SteamId steamIDExpected ) + { + var returnValue = _CheckResultSteamID( Self, resultHandle, steamIDExpected ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FDestroyResult( IntPtr self, SteamInventoryResult_t resultHandle ); + private FDestroyResult _DestroyResult; + + #endregion + internal void DestroyResult( SteamInventoryResult_t resultHandle ) + { + _DestroyResult( Self, resultHandle ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAllItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); + private FGetAllItems _GetAllItems; + + #endregion + internal bool GetAllItems( ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _GetAllItems( Self, ref pResultHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemsByID( IntPtr self, ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ); + private FGetItemsByID _GetItemsByID; + + #endregion + internal bool GetItemsByID( ref SteamInventoryResult_t pResultHandle, ref InventoryItemId pInstanceIDs, uint unCountInstanceIDs ) + { + var returnValue = _GetItemsByID( Self, ref pResultHandle, ref pInstanceIDs, unCountInstanceIDs ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSerializeResult( IntPtr self, SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ); + private FSerializeResult _SerializeResult; + + #endregion + internal bool SerializeResult( SteamInventoryResult_t resultHandle, IntPtr pOutBuffer, ref uint punOutBufferSize ) + { + var returnValue = _SerializeResult( Self, resultHandle, pOutBuffer, ref punOutBufferSize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDeserializeResult( IntPtr self, ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ); + private FDeserializeResult _DeserializeResult; + + #endregion + internal bool DeserializeResult( ref SteamInventoryResult_t pOutResultHandle, IntPtr pBuffer, uint unBufferSize, [MarshalAs( UnmanagedType.U1 )] bool bRESERVED_MUST_BE_FALSE ) + { + var returnValue = _DeserializeResult( Self, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGenerateItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); + private FGenerateItems _GenerateItems; + + #endregion + internal bool GenerateItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + { + var returnValue = _GenerateItems( Self, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGrantPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle ); + private FGrantPromoItems _GrantPromoItems; + + #endregion + internal bool GrantPromoItems( ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _GrantPromoItems( Self, ref pResultHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddPromoItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ); + private FAddPromoItem _AddPromoItem; + + #endregion + internal bool AddPromoItem( ref SteamInventoryResult_t pResultHandle, InventoryDefId itemDef ) + { + var returnValue = _AddPromoItem( Self, ref pResultHandle, itemDef ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddPromoItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ); + private FAddPromoItems _AddPromoItems; + + #endregion + internal bool AddPromoItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayItemDefs, uint unArrayLength ) + { + var returnValue = _AddPromoItems( Self, ref pResultHandle, pArrayItemDefs, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FConsumeItem( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ); + private FConsumeItem _ConsumeItem; + + #endregion + internal bool ConsumeItem( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemConsume, uint unQuantity ) + { + var returnValue = _ConsumeItem( Self, ref pResultHandle, itemConsume, unQuantity ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FExchangeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ); + private FExchangeItems _ExchangeItems; + + #endregion + internal bool ExchangeItems( ref SteamInventoryResult_t pResultHandle, [In,Out] InventoryDefId[] pArrayGenerate, [In,Out] uint[] punArrayGenerateQuantity, uint unArrayGenerateLength, [In,Out] InventoryItemId[] pArrayDestroy, [In,Out] uint[] punArrayDestroyQuantity, uint unArrayDestroyLength ) + { + var returnValue = _ExchangeItems( Self, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FTransferItemQuantity( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ); + private FTransferItemQuantity _TransferItemQuantity; + + #endregion + internal bool TransferItemQuantity( ref SteamInventoryResult_t pResultHandle, InventoryItemId itemIdSource, uint unQuantity, InventoryItemId itemIdDest ) + { + var returnValue = _TransferItemQuantity( Self, ref pResultHandle, itemIdSource, unQuantity, itemIdDest ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSendItemDropHeartbeat( IntPtr self ); + private FSendItemDropHeartbeat _SendItemDropHeartbeat; + + #endregion + internal void SendItemDropHeartbeat() + { + _SendItemDropHeartbeat( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FTriggerItemDrop( IntPtr self, ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ); + private FTriggerItemDrop _TriggerItemDrop; + + #endregion + internal bool TriggerItemDrop( ref SteamInventoryResult_t pResultHandle, InventoryDefId dropListDefinition ) + { + var returnValue = _TriggerItemDrop( Self, ref pResultHandle, dropListDefinition ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FTradeItems( IntPtr self, ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ); + private FTradeItems _TradeItems; + + #endregion + internal bool TradeItems( ref SteamInventoryResult_t pResultHandle, SteamId steamIDTradePartner, [In,Out] InventoryItemId[] pArrayGive, [In,Out] uint[] pArrayGiveQuantity, uint nArrayGiveLength, [In,Out] InventoryItemId[] pArrayGet, [In,Out] uint[] pArrayGetQuantity, uint nArrayGetLength ) + { + var returnValue = _TradeItems( Self, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FLoadItemDefinitions( IntPtr self ); + private FLoadItemDefinitions _LoadItemDefinitions; + + #endregion + internal bool LoadItemDefinitions() + { + var returnValue = _LoadItemDefinitions( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemDefinitionIDs( IntPtr self, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); + private FGetItemDefinitionIDs _GetItemDefinitionIDs; + + #endregion + internal bool GetItemDefinitionIDs( [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) + { + var returnValue = _GetItemDefinitionIDs( Self, pItemDefIDs, ref punItemDefIDsArraySize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemDefinitionProperty( IntPtr self, InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, IntPtr pchValueBuffer, ref uint punValueBufferSizeOut ); + private FGetItemDefinitionProperty _GetItemDefinitionProperty; + + #endregion + internal bool GetItemDefinitionProperty( InventoryDefId iDefinition, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, out string pchValueBuffer, ref uint punValueBufferSizeOut ) + { + IntPtr mempchValueBuffer = Helpers.TakeMemory(); + var returnValue = _GetItemDefinitionProperty( Self, iDefinition, pchPropertyName, mempchValueBuffer, ref punValueBufferSizeOut ); + pchValueBuffer = Helpers.MemoryToString( mempchValueBuffer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestEligiblePromoItemDefinitionsIDs( IntPtr self, SteamId steamID ); + private FRequestEligiblePromoItemDefinitionsIDs _RequestEligiblePromoItemDefinitionsIDs; + + #endregion + internal async Task RequestEligiblePromoItemDefinitionsIDs( SteamId steamID ) + { + var returnValue = _RequestEligiblePromoItemDefinitionsIDs( Self, steamID ); + return await SteamInventoryEligiblePromoItemDefIDs_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetEligiblePromoItemDefinitionIDs( IntPtr self, SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ); + private FGetEligiblePromoItemDefinitionIDs _GetEligiblePromoItemDefinitionIDs; + + #endregion + internal bool GetEligiblePromoItemDefinitionIDs( SteamId steamID, [In,Out] InventoryDefId[] pItemDefIDs, ref uint punItemDefIDsArraySize ) + { + var returnValue = _GetEligiblePromoItemDefinitionIDs( Self, steamID, pItemDefIDs, ref punItemDefIDsArraySize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FStartPurchase( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ); + private FStartPurchase _StartPurchase; + + #endregion + internal async Task StartPurchase( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] uint[] punArrayQuantity, uint unArrayLength ) + { + var returnValue = _StartPurchase( Self, pArrayItemDefs, punArrayQuantity, unArrayLength ); + return await SteamInventoryStartPurchaseResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestPrices( IntPtr self ); + private FRequestPrices _RequestPrices; + + #endregion + internal async Task RequestPrices() + { + var returnValue = _RequestPrices( Self ); + return await SteamInventoryRequestPricesResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetNumItemsWithPrices( IntPtr self ); + private FGetNumItemsWithPrices _GetNumItemsWithPrices; + + #endregion + internal uint GetNumItemsWithPrices() + { + var returnValue = _GetNumItemsWithPrices( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemsWithPrices( IntPtr self, [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ); + private FGetItemsWithPrices _GetItemsWithPrices; + + #endregion + internal bool GetItemsWithPrices( [In,Out] InventoryDefId[] pArrayItemDefs, [In,Out] ulong[] pCurrentPrices, [In,Out] ulong[] pBasePrices, uint unArrayLength ) + { + var returnValue = _GetItemsWithPrices( Self, pArrayItemDefs, pCurrentPrices, pBasePrices, unArrayLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemPrice( IntPtr self, InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ); + private FGetItemPrice _GetItemPrice; + + #endregion + internal bool GetItemPrice( InventoryDefId iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice ) + { + var returnValue = _GetItemPrice( Self, iDefinition, ref pCurrentPrice, ref pBasePrice ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamInventoryUpdateHandle_t FStartUpdateProperties( IntPtr self ); + private FStartUpdateProperties _StartUpdateProperties; + + #endregion + internal SteamInventoryUpdateHandle_t StartUpdateProperties() + { + var returnValue = _StartUpdateProperties( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRemoveProperty( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ); + private FRemoveProperty _RemoveProperty; + + #endregion + internal bool RemoveProperty( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName ) + { + var returnValue = _RemoveProperty( Self, handle, nItemID, pchPropertyName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetProperty1( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ); + private FSetProperty1 _SetProperty1; + + #endregion + internal bool SetProperty1( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyValue ) + { + var returnValue = _SetProperty1( Self, handle, nItemID, pchPropertyName, pchPropertyValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetProperty2( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ); + private FSetProperty2 _SetProperty2; + + #endregion + internal bool SetProperty2( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, [MarshalAs( UnmanagedType.U1 )] bool bValue ) + { + var returnValue = _SetProperty2( Self, handle, nItemID, pchPropertyName, bValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetProperty3( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ); + private FSetProperty3 _SetProperty3; + + #endregion + internal bool SetProperty3( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, long nValue ) + { + var returnValue = _SetProperty3( Self, handle, nItemID, pchPropertyName, nValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetProperty4( IntPtr self, SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ); + private FSetProperty4 _SetProperty4; + + #endregion + internal bool SetProperty4( SteamInventoryUpdateHandle_t handle, InventoryItemId nItemID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchPropertyName, float flValue ) + { + var returnValue = _SetProperty4( Self, handle, nItemID, pchPropertyName, flValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSubmitUpdateProperties( IntPtr self, SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ); + private FSubmitUpdateProperties _SubmitUpdateProperties; + + #endregion + internal bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle, ref SteamInventoryResult_t pResultHandle ) + { + var returnValue = _SubmitUpdateProperties( Self, handle, ref pResultHandle ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs new file mode 100644 index 0000000..6a134dc --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmaking.cs @@ -0,0 +1,594 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamMatchmaking : SteamInterface + { + public override string InterfaceName => "SteamMatchMaking009"; + + public override void InitInternals() + { + _GetFavoriteGameCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _GetFavoriteGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _AddFavoriteGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _RemoveFavoriteGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _RequestLobbyList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _AddRequestLobbyListStringFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _AddRequestLobbyListNumericalFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _AddRequestLobbyListNearValueFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _AddRequestLobbyListFilterSlotsAvailable = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _AddRequestLobbyListDistanceFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _AddRequestLobbyListResultCountFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _AddRequestLobbyListCompatibleMembersFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetLobbyByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _CreateLobby = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _JoinLobby = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _LeaveLobby = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _InviteUserToLobby = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetNumLobbyMembers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetLobbyMemberByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetLobbyData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _SetLobbyData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetLobbyDataCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetLobbyDataByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _DeleteLobbyData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _GetLobbyMemberData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _SetLobbyMemberData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _SendLobbyChatMsg = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _GetLobbyChatEntry = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _RequestLobbyData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _SetLobbyGameServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _GetLobbyGameServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _SetLobbyMemberLimit = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _GetLobbyMemberLimit = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _SetLobbyType = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _SetLobbyJoinable = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _GetLobbyOwner = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _SetLobbyOwner = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + _SetLinkedLobby = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 296 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetFavoriteGameCount = null; + _GetFavoriteGame = null; + _AddFavoriteGame = null; + _RemoveFavoriteGame = null; + _RequestLobbyList = null; + _AddRequestLobbyListStringFilter = null; + _AddRequestLobbyListNumericalFilter = null; + _AddRequestLobbyListNearValueFilter = null; + _AddRequestLobbyListFilterSlotsAvailable = null; + _AddRequestLobbyListDistanceFilter = null; + _AddRequestLobbyListResultCountFilter = null; + _AddRequestLobbyListCompatibleMembersFilter = null; + _GetLobbyByIndex = null; + _CreateLobby = null; + _JoinLobby = null; + _LeaveLobby = null; + _InviteUserToLobby = null; + _GetNumLobbyMembers = null; + _GetLobbyMemberByIndex = null; + _GetLobbyData = null; + _SetLobbyData = null; + _GetLobbyDataCount = null; + _GetLobbyDataByIndex = null; + _DeleteLobbyData = null; + _GetLobbyMemberData = null; + _SetLobbyMemberData = null; + _SendLobbyChatMsg = null; + _GetLobbyChatEntry = null; + _RequestLobbyData = null; + _SetLobbyGameServer = null; + _GetLobbyGameServer = null; + _SetLobbyMemberLimit = null; + _GetLobbyMemberLimit = null; + _SetLobbyType = null; + _SetLobbyJoinable = null; + _GetLobbyOwner = null; + _SetLobbyOwner = null; + _SetLinkedLobby = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFavoriteGameCount( IntPtr self ); + private FGetFavoriteGameCount _GetFavoriteGameCount; + + #endregion + internal int GetFavoriteGameCount() + { + var returnValue = _GetFavoriteGameCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetFavoriteGame( IntPtr self, int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ); + private FGetFavoriteGame _GetFavoriteGame; + + #endregion + internal bool GetFavoriteGame( int iGame, ref AppId pnAppID, ref uint pnIP, ref ushort pnConnPort, ref ushort pnQueryPort, ref uint punFlags, ref uint pRTime32LastPlayedOnServer ) + { + var returnValue = _GetFavoriteGame( Self, iGame, ref pnAppID, ref pnIP, ref pnConnPort, ref pnQueryPort, ref punFlags, ref pRTime32LastPlayedOnServer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FAddFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ); + private FAddFavoriteGame _AddFavoriteGame; + + #endregion + internal int AddFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags, uint rTime32LastPlayedOnServer ) + { + var returnValue = _AddFavoriteGame( Self, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRemoveFavoriteGame( IntPtr self, AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ); + private FRemoveFavoriteGame _RemoveFavoriteGame; + + #endregion + internal bool RemoveFavoriteGame( AppId nAppID, uint nIP, ushort nConnPort, ushort nQueryPort, uint unFlags ) + { + var returnValue = _RemoveFavoriteGame( Self, nAppID, nIP, nConnPort, nQueryPort, unFlags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestLobbyList( IntPtr self ); + private FRequestLobbyList _RequestLobbyList; + + #endregion + internal async Task RequestLobbyList() + { + var returnValue = _RequestLobbyList( Self ); + return await LobbyMatchList_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListStringFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ); + private FAddRequestLobbyListStringFilter _AddRequestLobbyListStringFilter; + + #endregion + internal void AddRequestLobbyListStringFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValueToMatch, LobbyComparison eComparisonType ) + { + _AddRequestLobbyListStringFilter( Self, pchKeyToMatch, pchValueToMatch, eComparisonType ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListNumericalFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ); + private FAddRequestLobbyListNumericalFilter _AddRequestLobbyListNumericalFilter; + + #endregion + internal void AddRequestLobbyListNumericalFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToMatch, LobbyComparison eComparisonType ) + { + _AddRequestLobbyListNumericalFilter( Self, pchKeyToMatch, nValueToMatch, eComparisonType ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListNearValueFilter( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ); + private FAddRequestLobbyListNearValueFilter _AddRequestLobbyListNearValueFilter; + + #endregion + internal void AddRequestLobbyListNearValueFilter( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKeyToMatch, int nValueToBeCloseTo ) + { + _AddRequestLobbyListNearValueFilter( Self, pchKeyToMatch, nValueToBeCloseTo ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListFilterSlotsAvailable( IntPtr self, int nSlotsAvailable ); + private FAddRequestLobbyListFilterSlotsAvailable _AddRequestLobbyListFilterSlotsAvailable; + + #endregion + internal void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable ) + { + _AddRequestLobbyListFilterSlotsAvailable( Self, nSlotsAvailable ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListDistanceFilter( IntPtr self, LobbyDistanceFilter eLobbyDistanceFilter ); + private FAddRequestLobbyListDistanceFilter _AddRequestLobbyListDistanceFilter; + + #endregion + internal void AddRequestLobbyListDistanceFilter( LobbyDistanceFilter eLobbyDistanceFilter ) + { + _AddRequestLobbyListDistanceFilter( Self, eLobbyDistanceFilter ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListResultCountFilter( IntPtr self, int cMaxResults ); + private FAddRequestLobbyListResultCountFilter _AddRequestLobbyListResultCountFilter; + + #endregion + internal void AddRequestLobbyListResultCountFilter( int cMaxResults ) + { + _AddRequestLobbyListResultCountFilter( Self, cMaxResults ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAddRequestLobbyListCompatibleMembersFilter( IntPtr self, SteamId steamIDLobby ); + private FAddRequestLobbyListCompatibleMembersFilter _AddRequestLobbyListCompatibleMembersFilter; + + #endregion + internal void AddRequestLobbyListCompatibleMembersFilter( SteamId steamIDLobby ) + { + _AddRequestLobbyListCompatibleMembersFilter( Self, steamIDLobby ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetLobbyByIndex( IntPtr self, ref SteamId retVal, int iLobby ); + #else + private delegate SteamId FGetLobbyByIndex( IntPtr self, int iLobby ); + #endif + private FGetLobbyByIndex _GetLobbyByIndex; + + #endregion + internal SteamId GetLobbyByIndex( int iLobby ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetLobbyByIndex( Self, ref retVal, iLobby ); + return retVal; + #else + var returnValue = _GetLobbyByIndex( Self, iLobby ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FCreateLobby( IntPtr self, LobbyType eLobbyType, int cMaxMembers ); + private FCreateLobby _CreateLobby; + + #endregion + internal async Task CreateLobby( LobbyType eLobbyType, int cMaxMembers ) + { + var returnValue = _CreateLobby( Self, eLobbyType, cMaxMembers ); + return await LobbyCreated_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FJoinLobby( IntPtr self, SteamId steamIDLobby ); + private FJoinLobby _JoinLobby; + + #endregion + internal async Task JoinLobby( SteamId steamIDLobby ) + { + var returnValue = _JoinLobby( Self, steamIDLobby ); + return await LobbyEnter_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FLeaveLobby( IntPtr self, SteamId steamIDLobby ); + private FLeaveLobby _LeaveLobby; + + #endregion + internal void LeaveLobby( SteamId steamIDLobby ) + { + _LeaveLobby( Self, steamIDLobby ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FInviteUserToLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDInvitee ); + private FInviteUserToLobby _InviteUserToLobby; + + #endregion + internal bool InviteUserToLobby( SteamId steamIDLobby, SteamId steamIDInvitee ) + { + var returnValue = _InviteUserToLobby( Self, steamIDLobby, steamIDInvitee ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetNumLobbyMembers( IntPtr self, SteamId steamIDLobby ); + private FGetNumLobbyMembers _GetNumLobbyMembers; + + #endregion + internal int GetNumLobbyMembers( SteamId steamIDLobby ) + { + var returnValue = _GetNumLobbyMembers( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetLobbyMemberByIndex( IntPtr self, ref SteamId retVal, SteamId steamIDLobby, int iMember ); + #else + private delegate SteamId FGetLobbyMemberByIndex( IntPtr self, SteamId steamIDLobby, int iMember ); + #endif + private FGetLobbyMemberByIndex _GetLobbyMemberByIndex; + + #endregion + internal SteamId GetLobbyMemberByIndex( SteamId steamIDLobby, int iMember ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetLobbyMemberByIndex( Self, ref retVal, steamIDLobby, iMember ); + return retVal; + #else + var returnValue = _GetLobbyMemberByIndex( Self, steamIDLobby, iMember ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FGetLobbyData _GetLobbyData; + + #endregion + internal string GetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLobbyData( Self, steamIDLobby, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private FSetLobbyData _SetLobbyData; + + #endregion + internal bool SetLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _SetLobbyData( Self, steamIDLobby, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLobbyDataCount( IntPtr self, SteamId steamIDLobby ); + private FGetLobbyDataCount _GetLobbyDataCount; + + #endregion + internal int GetLobbyDataCount( SteamId steamIDLobby ) + { + var returnValue = _GetLobbyDataCount( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetLobbyDataByIndex( IntPtr self, SteamId steamIDLobby, int iLobbyData, IntPtr pchKey, int cchKeyBufferSize, IntPtr pchValue, int cchValueBufferSize ); + private FGetLobbyDataByIndex _GetLobbyDataByIndex; + + #endregion + internal bool GetLobbyDataByIndex( SteamId steamIDLobby, int iLobbyData, out string pchKey, out string pchValue ) + { + IntPtr mempchKey = Helpers.TakeMemory(); + IntPtr mempchValue = Helpers.TakeMemory(); + var returnValue = _GetLobbyDataByIndex( Self, steamIDLobby, iLobbyData, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mempchKey ); + pchValue = Helpers.MemoryToString( mempchValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDeleteLobbyData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FDeleteLobbyData _DeleteLobbyData; + + #endregion + internal bool DeleteLobbyData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _DeleteLobbyData( Self, steamIDLobby, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetLobbyMemberData( IntPtr self, SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FGetLobbyMemberData _GetLobbyMemberData; + + #endregion + internal string GetLobbyMemberData( SteamId steamIDLobby, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetLobbyMemberData( Self, steamIDLobby, steamIDUser, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetLobbyMemberData( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private FSetLobbyMemberData _SetLobbyMemberData; + + #endregion + internal void SetLobbyMemberData( SteamId steamIDLobby, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + _SetLobbyMemberData( Self, steamIDLobby, pchKey, pchValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSendLobbyChatMsg( IntPtr self, SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ); + private FSendLobbyChatMsg _SendLobbyChatMsg; + + #endregion + internal bool SendLobbyChatMsg( SteamId steamIDLobby, IntPtr pvMsgBody, int cubMsgBody ) + { + var returnValue = _SendLobbyChatMsg( Self, steamIDLobby, pvMsgBody, cubMsgBody ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLobbyChatEntry( IntPtr self, SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ); + private FGetLobbyChatEntry _GetLobbyChatEntry; + + #endregion + internal int GetLobbyChatEntry( SteamId steamIDLobby, int iChatID, ref SteamId pSteamIDUser, IntPtr pvData, int cubData, ref ChatEntryType peChatEntryType ) + { + var returnValue = _GetLobbyChatEntry( Self, steamIDLobby, iChatID, ref pSteamIDUser, pvData, cubData, ref peChatEntryType ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRequestLobbyData( IntPtr self, SteamId steamIDLobby ); + private FRequestLobbyData _RequestLobbyData; + + #endregion + internal bool RequestLobbyData( SteamId steamIDLobby ) + { + var returnValue = _RequestLobbyData( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetLobbyGameServer( IntPtr self, SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ); + private FSetLobbyGameServer _SetLobbyGameServer; + + #endregion + internal void SetLobbyGameServer( SteamId steamIDLobby, uint unGameServerIP, ushort unGameServerPort, SteamId steamIDGameServer ) + { + _SetLobbyGameServer( Self, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetLobbyGameServer( IntPtr self, SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ); + private FGetLobbyGameServer _GetLobbyGameServer; + + #endregion + internal bool GetLobbyGameServer( SteamId steamIDLobby, ref uint punGameServerIP, ref ushort punGameServerPort, ref SteamId psteamIDGameServer ) + { + var returnValue = _GetLobbyGameServer( Self, steamIDLobby, ref punGameServerIP, ref punGameServerPort, ref psteamIDGameServer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby, int cMaxMembers ); + private FSetLobbyMemberLimit _SetLobbyMemberLimit; + + #endregion + internal bool SetLobbyMemberLimit( SteamId steamIDLobby, int cMaxMembers ) + { + var returnValue = _SetLobbyMemberLimit( Self, steamIDLobby, cMaxMembers ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLobbyMemberLimit( IntPtr self, SteamId steamIDLobby ); + private FGetLobbyMemberLimit _GetLobbyMemberLimit; + + #endregion + internal int GetLobbyMemberLimit( SteamId steamIDLobby ) + { + var returnValue = _GetLobbyMemberLimit( Self, steamIDLobby ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLobbyType( IntPtr self, SteamId steamIDLobby, LobbyType eLobbyType ); + private FSetLobbyType _SetLobbyType; + + #endregion + internal bool SetLobbyType( SteamId steamIDLobby, LobbyType eLobbyType ) + { + var returnValue = _SetLobbyType( Self, steamIDLobby, eLobbyType ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLobbyJoinable( IntPtr self, SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ); + private FSetLobbyJoinable _SetLobbyJoinable; + + #endregion + internal bool SetLobbyJoinable( SteamId steamIDLobby, [MarshalAs( UnmanagedType.U1 )] bool bLobbyJoinable ) + { + var returnValue = _SetLobbyJoinable( Self, steamIDLobby, bLobbyJoinable ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetLobbyOwner( IntPtr self, ref SteamId retVal, SteamId steamIDLobby ); + #else + private delegate SteamId FGetLobbyOwner( IntPtr self, SteamId steamIDLobby ); + #endif + private FGetLobbyOwner _GetLobbyOwner; + + #endregion + internal SteamId GetLobbyOwner( SteamId steamIDLobby ) + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetLobbyOwner( Self, ref retVal, steamIDLobby ); + return retVal; + #else + var returnValue = _GetLobbyOwner( Self, steamIDLobby ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLobbyOwner( IntPtr self, SteamId steamIDLobby, SteamId steamIDNewOwner ); + private FSetLobbyOwner _SetLobbyOwner; + + #endregion + internal bool SetLobbyOwner( SteamId steamIDLobby, SteamId steamIDNewOwner ) + { + var returnValue = _SetLobbyOwner( Self, steamIDLobby, steamIDNewOwner ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLinkedLobby( IntPtr self, SteamId steamIDLobby, SteamId steamIDLobbyDependent ); + private FSetLinkedLobby _SetLinkedLobby; + + #endregion + internal bool SetLinkedLobby( SteamId steamIDLobby, SteamId steamIDLobbyDependent ) + { + var returnValue = _SetLinkedLobby( Self, steamIDLobby, steamIDLobbyDependent ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs new file mode 100644 index 0000000..3401895 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMatchmakingServers.cs @@ -0,0 +1,258 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamMatchmakingServers : SteamInterface + { + public override string InterfaceName => "SteamMatchMakingServers002"; + + public override void InitInternals() + { + _RequestInternetServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _RequestLANServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _RequestFriendsServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _RequestFavoritesServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _RequestHistoryServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _RequestSpectatorServerList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _ReleaseRequest = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetServerDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _CancelQuery = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _RefreshQuery = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _IsRefreshing = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetServerCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _RefreshServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _PingServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _PlayerDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _ServerRules = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _CancelServerQuery = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _RequestInternetServerList = null; + _RequestLANServerList = null; + _RequestFriendsServerList = null; + _RequestFavoritesServerList = null; + _RequestHistoryServerList = null; + _RequestSpectatorServerList = null; + _ReleaseRequest = null; + _GetServerDetails = null; + _CancelQuery = null; + _RefreshQuery = null; + _IsRefreshing = null; + _GetServerCount = null; + _RefreshServer = null; + _PingServer = null; + _PlayerDetails = null; + _ServerRules = null; + _CancelServerQuery = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestInternetServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private FRequestInternetServerList _RequestInternetServerList; + + #endregion + internal HServerListRequest RequestInternetServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestInternetServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestLANServerList( IntPtr self, AppId iApp, IntPtr pRequestServersResponse ); + private FRequestLANServerList _RequestLANServerList; + + #endregion + internal HServerListRequest RequestLANServerList( AppId iApp, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestLANServerList( Self, iApp, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestFriendsServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private FRequestFriendsServerList _RequestFriendsServerList; + + #endregion + internal HServerListRequest RequestFriendsServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestFriendsServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestFavoritesServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private FRequestFavoritesServerList _RequestFavoritesServerList; + + #endregion + internal HServerListRequest RequestFavoritesServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestFavoritesServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestHistoryServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private FRequestHistoryServerList _RequestHistoryServerList; + + #endregion + internal HServerListRequest RequestHistoryServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestHistoryServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerListRequest FRequestSpectatorServerList( IntPtr self, AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ); + private FRequestSpectatorServerList _RequestSpectatorServerList; + + #endregion + internal HServerListRequest RequestSpectatorServerList( AppId iApp, [In,Out] ref MatchMakingKeyValuePair[] ppchFilters, uint nFilters, IntPtr pRequestServersResponse ) + { + var returnValue = _RequestSpectatorServerList( Self, iApp, ref ppchFilters, nFilters, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FReleaseRequest( IntPtr self, HServerListRequest hServerListRequest ); + private FReleaseRequest _ReleaseRequest; + + #endregion + internal void ReleaseRequest( HServerListRequest hServerListRequest ) + { + _ReleaseRequest( Self, hServerListRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate IntPtr FGetServerDetails( IntPtr self, HServerListRequest hRequest, int iServer ); + private FGetServerDetails _GetServerDetails; + + #endregion + internal gameserveritem_t GetServerDetails( HServerListRequest hRequest, int iServer ) + { + var returnValue = _GetServerDetails( Self, hRequest, iServer ); + return gameserveritem_t.Fill( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FCancelQuery( IntPtr self, HServerListRequest hRequest ); + private FCancelQuery _CancelQuery; + + #endregion + internal void CancelQuery( HServerListRequest hRequest ) + { + _CancelQuery( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRefreshQuery( IntPtr self, HServerListRequest hRequest ); + private FRefreshQuery _RefreshQuery; + + #endregion + internal void RefreshQuery( HServerListRequest hRequest ) + { + _RefreshQuery( Self, hRequest ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsRefreshing( IntPtr self, HServerListRequest hRequest ); + private FIsRefreshing _IsRefreshing; + + #endregion + internal bool IsRefreshing( HServerListRequest hRequest ) + { + var returnValue = _IsRefreshing( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetServerCount( IntPtr self, HServerListRequest hRequest ); + private FGetServerCount _GetServerCount; + + #endregion + internal int GetServerCount( HServerListRequest hRequest ) + { + var returnValue = _GetServerCount( Self, hRequest ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRefreshServer( IntPtr self, HServerListRequest hRequest, int iServer ); + private FRefreshServer _RefreshServer; + + #endregion + internal void RefreshServer( HServerListRequest hRequest, int iServer ) + { + _RefreshServer( Self, hRequest, iServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerQuery FPingServer( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private FPingServer _PingServer; + + #endregion + internal HServerQuery PingServer( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _PingServer( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerQuery FPlayerDetails( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private FPlayerDetails _PlayerDetails; + + #endregion + internal HServerQuery PlayerDetails( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _PlayerDetails( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HServerQuery FServerRules( IntPtr self, uint unIP, ushort usPort, IntPtr pRequestServersResponse ); + private FServerRules _ServerRules; + + #endregion + internal HServerQuery ServerRules( uint unIP, ushort usPort, IntPtr pRequestServersResponse ) + { + var returnValue = _ServerRules( Self, unIP, usPort, pRequestServersResponse ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FCancelServerQuery( IntPtr self, HServerQuery hServerQuery ); + private FCancelServerQuery _CancelServerQuery; + + #endregion + internal void CancelServerQuery( HServerQuery hServerQuery ) + { + _CancelServerQuery( Self, hServerQuery ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs new file mode 100644 index 0000000..f07f7ad --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamMusic.cs @@ -0,0 +1,147 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamMusic : SteamInterface + { + public override string InterfaceName => "STEAMMUSIC_INTERFACE_VERSION001"; + + public override void InitInternals() + { + _BIsEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _BIsPlaying = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetPlaybackStatus = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _Play = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _Pause = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _PlayPrevious = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _PlayNext = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _SetVolume = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetVolume = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _BIsEnabled = null; + _BIsPlaying = null; + _GetPlaybackStatus = null; + _Play = null; + _Pause = null; + _PlayPrevious = null; + _PlayNext = null; + _SetVolume = null; + _GetVolume = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsEnabled( IntPtr self ); + private FBIsEnabled _BIsEnabled; + + #endregion + internal bool BIsEnabled() + { + var returnValue = _BIsEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsPlaying( IntPtr self ); + private FBIsPlaying _BIsPlaying; + + #endregion + internal bool BIsPlaying() + { + var returnValue = _BIsPlaying( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate MusicStatus FGetPlaybackStatus( IntPtr self ); + private FGetPlaybackStatus _GetPlaybackStatus; + + #endregion + internal MusicStatus GetPlaybackStatus() + { + var returnValue = _GetPlaybackStatus( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FPlay( IntPtr self ); + private FPlay _Play; + + #endregion + internal void Play() + { + _Play( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FPause( IntPtr self ); + private FPause _Pause; + + #endregion + internal void Pause() + { + _Pause( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FPlayPrevious( IntPtr self ); + private FPlayPrevious _PlayPrevious; + + #endregion + internal void PlayPrevious() + { + _PlayPrevious( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FPlayNext( IntPtr self ); + private FPlayNext _PlayNext; + + #endregion + internal void PlayNext() + { + _PlayNext( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetVolume( IntPtr self, float flVolume ); + private FSetVolume _SetVolume; + + #endregion + internal void SetVolume( float flVolume ) + { + _SetVolume( Self, flVolume ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate float FGetVolume( IntPtr self ); + private FGetVolume _GetVolume; + + #endregion + internal float GetVolume() + { + var returnValue = _GetVolume( Self ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs new file mode 100644 index 0000000..ee94c80 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworking.cs @@ -0,0 +1,349 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamNetworking : SteamInterface + { + public override string InterfaceName => "SteamNetworking005"; + + public override void InitInternals() + { + _SendP2PPacket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _IsP2PPacketAvailable = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _ReadP2PPacket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _AcceptP2PSessionWithUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _CloseP2PSessionWithUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _CloseP2PChannelWithUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetP2PSessionState = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _AllowP2PPacketRelay = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _CreateListenSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _CreateP2PConnectionSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _CreateConnectionSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _DestroySocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _DestroyListenSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _SendDataOnSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _IsDataAvailableOnSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _RetrieveDataFromSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _IsDataAvailable = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _RetrieveData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetSocketInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetListenSocketInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetSocketConnectionType = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetMaxPacketSize = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _SendP2PPacket = null; + _IsP2PPacketAvailable = null; + _ReadP2PPacket = null; + _AcceptP2PSessionWithUser = null; + _CloseP2PSessionWithUser = null; + _CloseP2PChannelWithUser = null; + _GetP2PSessionState = null; + _AllowP2PPacketRelay = null; + _CreateListenSocket = null; + _CreateP2PConnectionSocket = null; + _CreateConnectionSocket = null; + _DestroySocket = null; + _DestroyListenSocket = null; + _SendDataOnSocket = null; + _IsDataAvailableOnSocket = null; + _RetrieveDataFromSocket = null; + _IsDataAvailable = null; + _RetrieveData = null; + _GetSocketInfo = null; + _GetListenSocketInfo = null; + _GetSocketConnectionType = null; + _GetMaxPacketSize = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSendP2PPacket( IntPtr self, SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ); + private FSendP2PPacket _SendP2PPacket; + + #endregion + internal bool SendP2PPacket( SteamId steamIDRemote, IntPtr pubData, uint cubData, P2PSend eP2PSendType, int nChannel ) + { + var returnValue = _SendP2PPacket( Self, steamIDRemote, pubData, cubData, eP2PSendType, nChannel ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsP2PPacketAvailable( IntPtr self, ref uint pcubMsgSize, int nChannel ); + private FIsP2PPacketAvailable _IsP2PPacketAvailable; + + #endregion + internal bool IsP2PPacketAvailable( ref uint pcubMsgSize, int nChannel ) + { + var returnValue = _IsP2PPacketAvailable( Self, ref pcubMsgSize, nChannel ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FReadP2PPacket( IntPtr self, IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ); + private FReadP2PPacket _ReadP2PPacket; + + #endregion + internal bool ReadP2PPacket( IntPtr pubDest, uint cubDest, ref uint pcubMsgSize, ref SteamId psteamIDRemote, int nChannel ) + { + var returnValue = _ReadP2PPacket( Self, pubDest, cubDest, ref pcubMsgSize, ref psteamIDRemote, nChannel ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAcceptP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); + private FAcceptP2PSessionWithUser _AcceptP2PSessionWithUser; + + #endregion + internal bool AcceptP2PSessionWithUser( SteamId steamIDRemote ) + { + var returnValue = _AcceptP2PSessionWithUser( Self, steamIDRemote ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCloseP2PSessionWithUser( IntPtr self, SteamId steamIDRemote ); + private FCloseP2PSessionWithUser _CloseP2PSessionWithUser; + + #endregion + internal bool CloseP2PSessionWithUser( SteamId steamIDRemote ) + { + var returnValue = _CloseP2PSessionWithUser( Self, steamIDRemote ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCloseP2PChannelWithUser( IntPtr self, SteamId steamIDRemote, int nChannel ); + private FCloseP2PChannelWithUser _CloseP2PChannelWithUser; + + #endregion + internal bool CloseP2PChannelWithUser( SteamId steamIDRemote, int nChannel ) + { + var returnValue = _CloseP2PChannelWithUser( Self, steamIDRemote, nChannel ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetP2PSessionState( IntPtr self, SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ); + private FGetP2PSessionState _GetP2PSessionState; + + #endregion + internal bool GetP2PSessionState( SteamId steamIDRemote, ref P2PSessionState_t pConnectionState ) + { + var returnValue = _GetP2PSessionState( Self, steamIDRemote, ref pConnectionState ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAllowP2PPacketRelay( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAllow ); + private FAllowP2PPacketRelay _AllowP2PPacketRelay; + + #endregion + internal bool AllowP2PPacketRelay( [MarshalAs( UnmanagedType.U1 )] bool bAllow ) + { + var returnValue = _AllowP2PPacketRelay( Self, bAllow ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SNetListenSocket_t FCreateListenSocket( IntPtr self, int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); + private FCreateListenSocket _CreateListenSocket; + + #endregion + internal SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort, uint nIP, ushort nPort, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ) + { + var returnValue = _CreateListenSocket( Self, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SNetSocket_t FCreateP2PConnectionSocket( IntPtr self, SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ); + private FCreateP2PConnectionSocket _CreateP2PConnectionSocket; + + #endregion + internal SNetSocket_t CreateP2PConnectionSocket( SteamId steamIDTarget, int nVirtualPort, int nTimeoutSec, [MarshalAs( UnmanagedType.U1 )] bool bAllowUseOfPacketRelay ) + { + var returnValue = _CreateP2PConnectionSocket( Self, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SNetSocket_t FCreateConnectionSocket( IntPtr self, uint nIP, ushort nPort, int nTimeoutSec ); + private FCreateConnectionSocket _CreateConnectionSocket; + + #endregion + internal SNetSocket_t CreateConnectionSocket( uint nIP, ushort nPort, int nTimeoutSec ) + { + var returnValue = _CreateConnectionSocket( Self, nIP, nPort, nTimeoutSec ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDestroySocket( IntPtr self, SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); + private FDestroySocket _DestroySocket; + + #endregion + internal bool DestroySocket( SNetSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ) + { + var returnValue = _DestroySocket( Self, hSocket, bNotifyRemoteEnd ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDestroyListenSocket( IntPtr self, SNetListenSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ); + private FDestroyListenSocket _DestroyListenSocket; + + #endregion + internal bool DestroyListenSocket( SNetListenSocket_t hSocket, [MarshalAs( UnmanagedType.U1 )] bool bNotifyRemoteEnd ) + { + var returnValue = _DestroyListenSocket( Self, hSocket, bNotifyRemoteEnd ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSendDataOnSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubData, uint cubData, [MarshalAs( UnmanagedType.U1 )] bool bReliable ); + private FSendDataOnSocket _SendDataOnSocket; + + #endregion + internal bool SendDataOnSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] pubData, uint cubData, [MarshalAs( UnmanagedType.U1 )] bool bReliable ) + { + var returnValue = _SendDataOnSocket( Self, hSocket, pubData, cubData, bReliable ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsDataAvailableOnSocket( IntPtr self, SNetSocket_t hSocket, ref uint pcubMsgSize ); + private FIsDataAvailableOnSocket _IsDataAvailableOnSocket; + + #endregion + internal bool IsDataAvailableOnSocket( SNetSocket_t hSocket, ref uint pcubMsgSize ) + { + var returnValue = _IsDataAvailableOnSocket( Self, hSocket, ref pcubMsgSize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRetrieveDataFromSocket( IntPtr self, SNetSocket_t hSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize ); + private FRetrieveDataFromSocket _RetrieveDataFromSocket; + + #endregion + internal bool RetrieveDataFromSocket( SNetSocket_t hSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize ) + { + var returnValue = _RetrieveDataFromSocket( Self, hSocket, pubDest, cubDest, ref pcubMsgSize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsDataAvailable( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); + private FIsDataAvailable _IsDataAvailable; + + #endregion + internal bool IsDataAvailable( SNetListenSocket_t hListenSocket, ref uint pcubMsgSize, ref SNetSocket_t phSocket ) + { + var returnValue = _IsDataAvailable( Self, hListenSocket, ref pcubMsgSize, ref phSocket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRetrieveData( IntPtr self, SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize, ref SNetSocket_t phSocket ); + private FRetrieveData _RetrieveData; + + #endregion + internal bool RetrieveData( SNetListenSocket_t hListenSocket, [In,Out] IntPtr[] pubDest, uint cubDest, ref uint pcubMsgSize, ref SNetSocket_t phSocket ) + { + var returnValue = _RetrieveData( Self, hListenSocket, pubDest, cubDest, ref pcubMsgSize, ref phSocket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetSocketInfo( IntPtr self, SNetSocket_t hSocket, ref SteamId pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref ushort punPortRemote ); + private FGetSocketInfo _GetSocketInfo; + + #endregion + internal bool GetSocketInfo( SNetSocket_t hSocket, ref SteamId pSteamIDRemote, ref int peSocketStatus, ref uint punIPRemote, ref ushort punPortRemote ) + { + var returnValue = _GetSocketInfo( Self, hSocket, ref pSteamIDRemote, ref peSocketStatus, ref punIPRemote, ref punPortRemote ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetListenSocketInfo( IntPtr self, SNetListenSocket_t hListenSocket, ref uint pnIP, ref ushort pnPort ); + private FGetListenSocketInfo _GetListenSocketInfo; + + #endregion + internal bool GetListenSocketInfo( SNetListenSocket_t hListenSocket, ref uint pnIP, ref ushort pnPort ) + { + var returnValue = _GetListenSocketInfo( Self, hListenSocket, ref pnIP, ref pnPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SNetSocketConnectionType FGetSocketConnectionType( IntPtr self, SNetSocket_t hSocket ); + private FGetSocketConnectionType _GetSocketConnectionType; + + #endregion + internal SNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket ) + { + var returnValue = _GetSocketConnectionType( Self, hSocket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetMaxPacketSize( IntPtr self, SNetSocket_t hSocket ); + private FGetMaxPacketSize _GetMaxPacketSize; + + #endregion + internal int GetMaxPacketSize( SNetSocket_t hSocket ) + { + var returnValue = _GetMaxPacketSize( Self, hSocket ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs new file mode 100644 index 0000000..4dcf5c5 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingSockets.cs @@ -0,0 +1,443 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamNetworkingSockets : SteamInterface + { + public override string InterfaceName => "SteamNetworkingSockets002"; + + public override void InitInternals() + { + _CreateListenSocketIP = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _ConnectByIPAddress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _CreateListenSocketP2P = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _ConnectP2P = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _AcceptConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _CloseConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _CloseListenSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _SetConnectionUserData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetConnectionUserData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _SetConnectionName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetConnectionName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _SendMessageToConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _FlushMessagesOnConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _ReceiveMessagesOnConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _ReceiveMessagesOnListenSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetConnectionInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _GetQuickConnectionStatus = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetDetailedConnectionStatus = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetListenSocketAddress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _CreateSocketPair = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetIdentity = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _ReceivedRelayAuthTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _FindRelayAuthTicketForServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _ConnectToHostedDedicatedServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _GetHostedDedicatedServerPort = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _GetHostedDedicatedServerPOPID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _GetHostedDedicatedServerAddress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _CreateHostedDedicatedServerListenSocket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _RunCallbacks = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _CreateListenSocketIP = null; + _ConnectByIPAddress = null; + _CreateListenSocketP2P = null; + _ConnectP2P = null; + _AcceptConnection = null; + _CloseConnection = null; + _CloseListenSocket = null; + _SetConnectionUserData = null; + _GetConnectionUserData = null; + _SetConnectionName = null; + _GetConnectionName = null; + _SendMessageToConnection = null; + _FlushMessagesOnConnection = null; + _ReceiveMessagesOnConnection = null; + _ReceiveMessagesOnListenSocket = null; + _GetConnectionInfo = null; + _GetQuickConnectionStatus = null; + _GetDetailedConnectionStatus = null; + _GetListenSocketAddress = null; + _CreateSocketPair = null; + _GetIdentity = null; + _ReceivedRelayAuthTicket = null; + _FindRelayAuthTicketForServer = null; + _ConnectToHostedDedicatedServer = null; + _GetHostedDedicatedServerPort = null; + _GetHostedDedicatedServerPOPID = null; + _GetHostedDedicatedServerAddress = null; + _CreateHostedDedicatedServerListenSocket = null; + _RunCallbacks = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Socket FCreateListenSocketIP( IntPtr self, ref NetAddress localAddress ); + private FCreateListenSocketIP _CreateListenSocketIP; + + #endregion + internal Socket CreateListenSocketIP( ref NetAddress localAddress ) + { + var returnValue = _CreateListenSocketIP( Self, ref localAddress ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Connection FConnectByIPAddress( IntPtr self, ref NetAddress address ); + private FConnectByIPAddress _ConnectByIPAddress; + + #endregion + internal Connection ConnectByIPAddress( ref NetAddress address ) + { + var returnValue = _ConnectByIPAddress( Self, ref address ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Socket FCreateListenSocketP2P( IntPtr self, int nVirtualPort ); + private FCreateListenSocketP2P _CreateListenSocketP2P; + + #endregion + internal Socket CreateListenSocketP2P( int nVirtualPort ) + { + var returnValue = _CreateListenSocketP2P( Self, nVirtualPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Connection FConnectP2P( IntPtr self, ref NetIdentity identityRemote, int nVirtualPort ); + private FConnectP2P _ConnectP2P; + + #endregion + internal Connection ConnectP2P( ref NetIdentity identityRemote, int nVirtualPort ) + { + var returnValue = _ConnectP2P( Self, ref identityRemote, nVirtualPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Result FAcceptConnection( IntPtr self, Connection hConn ); + private FAcceptConnection _AcceptConnection; + + #endregion + internal Result AcceptConnection( Connection hConn ) + { + var returnValue = _AcceptConnection( Self, hConn ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCloseConnection( IntPtr self, Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ); + private FCloseConnection _CloseConnection; + + #endregion + internal bool CloseConnection( Connection hPeer, int nReason, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszDebug, [MarshalAs( UnmanagedType.U1 )] bool bEnableLinger ) + { + var returnValue = _CloseConnection( Self, hPeer, nReason, pszDebug, bEnableLinger ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCloseListenSocket( IntPtr self, Socket hSocket ); + private FCloseListenSocket _CloseListenSocket; + + #endregion + internal bool CloseListenSocket( Socket hSocket ) + { + var returnValue = _CloseListenSocket( Self, hSocket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetConnectionUserData( IntPtr self, Connection hPeer, long nUserData ); + private FSetConnectionUserData _SetConnectionUserData; + + #endregion + internal bool SetConnectionUserData( Connection hPeer, long nUserData ) + { + var returnValue = _SetConnectionUserData( Self, hPeer, nUserData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate long FGetConnectionUserData( IntPtr self, Connection hPeer ); + private FGetConnectionUserData _GetConnectionUserData; + + #endregion + internal long GetConnectionUserData( Connection hPeer ) + { + var returnValue = _GetConnectionUserData( Self, hPeer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetConnectionName( IntPtr self, Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ); + private FSetConnectionName _SetConnectionName; + + #endregion + internal void SetConnectionName( Connection hPeer, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszName ) + { + _SetConnectionName( Self, hPeer, pszName ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetConnectionName( IntPtr self, Connection hPeer, IntPtr pszName, int nMaxLen ); + private FGetConnectionName _GetConnectionName; + + #endregion + internal bool GetConnectionName( Connection hPeer, out string pszName ) + { + IntPtr mempszName = Helpers.TakeMemory(); + var returnValue = _GetConnectionName( Self, hPeer, mempszName, (1024 * 32) ); + pszName = Helpers.MemoryToString( mempszName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Result FSendMessageToConnection( IntPtr self, Connection hConn, IntPtr pData, uint cbData, int nSendFlags ); + private FSendMessageToConnection _SendMessageToConnection; + + #endregion + internal Result SendMessageToConnection( Connection hConn, IntPtr pData, uint cbData, int nSendFlags ) + { + var returnValue = _SendMessageToConnection( Self, hConn, pData, cbData, nSendFlags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Result FFlushMessagesOnConnection( IntPtr self, Connection hConn ); + private FFlushMessagesOnConnection _FlushMessagesOnConnection; + + #endregion + internal Result FlushMessagesOnConnection( Connection hConn ) + { + var returnValue = _FlushMessagesOnConnection( Self, hConn ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FReceiveMessagesOnConnection( IntPtr self, Connection hConn, IntPtr ppOutMessages, int nMaxMessages ); + private FReceiveMessagesOnConnection _ReceiveMessagesOnConnection; + + #endregion + internal int ReceiveMessagesOnConnection( Connection hConn, IntPtr ppOutMessages, int nMaxMessages ) + { + var returnValue = _ReceiveMessagesOnConnection( Self, hConn, ppOutMessages, nMaxMessages ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FReceiveMessagesOnListenSocket( IntPtr self, Socket hSocket, IntPtr ppOutMessages, int nMaxMessages ); + private FReceiveMessagesOnListenSocket _ReceiveMessagesOnListenSocket; + + #endregion + internal int ReceiveMessagesOnListenSocket( Socket hSocket, IntPtr ppOutMessages, int nMaxMessages ) + { + var returnValue = _ReceiveMessagesOnListenSocket( Self, hSocket, ppOutMessages, nMaxMessages ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetConnectionInfo( IntPtr self, Connection hConn, ref ConnectionInfo pInfo ); + private FGetConnectionInfo _GetConnectionInfo; + + #endregion + internal bool GetConnectionInfo( Connection hConn, ref ConnectionInfo pInfo ) + { + var returnValue = _GetConnectionInfo( Self, hConn, ref pInfo ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQuickConnectionStatus( IntPtr self, Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ); + private FGetQuickConnectionStatus _GetQuickConnectionStatus; + + #endregion + internal bool GetQuickConnectionStatus( Connection hConn, ref SteamNetworkingQuickConnectionStatus pStats ) + { + var returnValue = _GetQuickConnectionStatus( Self, hConn, ref pStats ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetDetailedConnectionStatus( IntPtr self, Connection hConn, IntPtr pszBuf, int cbBuf ); + private FGetDetailedConnectionStatus _GetDetailedConnectionStatus; + + #endregion + internal int GetDetailedConnectionStatus( Connection hConn, out string pszBuf ) + { + IntPtr mempszBuf = Helpers.TakeMemory(); + var returnValue = _GetDetailedConnectionStatus( Self, hConn, mempszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mempszBuf ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetListenSocketAddress( IntPtr self, Socket hSocket, ref NetAddress address ); + private FGetListenSocketAddress _GetListenSocketAddress; + + #endregion + internal bool GetListenSocketAddress( Socket hSocket, ref NetAddress address ) + { + var returnValue = _GetListenSocketAddress( Self, hSocket, ref address ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCreateSocketPair( IntPtr self, [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ); + private FCreateSocketPair _CreateSocketPair; + + #endregion + internal bool CreateSocketPair( [In,Out] Connection[] pOutConnection1, [In,Out] Connection[] pOutConnection2, [MarshalAs( UnmanagedType.U1 )] bool bUseNetworkLoopback, ref NetIdentity pIdentity1, ref NetIdentity pIdentity2 ) + { + var returnValue = _CreateSocketPair( Self, pOutConnection1, pOutConnection2, bUseNetworkLoopback, ref pIdentity1, ref pIdentity2 ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetIdentity( IntPtr self, ref NetIdentity pIdentity ); + private FGetIdentity _GetIdentity; + + #endregion + internal bool GetIdentity( ref NetIdentity pIdentity ) + { + var returnValue = _GetIdentity( Self, ref pIdentity ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FReceivedRelayAuthTicket( IntPtr self, IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); + private FReceivedRelayAuthTicket _ReceivedRelayAuthTicket; + + #endregion + internal bool ReceivedRelayAuthTicket( IntPtr pvTicket, int cbTicket, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) + { + var returnValue = _ReceivedRelayAuthTicket( Self, pvTicket, cbTicket, pOutParsedTicket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FFindRelayAuthTicketForServer( IntPtr self, ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ); + private FFindRelayAuthTicketForServer _FindRelayAuthTicketForServer; + + #endregion + internal int FindRelayAuthTicketForServer( ref NetIdentity identityGameServer, int nVirtualPort, [In,Out] SteamDatagramRelayAuthTicket[] pOutParsedTicket ) + { + var returnValue = _FindRelayAuthTicketForServer( Self, ref identityGameServer, nVirtualPort, pOutParsedTicket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Connection FConnectToHostedDedicatedServer( IntPtr self, ref NetIdentity identityTarget, int nVirtualPort ); + private FConnectToHostedDedicatedServer _ConnectToHostedDedicatedServer; + + #endregion + internal Connection ConnectToHostedDedicatedServer( ref NetIdentity identityTarget, int nVirtualPort ) + { + var returnValue = _ConnectToHostedDedicatedServer( Self, ref identityTarget, nVirtualPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate ushort FGetHostedDedicatedServerPort( IntPtr self ); + private FGetHostedDedicatedServerPort _GetHostedDedicatedServerPort; + + #endregion + internal ushort GetHostedDedicatedServerPort() + { + var returnValue = _GetHostedDedicatedServerPort( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamNetworkingPOPID FGetHostedDedicatedServerPOPID( IntPtr self ); + private FGetHostedDedicatedServerPOPID _GetHostedDedicatedServerPOPID; + + #endregion + internal SteamNetworkingPOPID GetHostedDedicatedServerPOPID() + { + var returnValue = _GetHostedDedicatedServerPOPID( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetHostedDedicatedServerAddress( IntPtr self, ref SteamDatagramHostedAddress pRouting ); + private FGetHostedDedicatedServerAddress _GetHostedDedicatedServerAddress; + + #endregion + internal bool GetHostedDedicatedServerAddress( ref SteamDatagramHostedAddress pRouting ) + { + var returnValue = _GetHostedDedicatedServerAddress( Self, ref pRouting ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Socket FCreateHostedDedicatedServerListenSocket( IntPtr self, int nVirtualPort ); + private FCreateHostedDedicatedServerListenSocket _CreateHostedDedicatedServerListenSocket; + + #endregion + internal Socket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) + { + var returnValue = _CreateHostedDedicatedServerListenSocket( Self, nVirtualPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRunCallbacks( IntPtr self, IntPtr pCallbacks ); + private FRunCallbacks _RunCallbacks; + + #endregion + internal void RunCallbacks( IntPtr pCallbacks ) + { + _RunCallbacks( Self, pCallbacks ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs new file mode 100644 index 0000000..8da7049 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamNetworkingUtils.cs @@ -0,0 +1,267 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamNetworkingUtils : SteamInterface + { + public override string InterfaceName => "SteamNetworkingUtils001"; + + public override void InitInternals() + { + _GetLocalPingLocation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _EstimatePingTimeBetweenTwoLocations = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _EstimatePingTimeFromLocalHost = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _ConvertPingLocationToString = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _ParsePingLocationString = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _CheckPingDataUpToDate = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _IsPingMeasurementInProgress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetPingToDataCenter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetDirectPingToPOP = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetPOPCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetPOPList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetLocalTimestamp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _SetDebugOutputFunction = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _SetConfigValue = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _GetConfigValue = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetConfigValueInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _GetFirstConfigValue = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetLocalPingLocation = null; + _EstimatePingTimeBetweenTwoLocations = null; + _EstimatePingTimeFromLocalHost = null; + _ConvertPingLocationToString = null; + _ParsePingLocationString = null; + _CheckPingDataUpToDate = null; + _IsPingMeasurementInProgress = null; + _GetPingToDataCenter = null; + _GetDirectPingToPOP = null; + _GetPOPCount = null; + _GetPOPList = null; + _GetLocalTimestamp = null; + _SetDebugOutputFunction = null; + _SetConfigValue = null; + _GetConfigValue = null; + _GetConfigValueInfo = null; + _GetFirstConfigValue = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate float FGetLocalPingLocation( IntPtr self, ref PingLocation result ); + private FGetLocalPingLocation _GetLocalPingLocation; + + #endregion + internal float GetLocalPingLocation( ref PingLocation result ) + { + var returnValue = _GetLocalPingLocation( Self, ref result ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FEstimatePingTimeBetweenTwoLocations( IntPtr self, ref PingLocation location1, ref PingLocation location2 ); + private FEstimatePingTimeBetweenTwoLocations _EstimatePingTimeBetweenTwoLocations; + + #endregion + internal int EstimatePingTimeBetweenTwoLocations( ref PingLocation location1, ref PingLocation location2 ) + { + var returnValue = _EstimatePingTimeBetweenTwoLocations( Self, ref location1, ref location2 ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FEstimatePingTimeFromLocalHost( IntPtr self, ref PingLocation remoteLocation ); + private FEstimatePingTimeFromLocalHost _EstimatePingTimeFromLocalHost; + + #endregion + internal int EstimatePingTimeFromLocalHost( ref PingLocation remoteLocation ) + { + var returnValue = _EstimatePingTimeFromLocalHost( Self, ref remoteLocation ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FConvertPingLocationToString( IntPtr self, ref PingLocation location, IntPtr pszBuf, int cchBufSize ); + private FConvertPingLocationToString _ConvertPingLocationToString; + + #endregion + internal void ConvertPingLocationToString( ref PingLocation location, out string pszBuf ) + { + IntPtr mempszBuf = Helpers.TakeMemory(); + _ConvertPingLocationToString( Self, ref location, mempszBuf, (1024 * 32) ); + pszBuf = Helpers.MemoryToString( mempszBuf ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FParsePingLocationString( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref PingLocation result ); + private FParsePingLocationString _ParsePingLocationString; + + #endregion + internal bool ParsePingLocationString( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszString, ref PingLocation result ) + { + var returnValue = _ParsePingLocationString( Self, pszString, ref result ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FCheckPingDataUpToDate( IntPtr self, float flMaxAgeSeconds ); + private FCheckPingDataUpToDate _CheckPingDataUpToDate; + + #endregion + internal bool CheckPingDataUpToDate( float flMaxAgeSeconds ) + { + var returnValue = _CheckPingDataUpToDate( Self, flMaxAgeSeconds ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsPingMeasurementInProgress( IntPtr self ); + private FIsPingMeasurementInProgress _IsPingMeasurementInProgress; + + #endregion + internal bool IsPingMeasurementInProgress() + { + var returnValue = _IsPingMeasurementInProgress( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetPingToDataCenter( IntPtr self, SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ); + private FGetPingToDataCenter _GetPingToDataCenter; + + #endregion + internal int GetPingToDataCenter( SteamNetworkingPOPID popID, ref SteamNetworkingPOPID pViaRelayPoP ) + { + var returnValue = _GetPingToDataCenter( Self, popID, ref pViaRelayPoP ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetDirectPingToPOP( IntPtr self, SteamNetworkingPOPID popID ); + private FGetDirectPingToPOP _GetDirectPingToPOP; + + #endregion + internal int GetDirectPingToPOP( SteamNetworkingPOPID popID ) + { + var returnValue = _GetDirectPingToPOP( Self, popID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetPOPCount( IntPtr self ); + private FGetPOPCount _GetPOPCount; + + #endregion + internal int GetPOPCount() + { + var returnValue = _GetPOPCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetPOPList( IntPtr self, ref SteamNetworkingPOPID list, int nListSz ); + private FGetPOPList _GetPOPList; + + #endregion + internal int GetPOPList( ref SteamNetworkingPOPID list, int nListSz ) + { + var returnValue = _GetPOPList( Self, ref list, nListSz ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate long FGetLocalTimestamp( IntPtr self ); + private FGetLocalTimestamp _GetLocalTimestamp; + + #endregion + internal long GetLocalTimestamp() + { + var returnValue = _GetLocalTimestamp( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetDebugOutputFunction( IntPtr self, DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ); + private FSetDebugOutputFunction _SetDebugOutputFunction; + + #endregion + internal void SetDebugOutputFunction( DebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) + { + _SetDebugOutputFunction( Self, eDetailLevel, pfnFunc ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ); + private FSetConfigValue _SetConfigValue; + + #endregion + internal bool SetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, NetConfigType eDataType, IntPtr pArg ) + { + var returnValue = _SetConfigValue( Self, eValue, eScopeType, scopeObj, eDataType, pArg ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate NetConfigResult FGetConfigValue( IntPtr self, NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ); + private FGetConfigValue _GetConfigValue; + + #endregion + internal NetConfigResult GetConfigValue( NetConfig eValue, NetScope eScopeType, long scopeObj, ref NetConfigType pOutDataType, IntPtr pResult, ref ulong cbResult ) + { + var returnValue = _GetConfigValue( Self, eValue, eScopeType, scopeObj, ref pOutDataType, pResult, ref cbResult ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetConfigValueInfo( IntPtr self, NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ); + private FGetConfigValueInfo _GetConfigValueInfo; + + #endregion + internal bool GetConfigValueInfo( NetConfig eValue, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pOutName, ref NetConfigType pOutDataType, [In,Out] NetScope[] pOutScope, [In,Out] NetConfig[] pOutNextValue ) + { + var returnValue = _GetConfigValueInfo( Self, eValue, pOutName, ref pOutDataType, pOutScope, pOutNextValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate NetConfig FGetFirstConfigValue( IntPtr self ); + private FGetFirstConfigValue _GetFirstConfigValue; + + #endregion + internal NetConfig GetFirstConfigValue() + { + var returnValue = _GetFirstConfigValue( Self ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs new file mode 100644 index 0000000..84e3f15 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParentalSettings.cs @@ -0,0 +1,114 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamParentalSettings : SteamInterface + { + public override string InterfaceName => "STEAMPARENTALSETTINGS_INTERFACE_VERSION001"; + + public override void InitInternals() + { + _BIsParentalLockEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _BIsParentalLockLocked = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _BIsAppBlocked = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _BIsAppInBlockList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _BIsFeatureBlocked = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _BIsFeatureInBlockList = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _BIsParentalLockEnabled = null; + _BIsParentalLockLocked = null; + _BIsAppBlocked = null; + _BIsAppInBlockList = null; + _BIsFeatureBlocked = null; + _BIsFeatureInBlockList = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsParentalLockEnabled( IntPtr self ); + private FBIsParentalLockEnabled _BIsParentalLockEnabled; + + #endregion + internal bool BIsParentalLockEnabled() + { + var returnValue = _BIsParentalLockEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsParentalLockLocked( IntPtr self ); + private FBIsParentalLockLocked _BIsParentalLockLocked; + + #endregion + internal bool BIsParentalLockLocked() + { + var returnValue = _BIsParentalLockLocked( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsAppBlocked( IntPtr self, AppId nAppID ); + private FBIsAppBlocked _BIsAppBlocked; + + #endregion + internal bool BIsAppBlocked( AppId nAppID ) + { + var returnValue = _BIsAppBlocked( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsAppInBlockList( IntPtr self, AppId nAppID ); + private FBIsAppInBlockList _BIsAppInBlockList; + + #endregion + internal bool BIsAppInBlockList( AppId nAppID ) + { + var returnValue = _BIsAppInBlockList( Self, nAppID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsFeatureBlocked( IntPtr self, ParentalFeature eFeature ); + private FBIsFeatureBlocked _BIsFeatureBlocked; + + #endregion + internal bool BIsFeatureBlocked( ParentalFeature eFeature ) + { + var returnValue = _BIsFeatureBlocked( Self, eFeature ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsFeatureInBlockList( IntPtr self, ParentalFeature eFeature ); + private FBIsFeatureInBlockList _BIsFeatureInBlockList; + + #endregion + internal bool BIsFeatureInBlockList( ParentalFeature eFeature ) + { + var returnValue = _BIsFeatureInBlockList( Self, eFeature ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs new file mode 100644 index 0000000..58a5029 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamParties.cs @@ -0,0 +1,199 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamParties : SteamInterface + { + public override string InterfaceName => "SteamParties002"; + + public override void InitInternals() + { + _GetNumActiveBeacons = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _GetBeaconByIndex = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetBeaconDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _JoinParty = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetNumAvailableBeaconLocations = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetAvailableBeaconLocations = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _CreateBeacon = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _OnReservationCompleted = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _CancelReservation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _ChangeNumOpenSlots = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _DestroyBeacon = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetBeaconLocationData = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetNumActiveBeacons = null; + _GetBeaconByIndex = null; + _GetBeaconDetails = null; + _JoinParty = null; + _GetNumAvailableBeaconLocations = null; + _GetAvailableBeaconLocations = null; + _CreateBeacon = null; + _OnReservationCompleted = null; + _CancelReservation = null; + _ChangeNumOpenSlots = null; + _DestroyBeacon = null; + _GetBeaconLocationData = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetNumActiveBeacons( IntPtr self ); + private FGetNumActiveBeacons _GetNumActiveBeacons; + + #endregion + internal uint GetNumActiveBeacons() + { + var returnValue = _GetNumActiveBeacons( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate PartyBeaconID_t FGetBeaconByIndex( IntPtr self, uint unIndex ); + private FGetBeaconByIndex _GetBeaconByIndex; + + #endregion + internal PartyBeaconID_t GetBeaconByIndex( uint unIndex ) + { + var returnValue = _GetBeaconByIndex( Self, unIndex ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetBeaconDetails( IntPtr self, PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, IntPtr pchMetadata, int cchMetadata ); + private FGetBeaconDetails _GetBeaconDetails; + + #endregion + internal bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, ref SteamId pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, out string pchMetadata ) + { + IntPtr mempchMetadata = Helpers.TakeMemory(); + var returnValue = _GetBeaconDetails( Self, ulBeaconID, ref pSteamIDBeaconOwner, ref pLocation, mempchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mempchMetadata ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FJoinParty( IntPtr self, PartyBeaconID_t ulBeaconID ); + private FJoinParty _JoinParty; + + #endregion + internal async Task JoinParty( PartyBeaconID_t ulBeaconID ) + { + var returnValue = _JoinParty( Self, ulBeaconID ); + return await JoinPartyCallback_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetNumAvailableBeaconLocations( IntPtr self, ref uint puNumLocations ); + private FGetNumAvailableBeaconLocations _GetNumAvailableBeaconLocations; + + #endregion + internal bool GetNumAvailableBeaconLocations( ref uint puNumLocations ) + { + var returnValue = _GetNumAvailableBeaconLocations( Self, ref puNumLocations ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAvailableBeaconLocations( IntPtr self, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ); + private FGetAvailableBeaconLocations _GetAvailableBeaconLocations; + + #endregion + internal bool GetAvailableBeaconLocations( ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations ) + { + var returnValue = _GetAvailableBeaconLocations( Self, ref pLocationList, uMaxNumLocations ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FCreateBeacon( IntPtr self, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ); + private FCreateBeacon _CreateBeacon; + + #endregion + internal async Task CreateBeacon( uint unOpenSlots, /* ref */ SteamPartyBeaconLocation_t pBeaconLocation, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchConnectString, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetadata ) + { + var returnValue = _CreateBeacon( Self, unOpenSlots, ref pBeaconLocation, pchConnectString, pchMetadata ); + return await CreateBeaconCallback_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FOnReservationCompleted( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + private FOnReservationCompleted _OnReservationCompleted; + + #endregion + internal void OnReservationCompleted( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _OnReservationCompleted( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FCancelReservation( IntPtr self, PartyBeaconID_t ulBeacon, SteamId steamIDUser ); + private FCancelReservation _CancelReservation; + + #endregion + internal void CancelReservation( PartyBeaconID_t ulBeacon, SteamId steamIDUser ) + { + _CancelReservation( Self, ulBeacon, steamIDUser ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FChangeNumOpenSlots( IntPtr self, PartyBeaconID_t ulBeacon, uint unOpenSlots ); + private FChangeNumOpenSlots _ChangeNumOpenSlots; + + #endregion + internal async Task ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint unOpenSlots ) + { + var returnValue = _ChangeNumOpenSlots( Self, ulBeacon, unOpenSlots ); + return await ChangeNumOpenSlotsCallback_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDestroyBeacon( IntPtr self, PartyBeaconID_t ulBeacon ); + private FDestroyBeacon _DestroyBeacon; + + #endregion + internal bool DestroyBeacon( PartyBeaconID_t ulBeacon ) + { + var returnValue = _DestroyBeacon( Self, ulBeacon ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetBeaconLocationData( IntPtr self, SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, IntPtr pchDataStringOut, int cchDataStringOut ); + private FGetBeaconLocationData _GetBeaconLocationData; + + #endregion + internal bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, SteamPartyBeaconLocationData eData, out string pchDataStringOut ) + { + IntPtr mempchDataStringOut = Helpers.TakeMemory(); + var returnValue = _GetBeaconLocationData( Self, BeaconLocation, eData, mempchDataStringOut, (1024 * 32) ); + pchDataStringOut = Helpers.MemoryToString( mempchDataStringOut ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs new file mode 100644 index 0000000..48e9030 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamRemoteStorage.cs @@ -0,0 +1,482 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamRemoteStorage : SteamInterface + { + public override string InterfaceName => "STEAMREMOTESTORAGE_INTERFACE_VERSION014"; + + public override void InitInternals() + { + _FileWrite = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _FileRead = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _FileWriteAsync = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _FileReadAsync = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _FileReadAsyncComplete = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _FileForget = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _FileDelete = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _FileShare = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _SetSyncPlatforms = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _FileWriteStreamOpen = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _FileWriteStreamWriteChunk = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _FileWriteStreamClose = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _FileWriteStreamCancel = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _FileExists = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _FilePersisted = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetFileSize = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _GetFileTimestamp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetSyncPlatforms = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetFileCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetFileNameAndSize = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetQuota = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _IsCloudEnabledForAccount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _IsCloudEnabledForApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _SetCloudEnabledForApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _UGCDownload = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _GetUGCDownloadProgress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _GetUGCDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _UGCRead = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _GetCachedUGCCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + // PublishWorkshopFile is deprecated + // CreatePublishedFileUpdateRequest is deprecated + // UpdatePublishedFileFile is deprecated + // UpdatePublishedFilePreviewFile is deprecated + // UpdatePublishedFileTitle is deprecated + // UpdatePublishedFileDescription is deprecated + // UpdatePublishedFileVisibility is deprecated + // UpdatePublishedFileTags is deprecated + // CommitPublishedFileUpdate is deprecated + // GetPublishedFileDetails is deprecated + // DeletePublishedFile is deprecated + // EnumerateUserPublishedFiles is deprecated + // SubscribePublishedFile is deprecated + // EnumerateUserSubscribedFiles is deprecated + // UnsubscribePublishedFile is deprecated + // UpdatePublishedFileSetChangeDescription is deprecated + // GetPublishedItemVoteDetails is deprecated + // UpdateUserPublishedItemVote is deprecated + // GetUserPublishedItemVoteDetails is deprecated + // EnumerateUserSharedWorkshopFiles is deprecated + // PublishVideo is deprecated + // SetUserPublishedFileAction is deprecated + // EnumeratePublishedFilesByUserAction is deprecated + // EnumeratePublishedWorkshopFiles is deprecated + _UGCDownloadToLocation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 424 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _FileWrite = null; + _FileRead = null; + _FileWriteAsync = null; + _FileReadAsync = null; + _FileReadAsyncComplete = null; + _FileForget = null; + _FileDelete = null; + _FileShare = null; + _SetSyncPlatforms = null; + _FileWriteStreamOpen = null; + _FileWriteStreamWriteChunk = null; + _FileWriteStreamClose = null; + _FileWriteStreamCancel = null; + _FileExists = null; + _FilePersisted = null; + _GetFileSize = null; + _GetFileTimestamp = null; + _GetSyncPlatforms = null; + _GetFileCount = null; + _GetFileNameAndSize = null; + _GetQuota = null; + _IsCloudEnabledForAccount = null; + _IsCloudEnabledForApp = null; + _SetCloudEnabledForApp = null; + _UGCDownload = null; + _GetUGCDownloadProgress = null; + _GetUGCDetails = null; + _UGCRead = null; + _GetCachedUGCCount = null; + _UGCDownloadToLocation = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileWrite( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ); + private FFileWrite _FileWrite; + + #endregion + internal bool FileWrite( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubData ) + { + var returnValue = _FileWrite( Self, pchFile, pvData, cubData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FFileRead( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ); + private FFileRead _FileRead; + + #endregion + internal int FileRead( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, int cubDataToRead ) + { + var returnValue = _FileRead( Self, pchFile, pvData, cubDataToRead ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FFileWriteAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ); + private FFileWriteAsync _FileWriteAsync; + + #endregion + internal async Task FileWriteAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, IntPtr pvData, uint cubData ) + { + var returnValue = _FileWriteAsync( Self, pchFile, pvData, cubData ); + return await RemoteStorageFileWriteAsyncComplete_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FFileReadAsync( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ); + private FFileReadAsync _FileReadAsync; + + #endregion + internal async Task FileReadAsync( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, uint nOffset, uint cubToRead ) + { + var returnValue = _FileReadAsync( Self, pchFile, nOffset, cubToRead ); + return await RemoteStorageFileReadAsyncComplete_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileReadAsyncComplete( IntPtr self, SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ); + private FFileReadAsyncComplete _FileReadAsyncComplete; + + #endregion + internal bool FileReadAsyncComplete( SteamAPICall_t hReadCall, IntPtr pvBuffer, uint cubToRead ) + { + var returnValue = _FileReadAsyncComplete( Self, hReadCall, pvBuffer, cubToRead ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileForget( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFileForget _FileForget; + + #endregion + internal bool FileForget( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileForget( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileDelete( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFileDelete _FileDelete; + + #endregion + internal bool FileDelete( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileDelete( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FFileShare( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFileShare _FileShare; + + #endregion + internal async Task FileShare( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileShare( Self, pchFile ); + return await RemoteStorageFileShareResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ); + private FSetSyncPlatforms _SetSyncPlatforms; + + #endregion + internal bool SetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile, RemoteStoragePlatform eRemoteStoragePlatform ) + { + var returnValue = _SetSyncPlatforms( Self, pchFile, eRemoteStoragePlatform ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCFileWriteStreamHandle_t FFileWriteStreamOpen( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFileWriteStreamOpen _FileWriteStreamOpen; + + #endregion + internal UGCFileWriteStreamHandle_t FileWriteStreamOpen( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileWriteStreamOpen( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileWriteStreamWriteChunk( IntPtr self, UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ); + private FFileWriteStreamWriteChunk _FileWriteStreamWriteChunk; + + #endregion + internal bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle, IntPtr pvData, int cubData ) + { + var returnValue = _FileWriteStreamWriteChunk( Self, writeHandle, pvData, cubData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileWriteStreamClose( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); + private FFileWriteStreamClose _FileWriteStreamClose; + + #endregion + internal bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle ) + { + var returnValue = _FileWriteStreamClose( Self, writeHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileWriteStreamCancel( IntPtr self, UGCFileWriteStreamHandle_t writeHandle ); + private FFileWriteStreamCancel _FileWriteStreamCancel; + + #endregion + internal bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle ) + { + var returnValue = _FileWriteStreamCancel( Self, writeHandle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFileExists( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFileExists _FileExists; + + #endregion + internal bool FileExists( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FileExists( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FFilePersisted( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FFilePersisted _FilePersisted; + + #endregion + internal bool FilePersisted( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _FilePersisted( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFileSize( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FGetFileSize _GetFileSize; + + #endregion + internal int GetFileSize( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetFileSize( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate long FGetFileTimestamp( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FGetFileTimestamp _GetFileTimestamp; + + #endregion + internal long GetFileTimestamp( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetFileTimestamp( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate RemoteStoragePlatform FGetSyncPlatforms( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ); + private FGetSyncPlatforms _GetSyncPlatforms; + + #endregion + internal RemoteStoragePlatform GetSyncPlatforms( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFile ) + { + var returnValue = _GetSyncPlatforms( Self, pchFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetFileCount( IntPtr self ); + private FGetFileCount _GetFileCount; + + #endregion + internal int GetFileCount() + { + var returnValue = _GetFileCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetFileNameAndSize( IntPtr self, int iFile, ref int pnFileSizeInBytes ); + private FGetFileNameAndSize _GetFileNameAndSize; + + #endregion + internal string GetFileNameAndSize( int iFile, ref int pnFileSizeInBytes ) + { + var returnValue = _GetFileNameAndSize( Self, iFile, ref pnFileSizeInBytes ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQuota( IntPtr self, ref ulong pnTotalBytes, ref ulong puAvailableBytes ); + private FGetQuota _GetQuota; + + #endregion + internal bool GetQuota( ref ulong pnTotalBytes, ref ulong puAvailableBytes ) + { + var returnValue = _GetQuota( Self, ref pnTotalBytes, ref puAvailableBytes ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsCloudEnabledForAccount( IntPtr self ); + private FIsCloudEnabledForAccount _IsCloudEnabledForAccount; + + #endregion + internal bool IsCloudEnabledForAccount() + { + var returnValue = _IsCloudEnabledForAccount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsCloudEnabledForApp( IntPtr self ); + private FIsCloudEnabledForApp _IsCloudEnabledForApp; + + #endregion + internal bool IsCloudEnabledForApp() + { + var returnValue = _IsCloudEnabledForApp( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetCloudEnabledForApp( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); + private FSetCloudEnabledForApp _SetCloudEnabledForApp; + + #endregion + internal void SetCloudEnabledForApp( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) + { + _SetCloudEnabledForApp( Self, bEnabled ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FUGCDownload( IntPtr self, UGCHandle_t hContent, uint unPriority ); + private FUGCDownload _UGCDownload; + + #endregion + internal async Task UGCDownload( UGCHandle_t hContent, uint unPriority ) + { + var returnValue = _UGCDownload( Self, hContent, unPriority ); + return await RemoteStorageDownloadUGCResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUGCDownloadProgress( IntPtr self, UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ); + private FGetUGCDownloadProgress _GetUGCDownloadProgress; + + #endregion + internal bool GetUGCDownloadProgress( UGCHandle_t hContent, ref int pnBytesDownloaded, ref int pnBytesExpected ) + { + var returnValue = _GetUGCDownloadProgress( Self, hContent, ref pnBytesDownloaded, ref pnBytesExpected ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUGCDetails( IntPtr self, UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ); + private FGetUGCDetails _GetUGCDetails; + + #endregion + internal bool GetUGCDetails( UGCHandle_t hContent, ref AppId pnAppID, [In,Out] ref char[] ppchName, ref int pnFileSizeInBytes, ref SteamId pSteamIDOwner ) + { + var returnValue = _GetUGCDetails( Self, hContent, ref pnAppID, ref ppchName, ref pnFileSizeInBytes, ref pSteamIDOwner ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FUGCRead( IntPtr self, UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ); + private FUGCRead _UGCRead; + + #endregion + internal int UGCRead( UGCHandle_t hContent, IntPtr pvData, int cubDataToRead, uint cOffset, UGCReadAction eAction ) + { + var returnValue = _UGCRead( Self, hContent, pvData, cubDataToRead, cOffset, eAction ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetCachedUGCCount( IntPtr self ); + private FGetCachedUGCCount _GetCachedUGCCount; + + #endregion + internal int GetCachedUGCCount() + { + var returnValue = _GetCachedUGCCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FUGCDownloadToLocation( IntPtr self, UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ); + private FUGCDownloadToLocation _UGCDownloadToLocation; + + #endregion + internal async Task UGCDownloadToLocation( UGCHandle_t hContent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation, uint unPriority ) + { + var returnValue = _UGCDownloadToLocation( Self, hContent, pchLocation, unPriority ); + return await RemoteStorageDownloadUGCResult_t.GetResultAsync( returnValue ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs new file mode 100644 index 0000000..84e570c --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamScreenshots.cs @@ -0,0 +1,152 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamScreenshots : SteamInterface + { + public override string InterfaceName => "STEAMSCREENSHOTS_INTERFACE_VERSION003"; + + public override void InitInternals() + { + _WriteScreenshot = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _AddScreenshotToLibrary = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _TriggerScreenshot = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _HookScreenshots = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _SetLocation = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _TagUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _TagPublishedFile = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _IsScreenshotsHooked = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _AddVRScreenshotToLibrary = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _WriteScreenshot = null; + _AddScreenshotToLibrary = null; + _TriggerScreenshot = null; + _HookScreenshots = null; + _SetLocation = null; + _TagUser = null; + _TagPublishedFile = null; + _IsScreenshotsHooked = null; + _AddVRScreenshotToLibrary = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate ScreenshotHandle FWriteScreenshot( IntPtr self, IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ); + private FWriteScreenshot _WriteScreenshot; + + #endregion + internal ScreenshotHandle WriteScreenshot( IntPtr pubRGB, uint cubRGB, int nWidth, int nHeight ) + { + var returnValue = _WriteScreenshot( Self, pubRGB, cubRGB, nWidth, nHeight ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate ScreenshotHandle FAddScreenshotToLibrary( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ); + private FAddScreenshotToLibrary _AddScreenshotToLibrary; + + #endregion + internal ScreenshotHandle AddScreenshotToLibrary( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchThumbnailFilename, int nWidth, int nHeight ) + { + var returnValue = _AddScreenshotToLibrary( Self, pchFilename, pchThumbnailFilename, nWidth, nHeight ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTriggerScreenshot( IntPtr self ); + private FTriggerScreenshot _TriggerScreenshot; + + #endregion + internal void TriggerScreenshot() + { + _TriggerScreenshot( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FHookScreenshots( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bHook ); + private FHookScreenshots _HookScreenshots; + + #endregion + internal void HookScreenshots( [MarshalAs( UnmanagedType.U1 )] bool bHook ) + { + _HookScreenshots( Self, bHook ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLocation( IntPtr self, ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ); + private FSetLocation _SetLocation; + + #endregion + internal bool SetLocation( ScreenshotHandle hScreenshot, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLocation ) + { + var returnValue = _SetLocation( Self, hScreenshot, pchLocation ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FTagUser( IntPtr self, ScreenshotHandle hScreenshot, SteamId steamID ); + private FTagUser _TagUser; + + #endregion + internal bool TagUser( ScreenshotHandle hScreenshot, SteamId steamID ) + { + var returnValue = _TagUser( Self, hScreenshot, steamID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FTagPublishedFile( IntPtr self, ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ); + private FTagPublishedFile _TagPublishedFile; + + #endregion + internal bool TagPublishedFile( ScreenshotHandle hScreenshot, PublishedFileId unPublishedFileID ) + { + var returnValue = _TagPublishedFile( Self, hScreenshot, unPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsScreenshotsHooked( IntPtr self ); + private FIsScreenshotsHooked _IsScreenshotsHooked; + + #endregion + internal bool IsScreenshotsHooked() + { + var returnValue = _IsScreenshotsHooked( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate ScreenshotHandle FAddVRScreenshotToLibrary( IntPtr self, VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ); + private FAddVRScreenshotToLibrary _AddVRScreenshotToLibrary; + + #endregion + internal ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchFilename, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVRFilename ) + { + var returnValue = _AddVRScreenshotToLibrary( Self, eType, pchFilename, pchVRFilename ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs new file mode 100644 index 0000000..941eb34 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUGC.cs @@ -0,0 +1,1152 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamUGC : SteamInterface + { + public override string InterfaceName => "STEAMUGC_INTERFACE_VERSION012"; + + public override void InitInternals() + { + _CreateQueryUserUGCRequest = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _CreateQueryUGCDetailsRequest = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _SendQueryUGCRequest = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetQueryUGCResult = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetQueryUGCPreviewURL = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetQueryUGCMetadata = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetQueryUGCChildren = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetQueryUGCStatistic = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetQueryUGCNumAdditionalPreviews = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetQueryUGCAdditionalPreview = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetQueryUGCNumKeyValueTags = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _GetQueryUGCKeyValueTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _ReleaseQueryUGCRequest = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _AddRequiredTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _AddExcludedTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _SetReturnOnlyIDs = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _SetReturnKeyValueTags = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _SetReturnLongDescription = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _SetReturnMetadata = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _SetReturnChildren = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _SetReturnAdditionalPreviews = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _SetReturnTotalOnly = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _SetReturnPlaytimeStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _SetLanguage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _SetAllowCachedResponse = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _SetCloudFileNameFilter = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _SetMatchAnyTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _SetSearchText = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _SetRankedByTrendDays = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _AddRequiredKeyValueTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _RequestUGCDetails = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _CreateItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _StartItemUpdate = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _SetItemTitle = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _SetItemDescription = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + _SetItemUpdateLanguage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 296 ) ) ); + _SetItemMetadata = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 304 ) ) ); + _SetItemVisibility = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 312 ) ) ); + _SetItemTags = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 320 ) ) ); + _SetItemContent = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 328 ) ) ); + _SetItemPreview = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 336 ) ) ); + _SetAllowLegacyUpload = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 344 ) ) ); + _RemoveItemKeyValueTags = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 352 ) ) ); + _AddItemKeyValueTag = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 360 ) ) ); + _AddItemPreviewFile = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 368 ) ) ); + _AddItemPreviewVideo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 376 ) ) ); + _UpdateItemPreviewFile = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 384 ) ) ); + _UpdateItemPreviewVideo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 392 ) ) ); + _RemoveItemPreview = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 400 ) ) ); + _SubmitItemUpdate = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 408 ) ) ); + _GetItemUpdateProgress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 416 ) ) ); + _SetUserItemVote = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 424 ) ) ); + _GetUserItemVote = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 432 ) ) ); + _AddItemToFavorites = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 440 ) ) ); + _RemoveItemFromFavorites = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 448 ) ) ); + _SubscribeItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 456 ) ) ); + _UnsubscribeItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 464 ) ) ); + _GetNumSubscribedItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 472 ) ) ); + _GetSubscribedItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 480 ) ) ); + _GetItemState = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 488 ) ) ); + _GetItemInstallInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 496 ) ) ); + _GetItemDownloadInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 504 ) ) ); + _DownloadItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 512 ) ) ); + _BInitWorkshopForGameServer = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 520 ) ) ); + _SuspendDownloads = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 528 ) ) ); + _StartPlaytimeTracking = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 536 ) ) ); + _StopPlaytimeTracking = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 544 ) ) ); + _StopPlaytimeTrackingForAllItems = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 552 ) ) ); + _AddDependency = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 560 ) ) ); + _RemoveDependency = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 568 ) ) ); + _AddAppDependency = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 576 ) ) ); + _RemoveAppDependency = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 584 ) ) ); + _GetAppDependencies = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 592 ) ) ); + _DeleteItem = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 600 ) ) ); + + #if PLATFORM_WIN + _CreateQueryAllUGCRequest1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _CreateQueryAllUGCRequest2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + #else + _CreateQueryAllUGCRequest1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _CreateQueryAllUGCRequest2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + #endif + } + internal override void Shutdown() + { + base.Shutdown(); + + _CreateQueryUserUGCRequest = null; + _CreateQueryAllUGCRequest1 = null; + _CreateQueryAllUGCRequest2 = null; + _CreateQueryUGCDetailsRequest = null; + _SendQueryUGCRequest = null; + _GetQueryUGCResult = null; + _GetQueryUGCPreviewURL = null; + _GetQueryUGCMetadata = null; + _GetQueryUGCChildren = null; + _GetQueryUGCStatistic = null; + _GetQueryUGCNumAdditionalPreviews = null; + _GetQueryUGCAdditionalPreview = null; + _GetQueryUGCNumKeyValueTags = null; + _GetQueryUGCKeyValueTag = null; + _ReleaseQueryUGCRequest = null; + _AddRequiredTag = null; + _AddExcludedTag = null; + _SetReturnOnlyIDs = null; + _SetReturnKeyValueTags = null; + _SetReturnLongDescription = null; + _SetReturnMetadata = null; + _SetReturnChildren = null; + _SetReturnAdditionalPreviews = null; + _SetReturnTotalOnly = null; + _SetReturnPlaytimeStats = null; + _SetLanguage = null; + _SetAllowCachedResponse = null; + _SetCloudFileNameFilter = null; + _SetMatchAnyTag = null; + _SetSearchText = null; + _SetRankedByTrendDays = null; + _AddRequiredKeyValueTag = null; + _RequestUGCDetails = null; + _CreateItem = null; + _StartItemUpdate = null; + _SetItemTitle = null; + _SetItemDescription = null; + _SetItemUpdateLanguage = null; + _SetItemMetadata = null; + _SetItemVisibility = null; + _SetItemTags = null; + _SetItemContent = null; + _SetItemPreview = null; + _SetAllowLegacyUpload = null; + _RemoveItemKeyValueTags = null; + _AddItemKeyValueTag = null; + _AddItemPreviewFile = null; + _AddItemPreviewVideo = null; + _UpdateItemPreviewFile = null; + _UpdateItemPreviewVideo = null; + _RemoveItemPreview = null; + _SubmitItemUpdate = null; + _GetItemUpdateProgress = null; + _SetUserItemVote = null; + _GetUserItemVote = null; + _AddItemToFavorites = null; + _RemoveItemFromFavorites = null; + _SubscribeItem = null; + _UnsubscribeItem = null; + _GetNumSubscribedItems = null; + _GetSubscribedItems = null; + _GetItemState = null; + _GetItemInstallInfo = null; + _GetItemDownloadInfo = null; + _DownloadItem = null; + _BInitWorkshopForGameServer = null; + _SuspendDownloads = null; + _StartPlaytimeTracking = null; + _StopPlaytimeTracking = null; + _StopPlaytimeTrackingForAllItems = null; + _AddDependency = null; + _RemoveDependency = null; + _AddAppDependency = null; + _RemoveAppDependency = null; + _GetAppDependencies = null; + _DeleteItem = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCQueryHandle_t FCreateQueryUserUGCRequest( IntPtr self, AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); + private FCreateQueryUserUGCRequest _CreateQueryUserUGCRequest; + + #endregion + internal UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID, UserUGCList eListType, UgcType eMatchingUGCType, UserUGCListSortOrder eSortOrder, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) + { + var returnValue = _CreateQueryUserUGCRequest( Self, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCQueryHandle_t FCreateQueryAllUGCRequest1( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ); + private FCreateQueryAllUGCRequest1 _CreateQueryAllUGCRequest1; + + #endregion + internal UGCQueryHandle_t CreateQueryAllUGCRequest1( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, uint unPage ) + { + var returnValue = _CreateQueryAllUGCRequest1( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCQueryHandle_t FCreateQueryAllUGCRequest2( IntPtr self, UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ); + private FCreateQueryAllUGCRequest2 _CreateQueryAllUGCRequest2; + + #endregion + internal UGCQueryHandle_t CreateQueryAllUGCRequest2( UGCQuery eQueryType, UgcType eMatchingeMatchingUGCTypeFileType, AppId nCreatorAppID, AppId nConsumerAppID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchCursor ) + { + var returnValue = _CreateQueryAllUGCRequest2( Self, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, pchCursor ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCQueryHandle_t FCreateQueryUGCDetailsRequest( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + private FCreateQueryUGCDetailsRequest _CreateQueryUGCDetailsRequest; + + #endregion + internal UGCQueryHandle_t CreateQueryUGCDetailsRequest( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _CreateQueryUGCDetailsRequest( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FSendQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); + private FSendQueryUGCRequest _SendQueryUGCRequest; + + #endregion + internal async Task SendQueryUGCRequest( UGCQueryHandle_t handle ) + { + var returnValue = _SendQueryUGCRequest( Self, handle ); + return await SteamUGCQueryCompleted_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCResult( IntPtr self, UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ); + private FGetQueryUGCResult _GetQueryUGCResult; + + #endregion + internal bool GetQueryUGCResult( UGCQueryHandle_t handle, uint index, ref SteamUGCDetails_t pDetails ) + { + var returnValue = _GetQueryUGCResult( Self, handle, index, ref pDetails ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCPreviewURL( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchURL, uint cchURLSize ); + private FGetQueryUGCPreviewURL _GetQueryUGCPreviewURL; + + #endregion + internal bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint index, out string pchURL ) + { + IntPtr mempchURL = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCPreviewURL( Self, handle, index, mempchURL, (1024 * 32) ); + pchURL = Helpers.MemoryToString( mempchURL ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCMetadata( IntPtr self, UGCQueryHandle_t handle, uint index, IntPtr pchMetadata, uint cchMetadatasize ); + private FGetQueryUGCMetadata _GetQueryUGCMetadata; + + #endregion + internal bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint index, out string pchMetadata ) + { + IntPtr mempchMetadata = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCMetadata( Self, handle, index, mempchMetadata, (1024 * 32) ); + pchMetadata = Helpers.MemoryToString( mempchMetadata ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCChildren( IntPtr self, UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); + private FGetQueryUGCChildren _GetQueryUGCChildren; + + #endregion + internal bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint index, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) + { + var returnValue = _GetQueryUGCChildren( Self, handle, index, pvecPublishedFileID, cMaxEntries ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCStatistic( IntPtr self, UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ); + private FGetQueryUGCStatistic _GetQueryUGCStatistic; + + #endregion + internal bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint index, ItemStatistic eStatType, ref ulong pStatValue ) + { + var returnValue = _GetQueryUGCStatistic( Self, handle, index, eStatType, ref pStatValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetQueryUGCNumAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, uint index ); + private FGetQueryUGCNumAdditionalPreviews _GetQueryUGCNumAdditionalPreviews; + + #endregion + internal uint GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint index ) + { + var returnValue = _GetQueryUGCNumAdditionalPreviews( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCAdditionalPreview( IntPtr self, UGCQueryHandle_t handle, uint index, uint previewIndex, IntPtr pchURLOrVideoID, uint cchURLSize, IntPtr pchOriginalFileName, uint cchOriginalFileNameSize, ref ItemPreviewType pPreviewType ); + private FGetQueryUGCAdditionalPreview _GetQueryUGCAdditionalPreview; + + #endregion + internal bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint index, uint previewIndex, out string pchURLOrVideoID, out string pchOriginalFileName, ref ItemPreviewType pPreviewType ) + { + IntPtr mempchURLOrVideoID = Helpers.TakeMemory(); + IntPtr mempchOriginalFileName = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCAdditionalPreview( Self, handle, index, previewIndex, mempchURLOrVideoID, (1024 * 32), mempchOriginalFileName, (1024 * 32), ref pPreviewType ); + pchURLOrVideoID = Helpers.MemoryToString( mempchURLOrVideoID ); + pchOriginalFileName = Helpers.MemoryToString( mempchOriginalFileName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetQueryUGCNumKeyValueTags( IntPtr self, UGCQueryHandle_t handle, uint index ); + private FGetQueryUGCNumKeyValueTags _GetQueryUGCNumKeyValueTags; + + #endregion + internal uint GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint index ) + { + var returnValue = _GetQueryUGCNumKeyValueTags( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetQueryUGCKeyValueTag( IntPtr self, UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, IntPtr pchKey, uint cchKeySize, IntPtr pchValue, uint cchValueSize ); + private FGetQueryUGCKeyValueTag _GetQueryUGCKeyValueTag; + + #endregion + internal bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint index, uint keyValueTagIndex, out string pchKey, out string pchValue ) + { + IntPtr mempchKey = Helpers.TakeMemory(); + IntPtr mempchValue = Helpers.TakeMemory(); + var returnValue = _GetQueryUGCKeyValueTag( Self, handle, index, keyValueTagIndex, mempchKey, (1024 * 32), mempchValue, (1024 * 32) ); + pchKey = Helpers.MemoryToString( mempchKey ); + pchValue = Helpers.MemoryToString( mempchValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FReleaseQueryUGCRequest( IntPtr self, UGCQueryHandle_t handle ); + private FReleaseQueryUGCRequest _ReleaseQueryUGCRequest; + + #endregion + internal bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) + { + var returnValue = _ReleaseQueryUGCRequest( Self, handle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddRequiredTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + private FAddRequiredTag _AddRequiredTag; + + #endregion + internal bool AddRequiredTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + { + var returnValue = _AddRequiredTag( Self, handle, pTagName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddExcludedTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ); + private FAddExcludedTag _AddExcludedTag; + + #endregion + internal bool AddExcludedTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pTagName ) + { + var returnValue = _AddExcludedTag( Self, handle, pTagName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnOnlyIDs( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ); + private FSetReturnOnlyIDs _SetReturnOnlyIDs; + + #endregion + internal bool SetReturnOnlyIDs( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnOnlyIDs ) + { + var returnValue = _SetReturnOnlyIDs( Self, handle, bReturnOnlyIDs ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnKeyValueTags( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ); + private FSetReturnKeyValueTags _SetReturnKeyValueTags; + + #endregion + internal bool SetReturnKeyValueTags( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnKeyValueTags ) + { + var returnValue = _SetReturnKeyValueTags( Self, handle, bReturnKeyValueTags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnLongDescription( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ); + private FSetReturnLongDescription _SetReturnLongDescription; + + #endregion + internal bool SetReturnLongDescription( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnLongDescription ) + { + var returnValue = _SetReturnLongDescription( Self, handle, bReturnLongDescription ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnMetadata( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ); + private FSetReturnMetadata _SetReturnMetadata; + + #endregion + internal bool SetReturnMetadata( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnMetadata ) + { + var returnValue = _SetReturnMetadata( Self, handle, bReturnMetadata ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnChildren( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ); + private FSetReturnChildren _SetReturnChildren; + + #endregion + internal bool SetReturnChildren( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnChildren ) + { + var returnValue = _SetReturnChildren( Self, handle, bReturnChildren ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnAdditionalPreviews( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ); + private FSetReturnAdditionalPreviews _SetReturnAdditionalPreviews; + + #endregion + internal bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnAdditionalPreviews ) + { + var returnValue = _SetReturnAdditionalPreviews( Self, handle, bReturnAdditionalPreviews ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnTotalOnly( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ); + private FSetReturnTotalOnly _SetReturnTotalOnly; + + #endregion + internal bool SetReturnTotalOnly( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bReturnTotalOnly ) + { + var returnValue = _SetReturnTotalOnly( Self, handle, bReturnTotalOnly ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetReturnPlaytimeStats( IntPtr self, UGCQueryHandle_t handle, uint unDays ); + private FSetReturnPlaytimeStats _SetReturnPlaytimeStats; + + #endregion + internal bool SetReturnPlaytimeStats( UGCQueryHandle_t handle, uint unDays ) + { + var returnValue = _SetReturnPlaytimeStats( Self, handle, unDays ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetLanguage( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + private FSetLanguage _SetLanguage; + + #endregion + internal bool SetLanguage( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + { + var returnValue = _SetLanguage( Self, handle, pchLanguage ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetAllowCachedResponse( IntPtr self, UGCQueryHandle_t handle, uint unMaxAgeSeconds ); + private FSetAllowCachedResponse _SetAllowCachedResponse; + + #endregion + internal bool SetAllowCachedResponse( UGCQueryHandle_t handle, uint unMaxAgeSeconds ) + { + var returnValue = _SetAllowCachedResponse( Self, handle, unMaxAgeSeconds ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetCloudFileNameFilter( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ); + private FSetCloudFileNameFilter _SetCloudFileNameFilter; + + #endregion + internal bool SetCloudFileNameFilter( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pMatchCloudFileName ) + { + var returnValue = _SetCloudFileNameFilter( Self, handle, pMatchCloudFileName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetMatchAnyTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ); + private FSetMatchAnyTag _SetMatchAnyTag; + + #endregion + internal bool SetMatchAnyTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bMatchAnyTag ) + { + var returnValue = _SetMatchAnyTag( Self, handle, bMatchAnyTag ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetSearchText( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ); + private FSetSearchText _SetSearchText; + + #endregion + internal bool SetSearchText( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pSearchText ) + { + var returnValue = _SetSearchText( Self, handle, pSearchText ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetRankedByTrendDays( IntPtr self, UGCQueryHandle_t handle, uint unDays ); + private FSetRankedByTrendDays _SetRankedByTrendDays; + + #endregion + internal bool SetRankedByTrendDays( UGCQueryHandle_t handle, uint unDays ) + { + var returnValue = _SetRankedByTrendDays( Self, handle, unDays ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddRequiredKeyValueTag( IntPtr self, UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ); + private FAddRequiredKeyValueTag _AddRequiredKeyValueTag; + + #endregion + internal bool AddRequiredKeyValueTag( UGCQueryHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pValue ) + { + var returnValue = _AddRequiredKeyValueTag( Self, handle, pKey, pValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestUGCDetails( IntPtr self, PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ); + private FRequestUGCDetails _RequestUGCDetails; + + #endregion + internal async Task RequestUGCDetails( PublishedFileId nPublishedFileID, uint unMaxAgeSeconds ) + { + var returnValue = _RequestUGCDetails( Self, nPublishedFileID, unMaxAgeSeconds ); + return await SteamUGCRequestUGCDetailsResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FCreateItem( IntPtr self, AppId nConsumerAppId, WorkshopFileType eFileType ); + private FCreateItem _CreateItem; + + #endregion + internal async Task CreateItem( AppId nConsumerAppId, WorkshopFileType eFileType ) + { + var returnValue = _CreateItem( Self, nConsumerAppId, eFileType ); + return await CreateItemResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UGCUpdateHandle_t FStartItemUpdate( IntPtr self, AppId nConsumerAppId, PublishedFileId nPublishedFileID ); + private FStartItemUpdate _StartItemUpdate; + + #endregion + internal UGCUpdateHandle_t StartItemUpdate( AppId nConsumerAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _StartItemUpdate( Self, nConsumerAppId, nPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemTitle( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ); + private FSetItemTitle _SetItemTitle; + + #endregion + internal bool SetItemTitle( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchTitle ) + { + var returnValue = _SetItemTitle( Self, handle, pchTitle ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemDescription( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ); + private FSetItemDescription _SetItemDescription; + + #endregion + internal bool SetItemDescription( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription ) + { + var returnValue = _SetItemDescription( Self, handle, pchDescription ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemUpdateLanguage( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ); + private FSetItemUpdateLanguage _SetItemUpdateLanguage; + + #endregion + internal bool SetItemUpdateLanguage( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLanguage ) + { + var returnValue = _SetItemUpdateLanguage( Self, handle, pchLanguage ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemMetadata( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ); + private FSetItemMetadata _SetItemMetadata; + + #endregion + internal bool SetItemMetadata( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchMetaData ) + { + var returnValue = _SetItemMetadata( Self, handle, pchMetaData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemVisibility( IntPtr self, UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ); + private FSetItemVisibility _SetItemVisibility; + + #endregion + internal bool SetItemVisibility( UGCUpdateHandle_t handle, RemoteStoragePublishedFileVisibility eVisibility ) + { + var returnValue = _SetItemVisibility( Self, handle, eVisibility ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemTags( IntPtr self, UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ); + private FSetItemTags _SetItemTags; + + #endregion + internal bool SetItemTags( UGCUpdateHandle_t updateHandle, ref SteamParamStringArray_t pTags ) + { + var returnValue = _SetItemTags( Self, updateHandle, ref pTags ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemContent( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ); + private FSetItemContent _SetItemContent; + + #endregion + internal bool SetItemContent( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszContentFolder ) + { + var returnValue = _SetItemContent( Self, handle, pszContentFolder ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetItemPreview( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + private FSetItemPreview _SetItemPreview; + + #endregion + internal bool SetItemPreview( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + { + var returnValue = _SetItemPreview( Self, handle, pszPreviewFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetAllowLegacyUpload( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ); + private FSetAllowLegacyUpload _SetAllowLegacyUpload; + + #endregion + internal bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.U1 )] bool bAllowLegacyUpload ) + { + var returnValue = _SetAllowLegacyUpload( Self, handle, bAllowLegacyUpload ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRemoveItemKeyValueTags( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FRemoveItemKeyValueTags _RemoveItemKeyValueTags; + + #endregion + internal bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _RemoveItemKeyValueTags( Self, handle, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddItemKeyValueTag( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ); + private FAddItemKeyValueTag _AddItemKeyValueTag; + + #endregion + internal bool AddItemKeyValueTag( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchValue ) + { + var returnValue = _AddItemKeyValueTag( Self, handle, pchKey, pchValue ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ); + private FAddItemPreviewFile _AddItemPreviewFile; + + #endregion + internal bool AddItemPreviewFile( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile, ItemPreviewType type ) + { + var returnValue = _AddItemPreviewFile( Self, handle, pszPreviewFile, type ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FAddItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + private FAddItemPreviewVideo _AddItemPreviewVideo; + + #endregion + internal bool AddItemPreviewVideo( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + { + var returnValue = _AddItemPreviewVideo( Self, handle, pszVideoID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FUpdateItemPreviewFile( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ); + private FUpdateItemPreviewFile _UpdateItemPreviewFile; + + #endregion + internal bool UpdateItemPreviewFile( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszPreviewFile ) + { + var returnValue = _UpdateItemPreviewFile( Self, handle, index, pszPreviewFile ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FUpdateItemPreviewVideo( IntPtr self, UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ); + private FUpdateItemPreviewVideo _UpdateItemPreviewVideo; + + #endregion + internal bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint index, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszVideoID ) + { + var returnValue = _UpdateItemPreviewVideo( Self, handle, index, pszVideoID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRemoveItemPreview( IntPtr self, UGCUpdateHandle_t handle, uint index ); + private FRemoveItemPreview _RemoveItemPreview; + + #endregion + internal bool RemoveItemPreview( UGCUpdateHandle_t handle, uint index ) + { + var returnValue = _RemoveItemPreview( Self, handle, index ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FSubmitItemUpdate( IntPtr self, UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ); + private FSubmitItemUpdate _SubmitItemUpdate; + + #endregion + internal async Task SubmitItemUpdate( UGCUpdateHandle_t handle, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchChangeNote ) + { + var returnValue = _SubmitItemUpdate( Self, handle, pchChangeNote ); + return await SubmitItemUpdateResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate ItemUpdateStatus FGetItemUpdateProgress( IntPtr self, UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ); + private FGetItemUpdateProgress _GetItemUpdateProgress; + + #endregion + internal ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, ref ulong punBytesProcessed, ref ulong punBytesTotal ) + { + var returnValue = _GetItemUpdateProgress( Self, handle, ref punBytesProcessed, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FSetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ); + private FSetUserItemVote _SetUserItemVote; + + #endregion + internal async Task SetUserItemVote( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bVoteUp ) + { + var returnValue = _SetUserItemVote( Self, nPublishedFileID, bVoteUp ); + return await SetUserItemVoteResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetUserItemVote( IntPtr self, PublishedFileId nPublishedFileID ); + private FGetUserItemVote _GetUserItemVote; + + #endregion + internal async Task GetUserItemVote( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetUserItemVote( Self, nPublishedFileID ); + return await GetUserItemVoteResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FAddItemToFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); + private FAddItemToFavorites _AddItemToFavorites; + + #endregion + internal async Task AddItemToFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _AddItemToFavorites( Self, nAppId, nPublishedFileID ); + return await UserFavoriteItemsListChanged_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRemoveItemFromFavorites( IntPtr self, AppId nAppId, PublishedFileId nPublishedFileID ); + private FRemoveItemFromFavorites _RemoveItemFromFavorites; + + #endregion + internal async Task RemoveItemFromFavorites( AppId nAppId, PublishedFileId nPublishedFileID ) + { + var returnValue = _RemoveItemFromFavorites( Self, nAppId, nPublishedFileID ); + return await UserFavoriteItemsListChanged_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FSubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); + private FSubscribeItem _SubscribeItem; + + #endregion + internal async Task SubscribeItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _SubscribeItem( Self, nPublishedFileID ); + return await RemoteStorageSubscribePublishedFileResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FUnsubscribeItem( IntPtr self, PublishedFileId nPublishedFileID ); + private FUnsubscribeItem _UnsubscribeItem; + + #endregion + internal async Task UnsubscribeItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _UnsubscribeItem( Self, nPublishedFileID ); + return await RemoteStorageUnsubscribePublishedFileResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetNumSubscribedItems( IntPtr self ); + private FGetNumSubscribedItems _GetNumSubscribedItems; + + #endregion + internal uint GetNumSubscribedItems() + { + var returnValue = _GetNumSubscribedItems( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetSubscribedItems( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ); + private FGetSubscribedItems _GetSubscribedItems; + + #endregion + internal uint GetSubscribedItems( [In,Out] PublishedFileId[] pvecPublishedFileID, uint cMaxEntries ) + { + var returnValue = _GetSubscribedItems( Self, pvecPublishedFileID, cMaxEntries ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetItemState( IntPtr self, PublishedFileId nPublishedFileID ); + private FGetItemState _GetItemState; + + #endregion + internal uint GetItemState( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetItemState( Self, nPublishedFileID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemInstallInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, IntPtr pchFolder, uint cchFolderSize, ref uint punTimeStamp ); + private FGetItemInstallInfo _GetItemInstallInfo; + + #endregion + internal bool GetItemInstallInfo( PublishedFileId nPublishedFileID, ref ulong punSizeOnDisk, out string pchFolder, ref uint punTimeStamp ) + { + IntPtr mempchFolder = Helpers.TakeMemory(); + var returnValue = _GetItemInstallInfo( Self, nPublishedFileID, ref punSizeOnDisk, mempchFolder, (1024 * 32), ref punTimeStamp ); + pchFolder = Helpers.MemoryToString( mempchFolder ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetItemDownloadInfo( IntPtr self, PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ); + private FGetItemDownloadInfo _GetItemDownloadInfo; + + #endregion + internal bool GetItemDownloadInfo( PublishedFileId nPublishedFileID, ref ulong punBytesDownloaded, ref ulong punBytesTotal ) + { + var returnValue = _GetItemDownloadInfo( Self, nPublishedFileID, ref punBytesDownloaded, ref punBytesTotal ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FDownloadItem( IntPtr self, PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ); + private FDownloadItem _DownloadItem; + + #endregion + internal bool DownloadItem( PublishedFileId nPublishedFileID, [MarshalAs( UnmanagedType.U1 )] bool bHighPriority ) + { + var returnValue = _DownloadItem( Self, nPublishedFileID, bHighPriority ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBInitWorkshopForGameServer( IntPtr self, DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ); + private FBInitWorkshopForGameServer _BInitWorkshopForGameServer; + + #endregion + internal bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pszFolder ) + { + var returnValue = _BInitWorkshopForGameServer( Self, unWorkshopDepotID, pszFolder ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSuspendDownloads( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bSuspend ); + private FSuspendDownloads _SuspendDownloads; + + #endregion + internal void SuspendDownloads( [MarshalAs( UnmanagedType.U1 )] bool bSuspend ) + { + _SuspendDownloads( Self, bSuspend ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FStartPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + private FStartPlaytimeTracking _StartPlaytimeTracking; + + #endregion + internal async Task StartPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _StartPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return await StartPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FStopPlaytimeTracking( IntPtr self, [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ); + private FStopPlaytimeTracking _StopPlaytimeTracking; + + #endregion + internal async Task StopPlaytimeTracking( [In,Out] PublishedFileId[] pvecPublishedFileID, uint unNumPublishedFileIDs ) + { + var returnValue = _StopPlaytimeTracking( Self, pvecPublishedFileID, unNumPublishedFileIDs ); + return await StopPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FStopPlaytimeTrackingForAllItems( IntPtr self ); + private FStopPlaytimeTrackingForAllItems _StopPlaytimeTrackingForAllItems; + + #endregion + internal async Task StopPlaytimeTrackingForAllItems() + { + var returnValue = _StopPlaytimeTrackingForAllItems( Self ); + return await StopPlaytimeTrackingResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FAddDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); + private FAddDependency _AddDependency; + + #endregion + internal async Task AddDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + { + var returnValue = _AddDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); + return await AddUGCDependencyResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRemoveDependency( IntPtr self, PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ); + private FRemoveDependency _RemoveDependency; + + #endregion + internal async Task RemoveDependency( PublishedFileId nParentPublishedFileID, PublishedFileId nChildPublishedFileID ) + { + var returnValue = _RemoveDependency( Self, nParentPublishedFileID, nChildPublishedFileID ); + return await RemoveUGCDependencyResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FAddAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); + private FAddAppDependency _AddAppDependency; + + #endregion + internal async Task AddAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + { + var returnValue = _AddAppDependency( Self, nPublishedFileID, nAppID ); + return await AddAppDependencyResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRemoveAppDependency( IntPtr self, PublishedFileId nPublishedFileID, AppId nAppID ); + private FRemoveAppDependency _RemoveAppDependency; + + #endregion + internal async Task RemoveAppDependency( PublishedFileId nPublishedFileID, AppId nAppID ) + { + var returnValue = _RemoveAppDependency( Self, nPublishedFileID, nAppID ); + return await RemoveAppDependencyResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetAppDependencies( IntPtr self, PublishedFileId nPublishedFileID ); + private FGetAppDependencies _GetAppDependencies; + + #endregion + internal async Task GetAppDependencies( PublishedFileId nPublishedFileID ) + { + var returnValue = _GetAppDependencies( Self, nPublishedFileID ); + return await GetAppDependenciesResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FDeleteItem( IntPtr self, PublishedFileId nPublishedFileID ); + private FDeleteItem _DeleteItem; + + #endregion + internal async Task DeleteItem( PublishedFileId nPublishedFileID ) + { + var returnValue = _DeleteItem( Self, nPublishedFileID ); + return await DeleteItemResult_t.GetResultAsync( returnValue ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs new file mode 100644 index 0000000..b44bd13 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUser.cs @@ -0,0 +1,457 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamUser : SteamInterface + { + public override string InterfaceName => "SteamUser020"; + + public override void InitInternals() + { + _GetHSteamUser = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _BLoggedOn = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetSteamID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _InitiateGameConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _TerminateGameConnection = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _TrackAppUsageEvent = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetUserDataFolder = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _StartVoiceRecording = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _StopVoiceRecording = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetAvailableVoice = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _GetVoice = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _DecompressVoice = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetVoiceOptimalSampleRate = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _GetAuthSessionTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _BeginAuthSession = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _EndAuthSession = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _CancelAuthTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _UserHasLicenseForApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _BIsBehindNAT = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _AdvertiseGame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _RequestEncryptedAppTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetEncryptedAppTicket = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetGameBadgeLevel = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _GetPlayerSteamLevel = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _RequestStoreAuthURL = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _BIsPhoneVerified = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _BIsTwoFactorEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _BIsPhoneIdentifying = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _BIsPhoneRequiringVerification = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _GetMarketEligibility = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetHSteamUser = null; + _BLoggedOn = null; + _GetSteamID = null; + _InitiateGameConnection = null; + _TerminateGameConnection = null; + _TrackAppUsageEvent = null; + _GetUserDataFolder = null; + _StartVoiceRecording = null; + _StopVoiceRecording = null; + _GetAvailableVoice = null; + _GetVoice = null; + _DecompressVoice = null; + _GetVoiceOptimalSampleRate = null; + _GetAuthSessionTicket = null; + _BeginAuthSession = null; + _EndAuthSession = null; + _CancelAuthTicket = null; + _UserHasLicenseForApp = null; + _BIsBehindNAT = null; + _AdvertiseGame = null; + _RequestEncryptedAppTicket = null; + _GetEncryptedAppTicket = null; + _GetGameBadgeLevel = null; + _GetPlayerSteamLevel = null; + _RequestStoreAuthURL = null; + _BIsPhoneVerified = null; + _BIsTwoFactorEnabled = null; + _BIsPhoneIdentifying = null; + _BIsPhoneRequiringVerification = null; + _GetMarketEligibility = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HSteamUser FGetHSteamUser( IntPtr self ); + private FGetHSteamUser _GetHSteamUser; + + #endregion + internal HSteamUser GetHSteamUser() + { + var returnValue = _GetHSteamUser( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBLoggedOn( IntPtr self ); + private FBLoggedOn _BLoggedOn; + + #endregion + internal bool BLoggedOn() + { + var returnValue = _BLoggedOn( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + #if PLATFORM_WIN + private delegate void FGetSteamID( IntPtr self, ref SteamId retVal ); + #else + private delegate SteamId FGetSteamID( IntPtr self ); + #endif + private FGetSteamID _GetSteamID; + + #endregion + internal SteamId GetSteamID() + { + #if PLATFORM_WIN + var retVal = default( SteamId ); + _GetSteamID( Self, ref retVal ); + return retVal; + #else + var returnValue = _GetSteamID( Self ); + return returnValue; + #endif + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FInitiateGameConnection( IntPtr self, IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ); + private FInitiateGameConnection _InitiateGameConnection; + + #endregion + internal int InitiateGameConnection( IntPtr pAuthBlob, int cbMaxAuthBlob, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer, [MarshalAs( UnmanagedType.U1 )] bool bSecure ) + { + var returnValue = _InitiateGameConnection( Self, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTerminateGameConnection( IntPtr self, uint unIPServer, ushort usPortServer ); + private FTerminateGameConnection _TerminateGameConnection; + + #endregion + internal void TerminateGameConnection( uint unIPServer, ushort usPortServer ) + { + _TerminateGameConnection( Self, unIPServer, usPortServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FTrackAppUsageEvent( IntPtr self, GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ); + private FTrackAppUsageEvent _TrackAppUsageEvent; + + #endregion + internal void TrackAppUsageEvent( GameId gameID, int eAppUsageEvent, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExtraInfo ) + { + _TrackAppUsageEvent( Self, gameID, eAppUsageEvent, pchExtraInfo ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserDataFolder( IntPtr self, IntPtr pchBuffer, int cubBuffer ); + private FGetUserDataFolder _GetUserDataFolder; + + #endregion + internal bool GetUserDataFolder( out string pchBuffer ) + { + IntPtr mempchBuffer = Helpers.TakeMemory(); + var returnValue = _GetUserDataFolder( Self, mempchBuffer, (1024 * 32) ); + pchBuffer = Helpers.MemoryToString( mempchBuffer ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FStartVoiceRecording( IntPtr self ); + private FStartVoiceRecording _StartVoiceRecording; + + #endregion + internal void StartVoiceRecording() + { + _StartVoiceRecording( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FStopVoiceRecording( IntPtr self ); + private FStopVoiceRecording _StopVoiceRecording; + + #endregion + internal void StopVoiceRecording() + { + _StopVoiceRecording( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate VoiceResult FGetAvailableVoice( IntPtr self, ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); + private FGetAvailableVoice _GetAvailableVoice; + + #endregion + internal VoiceResult GetAvailableVoice( ref uint pcbCompressed, ref uint pcbUncompressed_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) + { + var returnValue = _GetAvailableVoice( Self, ref pcbCompressed, ref pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate VoiceResult FGetVoice( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ); + private FGetVoice _GetVoice; + + #endregion + internal VoiceResult GetVoice( [MarshalAs( UnmanagedType.U1 )] bool bWantCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, [MarshalAs( UnmanagedType.U1 )] bool bWantUncompressed_Deprecated, IntPtr pUncompressedDestBuffer_Deprecated, uint cbUncompressedDestBufferSize_Deprecated, ref uint nUncompressBytesWritten_Deprecated, uint nUncompressedVoiceDesiredSampleRate_Deprecated ) + { + var returnValue = _GetVoice( Self, bWantCompressed, pDestBuffer, cbDestBufferSize, ref nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, ref nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate VoiceResult FDecompressVoice( IntPtr self, IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ); + private FDecompressVoice _DecompressVoice; + + #endregion + internal VoiceResult DecompressVoice( IntPtr pCompressed, uint cbCompressed, IntPtr pDestBuffer, uint cbDestBufferSize, ref uint nBytesWritten, uint nDesiredSampleRate ) + { + var returnValue = _DecompressVoice( Self, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, ref nBytesWritten, nDesiredSampleRate ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetVoiceOptimalSampleRate( IntPtr self ); + private FGetVoiceOptimalSampleRate _GetVoiceOptimalSampleRate; + + #endregion + internal uint GetVoiceOptimalSampleRate() + { + var returnValue = _GetVoiceOptimalSampleRate( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate HAuthTicket FGetAuthSessionTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + private FGetAuthSessionTicket _GetAuthSessionTicket; + + #endregion + internal HAuthTicket GetAuthSessionTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetAuthSessionTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate BeginAuthResult FBeginAuthSession( IntPtr self, IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ); + private FBeginAuthSession _BeginAuthSession; + + #endregion + internal BeginAuthResult BeginAuthSession( IntPtr pAuthTicket, int cbAuthTicket, SteamId steamID ) + { + var returnValue = _BeginAuthSession( Self, pAuthTicket, cbAuthTicket, steamID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FEndAuthSession( IntPtr self, SteamId steamID ); + private FEndAuthSession _EndAuthSession; + + #endregion + internal void EndAuthSession( SteamId steamID ) + { + _EndAuthSession( Self, steamID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FCancelAuthTicket( IntPtr self, HAuthTicket hAuthTicket ); + private FCancelAuthTicket _CancelAuthTicket; + + #endregion + internal void CancelAuthTicket( HAuthTicket hAuthTicket ) + { + _CancelAuthTicket( Self, hAuthTicket ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate UserHasLicenseForAppResult FUserHasLicenseForApp( IntPtr self, SteamId steamID, AppId appID ); + private FUserHasLicenseForApp _UserHasLicenseForApp; + + #endregion + internal UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamID, AppId appID ) + { + var returnValue = _UserHasLicenseForApp( Self, steamID, appID ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsBehindNAT( IntPtr self ); + private FBIsBehindNAT _BIsBehindNAT; + + #endregion + internal bool BIsBehindNAT() + { + var returnValue = _BIsBehindNAT( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FAdvertiseGame( IntPtr self, SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ); + private FAdvertiseGame _AdvertiseGame; + + #endregion + internal void AdvertiseGame( SteamId steamIDGameServer, uint unIPServer, ushort usPortServer ) + { + _AdvertiseGame( Self, steamIDGameServer, unIPServer, usPortServer ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestEncryptedAppTicket( IntPtr self, IntPtr pDataToInclude, int cbDataToInclude ); + private FRequestEncryptedAppTicket _RequestEncryptedAppTicket; + + #endregion + internal async Task RequestEncryptedAppTicket( IntPtr pDataToInclude, int cbDataToInclude ) + { + var returnValue = _RequestEncryptedAppTicket( Self, pDataToInclude, cbDataToInclude ); + return await EncryptedAppTicketResponse_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetEncryptedAppTicket( IntPtr self, IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ); + private FGetEncryptedAppTicket _GetEncryptedAppTicket; + + #endregion + internal bool GetEncryptedAppTicket( IntPtr pTicket, int cbMaxTicket, ref uint pcbTicket ) + { + var returnValue = _GetEncryptedAppTicket( Self, pTicket, cbMaxTicket, ref pcbTicket ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetGameBadgeLevel( IntPtr self, int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ); + private FGetGameBadgeLevel _GetGameBadgeLevel; + + #endregion + internal int GetGameBadgeLevel( int nSeries, [MarshalAs( UnmanagedType.U1 )] bool bFoil ) + { + var returnValue = _GetGameBadgeLevel( Self, nSeries, bFoil ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetPlayerSteamLevel( IntPtr self ); + private FGetPlayerSteamLevel _GetPlayerSteamLevel; + + #endregion + internal int GetPlayerSteamLevel() + { + var returnValue = _GetPlayerSteamLevel( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestStoreAuthURL( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ); + private FRequestStoreAuthURL _RequestStoreAuthURL; + + #endregion + internal async Task RequestStoreAuthURL( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchRedirectURL ) + { + var returnValue = _RequestStoreAuthURL( Self, pchRedirectURL ); + return await StoreAuthURLResponse_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsPhoneVerified( IntPtr self ); + private FBIsPhoneVerified _BIsPhoneVerified; + + #endregion + internal bool BIsPhoneVerified() + { + var returnValue = _BIsPhoneVerified( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsTwoFactorEnabled( IntPtr self ); + private FBIsTwoFactorEnabled _BIsTwoFactorEnabled; + + #endregion + internal bool BIsTwoFactorEnabled() + { + var returnValue = _BIsTwoFactorEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsPhoneIdentifying( IntPtr self ); + private FBIsPhoneIdentifying _BIsPhoneIdentifying; + + #endregion + internal bool BIsPhoneIdentifying() + { + var returnValue = _BIsPhoneIdentifying( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBIsPhoneRequiringVerification( IntPtr self ); + private FBIsPhoneRequiringVerification _BIsPhoneRequiringVerification; + + #endregion + internal bool BIsPhoneRequiringVerification() + { + var returnValue = _BIsPhoneRequiringVerification( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetMarketEligibility( IntPtr self ); + private FGetMarketEligibility _GetMarketEligibility; + + #endregion + internal async Task GetMarketEligibility() + { + var returnValue = _GetMarketEligibility( Self ); + return await MarketEligibilityResponse_t.GetResultAsync( returnValue ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs new file mode 100644 index 0000000..4376970 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUserStats.cs @@ -0,0 +1,665 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamUserStats : SteamInterface + { + public override string InterfaceName => "STEAMUSERSTATS_INTERFACE_VERSION011"; + + public override void InitInternals() + { + _RequestCurrentStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _UpdateAvgRateStat = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _SetAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _ClearAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetAchievementAndUnlockTime = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _StoreStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _GetAchievementIcon = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetAchievementDisplayAttribute = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _IndicateAchievementProgress = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _GetNumAchievements = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetAchievementName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _RequestUserStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _GetUserAchievement = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _GetUserAchievementAndUnlockTime = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _ResetAllStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _FindOrCreateLeaderboard = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _FindLeaderboard = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _GetLeaderboardName = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _GetLeaderboardEntryCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _GetLeaderboardSortMethod = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _GetLeaderboardDisplayType = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _DownloadLeaderboardEntries = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _DownloadLeaderboardEntriesForUsers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + _GetDownloadedLeaderboardEntry = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 240 ) ) ); + _UploadLeaderboardScore = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 248 ) ) ); + _AttachLeaderboardUGC = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 256 ) ) ); + _GetNumberOfCurrentPlayers = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 264 ) ) ); + _RequestGlobalAchievementPercentages = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 272 ) ) ); + _GetMostAchievedAchievementInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 280 ) ) ); + _GetNextMostAchievedAchievementInfo = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 288 ) ) ); + _GetAchievementAchievedPercent = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 296 ) ) ); + _RequestGlobalStats = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 304 ) ) ); + + #if PLATFORM_WIN + _GetStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _SetStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _SetStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetGlobalStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 320 ) ) ); + _GetGlobalStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 312 ) ) ); + _GetGlobalStatHistory1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 336 ) ) ); + _GetGlobalStatHistory2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 328 ) ) ); + #else + _GetStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _SetStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _SetStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetUserStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _GetUserStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _GetGlobalStat1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 312 ) ) ); + _GetGlobalStat2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 320 ) ) ); + _GetGlobalStatHistory1 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 328 ) ) ); + _GetGlobalStatHistory2 = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 336 ) ) ); + #endif + } + internal override void Shutdown() + { + base.Shutdown(); + + _RequestCurrentStats = null; + _GetStat1 = null; + _GetStat2 = null; + _SetStat1 = null; + _SetStat2 = null; + _UpdateAvgRateStat = null; + _GetAchievement = null; + _SetAchievement = null; + _ClearAchievement = null; + _GetAchievementAndUnlockTime = null; + _StoreStats = null; + _GetAchievementIcon = null; + _GetAchievementDisplayAttribute = null; + _IndicateAchievementProgress = null; + _GetNumAchievements = null; + _GetAchievementName = null; + _RequestUserStats = null; + _GetUserStat1 = null; + _GetUserStat2 = null; + _GetUserAchievement = null; + _GetUserAchievementAndUnlockTime = null; + _ResetAllStats = null; + _FindOrCreateLeaderboard = null; + _FindLeaderboard = null; + _GetLeaderboardName = null; + _GetLeaderboardEntryCount = null; + _GetLeaderboardSortMethod = null; + _GetLeaderboardDisplayType = null; + _DownloadLeaderboardEntries = null; + _DownloadLeaderboardEntriesForUsers = null; + _GetDownloadedLeaderboardEntry = null; + _UploadLeaderboardScore = null; + _AttachLeaderboardUGC = null; + _GetNumberOfCurrentPlayers = null; + _RequestGlobalAchievementPercentages = null; + _GetMostAchievedAchievementInfo = null; + _GetNextMostAchievedAchievementInfo = null; + _GetAchievementAchievedPercent = null; + _RequestGlobalStats = null; + _GetGlobalStat1 = null; + _GetGlobalStat2 = null; + _GetGlobalStatHistory1 = null; + _GetGlobalStatHistory2 = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FRequestCurrentStats( IntPtr self ); + private FRequestCurrentStats _RequestCurrentStats; + + #endregion + internal bool RequestCurrentStats() + { + var returnValue = _RequestCurrentStats( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private FGetStat1 _GetStat1; + + #endregion + internal bool GetStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetStat1( Self, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private FGetStat2 _GetStat2; + + #endregion + internal bool GetStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetStat2( Self, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ); + private FSetStat1 _SetStat1; + + #endregion + internal bool SetStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, int nData ) + { + var returnValue = _SetStat1( Self, pchName, nData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ); + private FSetStat2 _SetStat2; + + #endregion + internal bool SetStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float fData ) + { + var returnValue = _SetStat2( Self, pchName, fData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FUpdateAvgRateStat( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ); + private FUpdateAvgRateStat _UpdateAvgRateStat; + + #endregion + internal bool UpdateAvgRateStat( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, float flCountThisSession, double dSessionLength ) + { + var returnValue = _UpdateAvgRateStat( Self, pchName, flCountThisSession, dSessionLength ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private FGetAchievement _GetAchievement; + + #endregion + internal bool GetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetAchievement( Self, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FSetAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private FSetAchievement _SetAchievement; + + #endregion + internal bool SetAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _SetAchievement( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FClearAchievement( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private FClearAchievement _ClearAchievement; + + #endregion + internal bool ClearAchievement( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _ClearAchievement( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAchievementAndUnlockTime( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + private FGetAchievementAndUnlockTime _GetAchievementAndUnlockTime; + + #endregion + internal bool GetAchievementAndUnlockTime( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + { + var returnValue = _GetAchievementAndUnlockTime( Self, pchName, ref pbAchieved, ref punUnlockTime ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FStoreStats( IntPtr self ); + private FStoreStats _StoreStats; + + #endregion + internal bool StoreStats() + { + var returnValue = _StoreStats( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetAchievementIcon( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ); + private FGetAchievementIcon _GetAchievementIcon; + + #endregion + internal int GetAchievementIcon( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName ) + { + var returnValue = _GetAchievementIcon( Self, pchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetAchievementDisplayAttribute( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ); + private FGetAchievementDisplayAttribute _GetAchievementDisplayAttribute; + + #endregion + internal string GetAchievementDisplayAttribute( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchKey ) + { + var returnValue = _GetAchievementDisplayAttribute( Self, pchName, pchKey ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIndicateAchievementProgress( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ); + private FIndicateAchievementProgress _IndicateAchievementProgress; + + #endregion + internal bool IndicateAchievementProgress( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, uint nCurProgress, uint nMaxProgress ) + { + var returnValue = _IndicateAchievementProgress( Self, pchName, nCurProgress, nMaxProgress ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetNumAchievements( IntPtr self ); + private FGetNumAchievements _GetNumAchievements; + + #endregion + internal uint GetNumAchievements() + { + var returnValue = _GetNumAchievements( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetAchievementName( IntPtr self, uint iAchievement ); + private FGetAchievementName _GetAchievementName; + + #endregion + internal string GetAchievementName( uint iAchievement ) + { + var returnValue = _GetAchievementName( Self, iAchievement ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestUserStats( IntPtr self, SteamId steamIDUser ); + private FRequestUserStats _RequestUserStats; + + #endregion + internal async Task RequestUserStats( SteamId steamIDUser ) + { + var returnValue = _RequestUserStats( Self, steamIDUser ); + return await UserStatsReceived_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserStat1( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ); + private FGetUserStat1 _GetUserStat1; + + #endregion + internal bool GetUserStat1( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref int pData ) + { + var returnValue = _GetUserStat1( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserStat2( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ); + private FGetUserStat2 _GetUserStat2; + + #endregion + internal bool GetUserStat2( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pData ) + { + var returnValue = _GetUserStat2( Self, steamIDUser, pchName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserAchievement( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private FGetUserAchievement _GetUserAchievement; + + #endregion + internal bool GetUserAchievement( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + var returnValue = _GetUserAchievement( Self, steamIDUser, pchName, ref pbAchieved ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetUserAchievementAndUnlockTime( IntPtr self, SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ); + private FGetUserAchievementAndUnlockTime _GetUserAchievementAndUnlockTime; + + #endregion + internal bool GetUserAchievementAndUnlockTime( SteamId steamIDUser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved, ref uint punUnlockTime ) + { + var returnValue = _GetUserAchievementAndUnlockTime( Self, steamIDUser, pchName, ref pbAchieved, ref punUnlockTime ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FResetAllStats( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ); + private FResetAllStats _ResetAllStats; + + #endregion + internal bool ResetAllStats( [MarshalAs( UnmanagedType.U1 )] bool bAchievementsToo ) + { + var returnValue = _ResetAllStats( Self, bAchievementsToo ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FFindOrCreateLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ); + private FFindOrCreateLeaderboard _FindOrCreateLeaderboard; + + #endregion + internal async Task FindOrCreateLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName, LeaderboardSort eLeaderboardSortMethod, LeaderboardDisplay eLeaderboardDisplayType ) + { + var returnValue = _FindOrCreateLeaderboard( Self, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); + return await LeaderboardFindResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FFindLeaderboard( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ); + private FFindLeaderboard _FindLeaderboard; + + #endregion + internal async Task FindLeaderboard( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchLeaderboardName ) + { + var returnValue = _FindLeaderboard( Self, pchLeaderboardName ); + return await LeaderboardFindResult_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetLeaderboardName( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + private FGetLeaderboardName _GetLeaderboardName; + + #endregion + internal string GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardName( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetLeaderboardEntryCount( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + private FGetLeaderboardEntryCount _GetLeaderboardEntryCount; + + #endregion + internal int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardEntryCount( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate LeaderboardSort FGetLeaderboardSortMethod( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + private FGetLeaderboardSortMethod _GetLeaderboardSortMethod; + + #endregion + internal LeaderboardSort GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardSortMethod( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate LeaderboardDisplay FGetLeaderboardDisplayType( IntPtr self, SteamLeaderboard_t hSteamLeaderboard ); + private FGetLeaderboardDisplayType _GetLeaderboardDisplayType; + + #endregion + internal LeaderboardDisplay GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard ) + { + var returnValue = _GetLeaderboardDisplayType( Self, hSteamLeaderboard ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FDownloadLeaderboardEntries( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ); + private FDownloadLeaderboardEntries _DownloadLeaderboardEntries; + + #endregion + internal async Task DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, LeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) + { + var returnValue = _DownloadLeaderboardEntries( Self, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); + return await LeaderboardScoresDownloaded_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FDownloadLeaderboardEntriesForUsers( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ); + private FDownloadLeaderboardEntriesForUsers _DownloadLeaderboardEntriesForUsers; + + #endregion + internal async Task DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, [In,Out] SteamId[] prgUsers, int cUsers ) + { + var returnValue = _DownloadLeaderboardEntriesForUsers( Self, hSteamLeaderboard, prgUsers, cUsers ); + return await LeaderboardScoresDownloaded_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetDownloadedLeaderboardEntry( IntPtr self, SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ); + private FGetDownloadedLeaderboardEntry _GetDownloadedLeaderboardEntry; + + #endregion + internal bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries, int index, ref LeaderboardEntry_t pLeaderboardEntry, [In,Out] int[] pDetails, int cDetailsMax ) + { + var returnValue = _GetDownloadedLeaderboardEntry( Self, hSteamLeaderboardEntries, index, ref pLeaderboardEntry, pDetails, cDetailsMax ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FUploadLeaderboardScore( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ); + private FUploadLeaderboardScore _UploadLeaderboardScore; + + #endregion + internal async Task UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int nScore, [In,Out] int[] pScoreDetails, int cScoreDetailsCount ) + { + var returnValue = _UploadLeaderboardScore( Self, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); + return await LeaderboardScoreUploaded_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FAttachLeaderboardUGC( IntPtr self, SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ); + private FAttachLeaderboardUGC _AttachLeaderboardUGC; + + #endregion + internal async Task AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) + { + var returnValue = _AttachLeaderboardUGC( Self, hSteamLeaderboard, hUGC ); + return await LeaderboardUGCSet_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FGetNumberOfCurrentPlayers( IntPtr self ); + private FGetNumberOfCurrentPlayers _GetNumberOfCurrentPlayers; + + #endregion + internal async Task GetNumberOfCurrentPlayers() + { + var returnValue = _GetNumberOfCurrentPlayers( Self ); + return await NumberOfCurrentPlayers_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestGlobalAchievementPercentages( IntPtr self ); + private FRequestGlobalAchievementPercentages _RequestGlobalAchievementPercentages; + + #endregion + internal async Task RequestGlobalAchievementPercentages() + { + var returnValue = _RequestGlobalAchievementPercentages( Self ); + return await GlobalAchievementPercentagesReady_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetMostAchievedAchievementInfo( IntPtr self, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private FGetMostAchievedAchievementInfo _GetMostAchievedAchievementInfo; + + #endregion + internal int GetMostAchievedAchievementInfo( out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetMostAchievedAchievementInfo( Self, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetNextMostAchievedAchievementInfo( IntPtr self, int iIteratorPrevious, IntPtr pchName, uint unNameBufLen, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ); + private FGetNextMostAchievedAchievementInfo _GetNextMostAchievedAchievementInfo; + + #endregion + internal int GetNextMostAchievedAchievementInfo( int iIteratorPrevious, out string pchName, ref float pflPercent, [MarshalAs( UnmanagedType.U1 )] ref bool pbAchieved ) + { + IntPtr mempchName = Helpers.TakeMemory(); + var returnValue = _GetNextMostAchievedAchievementInfo( Self, iIteratorPrevious, mempchName, (1024 * 32), ref pflPercent, ref pbAchieved ); + pchName = Helpers.MemoryToString( mempchName ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAchievementAchievedPercent( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ); + private FGetAchievementAchievedPercent _GetAchievementAchievedPercent; + + #endregion + internal bool GetAchievementAchievedPercent( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchName, ref float pflPercent ) + { + var returnValue = _GetAchievementAchievedPercent( Self, pchName, ref pflPercent ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FRequestGlobalStats( IntPtr self, int nHistoryDays ); + private FRequestGlobalStats _RequestGlobalStats; + + #endregion + internal async Task RequestGlobalStats( int nHistoryDays ) + { + var returnValue = _RequestGlobalStats( Self, nHistoryDays ); + return await GlobalStatsReceived_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetGlobalStat1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ); + private FGetGlobalStat1 _GetGlobalStat1; + + #endregion + internal bool GetGlobalStat1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref long pData ) + { + var returnValue = _GetGlobalStat1( Self, pchStatName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetGlobalStat2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ); + private FGetGlobalStat2 _GetGlobalStat2; + + #endregion + internal bool GetGlobalStat2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, ref double pData ) + { + var returnValue = _GetGlobalStat2( Self, pchStatName, ref pData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetGlobalStatHistory1( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ); + private FGetGlobalStatHistory1 _GetGlobalStatHistory1; + + #endregion + internal int GetGlobalStatHistory1( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] long[] pData, uint cubData ) + { + var returnValue = _GetGlobalStatHistory1( Self, pchStatName, pData, cubData ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate int FGetGlobalStatHistory2( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ); + private FGetGlobalStatHistory2 _GetGlobalStatHistory2; + + #endregion + internal int GetGlobalStatHistory2( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchStatName, [In,Out] double[] pData, uint cubData ) + { + var returnValue = _GetGlobalStatHistory2( Self, pchStatName, pData, cubData ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs new file mode 100644 index 0000000..bfe1161 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamUtils.cs @@ -0,0 +1,452 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamUtils : SteamInterface + { + public override string InterfaceName => "SteamUtils009"; + + public override void InitInternals() + { + _GetSecondsSinceAppActive = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _GetSecondsSinceComputerActive = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetConnectedUniverse = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetServerRealTime = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + _GetIPCountry = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 32 ) ) ); + _GetImageSize = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 40 ) ) ); + _GetImageRGBA = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 48 ) ) ); + _GetCSERIPPort = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 56 ) ) ); + _GetCurrentBatteryPower = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 64 ) ) ); + _GetAppID = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 72 ) ) ); + _SetOverlayNotificationPosition = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 80 ) ) ); + _IsAPICallCompleted = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 88 ) ) ); + _GetAPICallFailureReason = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 96 ) ) ); + _GetAPICallResult = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 104 ) ) ); + _RunFrame = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 112 ) ) ); + _GetIPCCallCount = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 120 ) ) ); + _SetWarningMessageHook = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 128 ) ) ); + _IsOverlayEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 136 ) ) ); + _BOverlayNeedsPresent = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 144 ) ) ); + _CheckFileSignature = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 152 ) ) ); + _ShowGamepadTextInput = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 160 ) ) ); + _GetEnteredGamepadTextLength = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 168 ) ) ); + _GetEnteredGamepadTextInput = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 176 ) ) ); + _GetSteamUILanguage = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 184 ) ) ); + _IsSteamRunningInVR = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 192 ) ) ); + _SetOverlayNotificationInset = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 200 ) ) ); + _IsSteamInBigPictureMode = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 208 ) ) ); + _StartVRDashboard = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 216 ) ) ); + _IsVRHeadsetStreamingEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 224 ) ) ); + _SetVRHeadsetStreamingEnabled = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 232 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetSecondsSinceAppActive = null; + _GetSecondsSinceComputerActive = null; + _GetConnectedUniverse = null; + _GetServerRealTime = null; + _GetIPCountry = null; + _GetImageSize = null; + _GetImageRGBA = null; + _GetCSERIPPort = null; + _GetCurrentBatteryPower = null; + _GetAppID = null; + _SetOverlayNotificationPosition = null; + _IsAPICallCompleted = null; + _GetAPICallFailureReason = null; + _GetAPICallResult = null; + _RunFrame = null; + _GetIPCCallCount = null; + _SetWarningMessageHook = null; + _IsOverlayEnabled = null; + _BOverlayNeedsPresent = null; + _CheckFileSignature = null; + _ShowGamepadTextInput = null; + _GetEnteredGamepadTextLength = null; + _GetEnteredGamepadTextInput = null; + _GetSteamUILanguage = null; + _IsSteamRunningInVR = null; + _SetOverlayNotificationInset = null; + _IsSteamInBigPictureMode = null; + _StartVRDashboard = null; + _IsVRHeadsetStreamingEnabled = null; + _SetVRHeadsetStreamingEnabled = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetSecondsSinceAppActive( IntPtr self ); + private FGetSecondsSinceAppActive _GetSecondsSinceAppActive; + + #endregion + internal uint GetSecondsSinceAppActive() + { + var returnValue = _GetSecondsSinceAppActive( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetSecondsSinceComputerActive( IntPtr self ); + private FGetSecondsSinceComputerActive _GetSecondsSinceComputerActive; + + #endregion + internal uint GetSecondsSinceComputerActive() + { + var returnValue = _GetSecondsSinceComputerActive( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Universe FGetConnectedUniverse( IntPtr self ); + private FGetConnectedUniverse _GetConnectedUniverse; + + #endregion + internal Universe GetConnectedUniverse() + { + var returnValue = _GetConnectedUniverse( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetServerRealTime( IntPtr self ); + private FGetServerRealTime _GetServerRealTime; + + #endregion + internal uint GetServerRealTime() + { + var returnValue = _GetServerRealTime( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetIPCountry( IntPtr self ); + private FGetIPCountry _GetIPCountry; + + #endregion + internal string GetIPCountry() + { + var returnValue = _GetIPCountry( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetImageSize( IntPtr self, int iImage, ref uint pnWidth, ref uint pnHeight ); + private FGetImageSize _GetImageSize; + + #endregion + internal bool GetImageSize( int iImage, ref uint pnWidth, ref uint pnHeight ) + { + var returnValue = _GetImageSize( Self, iImage, ref pnWidth, ref pnHeight ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetImageRGBA( IntPtr self, int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ); + private FGetImageRGBA _GetImageRGBA; + + #endregion + internal bool GetImageRGBA( int iImage, [In,Out] byte[] pubDest, int nDestBufferSize ) + { + var returnValue = _GetImageRGBA( Self, iImage, pubDest, nDestBufferSize ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetCSERIPPort( IntPtr self, ref uint unIP, ref ushort usPort ); + private FGetCSERIPPort _GetCSERIPPort; + + #endregion + internal bool GetCSERIPPort( ref uint unIP, ref ushort usPort ) + { + var returnValue = _GetCSERIPPort( Self, ref unIP, ref usPort ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate byte FGetCurrentBatteryPower( IntPtr self ); + private FGetCurrentBatteryPower _GetCurrentBatteryPower; + + #endregion + internal byte GetCurrentBatteryPower() + { + var returnValue = _GetCurrentBatteryPower( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetAppID( IntPtr self ); + private FGetAppID _GetAppID; + + #endregion + internal uint GetAppID() + { + var returnValue = _GetAppID( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetOverlayNotificationPosition( IntPtr self, NotificationPosition eNotificationPosition ); + private FSetOverlayNotificationPosition _SetOverlayNotificationPosition; + + #endregion + internal void SetOverlayNotificationPosition( NotificationPosition eNotificationPosition ) + { + _SetOverlayNotificationPosition( Self, eNotificationPosition ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsAPICallCompleted( IntPtr self, SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); + private FIsAPICallCompleted _IsAPICallCompleted; + + #endregion + internal bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) + { + var returnValue = _IsAPICallCompleted( Self, hSteamAPICall, ref pbFailed ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICallFailure FGetAPICallFailureReason( IntPtr self, SteamAPICall_t hSteamAPICall ); + private FGetAPICallFailureReason _GetAPICallFailureReason; + + #endregion + internal SteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall ) + { + var returnValue = _GetAPICallFailureReason( Self, hSteamAPICall ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetAPICallResult( IntPtr self, SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ); + private FGetAPICallResult _GetAPICallResult; + + #endregion + internal bool GetAPICallResult( SteamAPICall_t hSteamAPICall, IntPtr pCallback, int cubCallback, int iCallbackExpected, [MarshalAs( UnmanagedType.U1 )] ref bool pbFailed ) + { + var returnValue = _GetAPICallResult( Self, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FRunFrame( IntPtr self ); + private FRunFrame _RunFrame; + + #endregion + internal void RunFrame() + { + _RunFrame( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetIPCCallCount( IntPtr self ); + private FGetIPCCallCount _GetIPCCallCount; + + #endregion + internal uint GetIPCCallCount() + { + var returnValue = _GetIPCCallCount( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetWarningMessageHook( IntPtr self, IntPtr pFunction ); + private FSetWarningMessageHook _SetWarningMessageHook; + + #endregion + internal void SetWarningMessageHook( IntPtr pFunction ) + { + _SetWarningMessageHook( Self, pFunction ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsOverlayEnabled( IntPtr self ); + private FIsOverlayEnabled _IsOverlayEnabled; + + #endregion + internal bool IsOverlayEnabled() + { + var returnValue = _IsOverlayEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FBOverlayNeedsPresent( IntPtr self ); + private FBOverlayNeedsPresent _BOverlayNeedsPresent; + + #endregion + internal bool BOverlayNeedsPresent() + { + var returnValue = _BOverlayNeedsPresent( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate SteamAPICall_t FCheckFileSignature( IntPtr self, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ); + private FCheckFileSignature _CheckFileSignature; + + #endregion + internal async Task CheckFileSignature( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string szFileName ) + { + var returnValue = _CheckFileSignature( Self, szFileName ); + return await CheckFileSignature_t.GetResultAsync( returnValue ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FShowGamepadTextInput( IntPtr self, GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ); + private FShowGamepadTextInput _ShowGamepadTextInput; + + #endregion + internal bool ShowGamepadTextInput( GamepadTextInputMode eInputMode, GamepadTextInputLineMode eLineInputMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchDescription, uint unCharMax, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchExistingText ) + { + var returnValue = _ShowGamepadTextInput( Self, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate uint FGetEnteredGamepadTextLength( IntPtr self ); + private FGetEnteredGamepadTextLength _GetEnteredGamepadTextLength; + + #endregion + internal uint GetEnteredGamepadTextLength() + { + var returnValue = _GetEnteredGamepadTextLength( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetEnteredGamepadTextInput( IntPtr self, IntPtr pchText, uint cchText ); + private FGetEnteredGamepadTextInput _GetEnteredGamepadTextInput; + + #endregion + internal bool GetEnteredGamepadTextInput( out string pchText ) + { + IntPtr mempchText = Helpers.TakeMemory(); + var returnValue = _GetEnteredGamepadTextInput( Self, mempchText, (1024 * 32) ); + pchText = Helpers.MemoryToString( mempchText ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate Utf8StringPointer FGetSteamUILanguage( IntPtr self ); + private FGetSteamUILanguage _GetSteamUILanguage; + + #endregion + internal string GetSteamUILanguage() + { + var returnValue = _GetSteamUILanguage( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsSteamRunningInVR( IntPtr self ); + private FIsSteamRunningInVR _IsSteamRunningInVR; + + #endregion + internal bool IsSteamRunningInVR() + { + var returnValue = _IsSteamRunningInVR( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetOverlayNotificationInset( IntPtr self, int nHorizontalInset, int nVerticalInset ); + private FSetOverlayNotificationInset _SetOverlayNotificationInset; + + #endregion + internal void SetOverlayNotificationInset( int nHorizontalInset, int nVerticalInset ) + { + _SetOverlayNotificationInset( Self, nHorizontalInset, nVerticalInset ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsSteamInBigPictureMode( IntPtr self ); + private FIsSteamInBigPictureMode _IsSteamInBigPictureMode; + + #endregion + internal bool IsSteamInBigPictureMode() + { + var returnValue = _IsSteamInBigPictureMode( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FStartVRDashboard( IntPtr self ); + private FStartVRDashboard _StartVRDashboard; + + #endregion + internal void StartVRDashboard() + { + _StartVRDashboard( Self ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsVRHeadsetStreamingEnabled( IntPtr self ); + private FIsVRHeadsetStreamingEnabled _IsVRHeadsetStreamingEnabled; + + #endregion + internal bool IsVRHeadsetStreamingEnabled() + { + var returnValue = _IsVRHeadsetStreamingEnabled( Self ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FSetVRHeadsetStreamingEnabled( IntPtr self, [MarshalAs( UnmanagedType.U1 )] bool bEnabled ); + private FSetVRHeadsetStreamingEnabled _SetVRHeadsetStreamingEnabled; + + #endregion + internal void SetVRHeadsetStreamingEnabled( [MarshalAs( UnmanagedType.U1 )] bool bEnabled ) + { + _SetVRHeadsetStreamingEnabled( Self, bEnabled ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs new file mode 100644 index 0000000..9c45cd7 --- /dev/null +++ b/Facepunch.Steamworks/Generated/Interfaces/ISteamVideo.cs @@ -0,0 +1,82 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal class ISteamVideo : SteamInterface + { + public override string InterfaceName => "STEAMVIDEO_INTERFACE_V002"; + + public override void InitInternals() + { + _GetVideoURL = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 0 ) ) ); + _IsBroadcasting = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 8 ) ) ); + _GetOPFSettings = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 16 ) ) ); + _GetOPFStringForApp = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( 24 ) ) ); + } + internal override void Shutdown() + { + base.Shutdown(); + + _GetVideoURL = null; + _IsBroadcasting = null; + _GetOPFSettings = null; + _GetOPFStringForApp = null; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FGetVideoURL( IntPtr self, AppId unVideoAppID ); + private FGetVideoURL _GetVideoURL; + + #endregion + internal void GetVideoURL( AppId unVideoAppID ) + { + _GetVideoURL( Self, unVideoAppID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FIsBroadcasting( IntPtr self, ref int pnNumViewers ); + private FIsBroadcasting _IsBroadcasting; + + #endregion + internal bool IsBroadcasting( ref int pnNumViewers ) + { + var returnValue = _IsBroadcasting( Self, ref pnNumViewers ); + return returnValue; + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + private delegate void FGetOPFSettings( IntPtr self, AppId unVideoAppID ); + private FGetOPFSettings _GetOPFSettings; + + #endregion + internal void GetOPFSettings( AppId unVideoAppID ) + { + _GetOPFSettings( Self, unVideoAppID ); + } + + #region FunctionMeta + [UnmanagedFunctionPointer( Platform.MemberConvention )] + [return: MarshalAs( UnmanagedType.I1 )] + private delegate bool FGetOPFStringForApp( IntPtr self, AppId unVideoAppID, IntPtr pchBuffer, ref int pnBufferSize ); + private FGetOPFStringForApp _GetOPFStringForApp; + + #endregion + internal bool GetOPFStringForApp( AppId unVideoAppID, out string pchBuffer, ref int pnBufferSize ) + { + IntPtr mempchBuffer = Helpers.TakeMemory(); + var returnValue = _GetOPFStringForApp( Self, unVideoAppID, mempchBuffer, ref pnBufferSize ); + pchBuffer = Helpers.MemoryToString( mempchBuffer ); + return returnValue; + } + + } +} diff --git a/Facepunch.Steamworks/Generated/SteamApi.cs b/Facepunch.Steamworks/Generated/SteamApi.cs new file mode 100644 index 0000000..e65a2bd --- /dev/null +++ b/Facepunch.Steamworks/Generated/SteamApi.cs @@ -0,0 +1,98 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal static class SteamAPI + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_Init", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamAPI_Init(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_RunCallbacks", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_RunCallbacks(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_RegisterCallback", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_RegisterCallback( IntPtr pCallback, int callback ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_UnregisterCallback", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_UnregisterCallback( IntPtr pCallback ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_RegisterCallResult", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_RegisterCallResult( IntPtr pCallback, SteamAPICall_t callback ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_UnregisterCallResult", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_UnregisterCallResult( IntPtr pCallback, SteamAPICall_t callback ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_Shutdown", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamAPI_Shutdown(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_GetHSteamUser", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamUser SteamAPI_GetHSteamUser(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_GetHSteamPipe", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamPipe SteamAPI_GetHSteamPipe(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamAPI_RestartAppIfNecessary", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamAPI_RestartAppIfNecessary( uint unOwnAppID ); + + } + static internal bool Init() + { + return Native.SteamAPI_Init(); + } + + static internal void RunCallbacks() + { + Native.SteamAPI_RunCallbacks(); + } + + static internal void RegisterCallback( IntPtr pCallback, int callback ) + { + Native.SteamAPI_RegisterCallback( pCallback, callback ); + } + + static internal void UnregisterCallback( IntPtr pCallback ) + { + Native.SteamAPI_UnregisterCallback( pCallback ); + } + + static internal void RegisterCallResult( IntPtr pCallback, SteamAPICall_t callback ) + { + Native.SteamAPI_RegisterCallResult( pCallback, callback ); + } + + static internal void UnregisterCallResult( IntPtr pCallback, SteamAPICall_t callback ) + { + Native.SteamAPI_UnregisterCallResult( pCallback, callback ); + } + + static internal void Shutdown() + { + Native.SteamAPI_Shutdown(); + } + + static internal HSteamUser GetHSteamUser() + { + return Native.SteamAPI_GetHSteamUser(); + } + + static internal HSteamPipe GetHSteamPipe() + { + return Native.SteamAPI_GetHSteamPipe(); + } + + static internal bool RestartAppIfNecessary( uint unOwnAppID ) + { + return Native.SteamAPI_RestartAppIfNecessary( unOwnAppID ); + } + + } +} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs b/Facepunch.Steamworks/Generated/SteamConstants.cs similarity index 83% rename from Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs rename to Facepunch.Steamworks/Generated/SteamConstants.cs index 802775a..35c3b45 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Constants.cs +++ b/Facepunch.Steamworks/Generated/SteamConstants.cs @@ -1,8 +1,10 @@ using System; using System.Runtime.InteropServices; using System.Linq; +using Steamworks.Data; +using System.Threading.Tasks; -namespace SteamNative +namespace Steamworks.Data { internal static class CallbackIdentifiers { @@ -18,6 +20,8 @@ namespace SteamNative public const int SteamApps = 1000; public const int SteamUserStats = 1100; public const int SteamNetworking = 1200; + public const int SteamNetworkingSockets = 1220; + public const int SteamNetworkingMessages = 1250; public const int ClientRemoteStorage = 1300; public const int ClientDepotBuilder = 1400; public const int SteamGameServerItems = 1500; @@ -57,30 +61,38 @@ namespace SteamNative public const int ClientSharedConnection = 4900; public const int SteamParentalSettings = 5000; public const int ClientShader = 5100; + public const int SteamGameSearch = 5200; + public const int SteamParties = 5300; + public const int ClientParties = 5400; } 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 STEAMCONTROLLER_INTERFACE_VERSION = "SteamController007"; + internal const string STEAMFRIENDS_INTERFACE_VERSION = "SteamFriends017"; 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 STEAMHTMLSURFACE_INTERFACE_VERSION = "STEAMHTMLSURFACE_INTERFACE_VERSION_005"; + internal const string STEAMHTTP_INTERFACE_VERSION = "STEAMHTTP_INTERFACE_VERSION003"; + internal const string STEAMINPUT_INTERFACE_VERSION = "SteamInput001"; + internal const string STEAMINVENTORY_INTERFACE_VERSION = "STEAMINVENTORY_INTERFACE_V003"; internal const string STEAMMATCHMAKING_INTERFACE_VERSION = "SteamMatchMaking009"; internal const string STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION = "SteamMatchMakingServers002"; + internal const string STEAMGAMESEARCH_INTERFACE_VERSION = "SteamMatchGameSearch001"; + internal const string STEAMPARTIES_INTERFACE_VERSION = "SteamParties002"; 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 STEAMNETWORKINGSOCKETS_INTERFACE_VERSION = "SteamNetworkingSockets002"; + internal const string STEAMNETWORKINGUTILS_INTERFACE_VERSION = "SteamNetworkingUtils001"; 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 STEAMUGC_INTERFACE_VERSION = "STEAMUGC_INTERFACE_VERSION012"; + internal const string STEAMUSER_INTERFACE_VERSION = "SteamUser020"; 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"; diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Enums.cs b/Facepunch.Steamworks/Generated/SteamEnums.cs similarity index 65% rename from Facepunch.Steamworks/SteamNative/SteamNative.Enums.cs rename to Facepunch.Steamworks/Generated/SteamEnums.cs index f57eb40..2076b6b 100644 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Enums.cs +++ b/Facepunch.Steamworks/Generated/SteamEnums.cs @@ -1,13 +1,15 @@ using System; using System.Runtime.InteropServices; using System.Linq; +using Steamworks.Data; +using System.Threading.Tasks; -namespace SteamNative +namespace Steamworks { // // EUniverse // - internal enum Universe : int + public enum Universe : int { Invalid = 0, Public = 1, @@ -20,7 +22,7 @@ namespace SteamNative // // EResult // - internal enum Result : int + public enum Result : int { OK = 1, Fail = 2, @@ -133,6 +135,7 @@ namespace SteamNative WGNetworkSendExceeded = 110, AccountNotFriends = 111, LimitedUserAccount = 112, + CantRemoveItem = 113, } // @@ -178,7 +181,7 @@ namespace SteamNative // // EBeginAuthSessionResult // - internal enum BeginAuthSessionResult : int + public enum BeginAuthResult : int { OK = 0, InvalidTicket = 1, @@ -191,7 +194,7 @@ namespace SteamNative // // EAuthSessionResponse // - internal enum AuthSessionResponse : int + public enum AuthResponse : int { OK = 0, UserNotConnectedToSteam = 1, @@ -208,7 +211,7 @@ namespace SteamNative // // EUserHasLicenseForAppResult // - internal enum UserHasLicenseForAppResult : int + public enum UserHasLicenseForAppResult : int { HasLicense = 0, DoesNotHaveLicense = 1, @@ -335,7 +338,7 @@ namespace SteamNative // // EChatRoomEnterResponse // - internal enum ChatRoomEnterResponse : int + public enum RoomEnter : int { Success = 1, DoesntExist = 2, @@ -378,7 +381,7 @@ namespace SteamNative // // ENotificationPosition // - internal enum NotificationPosition : int + public enum NotificationPosition : int { TopLeft = 0, TopRight = 1, @@ -389,7 +392,7 @@ namespace SteamNative // // EBroadcastUploadResult // - internal enum BroadcastUploadResult : int + public enum BroadcastUploadResult : int { None = 0, OK = 1, @@ -405,6 +408,16 @@ namespace SteamNative MissingAudio = 11, TooFarBehind = 12, TranscodeBehind = 13, + NotAllowedToPlay = 14, + Busy = 15, + Banned = 16, + AlreadyActive = 17, + ForcedOff = 18, + AudioBehind = 19, + Shutdown = 20, + Disconnect = 21, + VideoInitFailed = 22, + AudioInitFailed = 23, } // @@ -441,6 +454,7 @@ namespace SteamNative HTC_Dev = 1, HTC_VivePre = 2, HTC_Vive = 3, + HTC_VivePro = 4, HTC_Unknown = 20, Oculus_DK1 = 21, Oculus_DK2 = 22, @@ -458,6 +472,34 @@ namespace SteamNative Samsung_Odyssey = 91, Unannounced_Unknown = 100, Unannounced_WindowsMR = 101, + vridge = 110, + Huawei_Unknown = 120, + Huawei_VR2 = 121, + Huawei_Unannounced = 129, + } + + // + // EMarketNotAllowedReasonFlags + // + internal enum MarketNotAllowedReasonFlags : int + { + None = 0, + TemporaryFailure = 1, + AccountDisabled = 2, + AccountLockedDown = 4, + AccountLimited = 8, + TradeBanned = 16, + AccountNotTrusted = 32, + SteamGuardNotEnabled = 64, + SteamGuardOnlyRecentlyEnabled = 128, + RecentPasswordReset = 256, + NewPaymentMethod = 512, + InvalidCookie = 1024, + UsingNewDevice = 2048, + RecentSelfRefund = 4096, + NewPaymentMethodCannotBeVerified = 8192, + NoRecentPurchases = 16384, + AcceptedWalletGift = 32768, } // @@ -471,6 +513,34 @@ namespace SteamNative P2P = 3, } + // + // EGameSearchErrorCode_t + // + internal enum GameSearchErrorCode_t : int + { + OK = 1, + Failed_Search_Already_In_Progress = 2, + Failed_No_Search_In_Progress = 3, + Failed_Not_Lobby_Leader = 4, + Failed_No_Host_Available = 5, + Failed_Search_Params_Invalid = 6, + Failed_Offline = 7, + Failed_NotAuthorized = 8, + Failed_Unknown_Error = 9, + } + + // + // EPlayerResult_t + // + internal enum PlayerResult_t : int + { + FailedToConnect = 1, + Abandoned = 2, + Kicked = 3, + Incomplete = 4, + Completed = 5, + } + // // IPCFailure_t::EFailureType // @@ -483,7 +553,7 @@ namespace SteamNative // // EFriendRelationship // - internal enum FriendRelationship : int + public enum Relationship : int { None = 0, Blocked = 1, @@ -499,7 +569,7 @@ namespace SteamNative // // EPersonaState // - internal enum PersonaState : int + public enum FriendState : int { Offline = 0, Online = 1, @@ -508,13 +578,14 @@ namespace SteamNative Snooze = 4, LookingToTrade = 5, LookingToPlay = 6, - Max = 7, + Invisible = 7, + Max = 8, } // // EFriendFlags // - internal enum FriendFlags : int + public enum FriendFlags : int { None = 0, Blocked = 1, @@ -555,6 +626,15 @@ namespace SteamNative AddToCartAndShow = 2, } + // + // EActivateGameOverlayToWebPageMode + // + internal enum ActivateGameOverlayToWebPageMode : int + { + Default = 0, + Modal = 1, + } + // // EPersonaChange // @@ -571,9 +651,10 @@ namespace SteamNative LeftSource = 256, RelationshipChanged = 512, NameFirstSet = 1024, - FacebookInfo = 2048, + Broadcast = 2048, Nickname = 4096, SteamLevel = 8192, + RichPresence = 16384, } // @@ -591,7 +672,7 @@ namespace SteamNative // // EGamepadTextInputMode // - internal enum GamepadTextInputMode : int + public enum GamepadTextInputMode : int { Normal = 0, Password = 1, @@ -600,7 +681,7 @@ namespace SteamNative // // EGamepadTextInputLineMode // - internal enum GamepadTextInputLineMode : int + public enum GamepadTextInputLineMode : int { SingleLine = 0, MultipleLines = 1, @@ -609,7 +690,7 @@ namespace SteamNative // // ECheckFileSignature // - internal enum CheckFileSignature : int + public enum CheckFileSignature : int { InvalidSignature = 0, ValidSignature = 1, @@ -675,6 +756,38 @@ namespace SteamNative Banned = 16, } + // + // ESteamPartyBeaconLocationType + // + internal enum SteamPartyBeaconLocationType : int + { + Invalid = 0, + ChatGroup = 1, + Max = 2, + } + + // + // ESteamPartyBeaconLocationData + // + internal enum SteamPartyBeaconLocationData : int + { + Invalid = 0, + Name = 1, + IconURLSmall = 2, + IconURLMedium = 3, + IconURLLarge = 4, + } + + // + // RequestPlayersForGameResultCallback_t::PlayerAcceptState_t + // + internal enum PlayerAcceptState_t : int + { + Unknown = 0, + PlayerAccepted = 1, + PlayerDeclined = 2, + } + // // ERemoteStoragePlatform // @@ -686,6 +799,7 @@ namespace SteamNative PS3 = 4, Linux = 8, Reserved2 = 16, + Android = 32, All = -1, } @@ -791,24 +905,9 @@ namespace SteamNative // // ELeaderboardSortMethod // - internal enum LeaderboardSortMethod : int - { - None = 0, - Ascending = 1, - Descending = 2, - } - // // ELeaderboardDisplayType // - internal enum LeaderboardDisplayType : int - { - None = 0, - Numeric = 1, - TimeSeconds = 2, - TimeMilliSeconds = 3, - } - // // ELeaderboardUploadScoreMethod // @@ -834,7 +933,7 @@ namespace SteamNative // // EP2PSessionError // - internal enum P2PSessionError : int + public enum P2PSessionError : int { None = 0, NotRunningApp = 1, @@ -847,7 +946,7 @@ namespace SteamNative // // EP2PSend // - internal enum P2PSend : int + public enum P2PSend : int { Unreliable = 0, UnreliableNoDelay = 1, @@ -899,7 +998,7 @@ namespace SteamNative // // AudioPlayback_Status // - internal enum AudioPlayback_Status : int + public enum MusicStatus : int { Undefined = 0, Playing = 1, @@ -973,6 +1072,358 @@ namespace SteamNative HTTPStatusCode5xxUnknown = 599, } + // + // EInputSource + // + internal enum InputSource : int + { + None = 0, + LeftTrackpad = 1, + RightTrackpad = 2, + Joystick = 3, + ABXY = 4, + Switch = 5, + LeftTrigger = 6, + RightTrigger = 7, + LeftBumper = 8, + RightBumper = 9, + Gyro = 10, + CenterTrackpad = 11, + RightJoystick = 12, + DPad = 13, + Key = 14, + Mouse = 15, + LeftGyro = 16, + Count = 17, + } + + // + // EInputSourceMode + // + public enum InputSourceMode : int + { + None = 0, + Dpad = 1, + Buttons = 2, + FourButtons = 3, + AbsoluteMouse = 4, + RelativeMouse = 5, + JoystickMove = 6, + JoystickMouse = 7, + JoystickCamera = 8, + ScrollWheel = 9, + Trigger = 10, + TouchMenu = 11, + MouseJoystick = 12, + MouseRegion = 13, + RadialMenu = 14, + SingleButton = 15, + Switches = 16, + } + + // + // EInputActionOrigin + // + internal enum InputActionOrigin : int + { + None = 0, + SteamController_A = 1, + SteamController_B = 2, + SteamController_X = 3, + SteamController_Y = 4, + SteamController_LeftBumper = 5, + SteamController_RightBumper = 6, + SteamController_LeftGrip = 7, + SteamController_RightGrip = 8, + SteamController_Start = 9, + SteamController_Back = 10, + SteamController_LeftPad_Touch = 11, + SteamController_LeftPad_Swipe = 12, + SteamController_LeftPad_Click = 13, + SteamController_LeftPad_DPadNorth = 14, + SteamController_LeftPad_DPadSouth = 15, + SteamController_LeftPad_DPadWest = 16, + SteamController_LeftPad_DPadEast = 17, + SteamController_RightPad_Touch = 18, + SteamController_RightPad_Swipe = 19, + SteamController_RightPad_Click = 20, + SteamController_RightPad_DPadNorth = 21, + SteamController_RightPad_DPadSouth = 22, + SteamController_RightPad_DPadWest = 23, + SteamController_RightPad_DPadEast = 24, + SteamController_LeftTrigger_Pull = 25, + SteamController_LeftTrigger_Click = 26, + SteamController_RightTrigger_Pull = 27, + SteamController_RightTrigger_Click = 28, + SteamController_LeftStick_Move = 29, + SteamController_LeftStick_Click = 30, + SteamController_LeftStick_DPadNorth = 31, + SteamController_LeftStick_DPadSouth = 32, + SteamController_LeftStick_DPadWest = 33, + SteamController_LeftStick_DPadEast = 34, + SteamController_Gyro_Move = 35, + SteamController_Gyro_Pitch = 36, + SteamController_Gyro_Yaw = 37, + SteamController_Gyro_Roll = 38, + SteamController_Reserved0 = 39, + SteamController_Reserved1 = 40, + SteamController_Reserved2 = 41, + SteamController_Reserved3 = 42, + SteamController_Reserved4 = 43, + SteamController_Reserved5 = 44, + SteamController_Reserved6 = 45, + SteamController_Reserved7 = 46, + SteamController_Reserved8 = 47, + SteamController_Reserved9 = 48, + SteamController_Reserved10 = 49, + PS4_X = 50, + PS4_Circle = 51, + PS4_Triangle = 52, + PS4_Square = 53, + PS4_LeftBumper = 54, + PS4_RightBumper = 55, + PS4_Options = 56, + PS4_Share = 57, + PS4_LeftPad_Touch = 58, + PS4_LeftPad_Swipe = 59, + PS4_LeftPad_Click = 60, + PS4_LeftPad_DPadNorth = 61, + PS4_LeftPad_DPadSouth = 62, + PS4_LeftPad_DPadWest = 63, + PS4_LeftPad_DPadEast = 64, + PS4_RightPad_Touch = 65, + PS4_RightPad_Swipe = 66, + PS4_RightPad_Click = 67, + PS4_RightPad_DPadNorth = 68, + PS4_RightPad_DPadSouth = 69, + PS4_RightPad_DPadWest = 70, + PS4_RightPad_DPadEast = 71, + PS4_CenterPad_Touch = 72, + PS4_CenterPad_Swipe = 73, + PS4_CenterPad_Click = 74, + PS4_CenterPad_DPadNorth = 75, + PS4_CenterPad_DPadSouth = 76, + PS4_CenterPad_DPadWest = 77, + PS4_CenterPad_DPadEast = 78, + PS4_LeftTrigger_Pull = 79, + PS4_LeftTrigger_Click = 80, + PS4_RightTrigger_Pull = 81, + PS4_RightTrigger_Click = 82, + PS4_LeftStick_Move = 83, + PS4_LeftStick_Click = 84, + PS4_LeftStick_DPadNorth = 85, + PS4_LeftStick_DPadSouth = 86, + PS4_LeftStick_DPadWest = 87, + PS4_LeftStick_DPadEast = 88, + PS4_RightStick_Move = 89, + PS4_RightStick_Click = 90, + PS4_RightStick_DPadNorth = 91, + PS4_RightStick_DPadSouth = 92, + PS4_RightStick_DPadWest = 93, + PS4_RightStick_DPadEast = 94, + PS4_DPad_North = 95, + PS4_DPad_South = 96, + PS4_DPad_West = 97, + PS4_DPad_East = 98, + PS4_Gyro_Move = 99, + PS4_Gyro_Pitch = 100, + PS4_Gyro_Yaw = 101, + PS4_Gyro_Roll = 102, + PS4_Reserved0 = 103, + PS4_Reserved1 = 104, + PS4_Reserved2 = 105, + PS4_Reserved3 = 106, + PS4_Reserved4 = 107, + PS4_Reserved5 = 108, + PS4_Reserved6 = 109, + PS4_Reserved7 = 110, + PS4_Reserved8 = 111, + PS4_Reserved9 = 112, + PS4_Reserved10 = 113, + XBoxOne_A = 114, + XBoxOne_B = 115, + XBoxOne_X = 116, + XBoxOne_Y = 117, + XBoxOne_LeftBumper = 118, + XBoxOne_RightBumper = 119, + XBoxOne_Menu = 120, + XBoxOne_View = 121, + XBoxOne_LeftTrigger_Pull = 122, + XBoxOne_LeftTrigger_Click = 123, + XBoxOne_RightTrigger_Pull = 124, + XBoxOne_RightTrigger_Click = 125, + XBoxOne_LeftStick_Move = 126, + XBoxOne_LeftStick_Click = 127, + XBoxOne_LeftStick_DPadNorth = 128, + XBoxOne_LeftStick_DPadSouth = 129, + XBoxOne_LeftStick_DPadWest = 130, + XBoxOne_LeftStick_DPadEast = 131, + XBoxOne_RightStick_Move = 132, + XBoxOne_RightStick_Click = 133, + XBoxOne_RightStick_DPadNorth = 134, + XBoxOne_RightStick_DPadSouth = 135, + XBoxOne_RightStick_DPadWest = 136, + XBoxOne_RightStick_DPadEast = 137, + XBoxOne_DPad_North = 138, + XBoxOne_DPad_South = 139, + XBoxOne_DPad_West = 140, + XBoxOne_DPad_East = 141, + XBoxOne_Reserved0 = 142, + XBoxOne_Reserved1 = 143, + XBoxOne_Reserved2 = 144, + XBoxOne_Reserved3 = 145, + XBoxOne_Reserved4 = 146, + XBoxOne_Reserved5 = 147, + XBoxOne_Reserved6 = 148, + XBoxOne_Reserved7 = 149, + XBoxOne_Reserved8 = 150, + XBoxOne_Reserved9 = 151, + XBoxOne_Reserved10 = 152, + XBox360_A = 153, + XBox360_B = 154, + XBox360_X = 155, + XBox360_Y = 156, + XBox360_LeftBumper = 157, + XBox360_RightBumper = 158, + XBox360_Start = 159, + XBox360_Back = 160, + XBox360_LeftTrigger_Pull = 161, + XBox360_LeftTrigger_Click = 162, + XBox360_RightTrigger_Pull = 163, + XBox360_RightTrigger_Click = 164, + XBox360_LeftStick_Move = 165, + XBox360_LeftStick_Click = 166, + XBox360_LeftStick_DPadNorth = 167, + XBox360_LeftStick_DPadSouth = 168, + XBox360_LeftStick_DPadWest = 169, + XBox360_LeftStick_DPadEast = 170, + XBox360_RightStick_Move = 171, + XBox360_RightStick_Click = 172, + XBox360_RightStick_DPadNorth = 173, + XBox360_RightStick_DPadSouth = 174, + XBox360_RightStick_DPadWest = 175, + XBox360_RightStick_DPadEast = 176, + XBox360_DPad_North = 177, + XBox360_DPad_South = 178, + XBox360_DPad_West = 179, + XBox360_DPad_East = 180, + XBox360_Reserved0 = 181, + XBox360_Reserved1 = 182, + XBox360_Reserved2 = 183, + XBox360_Reserved3 = 184, + XBox360_Reserved4 = 185, + XBox360_Reserved5 = 186, + XBox360_Reserved6 = 187, + XBox360_Reserved7 = 188, + XBox360_Reserved8 = 189, + XBox360_Reserved9 = 190, + XBox360_Reserved10 = 191, + Switch_A = 192, + Switch_B = 193, + Switch_X = 194, + Switch_Y = 195, + Switch_LeftBumper = 196, + Switch_RightBumper = 197, + Switch_Plus = 198, + Switch_Minus = 199, + Switch_Capture = 200, + Switch_LeftTrigger_Pull = 201, + Switch_LeftTrigger_Click = 202, + Switch_RightTrigger_Pull = 203, + Switch_RightTrigger_Click = 204, + Switch_LeftStick_Move = 205, + Switch_LeftStick_Click = 206, + Switch_LeftStick_DPadNorth = 207, + Switch_LeftStick_DPadSouth = 208, + Switch_LeftStick_DPadWest = 209, + Switch_LeftStick_DPadEast = 210, + Switch_RightStick_Move = 211, + Switch_RightStick_Click = 212, + Switch_RightStick_DPadNorth = 213, + Switch_RightStick_DPadSouth = 214, + Switch_RightStick_DPadWest = 215, + Switch_RightStick_DPadEast = 216, + Switch_DPad_North = 217, + Switch_DPad_South = 218, + Switch_DPad_West = 219, + Switch_DPad_East = 220, + Switch_ProGyro_Move = 221, + Switch_ProGyro_Pitch = 222, + Switch_ProGyro_Yaw = 223, + Switch_ProGyro_Roll = 224, + Switch_Reserved0 = 225, + Switch_Reserved1 = 226, + Switch_Reserved2 = 227, + Switch_Reserved3 = 228, + Switch_Reserved4 = 229, + Switch_Reserved5 = 230, + Switch_Reserved6 = 231, + Switch_Reserved7 = 232, + Switch_Reserved8 = 233, + Switch_Reserved9 = 234, + Switch_Reserved10 = 235, + Switch_RightGyro_Move = 236, + Switch_RightGyro_Pitch = 237, + Switch_RightGyro_Yaw = 238, + Switch_RightGyro_Roll = 239, + Switch_LeftGyro_Move = 240, + Switch_LeftGyro_Pitch = 241, + Switch_LeftGyro_Yaw = 242, + Switch_LeftGyro_Roll = 243, + Switch_LeftGrip_Lower = 244, + Switch_LeftGrip_Upper = 245, + Switch_RightGrip_Lower = 246, + Switch_RightGrip_Upper = 247, + Switch_Reserved11 = 248, + Switch_Reserved12 = 249, + Switch_Reserved13 = 250, + Switch_Reserved14 = 251, + Switch_Reserved15 = 252, + Switch_Reserved16 = 253, + Switch_Reserved17 = 254, + Switch_Reserved18 = 255, + Switch_Reserved19 = 256, + Switch_Reserved20 = 257, + Count = 258, + MaximumPossibleValue = 32767, + } + + // + // EXboxOrigin + // + internal enum XboxOrigin : int + { + A = 0, + B = 1, + X = 2, + Y = 3, + LeftBumper = 4, + RightBumper = 5, + Menu = 6, + View = 7, + LeftTrigger_Pull = 8, + LeftTrigger_Click = 9, + RightTrigger_Pull = 10, + RightTrigger_Click = 11, + LeftStick_Move = 12, + LeftStick_Click = 13, + LeftStick_DPadNorth = 14, + LeftStick_DPadSouth = 15, + LeftStick_DPadWest = 16, + LeftStick_DPadEast = 17, + RightStick_Move = 18, + RightStick_Click = 19, + RightStick_DPadNorth = 20, + RightStick_DPadSouth = 21, + RightStick_DPadWest = 22, + RightStick_DPadEast = 23, + DPad_North = 24, + DPad_South = 25, + DPad_West = 26, + DPad_East = 27, + Count = 28, + } + // // ESteamControllerPad // @@ -982,6 +1433,37 @@ namespace SteamNative Right = 1, } + // + // ESteamInputType + // + public enum InputType : int + { + Unknown = 0, + SteamController = 1, + XBox360Controller = 2, + XBoxOneController = 3, + GenericGamepad = 4, + PS4Controller = 5, + AppleMFiController = 6, + AndroidController = 7, + SwitchJoyConPair = 8, + SwitchJoyConSingle = 9, + SwitchProController = 10, + MobileTouch = 11, + PS3Controller = 12, + Count = 13, + MaximumPossibleValue = 255, + } + + // + // ESteamInputLEDFlag + // + internal enum SteamInputLEDFlag : int + { + SetColor = 0, + RestoreUserDefault = 1, + } + // // EControllerSource // @@ -995,13 +1477,16 @@ namespace SteamNative Switch = 5, LeftTrigger = 6, RightTrigger = 7, - Gyro = 8, - CenterTrackpad = 9, - RightJoystick = 10, - DPad = 11, - Key = 12, - Mouse = 13, - Count = 14, + LeftBumper = 8, + RightBumper = 9, + Gyro = 10, + CenterTrackpad = 11, + RightJoystick = 12, + DPad = 13, + Key = 14, + Mouse = 15, + LeftGyro = 16, + Count = 17, } // @@ -1187,9 +1672,9 @@ namespace SteamNative SteamV2_Y = 151, SteamV2_LeftBumper = 152, SteamV2_RightBumper = 153, - SteamV2_LeftGrip = 154, - SteamV2_RightGrip = 155, - SteamV2_LeftGrip_Upper = 156, + SteamV2_LeftGrip_Lower = 154, + SteamV2_LeftGrip_Upper = 155, + SteamV2_RightGrip_Lower = 156, SteamV2_RightGrip_Upper = 157, SteamV2_LeftBumper_Pressure = 158, SteamV2_RightBumper_Pressure = 159, @@ -1229,7 +1714,53 @@ namespace SteamNative SteamV2_Gyro_Pitch = 193, SteamV2_Gyro_Yaw = 194, SteamV2_Gyro_Roll = 195, - Count = 196, + Switch_A = 196, + Switch_B = 197, + Switch_X = 198, + Switch_Y = 199, + Switch_LeftBumper = 200, + Switch_RightBumper = 201, + Switch_Plus = 202, + Switch_Minus = 203, + Switch_Capture = 204, + Switch_LeftTrigger_Pull = 205, + Switch_LeftTrigger_Click = 206, + Switch_RightTrigger_Pull = 207, + Switch_RightTrigger_Click = 208, + Switch_LeftStick_Move = 209, + Switch_LeftStick_Click = 210, + Switch_LeftStick_DPadNorth = 211, + Switch_LeftStick_DPadSouth = 212, + Switch_LeftStick_DPadWest = 213, + Switch_LeftStick_DPadEast = 214, + Switch_RightStick_Move = 215, + Switch_RightStick_Click = 216, + Switch_RightStick_DPadNorth = 217, + Switch_RightStick_DPadSouth = 218, + Switch_RightStick_DPadWest = 219, + Switch_RightStick_DPadEast = 220, + Switch_DPad_North = 221, + Switch_DPad_South = 222, + Switch_DPad_West = 223, + Switch_DPad_East = 224, + Switch_ProGyro_Move = 225, + Switch_ProGyro_Pitch = 226, + Switch_ProGyro_Yaw = 227, + Switch_ProGyro_Roll = 228, + Switch_RightGyro_Move = 229, + Switch_RightGyro_Pitch = 230, + Switch_RightGyro_Yaw = 231, + Switch_RightGyro_Roll = 232, + Switch_LeftGyro_Move = 233, + Switch_LeftGyro_Pitch = 234, + Switch_LeftGyro_Yaw = 235, + Switch_LeftGyro_Roll = 236, + Switch_LeftGrip_Lower = 237, + Switch_LeftGrip_Upper = 238, + Switch_RightGrip_Lower = 239, + Switch_RightGrip_Upper = 240, + Count = 241, + MaximumPossibleValue = 32767, } // @@ -1241,23 +1772,10 @@ namespace SteamNative RestoreUserDefault = 1, } - // - // ESteamInputType - // - internal enum SteamInputType : int - { - Unknown = 0, - SteamController = 1, - XBox360Controller = 2, - XBoxOneController = 3, - GenericXInput = 4, - PS4Controller = 5, - } - // // EUGCMatchingUGCType // - internal enum UGCMatchingUGCType : int + public enum UgcType : int { Items = 0, Items_Mtx = 1, @@ -1474,7 +1992,7 @@ namespace SteamNative // // EParentalFeature // - internal enum ParentalFeature : int + public enum ParentalFeature : int { Invalid = 0, Store = 1, diff --git a/Facepunch.Steamworks/Generated/SteamGameServer.cs b/Facepunch.Steamworks/Generated/SteamGameServer.cs new file mode 100644 index 0000000..f9713c1 --- /dev/null +++ b/Facepunch.Steamworks/Generated/SteamGameServer.cs @@ -0,0 +1,48 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal static class SteamGameServer + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_RunCallbacks", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamGameServer_RunCallbacks(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_Shutdown", CallingConvention = CallingConvention.Cdecl )] + public static extern void SteamGameServer_Shutdown(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_GetHSteamUser", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamUser SteamGameServer_GetHSteamUser(); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamGameServer_GetHSteamPipe", CallingConvention = CallingConvention.Cdecl )] + public static extern HSteamPipe SteamGameServer_GetHSteamPipe(); + + } + static internal void RunCallbacks() + { + Native.SteamGameServer_RunCallbacks(); + } + + static internal void Shutdown() + { + Native.SteamGameServer_Shutdown(); + } + + static internal HSteamUser GetHSteamUser() + { + return Native.SteamGameServer_GetHSteamUser(); + } + + static internal HSteamPipe GetHSteamPipe() + { + return Native.SteamGameServer_GetHSteamPipe(); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/SteamInternal.cs b/Facepunch.Steamworks/Generated/SteamInternal.cs new file mode 100644 index 0000000..f9c15f0 --- /dev/null +++ b/Facepunch.Steamworks/Generated/SteamInternal.cs @@ -0,0 +1,49 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + + +namespace Steamworks +{ + internal static class SteamInternal + { + internal static class Native + { + [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_GameServer_Init", CallingConvention = CallingConvention.Cdecl )] + [return: MarshalAs( UnmanagedType.I1 )] + public static extern bool SteamInternal_GameServer_Init( uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_FindOrCreateUserInterface", CallingConvention = CallingConvention.Cdecl )] + public static extern IntPtr SteamInternal_FindOrCreateUserInterface( int steamuser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string versionname ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_FindOrCreateGameServerInterface", CallingConvention = CallingConvention.Cdecl )] + public static extern IntPtr SteamInternal_FindOrCreateGameServerInterface( int steamuser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string versionname ); + + [DllImport( Platform.LibraryName, EntryPoint = "SteamInternal_CreateInterface", CallingConvention = CallingConvention.Cdecl )] + public static extern IntPtr SteamInternal_CreateInterface( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string version ); + + } + static internal bool GameServer_Init( uint unIP, ushort usPort, ushort usGamePort, ushort usQueryPort, int eServerMode, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string pchVersionString ) + { + return Native.SteamInternal_GameServer_Init( unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString ); + } + + static internal IntPtr FindOrCreateUserInterface( int steamuser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string versionname ) + { + return Native.SteamInternal_FindOrCreateUserInterface( steamuser, versionname ); + } + + static internal IntPtr FindOrCreateGameServerInterface( int steamuser, [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string versionname ) + { + return Native.SteamInternal_FindOrCreateGameServerInterface( steamuser, versionname ); + } + + static internal IntPtr CreateInterface( [MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] string version ) + { + return Native.SteamInternal_CreateInterface( version ); + } + + } +} diff --git a/Facepunch.Steamworks/Generated/SteamStructs.cs b/Facepunch.Steamworks/Generated/SteamStructs.cs new file mode 100644 index 0000000..66839d8 --- /dev/null +++ b/Facepunch.Steamworks/Generated/SteamStructs.cs @@ -0,0 +1,10958 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Steamworks.Data; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CallbackMsg_t + { + internal int SteamUser; // m_hSteamUser HSteamUser + internal int Callback; // m_iCallback int + internal IntPtr ParamPtr; // m_pubParam uint8 * + internal int ParamCount; // m_cubParam int + + #region Marshalling + internal static CallbackMsg_t Fill( IntPtr p ) => ((CallbackMsg_t)(CallbackMsg_t) Marshal.PtrToStructure( p, typeof(CallbackMsg_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServerConnectFailure_t + { + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.I1)] + internal bool StillRetrying; // m_bStillRetrying _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServerConnectFailure_t) ); + internal static SteamServerConnectFailure_t Fill( IntPtr p ) => ((SteamServerConnectFailure_t)(SteamServerConnectFailure_t) Marshal.PtrToStructure( p, typeof(SteamServerConnectFailure_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServersDisconnected_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersDisconnected_t) ); + internal static SteamServersDisconnected_t Fill( IntPtr p ) => ((SteamServersDisconnected_t)(SteamServersDisconnected_t) Marshal.PtrToStructure( p, typeof(SteamServersDisconnected_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ClientGameServerDeny_t + { + internal uint AppID; // m_uAppID uint32 + internal uint GameServerIP; // m_unGameServerIP uint32 + internal ushort GameServerPort; // m_usGameServerPort uint16 + internal ushort Secure; // m_bSecure uint16 + internal uint Reason; // m_uReason uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClientGameServerDeny_t) ); + internal static ClientGameServerDeny_t Fill( IntPtr p ) => ((ClientGameServerDeny_t)(ClientGameServerDeny_t) Marshal.PtrToStructure( p, typeof(ClientGameServerDeny_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ValidateAuthTicketResponse_t + { + internal ulong SteamID; // m_SteamID class CSteamID + internal AuthResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse + internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); + internal static ValidateAuthTicketResponse_t Fill( IntPtr p ) => ((ValidateAuthTicketResponse_t)(ValidateAuthTicketResponse_t) Marshal.PtrToStructure( p, typeof(ValidateAuthTicketResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 43, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 43, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 43, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MicroTxnAuthorizationResponse_t + { + internal uint AppID; // m_unAppID uint32 + internal ulong OrderID; // m_ulOrderID uint64 + internal byte Authorized; // m_bAuthorized uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MicroTxnAuthorizationResponse_t) ); + internal static MicroTxnAuthorizationResponse_t Fill( IntPtr p ) => ((MicroTxnAuthorizationResponse_t)(MicroTxnAuthorizationResponse_t) Marshal.PtrToStructure( p, typeof(MicroTxnAuthorizationResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 52, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 52, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 52, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct EncryptedAppTicketResponse_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EncryptedAppTicketResponse_t) ); + internal static EncryptedAppTicketResponse_t Fill( IntPtr p ) => ((EncryptedAppTicketResponse_t)(EncryptedAppTicketResponse_t) Marshal.PtrToStructure( p, typeof(EncryptedAppTicketResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 54, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 54, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 54, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetAuthSessionTicketResponse_t + { + internal uint AuthTicket; // m_hAuthTicket HAuthTicket + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAuthSessionTicketResponse_t) ); + internal static GetAuthSessionTicketResponse_t Fill( IntPtr p ) => ((GetAuthSessionTicketResponse_t)(GetAuthSessionTicketResponse_t) Marshal.PtrToStructure( p, typeof(GetAuthSessionTicketResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 63, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 63, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 63, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameWebCallback_t + { + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_szURL + internal byte[] URL; // m_szURL char [256] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameWebCallback_t) ); + internal static GameWebCallback_t Fill( IntPtr p ) => ((GameWebCallback_t)(GameWebCallback_t) Marshal.PtrToStructure( p, typeof(GameWebCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 64, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 64, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 64, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StoreAuthURLResponse_t + { + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] // byte[] m_szURL + internal byte[] URL; // m_szURL char [512] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StoreAuthURLResponse_t) ); + internal static StoreAuthURLResponse_t Fill( IntPtr p ) => ((StoreAuthURLResponse_t)(StoreAuthURLResponse_t) Marshal.PtrToStructure( p, typeof(StoreAuthURLResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 65, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 65, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 65, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MarketEligibilityResponse_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Allowed; // m_bAllowed _Bool + internal MarketNotAllowedReasonFlags NotAllowedReason; // m_eNotAllowedReason enum EMarketNotAllowedReasonFlags + internal uint TAllowedAtTime; // m_rtAllowedAtTime RTime32 + internal int CdaySteamGuardRequiredDays; // m_cdaySteamGuardRequiredDays int + internal int CdayNewDeviceCooldown; // m_cdayNewDeviceCooldown int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MarketEligibilityResponse_t) ); + internal static MarketEligibilityResponse_t Fill( IntPtr p ) => ((MarketEligibilityResponse_t)(MarketEligibilityResponse_t) Marshal.PtrToStructure( p, typeof(MarketEligibilityResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 66, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 66, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 66, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendGameInfo_t + { + internal GameId GameID; // m_gameID class CGameID + internal uint GameIP; // m_unGameIP uint32 + internal ushort GamePort; // m_usGamePort uint16 + internal ushort QueryPort; // m_usQueryPort uint16 + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + + #region Marshalling + internal static FriendGameInfo_t Fill( IntPtr p ) => ((FriendGameInfo_t)(FriendGameInfo_t) Marshal.PtrToStructure( p, typeof(FriendGameInfo_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FriendSessionStateInfo_t + { + internal uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 + internal byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 + + #region Marshalling + internal static FriendSessionStateInfo_t Fill( IntPtr p ) => ((FriendSessionStateInfo_t)(FriendSessionStateInfo_t) Marshal.PtrToStructure( p, typeof(FriendSessionStateInfo_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FriendStateChange_t + { + internal ulong SteamID; // m_ulSteamID uint64 + internal int ChangeFlags; // m_nChangeFlags int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendStateChange_t) ); + internal static FriendStateChange_t Fill( IntPtr p ) => ((FriendStateChange_t)(FriendStateChange_t) Marshal.PtrToStructure( p, typeof(FriendStateChange_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameOverlayActivated_t + { + internal byte Active; // m_bActive uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) ); + internal static GameOverlayActivated_t Fill( IntPtr p ) => ((GameOverlayActivated_t)(GameOverlayActivated_t) Marshal.PtrToStructure( p, typeof(GameOverlayActivated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 31, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 31, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 31, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GameServerChangeRequested_t + { + internal string ServerUTF8() => System.Text.Encoding.UTF8.GetString( Server, 0, System.Array.IndexOf( Server, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchServer + internal byte[] Server; // m_rgchServer char [64] + internal string PasswordUTF8() => System.Text.Encoding.UTF8.GetString( Password, 0, System.Array.IndexOf( Password, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_rgchPassword + internal byte[] Password; // m_rgchPassword char [64] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameServerChangeRequested_t) ); + internal static GameServerChangeRequested_t Fill( IntPtr p ) => ((GameServerChangeRequested_t)(GameServerChangeRequested_t) Marshal.PtrToStructure( p, typeof(GameServerChangeRequested_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 32, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 32, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 32, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameLobbyJoinRequested_t + { + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); + internal static GameLobbyJoinRequested_t Fill( IntPtr p ) => ((GameLobbyJoinRequested_t)(GameLobbyJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameLobbyJoinRequested_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 33, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 33, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 33, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct AvatarImageLoaded_t + { + internal ulong SteamID; // m_steamID class CSteamID + internal int Image; // m_iImage int + internal int Wide; // m_iWide int + internal int Tall; // m_iTall int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); + internal static AvatarImageLoaded_t Fill( IntPtr p ) => ((AvatarImageLoaded_t)(AvatarImageLoaded_t) Marshal.PtrToStructure( p, typeof(AvatarImageLoaded_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 34, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 34, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 34, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ClanOfficerListResponse_t + { + internal ulong SteamIDClan; // m_steamIDClan class CSteamID + internal int COfficers; // m_cOfficers int + internal byte Success; // m_bSuccess uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); + internal static ClanOfficerListResponse_t Fill( IntPtr p ) => ((ClanOfficerListResponse_t)(ClanOfficerListResponse_t) Marshal.PtrToStructure( p, typeof(ClanOfficerListResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 35, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 35, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 35, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendRichPresenceUpdate_t + { + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); + internal static FriendRichPresenceUpdate_t Fill( IntPtr p ) => ((FriendRichPresenceUpdate_t)(FriendRichPresenceUpdate_t) Marshal.PtrToStructure( p, typeof(FriendRichPresenceUpdate_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 36, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 36, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 36, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameRichPresenceJoinRequested_t + { + internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID + internal string ConnectUTF8() => System.Text.Encoding.UTF8.GetString( Connect, 0, System.Array.IndexOf( Connect, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnect + internal byte[] Connect; // m_rgchConnect char [256] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); + internal static GameRichPresenceJoinRequested_t Fill( IntPtr p ) => ((GameRichPresenceJoinRequested_t)(GameRichPresenceJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameRichPresenceJoinRequested_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 37, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 37, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 37, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedClanChatMsg_t + { + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + internal int MessageID; // m_iMessageID int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); + internal static GameConnectedClanChatMsg_t Fill( IntPtr p ) => ((GameConnectedClanChatMsg_t)(GameConnectedClanChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedClanChatMsg_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 38, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 38, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 38, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedChatJoin_t + { + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); + internal static GameConnectedChatJoin_t Fill( IntPtr p ) => ((GameConnectedChatJoin_t)(GameConnectedChatJoin_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatJoin_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 39, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 39, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 39, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedChatLeave_t + { + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool Kicked; // m_bKicked _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool Dropped; // m_bDropped _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); + internal static GameConnectedChatLeave_t Fill( IntPtr p ) => ((GameConnectedChatLeave_t)(GameConnectedChatLeave_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatLeave_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 40, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 40, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 40, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DownloadClanActivityCountsResult_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Success; // m_bSuccess _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadClanActivityCountsResult_t) ); + internal static DownloadClanActivityCountsResult_t Fill( IntPtr p ) => ((DownloadClanActivityCountsResult_t)(DownloadClanActivityCountsResult_t) Marshal.PtrToStructure( p, typeof(DownloadClanActivityCountsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 41, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 41, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 41, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct JoinClanChatRoomCompletionResult_t + { + internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID + internal RoomEnter ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); + internal static JoinClanChatRoomCompletionResult_t Fill( IntPtr p ) => ((JoinClanChatRoomCompletionResult_t)(JoinClanChatRoomCompletionResult_t) Marshal.PtrToStructure( p, typeof(JoinClanChatRoomCompletionResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 42, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 42, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 42, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GameConnectedFriendChatMsg_t + { + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + internal int MessageID; // m_iMessageID int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); + internal static GameConnectedFriendChatMsg_t Fill( IntPtr p ) => ((GameConnectedFriendChatMsg_t)(GameConnectedFriendChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedFriendChatMsg_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 43, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 43, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 43, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsGetFollowerCount_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamID; // m_steamID class CSteamID + internal int Count; // m_nCount int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); + internal static FriendsGetFollowerCount_t Fill( IntPtr p ) => ((FriendsGetFollowerCount_t)(FriendsGetFollowerCount_t) Marshal.PtrToStructure( p, typeof(FriendsGetFollowerCount_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 44, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 44, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 44, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsIsFollowing_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamID; // m_steamID class CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool IsFollowing; // m_bIsFollowing _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); + internal static FriendsIsFollowing_t Fill( IntPtr p ) => ((FriendsIsFollowing_t)(FriendsIsFollowing_t) Marshal.PtrToStructure( p, typeof(FriendsIsFollowing_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 45, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 45, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 45, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct FriendsEnumerateFollowingList_t + { + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal ulong[] GSteamID; // m_rgSteamID class CSteamID [50] + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); + internal static FriendsEnumerateFollowingList_t Fill( IntPtr p ) => ((FriendsEnumerateFollowingList_t)(FriendsEnumerateFollowingList_t) Marshal.PtrToStructure( p, typeof(FriendsEnumerateFollowingList_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 46, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 46, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 46, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SetPersonaNameResponse_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Success; // m_bSuccess _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool LocalSuccess; // m_bLocalSuccess _Bool + internal Result Result; // m_result enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetPersonaNameResponse_t) ); + internal static SetPersonaNameResponse_t Fill( IntPtr p ) => ((SetPersonaNameResponse_t)(SetPersonaNameResponse_t) Marshal.PtrToStructure( p, typeof(SetPersonaNameResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamFriends + 47, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamFriends + 47, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamFriends + 47, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LowBatteryPower_t + { + internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LowBatteryPower_t) ); + internal static LowBatteryPower_t Fill( IntPtr p ) => ((LowBatteryPower_t)(LowBatteryPower_t) Marshal.PtrToStructure( p, typeof(LowBatteryPower_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAPICallCompleted_t + { + internal ulong AsyncCall; // m_hAsyncCall SteamAPICall_t + internal int Callback; // m_iCallback int + internal uint ParamCount; // m_cubParam uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAPICallCompleted_t) ); + internal static SteamAPICallCompleted_t Fill( IntPtr p ) => ((SteamAPICallCompleted_t)(SteamAPICallCompleted_t) Marshal.PtrToStructure( p, typeof(SteamAPICallCompleted_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CheckFileSignature_t + { + internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CheckFileSignature_t) ); + internal static CheckFileSignature_t Fill( IntPtr p ) => ((CheckFileSignature_t)(CheckFileSignature_t) Marshal.PtrToStructure( p, typeof(CheckFileSignature_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GamepadTextInputDismissed_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Submitted; // m_bSubmitted _Bool + internal uint SubmittedText; // m_unSubmittedText uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) ); + internal static GamepadTextInputDismissed_t Fill( IntPtr p ) => ((GamepadTextInputDismissed_t)(GamepadTextInputDismissed_t) Marshal.PtrToStructure( p, typeof(GamepadTextInputDismissed_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct servernetadr_t + { + internal ushort ConnectionPort; // m_usConnectionPort uint16 + internal ushort QueryPort; // m_usQueryPort uint16 + internal uint IP; // m_unIP uint32 + + #region Marshalling + internal static servernetadr_t Fill( IntPtr p ) => ((servernetadr_t)(servernetadr_t) Marshal.PtrToStructure( p, typeof(servernetadr_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct gameserveritem_t + { + internal servernetadr_t NetAdr; // m_NetAdr class servernetadr_t + internal int Ping; // m_nPing int + [MarshalAs(UnmanagedType.I1)] + internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool DoNotRefresh; // m_bDoNotRefresh _Bool + internal string GameDirUTF8() => System.Text.Encoding.UTF8.GetString( GameDir, 0, System.Array.IndexOf( GameDir, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szGameDir + internal byte[] GameDir; // m_szGameDir char [32] + internal string MapUTF8() => System.Text.Encoding.UTF8.GetString( Map, 0, System.Array.IndexOf( Map, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] // byte[] m_szMap + internal byte[] Map; // m_szMap char [32] + internal string GameDescriptionUTF8() => System.Text.Encoding.UTF8.GetString( GameDescription, 0, System.Array.IndexOf( GameDescription, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szGameDescription + internal byte[] GameDescription; // m_szGameDescription char [64] + internal uint AppID; // m_nAppID uint32 + internal int Players; // m_nPlayers int + internal int MaxPlayers; // m_nMaxPlayers int + internal int BotPlayers; // m_nBotPlayers int + [MarshalAs(UnmanagedType.I1)] + internal bool Password; // m_bPassword _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool Secure; // m_bSecure _Bool + internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 + internal int ServerVersion; // m_nServerVersion int + internal string ServerNameUTF8() => System.Text.Encoding.UTF8.GetString( ServerName, 0, System.Array.IndexOf( ServerName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 64)] // byte[] m_szServerName + internal byte[] ServerName; // m_szServerName char [64] + internal string GameTagsUTF8() => System.Text.Encoding.UTF8.GetString( GameTags, 0, System.Array.IndexOf( GameTags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_szGameTags + internal byte[] GameTags; // m_szGameTags char [128] + internal ulong SteamID; // m_steamID class CSteamID + + #region Marshalling + internal static gameserveritem_t Fill( IntPtr p ) => ((gameserveritem_t)(gameserveritem_t) Marshal.PtrToStructure( p, typeof(gameserveritem_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamPartyBeaconLocation_t + { + internal SteamPartyBeaconLocationType Type; // m_eType enum ESteamPartyBeaconLocationType + internal ulong LocationID; // m_ulLocationID uint64 + + #region Marshalling + internal static SteamPartyBeaconLocation_t Fill( IntPtr p ) => ((SteamPartyBeaconLocation_t)(SteamPartyBeaconLocation_t) Marshal.PtrToStructure( p, typeof(SteamPartyBeaconLocation_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FavoritesListChanged_t + { + internal uint IP; // m_nIP uint32 + internal uint QueryPort; // m_nQueryPort uint32 + internal uint ConnPort; // m_nConnPort uint32 + internal uint AppID; // m_nAppID uint32 + internal uint Flags; // m_nFlags uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Add; // m_bAdd _Bool + internal uint AccountId; // m_unAccountId AccountID_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListChanged_t) ); + internal static FavoritesListChanged_t Fill( IntPtr p ) => ((FavoritesListChanged_t)(FavoritesListChanged_t) Marshal.PtrToStructure( p, typeof(FavoritesListChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyInvite_t + { + internal ulong SteamIDUser; // m_ulSteamIDUser uint64 + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong GameID; // m_ulGameID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyInvite_t) ); + internal static LobbyInvite_t Fill( IntPtr p ) => ((LobbyInvite_t)(LobbyInvite_t) Marshal.PtrToStructure( p, typeof(LobbyInvite_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyEnter_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal uint GfChatPermissions; // m_rgfChatPermissions uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Locked; // m_bLocked _Bool + internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyEnter_t) ); + internal static LobbyEnter_t Fill( IntPtr p ) => ((LobbyEnter_t)(LobbyEnter_t) Marshal.PtrToStructure( p, typeof(LobbyEnter_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyDataUpdate_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDMember; // m_ulSteamIDMember uint64 + internal byte Success; // m_bSuccess uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyDataUpdate_t) ); + internal static LobbyDataUpdate_t Fill( IntPtr p ) => ((LobbyDataUpdate_t)(LobbyDataUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyDataUpdate_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyChatUpdate_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 + internal ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 + internal uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatUpdate_t) ); + internal static LobbyChatUpdate_t Fill( IntPtr p ) => ((LobbyChatUpdate_t)(LobbyChatUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyChatUpdate_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyChatMsg_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDUser; // m_ulSteamIDUser uint64 + internal byte ChatEntryType; // m_eChatEntryType uint8 + internal uint ChatID; // m_iChatID uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatMsg_t) ); + internal static LobbyChatMsg_t Fill( IntPtr p ) => ((LobbyChatMsg_t)(LobbyChatMsg_t) Marshal.PtrToStructure( p, typeof(LobbyChatMsg_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyGameCreated_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 + internal uint IP; // m_unIP uint32 + internal ushort Port; // m_usPort uint16 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyGameCreated_t) ); + internal static LobbyGameCreated_t Fill( IntPtr p ) => ((LobbyGameCreated_t)(LobbyGameCreated_t) Marshal.PtrToStructure( p, typeof(LobbyGameCreated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyMatchList_t + { + internal uint LobbiesMatching; // m_nLobbiesMatching uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyMatchList_t) ); + internal static LobbyMatchList_t Fill( IntPtr p ) => ((LobbyMatchList_t)(LobbyMatchList_t) Marshal.PtrToStructure( p, typeof(LobbyMatchList_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyKicked_t + { + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + internal ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 + internal byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyKicked_t) ); + internal static LobbyKicked_t Fill( IntPtr p ) => ((LobbyKicked_t)(LobbyKicked_t) Marshal.PtrToStructure( p, typeof(LobbyKicked_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LobbyCreated_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyCreated_t) ); + internal static LobbyCreated_t Fill( IntPtr p ) => ((LobbyCreated_t)(LobbyCreated_t) Marshal.PtrToStructure( p, typeof(LobbyCreated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct PSNGameBootInviteResult_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool GameBootInviteExists; // m_bGameBootInviteExists _Bool + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); + internal static PSNGameBootInviteResult_t Fill( IntPtr p ) => ((PSNGameBootInviteResult_t)(PSNGameBootInviteResult_t) Marshal.PtrToStructure( p, typeof(PSNGameBootInviteResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FavoritesListAccountsUpdated_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListAccountsUpdated_t) ); + internal static FavoritesListAccountsUpdated_t Fill( IntPtr p ) => ((FavoritesListAccountsUpdated_t)(FavoritesListAccountsUpdated_t) Marshal.PtrToStructure( p, typeof(FavoritesListAccountsUpdated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMatchmaking + 16, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SearchForGameProgressCallback_t + { + internal ulong LSearchID; // m_ullSearchID uint64 + internal Result Result; // m_eResult enum EResult + internal ulong LobbyID; // m_lobbyID class CSteamID + internal ulong SteamIDEndedSearch; // m_steamIDEndedSearch class CSteamID + internal int SecondsRemainingEstimate; // m_nSecondsRemainingEstimate int32 + internal int CPlayersSearching; // m_cPlayersSearching int32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameProgressCallback_t) ); + internal static SearchForGameProgressCallback_t Fill( IntPtr p ) => ((SearchForGameProgressCallback_t)(SearchForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameProgressCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SearchForGameResultCallback_t + { + internal ulong LSearchID; // m_ullSearchID uint64 + internal Result Result; // m_eResult enum EResult + internal int CountPlayersInGame; // m_nCountPlayersInGame int32 + internal int CountAcceptedGame; // m_nCountAcceptedGame int32 + internal ulong SteamIDHost; // m_steamIDHost class CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool FinalCallback; // m_bFinalCallback _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SearchForGameResultCallback_t) ); + internal static SearchForGameResultCallback_t Fill( IntPtr p ) => ((SearchForGameResultCallback_t)(SearchForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(SearchForGameResultCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RequestPlayersForGameProgressCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong LSearchID; // m_ullSearchID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameProgressCallback_t) ); + internal static RequestPlayersForGameProgressCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameProgressCallback_t)(RequestPlayersForGameProgressCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameProgressCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct RequestPlayersForGameResultCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong LSearchID; // m_ullSearchID uint64 + internal ulong SteamIDPlayerFound; // m_SteamIDPlayerFound class CSteamID + internal ulong SteamIDLobby; // m_SteamIDLobby class CSteamID + internal PlayerAcceptState_t PlayerAcceptState; // m_ePlayerAcceptState PlayerAcceptState_t + internal int PlayerIndex; // m_nPlayerIndex int32 + internal int TotalPlayersFound; // m_nTotalPlayersFound int32 + internal int TotalPlayersAcceptedGame; // m_nTotalPlayersAcceptedGame int32 + internal int SuggestedTeamIndex; // m_nSuggestedTeamIndex int32 + internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameResultCallback_t) ); + internal static RequestPlayersForGameResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameResultCallback_t)(RequestPlayersForGameResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameResultCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RequestPlayersForGameFinalResultCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong LSearchID; // m_ullSearchID uint64 + internal ulong LUniqueGameID; // m_ullUniqueGameID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RequestPlayersForGameFinalResultCallback_t) ); + internal static RequestPlayersForGameFinalResultCallback_t Fill( IntPtr p ) => ((RequestPlayersForGameFinalResultCallback_t)(RequestPlayersForGameFinalResultCallback_t) Marshal.PtrToStructure( p, typeof(RequestPlayersForGameFinalResultCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SubmitPlayerResultResultCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong UllUniqueGameID; // ullUniqueGameID uint64 + internal ulong SteamIDPlayer; // steamIDPlayer class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitPlayerResultResultCallback_t) ); + internal static SubmitPlayerResultResultCallback_t Fill( IntPtr p ) => ((SubmitPlayerResultResultCallback_t)(SubmitPlayerResultResultCallback_t) Marshal.PtrToStructure( p, typeof(SubmitPlayerResultResultCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct EndGameResultCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong UllUniqueGameID; // ullUniqueGameID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(EndGameResultCallback_t) ); + internal static EndGameResultCallback_t Fill( IntPtr p ) => ((EndGameResultCallback_t)(EndGameResultCallback_t) Marshal.PtrToStructure( p, typeof(EndGameResultCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameSearch + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameSearch + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameSearch + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct JoinPartyCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + internal ulong SteamIDBeaconOwner; // m_SteamIDBeaconOwner class CSteamID + internal string ConnectStringUTF8() => System.Text.Encoding.UTF8.GetString( ConnectString, 0, System.Array.IndexOf( ConnectString, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchConnectString + internal byte[] ConnectString; // m_rgchConnectString char [256] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinPartyCallback_t) ); + internal static JoinPartyCallback_t Fill( IntPtr p ) => ((JoinPartyCallback_t)(JoinPartyCallback_t) Marshal.PtrToStructure( p, typeof(JoinPartyCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CreateBeaconCallback_t + { + internal Result Result; // m_eResult enum EResult + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateBeaconCallback_t) ); + internal static CreateBeaconCallback_t Fill( IntPtr p ) => ((CreateBeaconCallback_t)(CreateBeaconCallback_t) Marshal.PtrToStructure( p, typeof(CreateBeaconCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ReservationNotificationCallback_t + { + internal ulong BeaconID; // m_ulBeaconID PartyBeaconID_t + internal ulong SteamIDJoiner; // m_steamIDJoiner class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ReservationNotificationCallback_t) ); + internal static ReservationNotificationCallback_t Fill( IntPtr p ) => ((ReservationNotificationCallback_t)(ReservationNotificationCallback_t) Marshal.PtrToStructure( p, typeof(ReservationNotificationCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ChangeNumOpenSlotsCallback_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ChangeNumOpenSlotsCallback_t) ); + internal static ChangeNumOpenSlotsCallback_t Fill( IntPtr p ) => ((ChangeNumOpenSlotsCallback_t)(ChangeNumOpenSlotsCallback_t) Marshal.PtrToStructure( p, typeof(ChangeNumOpenSlotsCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamParamStringArray_t + { + internal IntPtr Strings; // m_ppStrings const char ** + internal int NumStrings; // m_nNumStrings int32 + + #region Marshalling + internal static SteamParamStringArray_t Fill( IntPtr p ) => ((SteamParamStringArray_t)(SteamParamStringArray_t) Marshal.PtrToStructure( p, typeof(SteamParamStringArray_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncedClient_t + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult enum EResult + internal int NumDownloads; // m_unNumDownloads int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedClient_t) ); + internal static RemoteStorageAppSyncedClient_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedClient_t)(RemoteStorageAppSyncedClient_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedClient_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncedServer_t + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult enum EResult + internal int NumUploads; // m_unNumUploads int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedServer_t) ); + internal static RemoteStorageAppSyncedServer_t Fill( IntPtr p ) => ((RemoteStorageAppSyncedServer_t)(RemoteStorageAppSyncedServer_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedServer_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncProgress_t + { + internal string CurrentFileUTF8() => System.Text.Encoding.UTF8.GetString( CurrentFile, 0, System.Array.IndexOf( CurrentFile, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchCurrentFile + internal byte[] CurrentFile; // m_rgchCurrentFile char [260] + internal AppId AppID; // m_nAppID AppId_t + internal uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 + internal double DAppPercentComplete; // m_dAppPercentComplete double + [MarshalAs(UnmanagedType.I1)] + internal bool Uploading; // m_bUploading _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncProgress_t) ); + internal static RemoteStorageAppSyncProgress_t Fill( IntPtr p ) => ((RemoteStorageAppSyncProgress_t)(RemoteStorageAppSyncProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncProgress_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageAppSyncStatusCheck_t + { + internal AppId AppID; // m_nAppID AppId_t + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncStatusCheck_t) ); + internal static RemoteStorageAppSyncStatusCheck_t Fill( IntPtr p ) => ((RemoteStorageAppSyncStatusCheck_t)(RemoteStorageAppSyncStatusCheck_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncStatusCheck_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileShareResult_t + { + internal Result Result; // m_eResult enum EResult + internal ulong File; // m_hFile UGCHandle_t + internal string FilenameUTF8() => System.Text.Encoding.UTF8.GetString( Filename, 0, System.Array.IndexOf( Filename, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_rgchFilename + internal byte[] Filename; // m_rgchFilename char [260] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileShareResult_t) ); + internal static RemoteStorageFileShareResult_t Fill( IntPtr p ) => ((RemoteStorageFileShareResult_t)(RemoteStorageFileShareResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileShareResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishFileResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileResult_t) ); + internal static RemoteStoragePublishFileResult_t Fill( IntPtr p ) => ((RemoteStoragePublishFileResult_t)(RemoteStoragePublishFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageDeletePublishedFileResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDeletePublishedFileResult_t) ); + internal static RemoteStorageDeletePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageDeletePublishedFileResult_t)(RemoteStorageDeletePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDeletePublishedFileResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserPublishedFilesResult_t + { + internal Result Result; // m_eResult enum EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); + internal static RemoteStorageEnumerateUserPublishedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserPublishedFilesResult_t)(RemoteStorageEnumerateUserPublishedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageSubscribePublishedFileResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSubscribePublishedFileResult_t) ); + internal static RemoteStorageSubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageSubscribePublishedFileResult_t)(RemoteStorageSubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSubscribePublishedFileResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t + { + internal Result Result; // m_eResult enum EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); + internal static RemoteStorageEnumerateUserSubscribedFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSubscribedFilesResult_t)(RemoteStorageEnumerateUserSubscribedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUnsubscribePublishedFileResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); + internal static RemoteStorageUnsubscribePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUnsubscribePublishedFileResult_t)(RemoteStorageUnsubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUnsubscribePublishedFileResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUpdatePublishedFileResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdatePublishedFileResult_t) ); + internal static RemoteStorageUpdatePublishedFileResult_t Fill( IntPtr p ) => ((RemoteStorageUpdatePublishedFileResult_t)(RemoteStorageUpdatePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdatePublishedFileResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 16, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageDownloadUGCResult_t + { + internal Result Result; // m_eResult enum EResult + internal ulong File; // m_hFile UGCHandle_t + internal AppId AppID; // m_nAppID AppId_t + internal int SizeInBytes; // m_nSizeInBytes int32 + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDownloadUGCResult_t) ); + internal static RemoteStorageDownloadUGCResult_t Fill( IntPtr p ) => ((RemoteStorageDownloadUGCResult_t)(RemoteStorageDownloadUGCResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDownloadUGCResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 17, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageGetPublishedFileDetailsResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId CreatorAppID; // m_nCreatorAppID AppId_t + internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t + internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle + internal byte[] Title; // m_rgchTitle char [129] + internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription + internal byte[] Description; // m_rgchDescription char [8000] + internal ulong File; // m_hFile UGCHandle_t + internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + internal uint TimeCreated; // m_rtimeCreated uint32 + internal uint TimeUpdated; // m_rtimeUpdated uint32 + internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned _Bool + internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags + internal byte[] Tags; // m_rgchTags char [1025] + [MarshalAs(UnmanagedType.I1)] + internal bool TagsTruncated; // m_bTagsTruncated _Bool + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType + [MarshalAs(UnmanagedType.I1)] + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); + internal static RemoteStorageGetPublishedFileDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedFileDetailsResult_t)(RemoteStorageGetPublishedFileDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedFileDetailsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 18, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateWorkshopFilesResult_t + { + internal Result Result; // m_eResult enum EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] + internal float[] GScore; // m_rgScore float [50] + internal AppId AppId; // m_nAppId AppId_t + internal uint StartIndex; // m_unStartIndex uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); + internal static RemoteStorageEnumerateWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateWorkshopFilesResult_t)(RemoteStorageEnumerateWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 19, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_unPublishedFileId PublishedFileId_t + internal int VotesFor; // m_nVotesFor int32 + internal int VotesAgainst; // m_nVotesAgainst int32 + internal int Reports; // m_nReports int32 + internal float FScore; // m_fScore float + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); + internal static RemoteStorageGetPublishedItemVoteDetailsResult_t Fill( IntPtr p ) => ((RemoteStorageGetPublishedItemVoteDetailsResult_t)(RemoteStorageGetPublishedItemVoteDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 20, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 20, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 20, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileSubscribed_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileSubscribed_t) ); + internal static RemoteStoragePublishedFileSubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileSubscribed_t)(RemoteStoragePublishedFileSubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileSubscribed_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 21, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileUnsubscribed_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUnsubscribed_t) ); + internal static RemoteStoragePublishedFileUnsubscribed_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUnsubscribed_t)(RemoteStoragePublishedFileUnsubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUnsubscribed_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 22, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileDeleted_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileDeleted_t) ); + internal static RemoteStoragePublishedFileDeleted_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileDeleted_t)(RemoteStoragePublishedFileDeleted_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileDeleted_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 23, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); + internal static RemoteStorageUpdateUserPublishedItemVoteResult_t Fill( IntPtr p ) => ((RemoteStorageUpdateUserPublishedItemVoteResult_t)(RemoteStorageUpdateUserPublishedItemVoteResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 24, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 24, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageUserVoteDetails_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal WorkshopVote Vote; // m_eVote enum EWorkshopVote + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUserVoteDetails_t) ); + internal static RemoteStorageUserVoteDetails_t Fill( IntPtr p ) => ((RemoteStorageUserVoteDetails_t)(RemoteStorageUserVoteDetails_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUserVoteDetails_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 25, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t + { + internal Result Result; // m_eResult enum EResult + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); + internal static RemoteStorageEnumerateUserSharedWorkshopFilesResult_t Fill( IntPtr p ) => ((RemoteStorageEnumerateUserSharedWorkshopFilesResult_t)(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 26, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 26, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 26, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageSetUserPublishedFileActionResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); + internal static RemoteStorageSetUserPublishedFileActionResult_t Fill( IntPtr p ) => ((RemoteStorageSetUserPublishedFileActionResult_t)(RemoteStorageSetUserPublishedFileActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSetUserPublishedFileActionResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 27, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 27, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 27, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t + { + internal Result Result; // m_eResult enum EResult + internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction + internal int ResultsReturned; // m_nResultsReturned int32 + internal int TotalResultCount; // m_nTotalResultCount int32 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] + internal PublishedFileId[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] + internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); + internal static RemoteStorageEnumeratePublishedFilesByUserActionResult_t Fill( IntPtr p ) => ((RemoteStorageEnumeratePublishedFilesByUserActionResult_t)(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 28, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 28, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 28, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishFileProgress_t + { + internal double DPercentFile; // m_dPercentFile double + [MarshalAs(UnmanagedType.I1)] + internal bool Preview; // m_bPreview _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileProgress_t) ); + internal static RemoteStoragePublishFileProgress_t Fill( IntPtr p ) => ((RemoteStoragePublishFileProgress_t)(RemoteStoragePublishFileProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileProgress_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 29, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStoragePublishedFileUpdated_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + internal ulong Unused; // m_ulUnused uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUpdated_t) ); + internal static RemoteStoragePublishedFileUpdated_t Fill( IntPtr p ) => ((RemoteStoragePublishedFileUpdated_t)(RemoteStoragePublishedFileUpdated_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUpdated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 30, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileWriteAsyncComplete_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileWriteAsyncComplete_t) ); + internal static RemoteStorageFileWriteAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileWriteAsyncComplete_t)(RemoteStorageFileWriteAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileWriteAsyncComplete_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 31, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoteStorageFileReadAsyncComplete_t + { + internal ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t + internal Result Result; // m_eResult enum EResult + internal uint Offset; // m_nOffset uint32 + internal uint Read; // m_cubRead uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileReadAsyncComplete_t) ); + internal static RemoteStorageFileReadAsyncComplete_t Fill( IntPtr p ) => ((RemoteStorageFileReadAsyncComplete_t)(RemoteStorageFileReadAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileReadAsyncComplete_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientRemoteStorage + 32, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct LeaderboardEntry_t + { + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + internal int GlobalRank; // m_nGlobalRank int32 + internal int Score; // m_nScore int32 + internal int CDetails; // m_cDetails int32 + internal ulong UGC; // m_hUGC UGCHandle_t + + #region Marshalling + internal static LeaderboardEntry_t Fill( IntPtr p ) => ((LeaderboardEntry_t)(LeaderboardEntry_t) Marshal.PtrToStructure( p, typeof(LeaderboardEntry_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct UserStatsReceived_t + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); + internal static UserStatsReceived_t Fill( IntPtr p ) => ((UserStatsReceived_t)(UserStatsReceived_t) Marshal.PtrToStructure( p, typeof(UserStatsReceived_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserStatsStored_t + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsStored_t) ); + internal static UserStatsStored_t Fill( IntPtr p ) => ((UserStatsStored_t)(UserStatsStored_t) Marshal.PtrToStructure( p, typeof(UserStatsStored_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserAchievementStored_t + { + internal ulong GameID; // m_nGameID uint64 + [MarshalAs(UnmanagedType.I1)] + internal bool GroupAchievement; // m_bGroupAchievement _Bool + internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName + internal byte[] AchievementName; // m_rgchAchievementName char [128] + internal uint CurProgress; // m_nCurProgress uint32 + internal uint MaxProgress; // m_nMaxProgress uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementStored_t) ); + internal static UserAchievementStored_t Fill( IntPtr p ) => ((UserAchievementStored_t)(UserAchievementStored_t) Marshal.PtrToStructure( p, typeof(UserAchievementStored_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardFindResult_t + { + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal byte LeaderboardFound; // m_bLeaderboardFound uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardFindResult_t) ); + internal static LeaderboardFindResult_t Fill( IntPtr p ) => ((LeaderboardFindResult_t)(LeaderboardFindResult_t) Marshal.PtrToStructure( p, typeof(LeaderboardFindResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardScoresDownloaded_t + { + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t + internal int CEntryCount; // m_cEntryCount int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoresDownloaded_t) ); + internal static LeaderboardScoresDownloaded_t Fill( IntPtr p ) => ((LeaderboardScoresDownloaded_t)(LeaderboardScoresDownloaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoresDownloaded_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardScoreUploaded_t + { + internal byte Success; // m_bSuccess uint8 + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + internal int Score; // m_nScore int32 + internal byte ScoreChanged; // m_bScoreChanged uint8 + internal int GlobalRankNew; // m_nGlobalRankNew int + internal int GlobalRankPrevious; // m_nGlobalRankPrevious int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoreUploaded_t) ); + internal static LeaderboardScoreUploaded_t Fill( IntPtr p ) => ((LeaderboardScoreUploaded_t)(LeaderboardScoreUploaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoreUploaded_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct NumberOfCurrentPlayers_t + { + internal byte Success; // m_bSuccess uint8 + internal int CPlayers; // m_cPlayers int32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NumberOfCurrentPlayers_t) ); + internal static NumberOfCurrentPlayers_t Fill( IntPtr p ) => ((NumberOfCurrentPlayers_t)(NumberOfCurrentPlayers_t) Marshal.PtrToStructure( p, typeof(NumberOfCurrentPlayers_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct UserStatsUnloaded_t + { + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); + internal static UserStatsUnloaded_t Fill( IntPtr p ) => ((UserStatsUnloaded_t)(UserStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(UserStatsUnloaded_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserAchievementIconFetched_t + { + internal GameId GameID; // m_nGameID class CGameID + internal string AchievementNameUTF8() => System.Text.Encoding.UTF8.GetString( AchievementName, 0, System.Array.IndexOf( AchievementName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchAchievementName + internal byte[] AchievementName; // m_rgchAchievementName char [128] + [MarshalAs(UnmanagedType.I1)] + internal bool Achieved; // m_bAchieved _Bool + internal int IconHandle; // m_nIconHandle int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementIconFetched_t) ); + internal static UserAchievementIconFetched_t Fill( IntPtr p ) => ((UserAchievementIconFetched_t)(UserAchievementIconFetched_t) Marshal.PtrToStructure( p, typeof(UserAchievementIconFetched_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GlobalAchievementPercentagesReady_t + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalAchievementPercentagesReady_t) ); + internal static GlobalAchievementPercentagesReady_t Fill( IntPtr p ) => ((GlobalAchievementPercentagesReady_t)(GlobalAchievementPercentagesReady_t) Marshal.PtrToStructure( p, typeof(GlobalAchievementPercentagesReady_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LeaderboardUGCSet_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardUGCSet_t) ); + internal static LeaderboardUGCSet_t Fill( IntPtr p ) => ((LeaderboardUGCSet_t)(LeaderboardUGCSet_t) Marshal.PtrToStructure( p, typeof(LeaderboardUGCSet_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct PS3TrophiesInstalled_t + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult + internal ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PS3TrophiesInstalled_t) ); + internal static PS3TrophiesInstalled_t Fill( IntPtr p ) => ((PS3TrophiesInstalled_t)(PS3TrophiesInstalled_t) Marshal.PtrToStructure( p, typeof(PS3TrophiesInstalled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GlobalStatsReceived_t + { + internal ulong GameID; // m_nGameID uint64 + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalStatsReceived_t) ); + internal static GlobalStatsReceived_t Fill( IntPtr p ) => ((GlobalStatsReceived_t)(GlobalStatsReceived_t) Marshal.PtrToStructure( p, typeof(GlobalStatsReceived_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DlcInstalled_t + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DlcInstalled_t) ); + internal static DlcInstalled_t Fill( IntPtr p ) => ((DlcInstalled_t)(DlcInstalled_t) Marshal.PtrToStructure( p, typeof(DlcInstalled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RegisterActivationCodeResponse_t + { + internal RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult + internal uint PackageRegistered; // m_unPackageRegistered uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) ); + internal static RegisterActivationCodeResponse_t Fill( IntPtr p ) => ((RegisterActivationCodeResponse_t)(RegisterActivationCodeResponse_t) Marshal.PtrToStructure( p, typeof(RegisterActivationCodeResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AppProofOfPurchaseKeyResponse_t + { + internal Result Result; // m_eResult enum EResult + internal uint AppID; // m_nAppID uint32 + internal uint CchKeyLength; // m_cchKeyLength uint32 + internal string KeyUTF8() => System.Text.Encoding.UTF8.GetString( Key, 0, System.Array.IndexOf( Key, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 240)] // byte[] m_rgchKey + internal byte[] Key; // m_rgchKey char [240] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AppProofOfPurchaseKeyResponse_t) ); + internal static AppProofOfPurchaseKeyResponse_t Fill( IntPtr p ) => ((AppProofOfPurchaseKeyResponse_t)(AppProofOfPurchaseKeyResponse_t) Marshal.PtrToStructure( p, typeof(AppProofOfPurchaseKeyResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 21, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 21, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct FileDetailsResult_t + { + internal Result Result; // m_eResult enum EResult + internal ulong FileSize; // m_ulFileSize uint64 + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20)] // m_FileSHA + internal byte[] FileSHA; // m_FileSHA uint8 [20] + internal uint Flags; // m_unFlags uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(FileDetailsResult_t) ); + internal static FileDetailsResult_t Fill( IntPtr p ) => ((FileDetailsResult_t)(FileDetailsResult_t) Marshal.PtrToStructure( p, typeof(FileDetailsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 23, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 23, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct P2PSessionState_t + { + internal byte ConnectionActive; // m_bConnectionActive uint8 + internal byte Connecting; // m_bConnecting uint8 + internal byte P2PSessionError; // m_eP2PSessionError uint8 + internal byte UsingRelay; // m_bUsingRelay uint8 + internal int BytesQueuedForSend; // m_nBytesQueuedForSend int32 + internal int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 + internal uint RemoteIP; // m_nRemoteIP uint32 + internal ushort RemotePort; // m_nRemotePort uint16 + + #region Marshalling + internal static P2PSessionState_t Fill( IntPtr p ) => ((P2PSessionState_t)(P2PSessionState_t) Marshal.PtrToStructure( p, typeof(P2PSessionState_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct P2PSessionRequest_t + { + internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); + internal static P2PSessionRequest_t Fill( IntPtr p ) => ((P2PSessionRequest_t)(P2PSessionRequest_t) Marshal.PtrToStructure( p, typeof(P2PSessionRequest_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct P2PSessionConnectFail_t + { + internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID + internal byte P2PSessionError; // m_eP2PSessionError uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); + internal static P2PSessionConnectFail_t Fill( IntPtr p ) => ((P2PSessionConnectFail_t)(P2PSessionConnectFail_t) Marshal.PtrToStructure( p, typeof(P2PSessionConnectFail_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SocketStatusCallback_t + { + internal uint Socket; // m_hSocket SNetSocket_t + internal uint ListenSocket; // m_hListenSocket SNetListenSocket_t + internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID + internal int SNetSocketState; // m_eSNetSocketState int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SocketStatusCallback_t) ); + internal static SocketStatusCallback_t Fill( IntPtr p ) => ((SocketStatusCallback_t)(SocketStatusCallback_t) Marshal.PtrToStructure( p, typeof(SocketStatusCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworking + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworking + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworking + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ScreenshotReady_t + { + internal uint Local; // m_hLocal ScreenshotHandle + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotReady_t) ); + internal static ScreenshotReady_t Fill( IntPtr p ) => ((ScreenshotReady_t)(ScreenshotReady_t) Marshal.PtrToStructure( p, typeof(ScreenshotReady_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamScreenshots + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamScreenshots + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamScreenshots + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct VolumeHasChanged_t + { + internal float NewVolume; // m_flNewVolume float + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(VolumeHasChanged_t) ); + internal static VolumeHasChanged_t Fill( IntPtr p ) => ((VolumeHasChanged_t)(VolumeHasChanged_t) Marshal.PtrToStructure( p, typeof(VolumeHasChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsShuffled_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Shuffled; // m_bShuffled _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsShuffled_t) ); + internal static MusicPlayerWantsShuffled_t Fill( IntPtr p ) => ((MusicPlayerWantsShuffled_t)(MusicPlayerWantsShuffled_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsShuffled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsLooped_t + { + [MarshalAs(UnmanagedType.I1)] + internal bool Looped; // m_bLooped _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsLooped_t) ); + internal static MusicPlayerWantsLooped_t Fill( IntPtr p ) => ((MusicPlayerWantsLooped_t)(MusicPlayerWantsLooped_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsLooped_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsVolume_t + { + internal float NewVolume; // m_flNewVolume float + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsVolume_t) ); + internal static MusicPlayerWantsVolume_t Fill( IntPtr p ) => ((MusicPlayerWantsVolume_t)(MusicPlayerWantsVolume_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsVolume_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerSelectsQueueEntry_t + { + internal int NID; // nID int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsQueueEntry_t) ); + internal static MusicPlayerSelectsQueueEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsQueueEntry_t)(MusicPlayerSelectsQueueEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsQueueEntry_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerSelectsPlaylistEntry_t + { + internal int NID; // nID int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsPlaylistEntry_t) ); + internal static MusicPlayerSelectsPlaylistEntry_t Fill( IntPtr p ) => ((MusicPlayerSelectsPlaylistEntry_t)(MusicPlayerSelectsPlaylistEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsPlaylistEntry_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct MusicPlayerWantsPlayingRepeatStatus_t + { + internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); + internal static MusicPlayerWantsPlayingRepeatStatus_t Fill( IntPtr p ) => ((MusicPlayerWantsPlayingRepeatStatus_t)(MusicPlayerWantsPlayingRepeatStatus_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsPlayingRepeatStatus_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusicRemote + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestCompleted_t + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + [MarshalAs(UnmanagedType.I1)] + internal bool RequestSuccessful; // m_bRequestSuccessful _Bool + internal HTTPStatusCode StatusCode; // m_eStatusCode enum EHTTPStatusCode + internal uint BodySize; // m_unBodySize uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestCompleted_t) ); + internal static HTTPRequestCompleted_t Fill( IntPtr p ) => ((HTTPRequestCompleted_t)(HTTPRequestCompleted_t) Marshal.PtrToStructure( p, typeof(HTTPRequestCompleted_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestHeadersReceived_t + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestHeadersReceived_t) ); + internal static HTTPRequestHeadersReceived_t Fill( IntPtr p ) => ((HTTPRequestHeadersReceived_t)(HTTPRequestHeadersReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestHeadersReceived_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTTPRequestDataReceived_t + { + internal uint Request; // m_hRequest HTTPRequestHandle + internal ulong ContextValue; // m_ulContextValue uint64 + internal uint COffset; // m_cOffset uint32 + internal uint CBytesReceived; // m_cBytesReceived uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestDataReceived_t) ); + internal static HTTPRequestDataReceived_t Fill( IntPtr p ) => ((HTTPRequestDataReceived_t)(HTTPRequestDataReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestDataReceived_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientHTTP + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientHTTP + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientHTTP + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCDetails_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType + internal AppId CreatorAppID; // m_nCreatorAppID AppId_t + internal AppId ConsumerAppID; // m_nConsumerAppID AppId_t + internal string TitleUTF8() => System.Text.Encoding.UTF8.GetString( Title, 0, System.Array.IndexOf( Title, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 129)] // byte[] m_rgchTitle + internal byte[] Title; // m_rgchTitle char [129] + internal string DescriptionUTF8() => System.Text.Encoding.UTF8.GetString( Description, 0, System.Array.IndexOf( Description, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8000)] // byte[] m_rgchDescription + internal byte[] Description; // m_rgchDescription char [8000] + internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 + internal uint TimeCreated; // m_rtimeCreated uint32 + internal uint TimeUpdated; // m_rtimeUpdated uint32 + internal uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 + internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool AcceptedForUse; // m_bAcceptedForUse _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool TagsTruncated; // m_bTagsTruncated _Bool + internal string TagsUTF8() => System.Text.Encoding.UTF8.GetString( Tags, 0, System.Array.IndexOf( Tags, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1025)] // byte[] m_rgchTags + internal byte[] Tags; // m_rgchTags char [1025] + internal ulong File; // m_hFile UGCHandle_t + internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t + internal string PchFileNameUTF8() => System.Text.Encoding.UTF8.GetString( PchFileName, 0, System.Array.IndexOf( PchFileName, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 260)] // byte[] m_pchFileName + internal byte[] PchFileName; // m_pchFileName char [260] + internal int FileSize; // m_nFileSize int32 + internal int PreviewFileSize; // m_nPreviewFileSize int32 + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + internal uint VotesUp; // m_unVotesUp uint32 + internal uint VotesDown; // m_unVotesDown uint32 + internal float Score; // m_flScore float + internal uint NumChildren; // m_unNumChildren uint32 + + #region Marshalling + internal static SteamUGCDetails_t Fill( IntPtr p ) => ((SteamUGCDetails_t)(SteamUGCDetails_t) Marshal.PtrToStructure( p, typeof(SteamUGCDetails_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCQueryCompleted_t + { + internal ulong Handle; // m_handle UGCQueryHandle_t + internal Result Result; // m_eResult enum EResult + internal uint NumResultsReturned; // m_unNumResultsReturned uint32 + internal uint TotalMatchingResults; // m_unTotalMatchingResults uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData _Bool + internal string NextCursorUTF8() => System.Text.Encoding.UTF8.GetString( NextCursor, 0, System.Array.IndexOf( NextCursor, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchNextCursor + internal byte[] NextCursor; // m_rgchNextCursor char [256] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCQueryCompleted_t) ); + internal static SteamUGCQueryCompleted_t Fill( IntPtr p ) => ((SteamUGCQueryCompleted_t)(SteamUGCQueryCompleted_t) Marshal.PtrToStructure( p, typeof(SteamUGCQueryCompleted_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamUGCRequestUGCDetailsResult_t + { + internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCRequestUGCDetailsResult_t) ); + internal static SteamUGCRequestUGCDetailsResult_t Fill( IntPtr p ) => ((SteamUGCRequestUGCDetailsResult_t)(SteamUGCRequestUGCDetailsResult_t) Marshal.PtrToStructure( p, typeof(SteamUGCRequestUGCDetailsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct CreateItemResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateItemResult_t) ); + internal static CreateItemResult_t Fill( IntPtr p ) => ((CreateItemResult_t)(CreateItemResult_t) Marshal.PtrToStructure( p, typeof(CreateItemResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SubmitItemUpdateResult_t + { + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.I1)] + internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitItemUpdateResult_t) ); + internal static SubmitItemUpdateResult_t Fill( IntPtr p ) => ((SubmitItemUpdateResult_t)(SubmitItemUpdateResult_t) Marshal.PtrToStructure( p, typeof(SubmitItemUpdateResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DownloadItemResult_t + { + internal AppId AppID; // m_unAppID AppId_t + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadItemResult_t) ); + internal static DownloadItemResult_t Fill( IntPtr p ) => ((DownloadItemResult_t)(DownloadItemResult_t) Marshal.PtrToStructure( p, typeof(DownloadItemResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct UserFavoriteItemsListChanged_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.I1)] + internal bool WasAddRequest; // m_bWasAddRequest _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserFavoriteItemsListChanged_t) ); + internal static UserFavoriteItemsListChanged_t Fill( IntPtr p ) => ((UserFavoriteItemsListChanged_t)(UserFavoriteItemsListChanged_t) Marshal.PtrToStructure( p, typeof(UserFavoriteItemsListChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SetUserItemVoteResult_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.I1)] + internal bool VoteUp; // m_bVoteUp _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetUserItemVoteResult_t) ); + internal static SetUserItemVoteResult_t Fill( IntPtr p ) => ((SetUserItemVoteResult_t)(SetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(SetUserItemVoteResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetUserItemVoteResult_t + { + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal Result Result; // m_eResult enum EResult + [MarshalAs(UnmanagedType.I1)] + internal bool VotedUp; // m_bVotedUp _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool VotedDown; // m_bVotedDown _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool VoteSkipped; // m_bVoteSkipped _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetUserItemVoteResult_t) ); + internal static GetUserItemVoteResult_t Fill( IntPtr p ) => ((GetUserItemVoteResult_t)(GetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(GetUserItemVoteResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StartPlaytimeTrackingResult_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StartPlaytimeTrackingResult_t) ); + internal static StartPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StartPlaytimeTrackingResult_t)(StartPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StartPlaytimeTrackingResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct StopPlaytimeTrackingResult_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(StopPlaytimeTrackingResult_t) ); + internal static StopPlaytimeTrackingResult_t Fill( IntPtr p ) => ((StopPlaytimeTrackingResult_t)(StopPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StopPlaytimeTrackingResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AddUGCDependencyResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddUGCDependencyResult_t) ); + internal static AddUGCDependencyResult_t Fill( IntPtr p ) => ((AddUGCDependencyResult_t)(AddUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddUGCDependencyResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoveUGCDependencyResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal PublishedFileId ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveUGCDependencyResult_t) ); + internal static RemoveUGCDependencyResult_t Fill( IntPtr p ) => ((RemoveUGCDependencyResult_t)(RemoveUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveUGCDependencyResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AddAppDependencyResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddAppDependencyResult_t) ); + internal static AddAppDependencyResult_t Fill( IntPtr p ) => ((AddAppDependencyResult_t)(AddAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddAppDependencyResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct RemoveAppDependencyResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveAppDependencyResult_t) ); + internal static RemoveAppDependencyResult_t Fill( IntPtr p ) => ((RemoveAppDependencyResult_t)(RemoveAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveAppDependencyResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetAppDependenciesResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)] + internal AppId[] GAppIDs; // m_rgAppIDs AppId_t [32] + internal uint NumAppDependencies; // m_nNumAppDependencies uint32 + internal uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAppDependenciesResult_t) ); + internal static GetAppDependenciesResult_t Fill( IntPtr p ) => ((GetAppDependenciesResult_t)(GetAppDependenciesResult_t) Marshal.PtrToStructure( p, typeof(GetAppDependenciesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 16, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 16, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct DeleteItemResult_t + { + internal Result Result; // m_eResult enum EResult + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(DeleteItemResult_t) ); + internal static DeleteItemResult_t Fill( IntPtr p ) => ((DeleteItemResult_t)(DeleteItemResult_t) Marshal.PtrToStructure( p, typeof(DeleteItemResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 17, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 17, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAppInstalled_t + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppInstalled_t) ); + internal static SteamAppInstalled_t Fill( IntPtr p ) => ((SteamAppInstalled_t)(SteamAppInstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppInstalled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamAppList + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamAppList + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamAppList + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamAppUninstalled_t + { + internal AppId AppID; // m_nAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppUninstalled_t) ); + internal static SteamAppUninstalled_t Fill( IntPtr p ) => ((SteamAppUninstalled_t)(SteamAppUninstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppUninstalled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamAppList + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamAppList + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamAppList + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_BrowserReady_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserReady_t) ); + internal static HTML_BrowserReady_t Fill( IntPtr p ) => ((HTML_BrowserReady_t)(HTML_BrowserReady_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserReady_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_NeedsPaint_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PBGRA; // pBGRA const char * + internal uint UnWide; // unWide uint32 + internal uint UnTall; // unTall uint32 + internal uint UnUpdateX; // unUpdateX uint32 + internal uint UnUpdateY; // unUpdateY uint32 + internal uint UnUpdateWide; // unUpdateWide uint32 + internal uint UnUpdateTall; // unUpdateTall uint32 + internal uint UnScrollX; // unScrollX uint32 + internal uint UnScrollY; // unScrollY uint32 + internal float FlPageScale; // flPageScale float + internal uint UnPageSerial; // unPageSerial uint32 + + #region Marshalling + internal static HTML_NeedsPaint_t Fill( IntPtr p ) => ((HTML_NeedsPaint_t)(HTML_NeedsPaint_t) Marshal.PtrToStructure( p, typeof(HTML_NeedsPaint_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_StartRequest_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchTarget; // pchTarget const char * + internal string PchPostData; // pchPostData const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BIsRedirect; // bIsRedirect _Bool + + #region Marshalling + internal static HTML_StartRequest_t Fill( IntPtr p ) => ((HTML_StartRequest_t)(HTML_StartRequest_t) Marshal.PtrToStructure( p, typeof(HTML_StartRequest_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_CloseBrowser_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region Marshalling + internal static HTML_CloseBrowser_t Fill( IntPtr p ) => ((HTML_CloseBrowser_t)(HTML_CloseBrowser_t) Marshal.PtrToStructure( p, typeof(HTML_CloseBrowser_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_URLChanged_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchPostData; // pchPostData const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BIsRedirect; // bIsRedirect _Bool + internal string PchPageTitle; // pchPageTitle const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BNewNavigation; // bNewNavigation _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_URLChanged_t) ); + internal static HTML_URLChanged_t Fill( IntPtr p ) => ((HTML_URLChanged_t)(HTML_URLChanged_t) Marshal.PtrToStructure( p, typeof(HTML_URLChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_FinishedRequest_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal string PchPageTitle; // pchPageTitle const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FinishedRequest_t) ); + internal static HTML_FinishedRequest_t Fill( IntPtr p ) => ((HTML_FinishedRequest_t)(HTML_FinishedRequest_t) Marshal.PtrToStructure( p, typeof(HTML_FinishedRequest_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_OpenLinkInNewTab_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_OpenLinkInNewTab_t) ); + internal static HTML_OpenLinkInNewTab_t Fill( IntPtr p ) => ((HTML_OpenLinkInNewTab_t)(HTML_OpenLinkInNewTab_t) Marshal.PtrToStructure( p, typeof(HTML_OpenLinkInNewTab_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_ChangedTitle_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchTitle; // pchTitle const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ChangedTitle_t) ); + internal static HTML_ChangedTitle_t Fill( IntPtr p ) => ((HTML_ChangedTitle_t)(HTML_ChangedTitle_t) Marshal.PtrToStructure( p, typeof(HTML_ChangedTitle_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_SearchResults_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnResults; // unResults uint32 + internal uint UnCurrentMatch; // unCurrentMatch uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SearchResults_t) ); + internal static HTML_SearchResults_t Fill( IntPtr p ) => ((HTML_SearchResults_t)(HTML_SearchResults_t) Marshal.PtrToStructure( p, typeof(HTML_SearchResults_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_CanGoBackAndForward_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + [MarshalAs(UnmanagedType.I1)] + internal bool BCanGoBack; // bCanGoBack _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool BCanGoForward; // bCanGoForward _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CanGoBackAndForward_t) ); + internal static HTML_CanGoBackAndForward_t Fill( IntPtr p ) => ((HTML_CanGoBackAndForward_t)(HTML_CanGoBackAndForward_t) Marshal.PtrToStructure( p, typeof(HTML_CanGoBackAndForward_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_HorizontalScroll_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float + [MarshalAs(UnmanagedType.I1)] + internal bool BVisible; // bVisible _Bool + internal uint UnPageSize; // unPageSize uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HorizontalScroll_t) ); + internal static HTML_HorizontalScroll_t Fill( IntPtr p ) => ((HTML_HorizontalScroll_t)(HTML_HorizontalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_HorizontalScroll_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_VerticalScroll_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnScrollMax; // unScrollMax uint32 + internal uint UnScrollCurrent; // unScrollCurrent uint32 + internal float FlPageScale; // flPageScale float + [MarshalAs(UnmanagedType.I1)] + internal bool BVisible; // bVisible _Bool + internal uint UnPageSize; // unPageSize uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_VerticalScroll_t) ); + internal static HTML_VerticalScroll_t Fill( IntPtr p ) => ((HTML_VerticalScroll_t)(HTML_VerticalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_VerticalScroll_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 12, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_LinkAtPosition_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint X; // x uint32 + internal uint Y; // y uint32 + internal string PchURL; // pchURL const char * + [MarshalAs(UnmanagedType.I1)] + internal bool BInput; // bInput _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool BLiveLink; // bLiveLink _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_LinkAtPosition_t) ); + internal static HTML_LinkAtPosition_t Fill( IntPtr p ) => ((HTML_LinkAtPosition_t)(HTML_LinkAtPosition_t) Marshal.PtrToStructure( p, typeof(HTML_LinkAtPosition_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 13, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_JSAlert_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSAlert_t) ); + internal static HTML_JSAlert_t Fill( IntPtr p ) => ((HTML_JSAlert_t)(HTML_JSAlert_t) Marshal.PtrToStructure( p, typeof(HTML_JSAlert_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_JSConfirm_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMessage; // pchMessage const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSConfirm_t) ); + internal static HTML_JSConfirm_t Fill( IntPtr p ) => ((HTML_JSConfirm_t)(HTML_JSConfirm_t) Marshal.PtrToStructure( p, typeof(HTML_JSConfirm_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_FileOpenDialog_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchTitle; // pchTitle const char * + internal string PchInitialFile; // pchInitialFile const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FileOpenDialog_t) ); + internal static HTML_FileOpenDialog_t Fill( IntPtr p ) => ((HTML_FileOpenDialog_t)(HTML_FileOpenDialog_t) Marshal.PtrToStructure( p, typeof(HTML_FileOpenDialog_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 16, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_NewWindow_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchURL; // pchURL const char * + internal uint UnX; // unX uint32 + internal uint UnY; // unY uint32 + internal uint UnWide; // unWide uint32 + internal uint UnTall; // unTall uint32 + internal uint UnNewWindow_BrowserHandle_IGNORE; // unNewWindow_BrowserHandle_IGNORE HHTMLBrowser + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NewWindow_t) ); + internal static HTML_NewWindow_t Fill( IntPtr p ) => ((HTML_NewWindow_t)(HTML_NewWindow_t) Marshal.PtrToStructure( p, typeof(HTML_NewWindow_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 21, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_SetCursor_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint EMouseCursor; // eMouseCursor uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SetCursor_t) ); + internal static HTML_SetCursor_t Fill( IntPtr p ) => ((HTML_SetCursor_t)(HTML_SetCursor_t) Marshal.PtrToStructure( p, typeof(HTML_SetCursor_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 22, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_StatusText_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StatusText_t) ); + internal static HTML_StatusText_t Fill( IntPtr p ) => ((HTML_StatusText_t)(HTML_StatusText_t) Marshal.PtrToStructure( p, typeof(HTML_StatusText_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 23, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_ShowToolTip_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ShowToolTip_t) ); + internal static HTML_ShowToolTip_t Fill( IntPtr p ) => ((HTML_ShowToolTip_t)(HTML_ShowToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_ShowToolTip_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 24, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_UpdateToolTip_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal string PchMsg; // pchMsg const char * + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_UpdateToolTip_t) ); + internal static HTML_UpdateToolTip_t Fill( IntPtr p ) => ((HTML_UpdateToolTip_t)(HTML_UpdateToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_UpdateToolTip_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 25, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_HideToolTip_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HideToolTip_t) ); + internal static HTML_HideToolTip_t Fill( IntPtr p ) => ((HTML_HideToolTip_t)(HTML_HideToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_HideToolTip_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 26, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct HTML_BrowserRestarted_t + { + internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser + internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserRestarted_t) ); + internal static HTML_BrowserRestarted_t Fill( IntPtr p ) => ((HTML_BrowserRestarted_t)(HTML_BrowserRestarted_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserRestarted_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamHTMLSurface + 27, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamItemDetails_t + { + internal InventoryItemId ItemId; // m_itemId SteamItemInstanceID_t + internal InventoryDefId Definition; // m_iDefinition SteamItemDef_t + internal ushort Quantity; // m_unQuantity uint16 + internal ushort Flags; // m_unFlags uint16 + + #region Marshalling + internal static SteamItemDetails_t Fill( IntPtr p ) => ((SteamItemDetails_t)(SteamItemDetails_t) Marshal.PtrToStructure( p, typeof(SteamItemDetails_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryResultReady_t + { + internal int Handle; // m_handle SteamInventoryResult_t + internal Result Result; // m_result enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryResultReady_t) ); + internal static SteamInventoryResultReady_t Fill( IntPtr p ) => ((SteamInventoryResultReady_t)(SteamInventoryResultReady_t) Marshal.PtrToStructure( p, typeof(SteamInventoryResultReady_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 0, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 0, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 0, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryFullUpdate_t + { + internal int Handle; // m_handle SteamInventoryResult_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryFullUpdate_t) ); + internal static SteamInventoryFullUpdate_t Fill( IntPtr p ) => ((SteamInventoryFullUpdate_t)(SteamInventoryFullUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryFullUpdate_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct SteamInventoryEligiblePromoItemDefIDs_t + { + internal Result Result; // m_result enum EResult + internal ulong SteamID; // m_steamID class CSteamID + internal int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int + [MarshalAs(UnmanagedType.I1)] + internal bool CachedData; // m_bCachedData _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); + internal static SteamInventoryEligiblePromoItemDefIDs_t Fill( IntPtr p ) => ((SteamInventoryEligiblePromoItemDefIDs_t)(SteamInventoryEligiblePromoItemDefIDs_t) Marshal.PtrToStructure( p, typeof(SteamInventoryEligiblePromoItemDefIDs_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryStartPurchaseResult_t + { + internal Result Result; // m_result enum EResult + internal ulong OrderID; // m_ulOrderID uint64 + internal ulong TransID; // m_ulTransID uint64 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryStartPurchaseResult_t) ); + internal static SteamInventoryStartPurchaseResult_t Fill( IntPtr p ) => ((SteamInventoryStartPurchaseResult_t)(SteamInventoryStartPurchaseResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryStartPurchaseResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryRequestPricesResult_t + { + internal Result Result; // m_result enum EResult + internal string CurrencyUTF8() => System.Text.Encoding.UTF8.GetString( Currency, 0, System.Array.IndexOf( Currency, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] // byte[] m_rgchCurrency + internal byte[] Currency; // m_rgchCurrency char [4] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryRequestPricesResult_t) ); + internal static SteamInventoryRequestPricesResult_t Fill( IntPtr p ) => ((SteamInventoryRequestPricesResult_t)(SteamInventoryRequestPricesResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryRequestPricesResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct BroadcastUploadStop_t + { + internal BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStop_t) ); + internal static BroadcastUploadStop_t Fill( IntPtr p ) => ((BroadcastUploadStop_t)(BroadcastUploadStop_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStop_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetVideoURLResult_t + { + internal Result Result; // m_eResult enum EResult + internal AppId VideoAppID; // m_unVideoAppID AppId_t + internal string URLUTF8() => System.Text.Encoding.UTF8.GetString( URL, 0, System.Array.IndexOf( URL, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] // byte[] m_rgchURL + internal byte[] URL; // m_rgchURL char [256] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetVideoURLResult_t) ); + internal static GetVideoURLResult_t Fill( IntPtr p ) => ((GetVideoURLResult_t)(GetVideoURLResult_t) Marshal.PtrToStructure( p, typeof(GetVideoURLResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GetOPFSettingsResult_t + { + internal Result Result; // m_eResult enum EResult + internal AppId VideoAppID; // m_unVideoAppID AppId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetOPFSettingsResult_t) ); + internal static GetOPFSettingsResult_t Fill( IntPtr p ) => ((GetOPFSettingsResult_t)(GetOPFSettingsResult_t) Marshal.PtrToStructure( p, typeof(GetOPFSettingsResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 24, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 24, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 24, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientApprove_t + { + internal ulong SteamID; // m_SteamID class CSteamID + internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); + internal static GSClientApprove_t Fill( IntPtr p ) => ((GSClientApprove_t)(GSClientApprove_t) Marshal.PtrToStructure( p, typeof(GSClientApprove_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientDeny_t + { + internal ulong SteamID; // m_SteamID class CSteamID + internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason + internal string OptionalTextUTF8() => System.Text.Encoding.UTF8.GetString( OptionalText, 0, System.Array.IndexOf( OptionalText, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_rgchOptionalText + internal byte[] OptionalText; // m_rgchOptionalText char [128] + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); + internal static GSClientDeny_t Fill( IntPtr p ) => ((GSClientDeny_t)(GSClientDeny_t) Marshal.PtrToStructure( p, typeof(GSClientDeny_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientKick_t + { + internal ulong SteamID; // m_SteamID class CSteamID + internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); + internal static GSClientKick_t Fill( IntPtr p ) => ((GSClientKick_t)(GSClientKick_t) Marshal.PtrToStructure( p, typeof(GSClientKick_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 3, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 3, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 3, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSClientAchievementStatus_t + { + internal ulong SteamID; // m_SteamID uint64 + internal string PchAchievementUTF8() => System.Text.Encoding.UTF8.GetString( PchAchievement, 0, System.Array.IndexOf( PchAchievement, 0 ) ); + [MarshalAs(UnmanagedType.ByValArray, SizeConst = 128)] // byte[] m_pchAchievement + internal byte[] PchAchievement; // m_pchAchievement char [128] + [MarshalAs(UnmanagedType.I1)] + internal bool Unlocked; // m_bUnlocked _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientAchievementStatus_t) ); + internal static GSClientAchievementStatus_t Fill( IntPtr p ) => ((GSClientAchievementStatus_t)(GSClientAchievementStatus_t) Marshal.PtrToStructure( p, typeof(GSClientAchievementStatus_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSPolicyResponse_t + { + internal byte Secure; // m_bSecure uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSPolicyResponse_t) ); + internal static GSPolicyResponse_t Fill( IntPtr p ) => ((GSPolicyResponse_t)(GSPolicyResponse_t) Marshal.PtrToStructure( p, typeof(GSPolicyResponse_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 15, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 15, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 15, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSGameplayStats_t + { + internal Result Result; // m_eResult enum EResult + internal int Rank; // m_nRank int32 + internal uint TotalConnects; // m_unTotalConnects uint32 + internal uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSGameplayStats_t) ); + internal static GSGameplayStats_t Fill( IntPtr p ) => ((GSGameplayStats_t)(GSGameplayStats_t) Marshal.PtrToStructure( p, typeof(GSGameplayStats_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 7, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 7, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 7, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSClientGroupStatus_t + { + internal ulong SteamIDUser; // m_SteamIDUser class CSteamID + internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID + [MarshalAs(UnmanagedType.I1)] + internal bool Member; // m_bMember _Bool + [MarshalAs(UnmanagedType.I1)] + internal bool Officer; // m_bOfficer _Bool + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); + internal static GSClientGroupStatus_t Fill( IntPtr p ) => ((GSClientGroupStatus_t)(GSClientGroupStatus_t) Marshal.PtrToStructure( p, typeof(GSClientGroupStatus_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GSReputation_t + { + internal Result Result; // m_eResult enum EResult + internal uint ReputationScore; // m_unReputationScore uint32 + [MarshalAs(UnmanagedType.I1)] + internal bool Banned; // m_bBanned _Bool + internal uint BannedIP; // m_unBannedIP uint32 + internal ushort BannedPort; // m_usBannedPort uint16 + internal ulong BannedGameID; // m_ulBannedGameID uint64 + internal uint BanExpires; // m_unBanExpires uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSReputation_t) ); + internal static GSReputation_t Fill( IntPtr p ) => ((GSReputation_t)(GSReputation_t) Marshal.PtrToStructure( p, typeof(GSReputation_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 9, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 9, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 9, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AssociateWithClanResult_t + { + internal Result Result; // m_eResult enum EResult + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AssociateWithClanResult_t) ); + internal static AssociateWithClanResult_t Fill( IntPtr p ) => ((AssociateWithClanResult_t)(AssociateWithClanResult_t) Marshal.PtrToStructure( p, typeof(AssociateWithClanResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 10, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 10, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 10, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct ComputeNewPlayerCompatibilityResult_t + { + internal Result Result; // m_eResult enum EResult + internal int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int + internal int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int + internal int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int + internal ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); + internal static ComputeNewPlayerCompatibilityResult_t Fill( IntPtr p ) => ((ComputeNewPlayerCompatibilityResult_t)(ComputeNewPlayerCompatibilityResult_t) Marshal.PtrToStructure( p, typeof(ComputeNewPlayerCompatibilityResult_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServer + 11, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServer + 11, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServer + 11, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSStatsReceived_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); + internal static GSStatsReceived_t Fill( IntPtr p ) => ((GSStatsReceived_t)(GSStatsReceived_t) Marshal.PtrToStructure( p, typeof(GSStatsReceived_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServerStats + 0, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSStatsStored_t + { + internal Result Result; // m_eResult enum EResult + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); + internal static GSStatsStored_t Fill( IntPtr p ) => ((GSStatsStored_t)(GSStatsStored_t) Marshal.PtrToStructure( p, typeof(GSStatsStored_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameServerStats + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct GSStatsUnloaded_t + { + internal ulong SteamIDUser; // m_steamIDUser class CSteamID + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); + internal static GSStatsUnloaded_t Fill( IntPtr p ) => ((GSStatsUnloaded_t)(GSStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(GSStatsUnloaded_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUserStats + 8, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUserStats + 8, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUserStats + 8, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct AvailableBeaconLocationsUpdated_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvailableBeaconLocationsUpdated_t) ); + internal static AvailableBeaconLocationsUpdated_t Fill( IntPtr p ) => ((AvailableBeaconLocationsUpdated_t)(AvailableBeaconLocationsUpdated_t) Marshal.PtrToStructure( p, typeof(AvailableBeaconLocationsUpdated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ActiveBeaconsUpdated_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ActiveBeaconsUpdated_t) ); + internal static ActiveBeaconsUpdated_t Fill( IntPtr p ) => ((ActiveBeaconsUpdated_t)(ActiveBeaconsUpdated_t) Marshal.PtrToStructure( p, typeof(ActiveBeaconsUpdated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParties + 6, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParties + 6, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParties + 6, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct PlaybackStatusHasChanged_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(PlaybackStatusHasChanged_t) ); + internal static PlaybackStatusHasChanged_t Fill( IntPtr p ) => ((PlaybackStatusHasChanged_t)(PlaybackStatusHasChanged_t) Marshal.PtrToStructure( p, typeof(PlaybackStatusHasChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamMusic + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamMusic + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamMusic + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct BroadcastUploadStart_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStart_t) ); + internal static BroadcastUploadStart_t Fill( IntPtr p ) => ((BroadcastUploadStart_t)(BroadcastUploadStart_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStart_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientVideo + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientVideo + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientVideo + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct NewUrlLaunchParameters_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(NewUrlLaunchParameters_t) ); + internal static NewUrlLaunchParameters_t Fill( IntPtr p ) => ((NewUrlLaunchParameters_t)(NewUrlLaunchParameters_t) Marshal.PtrToStructure( p, typeof(NewUrlLaunchParameters_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamApps + 14, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamApps + 14, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamApps + 14, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ItemInstalled_t + { + internal AppId AppID; // m_unAppID AppId_t + internal PublishedFileId PublishedFileId; // m_nPublishedFileId PublishedFileId_t + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ItemInstalled_t) ); + internal static ItemInstalled_t Fill( IntPtr p ) => ((ItemInstalled_t)(ItemInstalled_t) Marshal.PtrToStructure( p, typeof(ItemInstalled_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientUGC + 5, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientUGC + 5, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientUGC + 5, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamNetConnectionStatusChangedCallback_t + { + internal Connection Conn; // m_hConn HSteamNetConnection + internal ConnectionInfo Nfo; // m_info SteamNetConnectionInfo_t + internal ConnectionState OldState; // m_eOldState ESteamNetworkingConnectionState + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamNetConnectionStatusChangedCallback_t) ); + internal static SteamNetConnectionStatusChangedCallback_t Fill( IntPtr p ) => ((SteamNetConnectionStatusChangedCallback_t)(SteamNetConnectionStatusChangedCallback_t) Marshal.PtrToStructure( p, typeof(SteamNetConnectionStatusChangedCallback_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamNetworkingSockets + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamInventoryDefinitionUpdate_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryDefinitionUpdate_t) ); + internal static SteamInventoryDefinitionUpdate_t Fill( IntPtr p ) => ((SteamInventoryDefinitionUpdate_t)(SteamInventoryDefinitionUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryDefinitionUpdate_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.ClientInventory + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.ClientInventory + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.ClientInventory + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamParentalSettingsChanged_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParentalSettingsChanged_t) ); + internal static SteamParentalSettingsChanged_t Fill( IntPtr p ) => ((SteamParentalSettingsChanged_t)(SteamParentalSettingsChanged_t) Marshal.PtrToStructure( p, typeof(SteamParentalSettingsChanged_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamParentalSettings + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamServersConnected_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersConnected_t) ); + internal static SteamServersConnected_t Fill( IntPtr p ) => ((SteamServersConnected_t)(SteamServersConnected_t) Marshal.PtrToStructure( p, typeof(SteamServersConnected_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct NewLaunchQueryParameters_t + { + + #region Marshalling + internal static NewLaunchQueryParameters_t Fill( IntPtr p ) => ((NewLaunchQueryParameters_t)(NewLaunchQueryParameters_t) Marshal.PtrToStructure( p, typeof(NewLaunchQueryParameters_t) ) ); + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GCMessageAvailable_t + { + internal uint MessageSize; // m_nMessageSize uint32 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageAvailable_t) ); + internal static GCMessageAvailable_t Fill( IntPtr p ) => ((GCMessageAvailable_t)(GCMessageAvailable_t) Marshal.PtrToStructure( p, typeof(GCMessageAvailable_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameCoordinator + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct GCMessageFailed_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageFailed_t) ); + internal static GCMessageFailed_t Fill( IntPtr p ) => ((GCMessageFailed_t)(GCMessageFailed_t) Marshal.PtrToStructure( p, typeof(GCMessageFailed_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamGameCoordinator + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct ScreenshotRequested_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotRequested_t) ); + internal static ScreenshotRequested_t Fill( IntPtr p ) => ((ScreenshotRequested_t)(ScreenshotRequested_t) Marshal.PtrToStructure( p, typeof(ScreenshotRequested_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamScreenshots + 2, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamScreenshots + 2, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamScreenshots + 2, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct LicensesUpdated_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(LicensesUpdated_t) ); + internal static LicensesUpdated_t Fill( IntPtr p ) => ((LicensesUpdated_t)(LicensesUpdated_t) Marshal.PtrToStructure( p, typeof(LicensesUpdated_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 25, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 25, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 25, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct SteamShutdown_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamShutdown_t) ); + internal static SteamShutdown_t Fill( IntPtr p ) => ((SteamShutdown_t)(SteamShutdown_t) Marshal.PtrToStructure( p, typeof(SteamShutdown_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 4, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 4, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 4, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct IPCountry_t + { + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCountry_t) ); + internal static IPCountry_t Fill( IntPtr p ) => ((IPCountry_t)(IPCountry_t) Marshal.PtrToStructure( p, typeof(IPCountry_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUtils + 1, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUtils + 1, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUtils + 1, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPlatformPackSize )] + internal struct IPCFailure_t + { + internal byte FailureType; // m_eFailureType uint8 + + #region SteamCallback + internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCFailure_t) ); + internal static IPCFailure_t Fill( IntPtr p ) => ((IPCFailure_t)(IPCFailure_t) Marshal.PtrToStructure( p, typeof(IPCFailure_t) ) ); + + static Action actionClient; + [MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) ); + static Action actionServer; + [MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) ); + public static void Install( Action action, bool server = false ) + { + if ( server ) + { + Event.Register( OnServer, StructSize, CallbackIdentifiers.SteamUser + 17, true ); + actionServer = action; + } + else + { + Event.Register( OnClient, StructSize, CallbackIdentifiers.SteamUser + 17, false ); + actionClient = action; + } + } + public static async Task GetResultAsync( SteamAPICall_t handle ) + { + bool failed = false; + + while ( !SteamUtils.IsCallComplete( handle, out failed ) ) + { + await Task.Delay( 1 ); + if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null; + } + if ( failed ) return null; + + var ptr = Marshal.AllocHGlobal( StructSize ); + + try + { + if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, CallbackIdentifiers.SteamUser + 17, ref failed ) || failed ) + return null; + + return Fill( ptr ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + #endregion + } + +} diff --git a/Facepunch.Steamworks/Generated/SteamTypes.cs b/Facepunch.Steamworks/Generated/SteamTypes.cs new file mode 100644 index 0000000..1ccf33b --- /dev/null +++ b/Facepunch.Steamworks/Generated/SteamTypes.cs @@ -0,0 +1,744 @@ +using System; +using System.Runtime.InteropServices; +using System.Linq; +using Steamworks.Data; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + internal struct GID_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator GID_t( ulong value ) => new GID_t(){ Value = value }; + public static implicit operator ulong( GID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (GID_t) p ); + public bool Equals( GID_t p ) => p.Value == Value; + public static bool operator ==( GID_t a, GID_t b ) => a.Equals( b ); + public static bool operator !=( GID_t a, GID_t b ) => !a.Equals( b ); + public int CompareTo( GID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct JobID_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator JobID_t( ulong value ) => new JobID_t(){ Value = value }; + public static implicit operator ulong( JobID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (JobID_t) p ); + public bool Equals( JobID_t p ) => p.Value == Value; + public static bool operator ==( JobID_t a, JobID_t b ) => a.Equals( b ); + public static bool operator !=( JobID_t a, JobID_t b ) => !a.Equals( b ); + public int CompareTo( JobID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct TxnID_t : IEquatable, IComparable + { + public GID_t Value; + + public static implicit operator TxnID_t( GID_t value ) => new TxnID_t(){ Value = value }; + public static implicit operator GID_t( TxnID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (TxnID_t) p ); + public bool Equals( TxnID_t p ) => p.Value == Value; + public static bool operator ==( TxnID_t a, TxnID_t b ) => a.Equals( b ); + public static bool operator !=( TxnID_t a, TxnID_t b ) => !a.Equals( b ); + public int CompareTo( TxnID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PackageId_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator PackageId_t( uint value ) => new PackageId_t(){ Value = value }; + public static implicit operator uint( PackageId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PackageId_t) p ); + public bool Equals( PackageId_t p ) => p.Value == Value; + public static bool operator ==( PackageId_t a, PackageId_t b ) => a.Equals( b ); + public static bool operator !=( PackageId_t a, PackageId_t b ) => !a.Equals( b ); + public int CompareTo( PackageId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct BundleId_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator BundleId_t( uint value ) => new BundleId_t(){ Value = value }; + public static implicit operator uint( BundleId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (BundleId_t) p ); + public bool Equals( BundleId_t p ) => p.Value == Value; + public static bool operator ==( BundleId_t a, BundleId_t b ) => a.Equals( b ); + public static bool operator !=( BundleId_t a, BundleId_t b ) => !a.Equals( b ); + public int CompareTo( BundleId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct AssetClassId_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator AssetClassId_t( ulong value ) => new AssetClassId_t(){ Value = value }; + public static implicit operator ulong( AssetClassId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (AssetClassId_t) p ); + public bool Equals( AssetClassId_t p ) => p.Value == Value; + public static bool operator ==( AssetClassId_t a, AssetClassId_t b ) => a.Equals( b ); + public static bool operator !=( AssetClassId_t a, AssetClassId_t b ) => !a.Equals( b ); + public int CompareTo( AssetClassId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PhysicalItemId_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator PhysicalItemId_t( uint value ) => new PhysicalItemId_t(){ Value = value }; + public static implicit operator uint( PhysicalItemId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PhysicalItemId_t) p ); + public bool Equals( PhysicalItemId_t p ) => p.Value == Value; + public static bool operator ==( PhysicalItemId_t a, PhysicalItemId_t b ) => a.Equals( b ); + public static bool operator !=( PhysicalItemId_t a, PhysicalItemId_t b ) => !a.Equals( b ); + public int CompareTo( PhysicalItemId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct DepotId_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator DepotId_t( uint value ) => new DepotId_t(){ Value = value }; + public static implicit operator uint( DepotId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (DepotId_t) p ); + public bool Equals( DepotId_t p ) => p.Value == Value; + public static bool operator ==( DepotId_t a, DepotId_t b ) => a.Equals( b ); + public static bool operator !=( DepotId_t a, DepotId_t b ) => !a.Equals( b ); + public int CompareTo( DepotId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct RTime32 : IEquatable, IComparable + { + public uint Value; + + public static implicit operator RTime32( uint value ) => new RTime32(){ Value = value }; + public static implicit operator uint( RTime32 value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (RTime32) p ); + public bool Equals( RTime32 p ) => p.Value == Value; + public static bool operator ==( RTime32 a, RTime32 b ) => a.Equals( b ); + public static bool operator !=( RTime32 a, RTime32 b ) => !a.Equals( b ); + public int CompareTo( RTime32 other ) => Value.CompareTo( other.Value ); + } + + internal struct CellID_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator CellID_t( uint value ) => new CellID_t(){ Value = value }; + public static implicit operator uint( CellID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (CellID_t) p ); + public bool Equals( CellID_t p ) => p.Value == Value; + public static bool operator ==( CellID_t a, CellID_t b ) => a.Equals( b ); + public static bool operator !=( CellID_t a, CellID_t b ) => !a.Equals( b ); + public int CompareTo( CellID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamAPICall_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator SteamAPICall_t( ulong value ) => new SteamAPICall_t(){ Value = value }; + public static implicit operator ulong( SteamAPICall_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamAPICall_t) p ); + public bool Equals( SteamAPICall_t p ) => p.Value == Value; + public static bool operator ==( SteamAPICall_t a, SteamAPICall_t b ) => a.Equals( b ); + public static bool operator !=( SteamAPICall_t a, SteamAPICall_t b ) => !a.Equals( b ); + public int CompareTo( SteamAPICall_t other ) => Value.CompareTo( other.Value ); + } + + internal struct AccountID_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator AccountID_t( uint value ) => new AccountID_t(){ Value = value }; + public static implicit operator uint( AccountID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (AccountID_t) p ); + public bool Equals( AccountID_t p ) => p.Value == Value; + public static bool operator ==( AccountID_t a, AccountID_t b ) => a.Equals( b ); + public static bool operator !=( AccountID_t a, AccountID_t b ) => !a.Equals( b ); + public int CompareTo( AccountID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PartnerId_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator PartnerId_t( uint value ) => new PartnerId_t(){ Value = value }; + public static implicit operator uint( PartnerId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PartnerId_t) p ); + public bool Equals( PartnerId_t p ) => p.Value == Value; + public static bool operator ==( PartnerId_t a, PartnerId_t b ) => a.Equals( b ); + public static bool operator !=( PartnerId_t a, PartnerId_t b ) => !a.Equals( b ); + public int CompareTo( PartnerId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ManifestId_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator ManifestId_t( ulong value ) => new ManifestId_t(){ Value = value }; + public static implicit operator ulong( ManifestId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ManifestId_t) p ); + public bool Equals( ManifestId_t p ) => p.Value == Value; + public static bool operator ==( ManifestId_t a, ManifestId_t b ) => a.Equals( b ); + public static bool operator !=( ManifestId_t a, ManifestId_t b ) => !a.Equals( b ); + public int CompareTo( ManifestId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SiteId_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator SiteId_t( ulong value ) => new SiteId_t(){ Value = value }; + public static implicit operator ulong( SiteId_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SiteId_t) p ); + public bool Equals( SiteId_t p ) => p.Value == Value; + public static bool operator ==( SiteId_t a, SiteId_t b ) => a.Equals( b ); + public static bool operator !=( SiteId_t a, SiteId_t b ) => !a.Equals( b ); + public int CompareTo( SiteId_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PartyBeaconID_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator PartyBeaconID_t( ulong value ) => new PartyBeaconID_t(){ Value = value }; + public static implicit operator ulong( PartyBeaconID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PartyBeaconID_t) p ); + public bool Equals( PartyBeaconID_t p ) => p.Value == Value; + public static bool operator ==( PartyBeaconID_t a, PartyBeaconID_t b ) => a.Equals( b ); + public static bool operator !=( PartyBeaconID_t a, PartyBeaconID_t b ) => !a.Equals( b ); + public int CompareTo( PartyBeaconID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HAuthTicket : IEquatable, IComparable + { + public uint Value; + + public static implicit operator HAuthTicket( uint value ) => new HAuthTicket(){ Value = value }; + public static implicit operator uint( HAuthTicket value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HAuthTicket) p ); + public bool Equals( HAuthTicket p ) => p.Value == Value; + public static bool operator ==( HAuthTicket a, HAuthTicket b ) => a.Equals( b ); + public static bool operator !=( HAuthTicket a, HAuthTicket b ) => !a.Equals( b ); + public int CompareTo( HAuthTicket other ) => Value.CompareTo( other.Value ); + } + + internal struct BREAKPAD_HANDLE : IEquatable, IComparable + { + public IntPtr Value; + + public static implicit operator BREAKPAD_HANDLE( IntPtr value ) => new BREAKPAD_HANDLE(){ Value = value }; + public static implicit operator IntPtr( BREAKPAD_HANDLE value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (BREAKPAD_HANDLE) p ); + public bool Equals( BREAKPAD_HANDLE p ) => p.Value == Value; + public static bool operator ==( BREAKPAD_HANDLE a, BREAKPAD_HANDLE b ) => a.Equals( b ); + public static bool operator !=( BREAKPAD_HANDLE a, BREAKPAD_HANDLE b ) => !a.Equals( b ); + public int CompareTo( BREAKPAD_HANDLE other ) => Value.ToInt64().CompareTo( other.Value.ToInt64() ); + } + + internal struct HSteamPipe : IEquatable, IComparable + { + public int Value; + + public static implicit operator HSteamPipe( int value ) => new HSteamPipe(){ Value = value }; + public static implicit operator int( HSteamPipe value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HSteamPipe) p ); + public bool Equals( HSteamPipe p ) => p.Value == Value; + public static bool operator ==( HSteamPipe a, HSteamPipe b ) => a.Equals( b ); + public static bool operator !=( HSteamPipe a, HSteamPipe b ) => !a.Equals( b ); + public int CompareTo( HSteamPipe other ) => Value.CompareTo( other.Value ); + } + + internal struct HSteamUser : IEquatable, IComparable + { + public int Value; + + public static implicit operator HSteamUser( int value ) => new HSteamUser(){ Value = value }; + public static implicit operator int( HSteamUser value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HSteamUser) p ); + public bool Equals( HSteamUser p ) => p.Value == Value; + public static bool operator ==( HSteamUser a, HSteamUser b ) => a.Equals( b ); + public static bool operator !=( HSteamUser a, HSteamUser b ) => !a.Equals( b ); + public int CompareTo( HSteamUser other ) => Value.CompareTo( other.Value ); + } + + internal struct FriendsGroupID_t : IEquatable, IComparable + { + public short Value; + + public static implicit operator FriendsGroupID_t( short value ) => new FriendsGroupID_t(){ Value = value }; + public static implicit operator short( FriendsGroupID_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (FriendsGroupID_t) p ); + public bool Equals( FriendsGroupID_t p ) => p.Value == Value; + public static bool operator ==( FriendsGroupID_t a, FriendsGroupID_t b ) => a.Equals( b ); + public static bool operator !=( FriendsGroupID_t a, FriendsGroupID_t b ) => !a.Equals( b ); + public int CompareTo( FriendsGroupID_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HServerListRequest : IEquatable, IComparable + { + public IntPtr Value; + + public static implicit operator HServerListRequest( IntPtr value ) => new HServerListRequest(){ Value = value }; + public static implicit operator IntPtr( HServerListRequest value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HServerListRequest) p ); + public bool Equals( HServerListRequest p ) => p.Value == Value; + public static bool operator ==( HServerListRequest a, HServerListRequest b ) => a.Equals( b ); + public static bool operator !=( HServerListRequest a, HServerListRequest b ) => !a.Equals( b ); + public int CompareTo( HServerListRequest other ) => Value.ToInt64().CompareTo( other.Value.ToInt64() ); + } + + internal struct HServerQuery : IEquatable, IComparable + { + public int Value; + + public static implicit operator HServerQuery( int value ) => new HServerQuery(){ Value = value }; + public static implicit operator int( HServerQuery value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HServerQuery) p ); + public bool Equals( HServerQuery p ) => p.Value == Value; + public static bool operator ==( HServerQuery a, HServerQuery b ) => a.Equals( b ); + public static bool operator !=( HServerQuery a, HServerQuery b ) => !a.Equals( b ); + public int CompareTo( HServerQuery other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator UGCHandle_t( ulong value ) => new UGCHandle_t(){ Value = value }; + public static implicit operator ulong( UGCHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCHandle_t) p ); + public bool Equals( UGCHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCHandle_t a, UGCHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCHandle_t a, UGCHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct PublishedFileUpdateHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator PublishedFileUpdateHandle_t( ulong value ) => new PublishedFileUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( PublishedFileUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PublishedFileUpdateHandle_t) p ); + public bool Equals( PublishedFileUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( PublishedFileUpdateHandle_t a, PublishedFileUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( PublishedFileUpdateHandle_t a, PublishedFileUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( PublishedFileUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + + public struct PublishedFileId : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator PublishedFileId( ulong value ) => new PublishedFileId(){ Value = value }; + public static implicit operator ulong( PublishedFileId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (PublishedFileId) p ); + public bool Equals( PublishedFileId p ) => p.Value == Value; + public static bool operator ==( PublishedFileId a, PublishedFileId b ) => a.Equals( b ); + public static bool operator !=( PublishedFileId a, PublishedFileId b ) => !a.Equals( b ); + public int CompareTo( PublishedFileId other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCFileWriteStreamHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator UGCFileWriteStreamHandle_t( ulong value ) => new UGCFileWriteStreamHandle_t(){ Value = value }; + public static implicit operator ulong( UGCFileWriteStreamHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCFileWriteStreamHandle_t) p ); + public bool Equals( UGCFileWriteStreamHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCFileWriteStreamHandle_t a, UGCFileWriteStreamHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCFileWriteStreamHandle_t a, UGCFileWriteStreamHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCFileWriteStreamHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamLeaderboard_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator SteamLeaderboard_t( ulong value ) => new SteamLeaderboard_t(){ Value = value }; + public static implicit operator ulong( SteamLeaderboard_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamLeaderboard_t) p ); + public bool Equals( SteamLeaderboard_t p ) => p.Value == Value; + public static bool operator ==( SteamLeaderboard_t a, SteamLeaderboard_t b ) => a.Equals( b ); + public static bool operator !=( SteamLeaderboard_t a, SteamLeaderboard_t b ) => !a.Equals( b ); + public int CompareTo( SteamLeaderboard_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamLeaderboardEntries_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator SteamLeaderboardEntries_t( ulong value ) => new SteamLeaderboardEntries_t(){ Value = value }; + public static implicit operator ulong( SteamLeaderboardEntries_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamLeaderboardEntries_t) p ); + public bool Equals( SteamLeaderboardEntries_t p ) => p.Value == Value; + public static bool operator ==( SteamLeaderboardEntries_t a, SteamLeaderboardEntries_t b ) => a.Equals( b ); + public static bool operator !=( SteamLeaderboardEntries_t a, SteamLeaderboardEntries_t b ) => !a.Equals( b ); + public int CompareTo( SteamLeaderboardEntries_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SNetSocket_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator SNetSocket_t( uint value ) => new SNetSocket_t(){ Value = value }; + public static implicit operator uint( SNetSocket_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SNetSocket_t) p ); + public bool Equals( SNetSocket_t p ) => p.Value == Value; + public static bool operator ==( SNetSocket_t a, SNetSocket_t b ) => a.Equals( b ); + public static bool operator !=( SNetSocket_t a, SNetSocket_t b ) => !a.Equals( b ); + public int CompareTo( SNetSocket_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SNetListenSocket_t : IEquatable, IComparable + { + public uint Value; + + public static implicit operator SNetListenSocket_t( uint value ) => new SNetListenSocket_t(){ Value = value }; + public static implicit operator uint( SNetListenSocket_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SNetListenSocket_t) p ); + public bool Equals( SNetListenSocket_t p ) => p.Value == Value; + public static bool operator ==( SNetListenSocket_t a, SNetListenSocket_t b ) => a.Equals( b ); + public static bool operator !=( SNetListenSocket_t a, SNetListenSocket_t b ) => !a.Equals( b ); + public int CompareTo( SNetListenSocket_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ScreenshotHandle : IEquatable, IComparable + { + public uint Value; + + public static implicit operator ScreenshotHandle( uint value ) => new ScreenshotHandle(){ Value = value }; + public static implicit operator uint( ScreenshotHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ScreenshotHandle) p ); + public bool Equals( ScreenshotHandle p ) => p.Value == Value; + public static bool operator ==( ScreenshotHandle a, ScreenshotHandle b ) => a.Equals( b ); + public static bool operator !=( ScreenshotHandle a, ScreenshotHandle b ) => !a.Equals( b ); + public int CompareTo( ScreenshotHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct HTTPRequestHandle : IEquatable, IComparable + { + public uint Value; + + public static implicit operator HTTPRequestHandle( uint value ) => new HTTPRequestHandle(){ Value = value }; + public static implicit operator uint( HTTPRequestHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HTTPRequestHandle) p ); + public bool Equals( HTTPRequestHandle p ) => p.Value == Value; + public static bool operator ==( HTTPRequestHandle a, HTTPRequestHandle b ) => a.Equals( b ); + public static bool operator !=( HTTPRequestHandle a, HTTPRequestHandle b ) => !a.Equals( b ); + public int CompareTo( HTTPRequestHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct HTTPCookieContainerHandle : IEquatable, IComparable + { + public uint Value; + + public static implicit operator HTTPCookieContainerHandle( uint value ) => new HTTPCookieContainerHandle(){ Value = value }; + public static implicit operator uint( HTTPCookieContainerHandle value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HTTPCookieContainerHandle) p ); + public bool Equals( HTTPCookieContainerHandle p ) => p.Value == Value; + public static bool operator ==( HTTPCookieContainerHandle a, HTTPCookieContainerHandle b ) => a.Equals( b ); + public static bool operator !=( HTTPCookieContainerHandle a, HTTPCookieContainerHandle b ) => !a.Equals( b ); + public int CompareTo( HTTPCookieContainerHandle other ) => Value.CompareTo( other.Value ); + } + + internal struct InputHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator InputHandle_t( ulong value ) => new InputHandle_t(){ Value = value }; + public static implicit operator ulong( InputHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputHandle_t) p ); + public bool Equals( InputHandle_t p ) => p.Value == Value; + public static bool operator ==( InputHandle_t a, InputHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputHandle_t a, InputHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputActionSetHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator InputActionSetHandle_t( ulong value ) => new InputActionSetHandle_t(){ Value = value }; + public static implicit operator ulong( InputActionSetHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputActionSetHandle_t) p ); + public bool Equals( InputActionSetHandle_t p ) => p.Value == Value; + public static bool operator ==( InputActionSetHandle_t a, InputActionSetHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputActionSetHandle_t a, InputActionSetHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputActionSetHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputDigitalActionHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator InputDigitalActionHandle_t( ulong value ) => new InputDigitalActionHandle_t(){ Value = value }; + public static implicit operator ulong( InputDigitalActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputDigitalActionHandle_t) p ); + public bool Equals( InputDigitalActionHandle_t p ) => p.Value == Value; + public static bool operator ==( InputDigitalActionHandle_t a, InputDigitalActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputDigitalActionHandle_t a, InputDigitalActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputDigitalActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct InputAnalogActionHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator InputAnalogActionHandle_t( ulong value ) => new InputAnalogActionHandle_t(){ Value = value }; + public static implicit operator ulong( InputAnalogActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InputAnalogActionHandle_t) p ); + public bool Equals( InputAnalogActionHandle_t p ) => p.Value == Value; + public static bool operator ==( InputAnalogActionHandle_t a, InputAnalogActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( InputAnalogActionHandle_t a, InputAnalogActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( InputAnalogActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator ControllerHandle_t( ulong value ) => new ControllerHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerHandle_t) p ); + public bool Equals( ControllerHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerHandle_t a, ControllerHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerHandle_t a, ControllerHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerActionSetHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator ControllerActionSetHandle_t( ulong value ) => new ControllerActionSetHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerActionSetHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerActionSetHandle_t) p ); + public bool Equals( ControllerActionSetHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerActionSetHandle_t a, ControllerActionSetHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerActionSetHandle_t a, ControllerActionSetHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerActionSetHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerDigitalActionHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator ControllerDigitalActionHandle_t( ulong value ) => new ControllerDigitalActionHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerDigitalActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerDigitalActionHandle_t) p ); + public bool Equals( ControllerDigitalActionHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerDigitalActionHandle_t a, ControllerDigitalActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerDigitalActionHandle_t a, ControllerDigitalActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerDigitalActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct ControllerAnalogActionHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator ControllerAnalogActionHandle_t( ulong value ) => new ControllerAnalogActionHandle_t(){ Value = value }; + public static implicit operator ulong( ControllerAnalogActionHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (ControllerAnalogActionHandle_t) p ); + public bool Equals( ControllerAnalogActionHandle_t p ) => p.Value == Value; + public static bool operator ==( ControllerAnalogActionHandle_t a, ControllerAnalogActionHandle_t b ) => a.Equals( b ); + public static bool operator !=( ControllerAnalogActionHandle_t a, ControllerAnalogActionHandle_t b ) => !a.Equals( b ); + public int CompareTo( ControllerAnalogActionHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCQueryHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator UGCQueryHandle_t( ulong value ) => new UGCQueryHandle_t(){ Value = value }; + public static implicit operator ulong( UGCQueryHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCQueryHandle_t) p ); + public bool Equals( UGCQueryHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCQueryHandle_t a, UGCQueryHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCQueryHandle_t a, UGCQueryHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCQueryHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct UGCUpdateHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator UGCUpdateHandle_t( ulong value ) => new UGCUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( UGCUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (UGCUpdateHandle_t) p ); + public bool Equals( UGCUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( UGCUpdateHandle_t a, UGCUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( UGCUpdateHandle_t a, UGCUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( UGCUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + + internal struct HHTMLBrowser : IEquatable, IComparable + { + public uint Value; + + public static implicit operator HHTMLBrowser( uint value ) => new HHTMLBrowser(){ Value = value }; + public static implicit operator uint( HHTMLBrowser value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (HHTMLBrowser) p ); + public bool Equals( HHTMLBrowser p ) => p.Value == Value; + public static bool operator ==( HHTMLBrowser a, HHTMLBrowser b ) => a.Equals( b ); + public static bool operator !=( HHTMLBrowser a, HHTMLBrowser b ) => !a.Equals( b ); + public int CompareTo( HHTMLBrowser other ) => Value.CompareTo( other.Value ); + } + + public struct InventoryItemId : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator InventoryItemId( ulong value ) => new InventoryItemId(){ Value = value }; + public static implicit operator ulong( InventoryItemId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryItemId) p ); + public bool Equals( InventoryItemId p ) => p.Value == Value; + public static bool operator ==( InventoryItemId a, InventoryItemId b ) => a.Equals( b ); + public static bool operator !=( InventoryItemId a, InventoryItemId b ) => !a.Equals( b ); + public int CompareTo( InventoryItemId other ) => Value.CompareTo( other.Value ); + } + + public struct InventoryDefId : IEquatable, IComparable + { + public int Value; + + public static implicit operator InventoryDefId( int value ) => new InventoryDefId(){ Value = value }; + public static implicit operator int( InventoryDefId value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryDefId) p ); + public bool Equals( InventoryDefId p ) => p.Value == Value; + public static bool operator ==( InventoryDefId a, InventoryDefId b ) => a.Equals( b ); + public static bool operator !=( InventoryDefId a, InventoryDefId b ) => !a.Equals( b ); + public int CompareTo( InventoryDefId other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamInventoryResult_t : IEquatable, IComparable + { + public int Value; + + public static implicit operator SteamInventoryResult_t( int value ) => new SteamInventoryResult_t(){ Value = value }; + public static implicit operator int( SteamInventoryResult_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamInventoryResult_t) p ); + public bool Equals( SteamInventoryResult_t p ) => p.Value == Value; + public static bool operator ==( SteamInventoryResult_t a, SteamInventoryResult_t b ) => a.Equals( b ); + public static bool operator !=( SteamInventoryResult_t a, SteamInventoryResult_t b ) => !a.Equals( b ); + public int CompareTo( SteamInventoryResult_t other ) => Value.CompareTo( other.Value ); + } + + internal struct SteamInventoryUpdateHandle_t : IEquatable, IComparable + { + public ulong Value; + + public static implicit operator SteamInventoryUpdateHandle_t( ulong value ) => new SteamInventoryUpdateHandle_t(){ Value = value }; + public static implicit operator ulong( SteamInventoryUpdateHandle_t value ) => value.Value; + public override string ToString() => Value.ToString(); + public override int GetHashCode() => Value.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (SteamInventoryUpdateHandle_t) p ); + public bool Equals( SteamInventoryUpdateHandle_t p ) => p.Value == Value; + public static bool operator ==( SteamInventoryUpdateHandle_t a, SteamInventoryUpdateHandle_t b ) => a.Equals( b ); + public static bool operator !=( SteamInventoryUpdateHandle_t a, SteamInventoryUpdateHandle_t b ) => !a.Equals( b ); + public int CompareTo( SteamInventoryUpdateHandle_t other ) => Value.CompareTo( other.Value ); + } + +} diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs b/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs deleted file mode 100644 index b7249bb..0000000 --- a/Facepunch.Steamworks/Interfaces/Inventory.Definition.cs +++ /dev/null @@ -1,365 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Inventory - { - /// - /// An item definition. This describes an item in your Steam inventory, but is - /// not unique to that item. For example, this might be a tshirt, but you might be able to own - /// multiple tshirts. - /// - public class Definition - { - internal Inventory inventory; - - public int Id { get; private set; } - public string Name { get; set; } - public string Description { get; set; } - - /// - /// URL to an image specified by the schema, else empty - /// - public string IconUrl { get; set; } - - /// - /// URL to an image specified by the schema, else empty - /// - public string IconLargeUrl { get; set; } - - /// - /// Type can be whatever the schema defines. - /// - public string Type { get; set; } - - /// - /// If this item can be created using other items this string will contain a comma seperated - /// list of definition ids that can be used, ie "100,101;102x5;103x3,104x3" - /// - public string ExchangeSchema { get; set; } - - /// - /// A list of recepies for creating this item. Can be null if none. - /// - public Recipe[] Recipes { get; set; } - - /// - /// A list of recepies we're included in - /// - public Recipe[] IngredientFor { get; set; } - - public DateTime Created { get; set; } - public DateTime Modified { get; set; } - - /// - /// The raw contents of price_category from the schema - /// - public string PriceCategory { get; set; } - - /// - /// The dollar price from PriceRaw - /// - public double PriceDollars { get; internal set; } - - - /// - /// The price in the local player's currency. The local player's currency - /// is available in Invetory.Currency - /// - public double LocalPrice { get; internal set; } - - /// - /// Local Price but probably how you want to display it (ie, $3.99, 1.99 etc ) - /// - public string LocalPriceFormatted { get; internal set; } - - /// - /// Returns true if this item can be sold on the marketplace - /// - public bool Marketable { get; set; } - - public bool IsGenerator - { - get { return Type == "generator"; } - } - - private Dictionary customProperties; - - internal Definition( Inventory i, int id ) - { - inventory = i; - Id = id; - - SetupCommonProperties(); - UpdatePrice(); - } - - /// - /// If you're manually occupying the Definition (because maybe you're on a server - /// and want to hack around the fact that definitions aren't presented to you), - /// you can use this to set propertis. - /// - public void SetProperty( string name, string value ) - { - if ( customProperties == null ) - customProperties = new Dictionary(); - - if ( !customProperties.ContainsKey( name ) ) - customProperties.Add( name, value ); - else - customProperties[name] = value; - } - - /// - /// Read a raw property from the definition schema - /// - public T GetProperty( string name ) - { - string val = GetStringProperty( name ); - - if ( string.IsNullOrEmpty( val ) ) - return default( T ); - - try - { - return (T)Convert.ChangeType( val, typeof( T ) ); - } - catch ( System.Exception ) - { - return default( T ); - } - } - - /// - /// Read a raw property from the definition schema - /// - public string GetStringProperty( string name ) - { - string val = string.Empty; - - if ( customProperties != null && customProperties.ContainsKey( name ) ) - return customProperties[name]; - - if ( !inventory.inventory.GetItemDefinitionProperty( Id, name, out val ) ) - return string.Empty; - - return val; - } - - /// - /// Read a raw property from the definition schema - /// - public bool GetBoolProperty( string name ) - { - string val = GetStringProperty( name ); - - if ( val.Length == 0 ) return false; - if ( val[0] == '0' || val[0] == 'F'|| val[0] == 'f' ) return false; - - return true; - } - - internal void SetupCommonProperties() - { - Name = GetStringProperty( "name" ); - Description = GetStringProperty( "description" ); - Created = GetProperty( "timestamp" ); - Modified = GetProperty( "modified" ); - ExchangeSchema = GetStringProperty( "exchange" ); - IconUrl = GetStringProperty( "icon_url" ); - IconLargeUrl = GetStringProperty( "icon_url_large" ); - Type = GetStringProperty( "type" ); - PriceCategory = GetStringProperty( "price_category" ); - Marketable = GetBoolProperty( "marketable" ); - - if ( !string.IsNullOrEmpty( PriceCategory ) ) - { - PriceDollars = PriceCategoryToFloat( PriceCategory ); - } - } - - /// - /// Trigger an item drop. Call this when it's a good time to award - /// an item drop to a player. This won't automatically result in giving - /// an item to a player. Just call it every minute or so, or on launch. - /// ItemDefinition is usually a generator - /// - public void TriggerItemDrop() - { - inventory.TriggerItemDrop( Id ); - } - - /// - /// Trigger a promo item drop. You can call this at startup, it won't - /// give users multiple promo drops. - /// - public void TriggerPromoDrop() - { - inventory.TriggerPromoDrop( Id ); - } - - internal void Link( Definition[] definitions ) - { - LinkExchange( definitions ); - } - - private void LinkExchange( Definition[] definitions ) - { - if ( string.IsNullOrEmpty( ExchangeSchema ) ) return; - - var parts = ExchangeSchema.Split( new[] { ';' }, StringSplitOptions.RemoveEmptyEntries ); - - Recipes = parts.Select( x => Recipe.FromString( x, definitions, this ) ).ToArray(); - } - - internal void InRecipe( Recipe r ) - { - if ( IngredientFor == null ) - IngredientFor = new Recipe[0]; - - var list = new List( IngredientFor ); - list.Add( r ); - - IngredientFor = list.ToArray(); - } - - internal void UpdatePrice() - { - if ( inventory.inventory.GetItemPrice( Id, out ulong price) ) - { - LocalPrice = price / 100.0; - LocalPriceFormatted = Utility.FormatPrice( inventory.Currency, price ); - } - else - { - LocalPrice = 0; - LocalPriceFormatted = null; - } - } - } - - /// - /// Trigger a promo item drop. You can call this at startup, it won't - /// give users multiple promo drops. - /// - public void TriggerPromoDrop( int definitionId ) - { - SteamNative.SteamInventoryResult_t result = 0; - inventory.AddPromoItem( ref result, definitionId ); - inventory.DestroyResult( result ); - } - - /// - /// Trigger an item drop for this user. This is for timed drops. For promo - /// drops use TriggerPromoDrop. - /// - public void TriggerItemDrop( int definitionId ) - { - SteamNative.SteamInventoryResult_t result = 0; - inventory.TriggerItemDrop( ref result, definitionId ); - inventory.DestroyResult( result ); - } - - /// - /// Grant all promotional items the user is eligible for. - /// - public void GrantAllPromoItems() - { - SteamNative.SteamInventoryResult_t result = 0; - inventory.GrantPromoItems( ref result ); - inventory.DestroyResult( result ); - } - - /// - /// Represents a crafting recepie which was defined using the exchange - /// section in the item schema. - /// - public struct Recipe - { - public struct Ingredient - { - /// - /// The definition ID of the ingredient. - /// - public int DefinitionId; - - /// - /// If we don't know about this item definition this might be null. - /// In which case, DefinitionId should still hold the correct id. - /// - public Definition Definition; - - /// - /// The amount of this item needed. Generally this will be 1. - /// - public int Count; - - internal static Ingredient FromString( string part, Definition[] definitions ) - { - var i = new Ingredient(); - i.Count = 1; - - try - { - - if ( part.Contains( 'x' ) ) - { - var idx = part.IndexOf( 'x' ); - - int count = 0; - if ( int.TryParse( part.Substring( idx + 1 ), out count ) ) - i.Count = count; - - part = part.Substring( 0, idx ); - } - - i.DefinitionId = int.Parse( part ); - i.Definition = definitions.FirstOrDefault( x => x.Id == i.DefinitionId ); - - } - catch ( System.Exception ) - { - return i; - } - - return i; - } - } - - /// - /// The item that this will create. - /// - public Definition Result; - - /// - /// The items, with quantity required to create this item. - /// - public Ingredient[] Ingredients; - - internal static Recipe FromString( string part, Definition[] definitions, Definition Result ) - { - var r = new Recipe(); - r.Result = Result; - var parts = part.Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); - - r.Ingredients = parts.Select( x => Ingredient.FromString( x, definitions ) ).Where( x => x.DefinitionId != 0 ).ToArray(); - - foreach ( var i in r.Ingredients ) - { - if ( i.Definition == null ) - continue; - - i.Definition.InRecipe( r ); - } - - return r; - } - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs b/Facepunch.Steamworks/Interfaces/Inventory.Item.cs deleted file mode 100644 index 84c4383..0000000 --- a/Facepunch.Steamworks/Interfaces/Inventory.Item.cs +++ /dev/null @@ -1,181 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - public partial class Inventory - { - /// - /// An item in your inventory. - /// - public class Item : IEquatable - { - internal Item( Inventory Inventory, ulong Id, int Quantity, int DefinitionId ) - { - this.Inventory = Inventory; - this.Id = Id; - this.Quantity = Quantity; - this.DefinitionId = DefinitionId; - } - - public struct Amount - { - public Item Item; - public int Quantity; - } - - public ulong Id; - public int Quantity; - - public int DefinitionId; - - internal Inventory Inventory; - - public Dictionary Properties { get; internal set; } - - private Definition _cachedDefinition; - - /// - /// Careful, this might not be available. Especially on a game server. - /// - public Definition Definition - { - get - { - if ( _cachedDefinition != null ) - return _cachedDefinition; - - _cachedDefinition = Inventory.FindDefinition( DefinitionId ); - return _cachedDefinition; - } - } - - public bool TradeLocked; - - public bool Equals( Item other ) - { - return Equals( other, this ); - } - - public override bool Equals( object obj ) - { - if ( obj == null || GetType() != obj.GetType() ) - { - return false; - } - - return ((Item)obj).Id == Id; - } - - public override int GetHashCode() - { - return Id.GetHashCode(); - } - - - public static bool operator ==( Item c1, Item c2 ) - { - return c1.Equals( c2 ); - } - - public static bool operator !=( Item c1, Item c2 ) - { - return !c1.Equals( c2 ); - } - - /// - /// Consumes items from a user's inventory. If the quantity of the given item goes to zero, it is permanently removed. - /// Once an item is removed it cannot be recovered.This is not for the faint of heart - if your game implements item removal at all, - /// a high-friction UI confirmation process is highly recommended.ConsumeItem can be restricted to certain item definitions or fully - /// blocked via the Steamworks website to minimize support/abuse issues such as the classic "my brother borrowed my laptop and deleted all of my rare items". - /// - public Result Consume( int amount = 1 ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !Inventory.inventory.ConsumeItem( ref resultHandle, Id, (uint)amount ) ) - return null; - - return new Result( Inventory, resultHandle, true ); - } - - /// - /// Split stack into two items - /// - public Result SplitStack( int quantity = 1 ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !Inventory.inventory.TransferItemQuantity( ref resultHandle, Id, (uint)quantity, ulong.MaxValue ) ) - return null; - - return new Result( Inventory, resultHandle, true ); - } - - SteamNative.SteamInventoryUpdateHandle_t updateHandle; - - private void UpdatingProperties() - { - if (updateHandle != 0) return; - - updateHandle = Inventory.inventory.StartUpdateProperties(); - } - - public bool SetProperty( string name, string value ) - { - UpdatingProperties(); - Properties[name] = value.ToString(); - return Inventory.inventory.SetProperty(updateHandle, Id, name, value); - } - - public bool SetProperty(string name, bool value) - { - UpdatingProperties(); - Properties[name] = value.ToString(); - return Inventory.inventory.SetProperty0(updateHandle, Id, name, value); - } - - public bool SetProperty(string name, long value) - { - UpdatingProperties(); - Properties[name] = value.ToString(); - return Inventory.inventory.SetProperty1(updateHandle, Id, name, value); - } - - public bool SetProperty(string name, float value) - { - UpdatingProperties(); - Properties[name] = value.ToString(); - return Inventory.inventory.SetProperty2(updateHandle, Id, name, value); - } - - /// - /// Called to finalize any changes made using SetProperty - /// - public bool SubmitProperties() - { - if (updateHandle == 0) - throw new Exception("SubmitProperties called without updating properties"); - - try - { - SteamNative.SteamInventoryResult_t result = -1; - - if (!Inventory.inventory.SubmitUpdateProperties(updateHandle, ref result)) - { - return false; - } - - Inventory.inventory.DestroyResult(result); - - return true; - } - finally - { - updateHandle = 0; - } - } - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs b/Facepunch.Steamworks/Interfaces/Inventory.Result.cs deleted file mode 100644 index 68935bb..0000000 --- a/Facepunch.Steamworks/Interfaces/Inventory.Result.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Inventory - { - public class Result : IDisposable - { - internal static Dictionary< int, Result > Pending; - internal Inventory inventory; - - private SteamNative.SteamInventoryResult_t Handle { get; set; } = -1; - - /// - /// Called when result is successfully returned - /// - public Action OnResult; - - /// - /// Items that exist, or that have been created, or changed - /// - public Item[] Items { get; internal set; } - - /// - /// Items that have been removed or somehow destroyed - /// - public Item[] Removed { get; internal set; } - - /// - /// Items that have been consumed, like in a craft or something - /// - public Item[] Consumed { get; internal set; } - - protected bool _gotResult = false; - - /// - /// Returns true if this result is still pending - /// - public bool IsPending - { - get - { - if ( _gotResult ) return false; - - if ( Status() == Callbacks.Result.OK ) - { - Fill(); - return false; - } - - return Status() == Callbacks.Result.Pending; - } - } - - internal uint Timestamp { get; private set; } - - internal bool IsSuccess - { - get - { - if ( Items != null ) return true; - if ( Handle == -1 ) return false; - return Status() == Callbacks.Result.OK; - } - } - - internal Callbacks.Result Status() - { - if ( Handle == -1 ) return Callbacks.Result.InvalidParam; - return (Callbacks.Result)inventory.inventory.GetResultStatus( Handle ); - } - - internal Result( Inventory inventory, int Handle, bool pending ) - { - if ( pending ) - { - Pending.Add( Handle, this ); - } - - this.Handle = Handle; - this.inventory = inventory; - } - - - internal void Fill() - { - if ( _gotResult ) - return; - - if ( Items != null ) - return; - - if ( Status() != Callbacks.Result.OK ) - return; - - _gotResult = true; - - Timestamp = inventory.inventory.GetResultTimestamp( Handle ); - - SteamNative.SteamItemDetails_t[] steamItems = inventory.inventory.GetResultItems( Handle ); - - if ( steamItems == null ) - return; - - var tempItems = new List(); - var tempRemoved = new List(); - var tempConsumed = new List(); - - for ( int i=0; i< steamItems.Length; i++ ) - { - var item = inventory.ItemFrom( Handle, steamItems[i], i ); - - if ( ( steamItems[i].Flags & (int)SteamNative.SteamItemFlags.Removed ) != 0 ) - { - tempRemoved.Add(item); - } - else if ((steamItems[i].Flags & (int)SteamNative.SteamItemFlags.Consumed) != 0) - { - tempConsumed.Add(item); - } - else - { - tempItems.Add(item); - } - } - - Items = tempItems.ToArray(); - Removed = tempRemoved.ToArray(); - Consumed = tempConsumed.ToArray(); - - if ( OnResult != null ) - { - OnResult( this ); - } - } - - internal void OnSteamResult( SteamInventoryResultReady_t data ) - { - var success = data.Result == SteamNative.Result.OK; - - if ( success ) - { - Fill(); - } - } - - internal unsafe byte[] Serialize() - { - uint size = 0; - - if ( !inventory.inventory.SerializeResult( Handle, IntPtr.Zero, out size ) ) - return null; - - var data = new byte[size]; - - fixed ( byte* ptr = data ) - { - if ( !inventory.inventory.SerializeResult( Handle, (IntPtr)ptr, out size ) ) - return null; - } - - return data; - } - - public void Dispose() - { - if ( Handle != -1 && inventory != null ) - { - inventory.inventory.DestroyResult( Handle ); - Handle = -1; - } - - inventory = null; - } - } - - internal Item ItemFrom( SteamInventoryResult_t handle, SteamItemDetails_t detail, int index ) - { - var props = new Dictionary(); - - if ( inventory.GetResultItemProperty(handle, (uint) index, null, out string propertyNames) ) - { - foreach ( var propertyName in propertyNames.Split( ',' ) ) - { - if ( inventory.GetResultItemProperty(handle, (uint)index, propertyName, out string propertyValue ) ) - { - props.Add(propertyName, propertyValue); - } - } - } - - var item = new Item( this, detail.ItemId, detail.Quantity, detail.Definition ); - item.Properties = props; - - return item; - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Inventory.cs b/Facepunch.Steamworks/Interfaces/Inventory.cs deleted file mode 100644 index c0517e3..0000000 --- a/Facepunch.Steamworks/Interfaces/Inventory.cs +++ /dev/null @@ -1,465 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Inventory : IDisposable - { - /// - /// Called when the local client's items are first retrieved, and when they change. - /// Obviously not called on the server. - /// - public Action OnUpdate; - - /// - /// A list of items owned by this user. You should call Refresh() before trying to access this, - /// and then wait until it's non null or listen to OnUpdate to find out immediately when it's populated. - /// - public Item[] Items; - - /// - /// You can send this data to a server, or another player who can then deserialize it - /// and get a verified list of items. - /// - public byte[] SerializedItems; - - /// - /// Serialized data exprires after an hour. This is the time the value in SerializedItems will expire. - /// - public DateTime SerializedExpireTime; - - internal uint LastTimestamp = 0; - - internal SteamNative.SteamInventory inventory; - - private bool IsServer { get; set; } - - public event Action OnDefinitionsUpdated; - - internal Inventory( BaseSteamworks steamworks, SteamNative.SteamInventory c, bool server ) - { - IsServer = server; - inventory = c; - - steamworks.RegisterCallback( onDefinitionsUpdated ); - - Result.Pending = new Dictionary(); - - FetchItemDefinitions(); - LoadDefinitions(); - UpdatePrices(); - - if ( !server ) - { - steamworks.RegisterCallback( onResultReady ); - steamworks.RegisterCallback( onFullUpdate ); - - - // - // Get a list of our items immediately - // - Refresh(); - } - } - - /// - /// Should get called when the definitions get updated from Steam. - /// - private void onDefinitionsUpdated( SteamInventoryDefinitionUpdate_t obj ) - { - LoadDefinitions(); - UpdatePrices(); - - if ( OnDefinitionsUpdated != null ) - { - OnDefinitionsUpdated.Invoke(); - } - } - - private bool LoadDefinitions() - { - var ids = inventory.GetItemDefinitionIDs(); - if ( ids == null ) - return false; - - Definitions = ids.Select( x => CreateDefinition( x ) ).ToArray(); - - foreach ( var def in Definitions ) - { - def.Link( Definitions ); - } - - return true; - } - - /// - /// We've received a FULL update - /// - private void onFullUpdate( SteamInventoryFullUpdate_t data ) - { - var result = new Result( this, data.Handle, false ); - result.Fill(); - - onResult( result, true ); - } - - /// - /// A generic result has returned. - /// - private void onResultReady( SteamInventoryResultReady_t data ) - { - if ( Result.Pending.ContainsKey( data.Handle ) ) - { - var result = Result.Pending[data.Handle]; - - result.OnSteamResult( data ); - - if ( data.Result == SteamNative.Result.OK ) - { - onResult( result, false ); - } - - Result.Pending.Remove( data.Handle ); - result.Dispose(); - } - } - - private void onResult( Result r, bool serialize ) - { - if ( r.IsSuccess ) - { - // - // We only serialize FULL updates - // - if ( serialize ) - { - // - // Only serialize if this result is newer than the last one - // - if ( r.Timestamp < LastTimestamp ) - return; - - SerializedItems = r.Serialize(); - SerializedExpireTime = DateTime.Now.Add( TimeSpan.FromMinutes( 60 ) ); - } - - LastTimestamp = r.Timestamp; - ApplyResult( r ); - } - - r.Dispose(); - r = null; - } - - /// - /// Apply this result to our current stack of Items - /// Here we're trying to keep our stack up to date with whatever happens - /// with the crafting, stacking etc - /// - internal void ApplyResult( Result r ) - { - if ( IsServer ) return; - - if ( r.IsSuccess && r.Items != null ) - { - if ( Items == null ) - Items = new Item[0]; - - Items = Items - .Union( r.Items ) - .Distinct() - .Where( x => !r.Removed.Contains( x ) ) - .Where( x => !r.Consumed.Contains( x ) ) - .ToArray(); - - // - // Tell everyone we've got new items! - // - OnUpdate?.Invoke(); - } - } - - public void Dispose() - { - inventory = null; - - Items = null; - SerializedItems = null; - - Result.Pending = null; - } - - /// - /// Call this at least every two minutes, every frame doesn't hurt. - /// You should call it when you consider it active play time. - /// IE - your player is alive, and playing. - /// Don't stress on it too much tho cuz it's super hijackable anyway. - /// - [Obsolete( "No longer required, will be removed in a later version" )] - public void PlaytimeHeartbeat() - { - } - - /// - /// Call this to retrieve the items. - /// Note that if this has already been called it won't - /// trigger a call to OnUpdate unless the items have changed - /// - public void Refresh() - { - if ( IsServer ) return; - - SteamNative.SteamInventoryResult_t request = 0; - if ( !inventory.GetAllItems( ref request ) || request == -1 ) - { - Console.WriteLine( "GetAllItems failed!?" ); - return; - } - } - - /// - /// Some definitions aren't sent to the client, and all aren't available on the server. - /// Manually getting a Definition here lets you call functions on those definitions. - /// - public Definition CreateDefinition( int id ) - { - return new Definition( this, id ); - } - - /// - /// Fetch item definitions in case new ones have been added since we've initialized - /// - public void FetchItemDefinitions() - { - inventory.LoadItemDefinitions(); - } - - /// - /// No need to call this manually if you're calling Update - /// - public void Update() - { - - } - - /// - /// A list of items defined for this app. - /// This should be immediately populated and available. - /// - public Definition[] Definitions; - - /// - /// A list of item definitions that have prices and so can be bought. - /// - public IEnumerable DefinitionsWithPrices - { - get - { - if ( Definitions == null ) - yield break; - - for ( int i=0; i< Definitions.Length; i++ ) - { - if (Definitions[i].LocalPrice > 0) - yield return Definitions[i]; - } - } - } - - /// - /// Utility, given a "1;VLV250" string, convert it to a 2.5 - /// - public static float PriceCategoryToFloat( string price ) - { - if ( string.IsNullOrEmpty( price ) ) - return 0.0f; - - price = price.Replace( "1;VLV", "" ); - - int iPrice = 0; - if ( !int.TryParse( price, out iPrice ) ) - return 0.0f; - - return int.Parse( price ) / 100.0f; - } - - /// - /// We might be better off using a dictionary for this, once there's 1000+ definitions - /// - public Definition FindDefinition( int DefinitionId ) - { - if ( Definitions == null ) return null; - - for( int i=0; i< Definitions.Length; i++ ) - { - if ( Definitions[i].Id == DefinitionId ) - return Definitions[i]; - } - - return null; - } - - public unsafe Result Deserialize( byte[] data, int dataLength = -1 ) - { - if (data == null) - throw new ArgumentException("data should nto be null"); - - if ( dataLength == -1 ) - dataLength = data.Length; - - SteamNative.SteamInventoryResult_t resultHandle = -1; - - fixed ( byte* ptr = data ) - { - var result = inventory.DeserializeResult( ref resultHandle, (IntPtr) ptr, (uint)dataLength, false ); - if ( !result || resultHandle == -1 ) - return null; - - var r = new Result( this, resultHandle, false ); - r.Fill(); - return r; - } - } - - /// - /// Crafting! Uses the passed items to buy the target item. - /// You need to have set up the appropriate exchange rules in your item - /// definitions. This assumes all the items passed in aren't stacked. - /// - public Result CraftItem( Item[] list, Definition target ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - - var newItems = new SteamNative.SteamItemDef_t[] { new SteamNative.SteamItemDef_t() { Value = target.Id } }; - var newItemC = new uint[] { 1 }; - - var takeItems = list.Select( x => (SteamNative.SteamItemInstanceID_t)x.Id ).ToArray(); - var takeItemsC = list.Select( x => (uint)1 ).ToArray(); - - if ( !inventory.ExchangeItems( ref resultHandle, newItems, newItemC, 1, takeItems, takeItemsC, (uint)takeItems.Length ) ) - return null; - - return new Result( this, resultHandle, true ); - } - - /// - /// Crafting! Uses the passed items to buy the target item. - /// You need to have set up the appropriate exchange rules in your item - /// definitions. - /// - public Result CraftItem( Item.Amount[] list, Definition target ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - - var newItems = new SteamNative.SteamItemDef_t[] { new SteamNative.SteamItemDef_t() { Value = target.Id } }; - var newItemC = new uint[] { 1 }; - - var takeItems = list.Select( x => (SteamNative.SteamItemInstanceID_t)x.Item.Id ).ToArray(); - var takeItemsC = list.Select( x => (uint)x.Quantity ).ToArray(); - - if ( !inventory.ExchangeItems( ref resultHandle, newItems, newItemC, 1, takeItems, takeItemsC, (uint)takeItems.Length ) ) - return null; - - return new Result( this, resultHandle, true ); - } - - /// - /// Split stack into two items - /// - public Result SplitStack( Item item, int quantity = 1 ) - { - return item.SplitStack( quantity ); - } - - /// - /// Stack source item onto dest item - /// - public Result Stack( Item source, Item dest, int quantity = 1 ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - if ( !inventory.TransferItemQuantity( ref resultHandle, source.Id, (uint)quantity, dest.Id ) ) - return null; - - return new Result( this, resultHandle, true ); - } - - /// - /// This is used to grant a specific item to the user. This should - /// only be used for development prototyping, from a trusted server, - /// or if you don't care about hacked clients granting arbitrary items. - /// This call can be disabled by a setting on Steamworks. - /// - public Result GenerateItem( Definition target, int amount ) - { - SteamNative.SteamInventoryResult_t resultHandle = -1; - - var newItems = new SteamNative.SteamItemDef_t[] { new SteamNative.SteamItemDef_t() { Value = target.Id } }; - var newItemC = new uint[] { (uint) amount }; - - if ( !inventory.GenerateItems( ref resultHandle, newItems, newItemC, 1 ) ) - return null; - - return new Result( this, resultHandle, true ); - } - - public delegate void StartPurchaseSuccess( ulong orderId, ulong transactionId ); - - /// - /// Starts the purchase process for the user, given a "shopping cart" of item definitions that the user would like to buy. - /// The user will be prompted in the Steam Overlay to complete the purchase in their local currency, funding their Steam Wallet if necessary, etc. - /// - /// If was succesful the callback orderId and transactionId will be non 0 - /// - public bool StartPurchase( Definition[] items, StartPurchaseSuccess callback = null ) - { - var itemGroup = items.GroupBy(x => x.Id); - - var newItems = itemGroup.Select( x => new SteamItemDef_t { Value = x.Key } ).ToArray(); - var newItemC = itemGroup.Select( x => (uint) x.Count() ).ToArray(); - - var h = inventory.StartPurchase( newItems, newItemC, (uint) newItemC.Length, ( result, error ) => - { - if ( error ) - { - callback?.Invoke(0, 0); - } - else - { - callback?.Invoke(result.OrderID, result.TransID); - } - }); - - return h != null; - } - - /// - /// This might be null until Steam has actually recieved the prices. - /// - public string Currency { get; private set; } - - public void UpdatePrices() - { - if (IsServer) - return; - - inventory.RequestPrices((result, b) => - { - Currency = result.Currency; - - if ( Definitions == null ) - return; - - for (int i = 0; i < Definitions.Length; i++) - { - Definitions[i].UpdatePrice(); - } - - }); - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Networking.cs b/Facepunch.Steamworks/Interfaces/Networking.cs deleted file mode 100644 index ee8bca2..0000000 --- a/Facepunch.Steamworks/Interfaces/Networking.cs +++ /dev/null @@ -1,199 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public class Networking : IDisposable - { - private static byte[] ReceiveBuffer = new byte[1024 * 64]; - - public delegate void OnRecievedP2PData( ulong steamid, byte[] data, int dataLength, int channel ); - - public OnRecievedP2PData OnP2PData; - public Func OnIncomingConnection; - public Action OnConnectionFailed; - - private List ListenChannels = new List(); - - private System.Diagnostics.Stopwatch UpdateTimer = System.Diagnostics.Stopwatch.StartNew(); - - internal SteamNative.SteamNetworking networking; - - internal Networking( BaseSteamworks steamworks, SteamNative.SteamNetworking networking ) - { - this.networking = networking; - - steamworks.RegisterCallback( onP2PConnectionRequest ); - steamworks.RegisterCallback( onP2PConnectionFailed ); - } - - public void Dispose() - { - networking = null; - - OnIncomingConnection = null; - OnConnectionFailed = null; - OnP2PData = null; - ListenChannels.Clear(); - } - - - /// - /// No need to call this manually if you're calling Update() - /// - public void Update() - { - if ( OnP2PData == null ) - return; - - // Update every 60th of a second - if ( UpdateTimer.Elapsed.TotalSeconds < 1.0 / 60.0 ) - return; - - UpdateTimer.Reset(); - UpdateTimer.Start(); - - foreach ( var channel in ListenChannels ) - { - while ( ReadP2PPacket( channel ) ) - { - // Nothing Here. - } - } - } - - /// - /// Enable or disable listening on a specific channel. - /// If you donp't enable the channel we won't listen to it, - /// so you won't be able to receive messages on it. - /// - public void SetListenChannel( int ChannelId, bool Listen ) - { - ListenChannels.RemoveAll( x => x == ChannelId ); - - if ( Listen ) - { - ListenChannels.Add( ChannelId ); - } - } - - private void onP2PConnectionRequest( SteamNative.P2PSessionRequest_t o ) - { - if ( OnIncomingConnection != null ) - { - var accept = OnIncomingConnection( o.SteamIDRemote ); - - if ( accept ) - { - networking.AcceptP2PSessionWithUser( o.SteamIDRemote ); - } - else - { - networking.CloseP2PSessionWithUser( o.SteamIDRemote ); - } - - return; - } - - // - // Default is to reject the session - // - networking.CloseP2PSessionWithUser( o.SteamIDRemote ); - } - - public enum SessionError : byte - { - None = 0, - NotRunningApp = 1, // target is not running the same game - NoRightsToApp = 2, // local user doesn't own the app that is running - DestinationNotLoggedIn = 3, // target user isn't connected to Steam - Timeout = 4, // target isn't responding, perhaps not calling AcceptP2PSessionWithUser() - // corporate firewalls can also block this (NAT traversal is not firewall traversal) - // make sure that UDP ports 3478, 4379, and 4380 are open in an outbound direction - Max = 5 - }; - - private void onP2PConnectionFailed( SteamNative.P2PSessionConnectFail_t o ) - { - if ( OnConnectionFailed != null ) - { - OnConnectionFailed( o.SteamIDRemote, (SessionError) o.P2PSessionError ); - } - } - - public enum SendType : int - { - /// - /// Basic UDP send. Packets can't be bigger than 1200 bytes (your typical MTU size). Can be lost, or arrive out of order (rare). - /// The sending API does have some knowledge of the underlying connection, so if there is no NAT-traversal accomplished or - /// there is a recognized adjustment happening on the connection, the packet will be batched until the connection is open again. - /// - - Unreliable = 0, - - /// - /// As above, but if the underlying p2p connection isn't yet established the packet will just be thrown away. Using this on the first - /// packet sent to a remote host almost guarantees the packet will be dropped. - /// This is only really useful for kinds of data that should never buffer up, i.e. voice payload packets - /// - UnreliableNoDelay = 1, - - /// - /// Reliable message send. Can send up to 1MB of data in a single message. - /// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for efficient sends of large chunks of data. - /// - Reliable = 2, - - /// - /// As above, but applies the Nagle algorithm to the send - sends will accumulate - /// until the current MTU size (typically ~1200 bytes, but can change) or ~200ms has passed (Nagle algorithm). - /// Useful if you want to send a set of smaller messages but have the coalesced into a single packet - /// Since the reliable stream is all ordered, you can do several small message sends with k_EP2PSendReliableWithBuffering and then - /// do a normal k_EP2PSendReliable to force all the buffered data to be sent. - /// - ReliableWithBuffering = 3, - - } - - public unsafe bool SendP2PPacket( ulong steamid, byte[] data, int length, SendType eP2PSendType = SendType.Reliable, int nChannel = 0 ) - { - fixed ( byte* p = data ) - { - return networking.SendP2PPacket( steamid, (IntPtr) p, (uint)length, (SteamNative.P2PSend)(int)eP2PSendType, nChannel ); - } - } - - private unsafe bool ReadP2PPacket( int channel ) - { - uint DataAvailable = 0; - - if ( !networking.IsP2PPacketAvailable( out DataAvailable, channel ) ) - return false; - - if ( ReceiveBuffer.Length < DataAvailable ) - ReceiveBuffer = new byte[ DataAvailable + 1024 ]; - - fixed ( byte* p = ReceiveBuffer ) - { - SteamNative.CSteamID steamid = 1; - if ( !networking.ReadP2PPacket( (IntPtr)p, DataAvailable, out DataAvailable, out steamid, channel ) || DataAvailable == 0 ) - return false; - - OnP2PData?.Invoke( steamid, ReceiveBuffer, (int) DataAvailable, channel ); - return true; - } - } - - /// - /// This should be called when you're done communicating with a user, as this will free up all of the resources allocated for the connection under-the-hood. - /// If the remote user tries to send data to you again, a new onP2PConnectionRequest callback will be posted. - /// - public bool CloseSession( ulong steamId ) - { - return networking.CloseP2PSessionWithUser( steamId ); - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs b/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs deleted file mode 100644 index 7905a13..0000000 --- a/Facepunch.Steamworks/Interfaces/Workshop.Editor.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -using System.Collections.Generic; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Workshop - { - public class Editor - { - internal Workshop workshop; - - internal CallbackHandle CreateItem; - internal CallbackHandle SubmitItemUpdate; - internal SteamNative.UGCUpdateHandle_t UpdateHandle; - - public ulong Id { get; internal set; } - public string Title { get; set; } = null; - public string Description { get; set; } = null; - public string Folder { get; set; } = null; - public string PreviewImage { get; set; } = null; - public List Tags { get; set; } = new List(); - public bool Publishing { get; internal set; } - public ItemType? Type { get; set; } - public string Error { get; internal set; } = null; - public string ChangeNote { get; set; } = ""; - public uint WorkshopUploadAppId { get; set; } - - public enum VisibilityType : int - { - Public = 0, - FriendsOnly = 1, - Private = 2 - } - - public VisibilityType ? Visibility { get; set; } - - public bool NeedToAgreeToWorkshopLegal { get; internal set; } - - - - public double Progress - { - get - { - var bt = BytesTotal; - if (bt == 0) return 0; - - return (double)BytesUploaded / (double)bt; - } - } - - private int bytesUploaded = 0; - - public int BytesUploaded - { - get - { - if ( !Publishing ) return bytesUploaded; - if (UpdateHandle == 0) return bytesUploaded; - - ulong b = 0; - ulong t = 0; - - workshop.steamworks.native.ugc.GetItemUpdateProgress( UpdateHandle, out b, out t ); - bytesUploaded = Math.Max( bytesUploaded, (int) b ); - return (int)bytesUploaded; - } - } - - private int bytesTotal = 0; - - public int BytesTotal - { - get - { - if ( !Publishing ) return bytesTotal; - if (UpdateHandle == 0 ) return bytesTotal; - - ulong b = 0; - ulong t = 0; - - workshop.steamworks.native.ugc.GetItemUpdateProgress( UpdateHandle, out b, out t ); - bytesTotal = Math.Max(bytesTotal, (int)t); - return (int)bytesTotal; - } - } - - public void Publish() - { - bytesUploaded = 0; - bytesTotal = 0; - - Publishing = true; - Error = null; - - if ( Id == 0 ) - { - StartCreatingItem(); - return; - } - - PublishChanges(); - } - - private void StartCreatingItem() - { - if ( !Type.HasValue ) - throw new System.Exception( "Editor.Type must be set when creating a new item!" ); - - CreateItem = workshop.ugc.CreateItem( WorkshopUploadAppId, (SteamNative.WorkshopFileType)(uint)Type, OnItemCreated ); - } - - private void OnItemCreated( SteamNative.CreateItemResult_t obj, bool Failed ) - { - NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement; - CreateItem.Dispose(); - CreateItem = null; - - if ( obj.Result == SteamNative.Result.OK && !Failed ) - { - Id = obj.PublishedFileId; - PublishChanges(); - return; - } - - Error = "Error creating new file: " + obj.Result.ToString() + "("+ obj.PublishedFileId+ ")"; - Publishing = false; - } - - private void PublishChanges() - { - UpdateHandle = workshop.ugc.StartItemUpdate(WorkshopUploadAppId, Id ); - - if ( Title != null ) - workshop.ugc.SetItemTitle( UpdateHandle, Title ); - - if ( Description != null ) - workshop.ugc.SetItemDescription( UpdateHandle, Description ); - - if ( Folder != null ) - { - var info = new System.IO.DirectoryInfo( Folder ); - - if ( !info.Exists ) - throw new System.Exception( $"Folder doesn't exist ({Folder})" ); - - workshop.ugc.SetItemContent( UpdateHandle, Folder ); - } - - if ( Tags != null && Tags.Count > 0 ) - workshop.ugc.SetItemTags( UpdateHandle, Tags.ToArray() ); - - if ( Visibility.HasValue ) - workshop.ugc.SetItemVisibility( UpdateHandle, (SteamNative.RemoteStoragePublishedFileVisibility)(uint)Visibility.Value ); - - if ( PreviewImage != null ) - { - var info = new System.IO.FileInfo( PreviewImage ); - - if ( !info.Exists ) - throw new System.Exception( $"PreviewImage doesn't exist ({PreviewImage})" ); - - if ( info.Length >= 1024 * 1024 ) - throw new System.Exception( $"PreviewImage should be under 1MB ({info.Length})" ); - - workshop.ugc.SetItemPreview( UpdateHandle, PreviewImage ); - } - - /* - workshop.ugc.SetItemUpdateLanguage( UpdateId, const char *pchLanguage ) = 0; // specify the language of the title or description that will be set - workshop.ugc.SetItemMetadata( UpdateId, const char *pchMetaData ) = 0; // change the metadata of an UGC item (max = k_cchDeveloperMetadataMax) - workshop.ugc.RemoveItemKeyValueTags( UpdateId, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key - workshop.ugc.AddItemKeyValueTag( UpdateId, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. - workshop.ugc.AddItemPreviewFile( UpdateId, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size - workshop.ugc.AddItemPreviewVideo( UpdateId, const char *pszVideoID ) = 0; // add preview video for this item - workshop.ugc.UpdateItemPreviewFile( UpdateId, uint32 index, const char *pszPreviewFile ) = 0; // updates an existing preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size - workshop.ugc.UpdateItemPreviewVideo( UpdateId, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item - workshop.ugc.RemoveItemPreview( UpdateId, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) - */ - - SubmitItemUpdate = workshop.ugc.SubmitItemUpdate( UpdateHandle, ChangeNote, OnChangesSubmitted ); - } - - private void OnChangesSubmitted( SteamNative.SubmitItemUpdateResult_t obj, bool Failed ) - { - if ( Failed ) - throw new System.Exception( "CreateItemResult_t Failed" ); - - UpdateHandle = 0; - SubmitItemUpdate = null; - NeedToAgreeToWorkshopLegal = obj.UserNeedsToAcceptWorkshopLegalAgreement; - Publishing = false; - - if ( obj.Result == SteamNative.Result.OK ) - { - return; - } - - Error = "Error publishing changes: " + obj.Result.ToString() + " ("+ NeedToAgreeToWorkshopLegal + ")"; - } - - public void Delete() - { - workshop.ugc.DeleteItem( Id ); - Id = 0; - } - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs b/Facepunch.Steamworks/Interfaces/Workshop.Item.cs deleted file mode 100644 index 24fda87..0000000 --- a/Facepunch.Steamworks/Interfaces/Workshop.Item.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks -{ - public partial class Workshop - { - public class Item - { - internal Workshop workshop; - - public string Description { get; private set; } - public ulong Id { get; private set; } - public ulong OwnerId { get; private set; } - public float Score { get; private set; } - public string[] Tags { get; private set; } - public string Title { get; private set; } - public uint VotesDown { get; private set; } - public uint VotesUp { get; private set; } - public DateTime Modified { get; private set; } - public DateTime Created { get; private set; } - - public Item( ulong Id, Workshop workshop ) - { - this.Id = Id; - this.workshop = workshop; - } - - internal static Item From( SteamNative.SteamUGCDetails_t details, Workshop workshop ) - { - var item = new Item( details.PublishedFileId, workshop); - - item.Title = details.Title; - item.Description = details.Description; - item.OwnerId = details.SteamIDOwner; - item.Tags = details.Tags.Split( ',' ).Select( x=> x.ToLower() ).ToArray(); - item.Score = details.Score; - item.VotesUp = details.VotesUp; - item.VotesDown = details.VotesDown; - item.Modified = Utility.Epoch.ToDateTime( details.TimeUpdated ); - item.Created = Utility.Epoch.ToDateTime( details.TimeCreated ); - - return item; - } - - public bool Download( bool highPriority = true ) - { - if ( Installed ) return true; - if ( Downloading ) return true; - - if ( !workshop.ugc.DownloadItem( Id, highPriority ) ) - { - Console.WriteLine( "Download Failed" ); - return false; - } - - workshop.OnFileDownloaded += OnFileDownloaded; - workshop.OnItemInstalled += OnItemInstalled; - return true; - } - - public void Subscribe() - { - workshop.ugc.SubscribeItem(Id); - SubscriptionCount++; - } - - public void UnSubscribe() - { - workshop.ugc.UnsubscribeItem(Id); - SubscriptionCount--; - } - - - private void OnFileDownloaded( ulong fileid, Callbacks.Result result ) - { - if ( fileid != Id ) return; - - workshop.OnFileDownloaded -= OnFileDownloaded; - } - - private void OnItemInstalled( ulong fileid ) - { - if ( fileid != Id ) return; - - workshop.OnItemInstalled -= OnItemInstalled; - } - - public ulong BytesDownloaded { get { UpdateDownloadProgress(); return _BytesDownloaded; } } - public ulong BytesTotalDownload { get { UpdateDownloadProgress(); return _BytesTotal; } } - - public double DownloadProgress - { - get - { - UpdateDownloadProgress(); - if ( _BytesTotal == 0 ) return 0; - return (double)_BytesDownloaded / (double)_BytesTotal; - } - } - - public bool Installed { get { return ( State & ItemState.Installed ) != 0; } } - public bool Downloading { get { return ( State & ItemState.Downloading ) != 0; } } - public bool DownloadPending { get { return ( State & ItemState.DownloadPending ) != 0; } } - public bool Subscribed { get { return ( State & ItemState.Subscribed ) != 0; } } - public bool NeedsUpdate { get { return ( State & ItemState.NeedsUpdate ) != 0; } } - - private SteamNative.ItemState State { get { return ( SteamNative.ItemState) workshop.ugc.GetItemState( Id ); } } - - - private DirectoryInfo _directory; - - public DirectoryInfo Directory - { - get - { - if ( _directory != null ) - return _directory; - - if ( !Installed ) - return null; - - ulong sizeOnDisk; - string folder; - uint timestamp; - - if ( workshop.ugc.GetItemInstallInfo( Id, out sizeOnDisk, out folder, out timestamp ) ) - { - _directory = new DirectoryInfo( folder ); - Size = sizeOnDisk; - - if ( !_directory.Exists ) - { - // Size = 0; - // _directory = null; - } - } - - return _directory; - } - } - - public ulong Size { get; private set; } - - private ulong _BytesDownloaded, _BytesTotal; - - internal void UpdateDownloadProgress() - { - workshop.ugc.GetItemDownloadInfo( Id, out _BytesDownloaded, out _BytesTotal ); - } - - private int YourVote = 0; - - - public void VoteUp() - { - if ( YourVote == 1 ) return; - if ( YourVote == -1 ) VotesDown--; - - VotesUp++; - workshop.ugc.SetUserItemVote( Id, true ); - YourVote = 1; - } - - public void VoteDown() - { - if ( YourVote == -1 ) return; - if ( YourVote == 1 ) VotesUp--; - - VotesDown++; - workshop.ugc.SetUserItemVote( Id, false ); - YourVote = -1; - } - - public Editor Edit() - { - return workshop.EditItem( Id ); - } - - - /// - /// Return a URL to view this item online - /// - public string Url { get { return string.Format( "http://steamcommunity.com/sharedfiles/filedetails/?source=Facepunch.Steamworks&id={0}", Id ); } } - - public string ChangelogUrl { get { return string.Format( "http://steamcommunity.com/sharedfiles/filedetails/changelog/{0}", Id ); } } - - public string CommentsUrl { get { return string.Format( "http://steamcommunity.com/sharedfiles/filedetails/comments/{0}", Id ); } } - - public string DiscussUrl { get { return string.Format( "http://steamcommunity.com/sharedfiles/filedetails/discussions/{0}", Id ); } } - - public string StartsUrl { get { return string.Format( "http://steamcommunity.com/sharedfiles/filedetails/stats/{0}", Id ); } } - - public int SubscriptionCount { get; internal set; } - public int FavouriteCount { get; internal set; } - public int FollowerCount { get; internal set; } - public int WebsiteViews { get; internal set; } - public int ReportScore { get; internal set; } - public string PreviewImageUrl { get; internal set; } - - string _ownerName = null; - - - - public string OwnerName - { - get - { - if ( _ownerName == null && workshop.friends != null ) - { - _ownerName = workshop.friends.GetName( OwnerId ); - if ( _ownerName == "[unknown]" ) - { - _ownerName = null; - return string.Empty; - } - } - - if ( _ownerName == null ) - return string.Empty; - - return _ownerName; - } - } - } - } -} diff --git a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs b/Facepunch.Steamworks/Interfaces/Workshop.Query.cs deleted file mode 100644 index 4b26d47..0000000 --- a/Facepunch.Steamworks/Interfaces/Workshop.Query.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; - -namespace Facepunch.Steamworks -{ - public partial class Workshop - { - public class Query : IDisposable - { - internal const int SteamResponseSize = 50; - - internal SteamNative.UGCQueryHandle_t Handle; - internal SteamNative.CallbackHandle Callback; - - /// - /// The AppId you're querying. This defaults to this appid. - /// - public uint AppId { get; set; } - - /// - /// The AppId of the app used to upload the item. This defaults to 0 - /// which means all/any. - /// - public uint UploaderAppId { get; set; } - - public QueryType QueryType { get; set; } = QueryType.Items; - public Order Order { get; set; } = Order.RankedByVote; - - public string SearchText { get; set; } - - public Item[] Items { get; set; } - - public int TotalResults { get; set; } - - public ulong? UserId { get; set; } - - /// - /// If order is RankedByTrend, this value represents how many days to take - /// into account. - /// - public int RankedByTrendDays { get; set; } - - public UserQueryType UserQueryType { get; set; } = UserQueryType.Published; - - /// - /// Called when the query finishes - /// - public Action OnResult; - - /// - /// Page starts at 1 !! - /// - public int Page { get; set; } = 1; - - public int PerPage { get; set; } = SteamResponseSize; - - internal Workshop workshop; - internal Friends friends; - - private int _resultPage = 0; - private int _resultsRemain = 0; - private int _resultSkip = 0; - private List _results; - - public void Run() - { - if ( Callback != null ) - return; - - if ( Page <= 0 ) - throw new System.Exception( "Page should be 1 or above" ); - - var actualOffset = ((Page-1) * PerPage); - - TotalResults = 0; - - _resultSkip = actualOffset % SteamResponseSize; - _resultsRemain = PerPage; - _resultPage = (int) Math.Floor( (float) actualOffset / (float)SteamResponseSize ); - _results = new List(); - - RunInternal(); - } - - unsafe void RunInternal() - { - if ( FileId.Count != 0 ) - { - var fileArray = FileId.Select( x => (SteamNative.PublishedFileId_t)x ).ToArray(); - _resultsRemain = fileArray.Length; - - Handle = workshop.ugc.CreateQueryUGCDetailsRequest( fileArray ); - } - else if ( UserId.HasValue ) - { - uint accountId = (uint)( UserId.Value & 0xFFFFFFFFul ); - Handle = workshop.ugc.CreateQueryUserUGCRequest( accountId, (SteamNative.UserUGCList)( int)UserQueryType, (SteamNative.UGCMatchingUGCType)( int)QueryType, SteamNative.UserUGCListSortOrder.LastUpdatedDesc, UploaderAppId, AppId, (uint)_resultPage + 1 ); - } - else - { - Handle = workshop.ugc.CreateQueryAllUGCRequest( (SteamNative.UGCQuery)(int)Order, (SteamNative.UGCMatchingUGCType)(int)QueryType, UploaderAppId, AppId, (uint)_resultPage + 1 ); - } - - if ( !string.IsNullOrEmpty( SearchText ) ) - workshop.ugc.SetSearchText( Handle, SearchText ); - - foreach ( var tag in RequireTags ) - workshop.ugc.AddRequiredTag( Handle, tag ); - - if ( RequireTags.Count > 0 ) - workshop.ugc.SetMatchAnyTag( Handle, !RequireAllTags ); - - if ( RankedByTrendDays > 0 ) - workshop.ugc.SetRankedByTrendDays( Handle, (uint) RankedByTrendDays ); - - foreach ( var tag in ExcludeTags ) - workshop.ugc.AddExcludedTag( Handle, tag ); - - Callback = workshop.ugc.SendQueryUGCRequest( Handle, ResultCallback ); - } - - void ResultCallback( SteamNative.SteamUGCQueryCompleted_t data, bool bFailed ) - { - if ( bFailed ) - throw new System.Exception( "bFailed!" ); - - var gotFiles = 0; - for ( int i = 0; i < data.NumResultsReturned; i++ ) - { - if ( _resultSkip > 0 ) - { - _resultSkip--; - continue; - } - - SteamNative.SteamUGCDetails_t details = new SteamNative.SteamUGCDetails_t(); - if ( !workshop.ugc.GetQueryUGCResult( data.Handle, (uint)i, ref details ) ) - continue; - - // We already have this file, so skip it - if ( _results.Any( x => x.Id == details.PublishedFileId ) ) - continue; - - var item = Item.From( details, workshop ); - - item.SubscriptionCount = GetStat( data.Handle, i, ItemStatistic.NumSubscriptions ); - item.FavouriteCount = GetStat( data.Handle, i, ItemStatistic.NumFavorites ); - item.FollowerCount = GetStat( data.Handle, i, ItemStatistic.NumFollowers ); - item.WebsiteViews = GetStat( data.Handle, i, ItemStatistic.NumUniqueWebsiteViews ); - item.ReportScore = GetStat( data.Handle, i, ItemStatistic.ReportScore ); - - string url = null; - if ( workshop.ugc.GetQueryUGCPreviewURL( data.Handle, (uint)i, out url ) ) - item.PreviewImageUrl = url; - - _results.Add( item ); - - _resultsRemain--; - gotFiles++; - - if ( _resultsRemain <= 0 ) - break; - } - - TotalResults = TotalResults > data.TotalMatchingResults ? TotalResults : (int)data.TotalMatchingResults; - - Callback.Dispose(); - Callback = null; - - _resultPage++; - - if ( _resultsRemain > 0 && gotFiles > 0 ) - { - RunInternal(); - } - else - { - Items = _results.ToArray(); - - if ( OnResult != null ) - { - OnResult( this ); - } - } - } - - private int GetStat( ulong handle, int index, ItemStatistic stat ) - { - ulong val = 0; - if ( !workshop.ugc.GetQueryUGCStatistic( handle, (uint)index, (SteamNative.ItemStatistic)(uint)stat, out val ) ) - return 0; - - return (int) val; - } - - public bool IsRunning - { - get { return Callback != null; } - } - - /// - /// Only return items with these tags - /// - public List RequireTags { get; set; } = new List(); - - /// - /// If true, return items that have all RequireTags - /// If false, return items that have any tags in RequireTags - /// - public bool RequireAllTags { get; set; } = false; - - /// - /// Don't return any items with this tag - /// - public List ExcludeTags { get; set; } = new List(); - - /// - /// If you're querying for a particular file or files, add them to this. - /// - public List FileId { get; set; } = new List(); - - - - /// - /// Don't call this in production! - /// - public void Block() - { - const int sleepMs = 10; - - workshop.steamworks.Update(); - - while ( IsRunning ) - { -#if NET_CORE - System.Threading.Tasks.Task.Delay( sleepMs ).Wait(); -#else - System.Threading.Thread.Sleep( sleepMs ); -#endif - workshop.steamworks.Update(); - } - } - - public void Dispose() - { - // ReleaseQueryUGCRequest - } - } - - private enum ItemStatistic : uint - { - NumSubscriptions = 0, - NumFavorites = 1, - NumFollowers = 2, - NumUniqueSubscriptions = 3, - NumUniqueFavorites = 4, - NumUniqueFollowers = 5, - NumUniqueWebsiteViews = 6, - ReportScore = 7, - }; - } -} diff --git a/Facepunch.Steamworks/Interfaces/Workshop.cs b/Facepunch.Steamworks/Interfaces/Workshop.cs deleted file mode 100644 index 64ae67e..0000000 --- a/Facepunch.Steamworks/Interfaces/Workshop.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using System.Collections.Generic; -using SteamNative; - -namespace Facepunch.Steamworks -{ - /// - /// Allows you to interact with Steam's UGC stuff (User Generated Content). - /// To put simply, this allows you to upload a folder of files to Steam. - /// - /// To upload a new file use CreateItem. This returns an Editor object. - /// This object is also used to edit existing items. - /// - /// To get a list of items you can call CreateQuery. From there you can download - /// an item and retrieve the folder that it's downloaded to. - /// - /// Generally there's no need to compress and decompress your uploads, so you should - /// usually be able to use the content straight from the destination folder. - /// - /// - public partial class Workshop : IDisposable - { - internal const ulong InvalidHandle = 0xffffffffffffffff; - - internal SteamNative.SteamUGC ugc; - internal Friends friends; - internal BaseSteamworks steamworks; - internal SteamNative.SteamRemoteStorage remoteStorage; - - /// - /// Called when an item has been downloaded. This could have been - /// because of a call to Download. - /// - public event Action OnFileDownloaded; - - /// - /// Called when an item has been installed. This could have been - /// because of a call to Download or because of a subscription triggered - /// via the browser/app. - /// - public event Action OnItemInstalled; - - internal Workshop( BaseSteamworks steamworks, SteamNative.SteamUGC ugc, SteamNative.SteamRemoteStorage remoteStorage ) - { - this.ugc = ugc; - this.steamworks = steamworks; - this.remoteStorage = remoteStorage; - - steamworks.RegisterCallback( onDownloadResult ); - steamworks.RegisterCallback( onItemInstalled ); - } - - /// - /// You should never have to call this manually - /// - public void Dispose() - { - ugc = null; - steamworks = null; - remoteStorage = null; - friends = null; - - OnFileDownloaded = null; - OnItemInstalled = null; - } - - private void onItemInstalled( SteamNative.ItemInstalled_t obj ) - { - if ( OnItemInstalled != null && obj.AppID == Client.Instance.AppId ) - OnItemInstalled( obj.PublishedFileId ); - } - - private void onDownloadResult( SteamNative.DownloadItemResult_t obj ) - { - if ( OnFileDownloaded != null && obj.AppID == Client.Instance.AppId ) - OnFileDownloaded( obj.PublishedFileId, (Callbacks.Result) obj.Result ); - } - - /// - /// Creates a query object, which is used to get a list of items. - /// - /// This could be a list of the most popular items, or a search, - /// or just getting a list of the items you've uploaded. - /// - public Query CreateQuery() - { - return new Query() - { - AppId = steamworks.AppId, - workshop = this, - friends = friends - }; - } - - /// - /// Create a new Editor object with the intention of creating a new item. - /// Your item won't actually be created until you call Publish() on the object. - /// - public Editor CreateItem( ItemType type ) - { - return CreateItem(this.steamworks.AppId, type); - } - - /// - /// Create a new Editor object with the intention of creating a new item. - /// Your item won't actually be created until you call Publish() on the object. - /// Your item will be published to the provided appId. - /// - /// You need to add app publish permissions for cross app uploading to work. - public Editor CreateItem( uint workshopUploadAppId, ItemType type ) - { - return new Editor() { workshop = this, WorkshopUploadAppId = workshopUploadAppId, Type = type }; - } - - /// - /// Returns a class representing this ItemId. We don't query - /// item name, description etc. We don't verify that item exists. - /// We don't verify that this item belongs to your app. - /// - public Editor EditItem( ulong itemId ) - { - return new Editor() { workshop = this, Id = itemId }; - } - - /// - /// Gets an Item object for a specific item. This doesn't currently - /// query the item's name and description. It's only really useful - /// if you know an item's ID and want to download it, or check its - /// current download status. - /// - public Item GetItem( ulong itemid ) - { - return new Item( itemid, this ); - } - - /// - /// How a query should be ordered. - /// - public enum Order - { - RankedByVote = 0, - RankedByPublicationDate = 1, - AcceptedForGameRankedByAcceptanceDate = 2, - RankedByTrend = 3, - FavoritedByFriendsRankedByPublicationDate = 4, - CreatedByFriendsRankedByPublicationDate = 5, - RankedByNumTimesReported = 6, - CreatedByFollowedUsersRankedByPublicationDate = 7, - NotYetRated = 8, - RankedByTotalVotesAsc = 9, - RankedByVotesUp = 10, - RankedByTextSearch = 11, - RankedByTotalUniqueSubscriptions = 12, - }; - - /// - /// The type of item you are querying for - /// - public enum QueryType - { - /// - /// Both MicrotransactionItems and subscriptionItems - /// - Items = 0, - /// - /// Workshop item that is meant to be voted on for the purpose of selling in-game - /// - MicrotransactionItems = 1, - /// - /// normal Workshop item that can be subscribed to - /// - SubscriptionItems = 2, - Collections = 3, - Artwork = 4, - Videos = 5, - Screenshots = 6, - AllGuides = 7, // both web guides and integrated guides - WebGuides = 8, - IntegratedGuides = 9, - UsableInGame = 10, // ready-to-use items and integrated guides - ControllerBindings = 11, - GameManagedItems = 12, // game managed items (not managed by users) - }; - - /// - /// Used to define the item type when creating - /// - public enum ItemType - { - Community = 0, // normal Workshop item that can be subscribed to - Microtransaction = 1, // Workshop item that is meant to be voted on for the purpose of selling in-game - Collection = 2, // a collection of Workshop or Greenlight items - Art = 3, // artwork - Video = 4, // external video - Screenshot = 5, // screenshot - Game = 6, // Greenlight game entry - Software = 7, // Greenlight software entry - Concept = 8, // Greenlight concept - WebGuide = 9, // Steam web guide - IntegratedGuide = 10, // application integrated guide - Merch = 11, // Workshop merchandise meant to be voted on for the purpose of being sold - ControllerBinding = 12, // Steam Controller bindings - SteamworksAccessInvite = 13, // internal - SteamVideo = 14, // Steam video - GameManagedItem = 15, // managed completely by the game, not the user, and not shown on the web - }; - - /// - /// When querying a specific user's items this defines what - /// type of items you're looking for. - /// - public enum UserQueryType : uint - { - Published = 0, - VotedOn, - VotedUp, - VotedDown, - WillVoteLater, - Favorited, - Subscribed, - UsedOrPlayed, - Followed, - } - - - } -} diff --git a/Facepunch.Steamworks/Interop/Native.cs b/Facepunch.Steamworks/Interop/Native.cs deleted file mode 100644 index 3bfebc2..0000000 --- a/Facepunch.Steamworks/Interop/Native.cs +++ /dev/null @@ -1,256 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using SteamNative; - -namespace Facepunch.Steamworks.Interop -{ - internal class NativeInterface : IDisposable - { - internal SteamNative.SteamApi api; - internal SteamNative.SteamClient client; - internal SteamNative.SteamUser user; - internal SteamNative.SteamApps apps; - internal SteamNative.SteamAppList applist; - internal SteamNative.SteamFriends friends; - internal SteamNative.SteamMatchmakingServers servers; - internal SteamNative.SteamMatchmaking matchmaking; - internal SteamNative.SteamInventory inventory; - internal SteamNative.SteamNetworking networking; - internal SteamNative.SteamUserStats userstats; - internal SteamNative.SteamUtils utils; - internal SteamNative.SteamScreenshots screenshots; - internal SteamNative.SteamHTTP http; - internal SteamNative.SteamUGC ugc; - internal SteamNative.SteamGameServer gameServer; - internal SteamNative.SteamGameServerStats gameServerStats; - internal SteamNative.SteamRemoteStorage remoteStorage; - - private bool isServer; - - internal bool InitClient( BaseSteamworks steamworks ) - { - if ( Steamworks.Server.Instance != null ) - throw new System.Exception("Steam client should be initialized before steam server - or there's big trouble."); - - isServer = false; - - api = new SteamNative.SteamApi(); - - if ( !api.SteamAPI_Init() ) - { - Console.Error.WriteLine( "InitClient: SteamAPI_Init returned false" ); - return false; - } - - var hUser = api.SteamAPI_GetHSteamUser(); - var hPipe = api.SteamAPI_GetHSteamPipe(); - if ( hPipe == 0 ) - { - Console.Error.WriteLine( "InitClient: hPipe == 0" ); - return false; - } - - FillInterfaces( steamworks, hUser, hPipe ); - - if ( !user.IsValid ) - { - Console.Error.WriteLine( "InitClient: ISteamUser is null" ); - return false; - } - - // Ensure that the user has logged into Steam. This will always return true if the game is launched - // from Steam, but if Steam is at the login prompt when you run your game it will return false. - if ( !user.BLoggedOn() ) - { - Console.Error.WriteLine( "InitClient: Not Logged On" ); - return false; - } - - return true; - } - - internal bool InitServer( BaseSteamworks steamworks, uint IpAddress /*uint32*/, ushort usPort /*uint16*/, ushort GamePort /*uint16*/, ushort QueryPort /*uint16*/, int eServerMode /*int*/, string pchVersionString /*const char **/) - { - isServer = true; - - api = new SteamNative.SteamApi(); - - if ( !api.SteamInternal_GameServer_Init( IpAddress, usPort, GamePort, QueryPort, eServerMode, pchVersionString ) ) - { - Console.Error.WriteLine( "InitServer: GameServer_Init returned false" ); - return false; - } - - var hUser = api.SteamGameServer_GetHSteamUser(); - var hPipe = api.SteamGameServer_GetHSteamPipe(); - if ( hPipe == 0 ) - { - Console.Error.WriteLine( "InitServer: hPipe == 0" ); - return false; - } - - FillInterfaces( steamworks, hPipe, hUser ); - - if ( !gameServer.IsValid ) - { - gameServer = null; - throw new System.Exception( "Steam Server: Couldn't load SteamGameServer012" ); - } - - return true; - } - - public void FillInterfaces( BaseSteamworks steamworks, int hpipe, int huser ) - { - var clientPtr = api.SteamInternal_CreateInterface( "SteamClient017" ); - if ( clientPtr == IntPtr.Zero ) - { - throw new System.Exception( "Steam Server: Couldn't load SteamClient017" ); - } - - client = new SteamNative.SteamClient( steamworks, clientPtr ); - - user = client.GetISteamUser( huser, hpipe, SteamNative.Defines.STEAMUSER_INTERFACE_VERSION ); - utils = client.GetISteamUtils( hpipe, SteamNative.Defines.STEAMUTILS_INTERFACE_VERSION ); - networking = client.GetISteamNetworking( huser, hpipe, SteamNative.Defines.STEAMNETWORKING_INTERFACE_VERSION ); - gameServerStats = client.GetISteamGameServerStats( huser, hpipe, SteamNative.Defines.STEAMGAMESERVERSTATS_INTERFACE_VERSION ); - http = client.GetISteamHTTP( huser, hpipe, SteamNative.Defines.STEAMHTTP_INTERFACE_VERSION ); - inventory = client.GetISteamInventory( huser, hpipe, SteamNative.Defines.STEAMINVENTORY_INTERFACE_VERSION ); - ugc = client.GetISteamUGC( huser, hpipe, SteamNative.Defines.STEAMUGC_INTERFACE_VERSION ); - apps = client.GetISteamApps( huser, hpipe, SteamNative.Defines.STEAMAPPS_INTERFACE_VERSION ); - gameServer = client.GetISteamGameServer( huser, hpipe, SteamNative.Defines.STEAMGAMESERVER_INTERFACE_VERSION ); - friends = client.GetISteamFriends( huser, hpipe, SteamNative.Defines.STEAMFRIENDS_INTERFACE_VERSION ); - servers = client.GetISteamMatchmakingServers( huser, hpipe, SteamNative.Defines.STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); - userstats = client.GetISteamUserStats( huser, hpipe, SteamNative.Defines.STEAMUSERSTATS_INTERFACE_VERSION ); - screenshots = client.GetISteamScreenshots( huser, hpipe, SteamNative.Defines.STEAMSCREENSHOTS_INTERFACE_VERSION ); - remoteStorage = client.GetISteamRemoteStorage( huser, hpipe, SteamNative.Defines.STEAMREMOTESTORAGE_INTERFACE_VERSION ); - matchmaking = client.GetISteamMatchmaking( huser, hpipe, SteamNative.Defines.STEAMMATCHMAKING_INTERFACE_VERSION ); - applist = client.GetISteamAppList( huser, hpipe, SteamNative.Defines.STEAMAPPLIST_INTERFACE_VERSION ); - } - - public void Dispose() - { - if ( user != null ) - { - user.Dispose(); - user = null; - } - - if ( utils != null ) - { - utils.Dispose(); - utils = null; - } - - if ( networking != null ) - { - networking.Dispose(); - networking = null; - } - - if ( gameServerStats != null ) - { - gameServerStats.Dispose(); - gameServerStats = null; - } - - if ( http != null ) - { - http.Dispose(); - http = null; - } - - if ( inventory != null ) - { - inventory.Dispose(); - inventory = null; - } - - if ( ugc != null ) - { - ugc.Dispose(); - ugc = null; - } - - if ( apps != null ) - { - apps.Dispose(); - apps = null; - } - - if ( gameServer != null ) - { - gameServer.Dispose(); - gameServer = null; - } - - if ( friends != null ) - { - friends.Dispose(); - friends = null; - } - - if ( servers != null ) - { - servers.Dispose(); - servers = null; - } - - if ( userstats != null ) - { - userstats.Dispose(); - userstats = null; - } - - if ( screenshots != null ) - { - screenshots.Dispose(); - screenshots = null; - } - - if ( remoteStorage != null ) - { - remoteStorage.Dispose(); - remoteStorage = null; - } - - if ( matchmaking != null ) - { - matchmaking.Dispose(); - matchmaking = null; - } - - if ( applist != null ) - { - applist.Dispose(); - applist = null; - } - - if ( client != null ) - { - client.Dispose(); - client = null; - } - - if ( api != null ) - { - if ( isServer ) - api.SteamGameServer_Shutdown(); - else - api.SteamAPI_Shutdown(); - - // - // The functions above destroy the pipeline handles - // and all of the classes. Trying to call a steam function - // at this point will result in a crash - because any - // pointers we stored are not invalid. - // - - api.Dispose(); - api = null; - } - } - } -} diff --git a/Facepunch.Steamworks/Properties/AssemblyInfo.cs b/Facepunch.Steamworks/Properties/AssemblyInfo.cs deleted file mode 100644 index 83de1b3..0000000 --- a/Facepunch.Steamworks/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -#if !NET_CORE - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Facepunch.Steamworks")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Facepunch Studios Ltd")] -[assembly: AssemblyProduct("Facepunch.Steamworks")] -[assembly: AssemblyCopyright("Copyright © 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("dc2d9fa9-f005-468f-8581-85c79f4e0034")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion( "1.2.0.0" )] -[assembly: AssemblyFileVersion("1.2.0.0")] - -#endif \ No newline at end of file diff --git a/Facepunch.Steamworks/Server.cs b/Facepunch.Steamworks/Server.cs deleted file mode 100644 index e2091c0..0000000 --- a/Facepunch.Steamworks/Server.cs +++ /dev/null @@ -1,338 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Facepunch.Steamworks -{ - /// - /// Initialize this class for Game Servers. - /// - /// Game servers offer a limited amount of Steam functionality - and don't require the Steam client. - /// - public partial class Server : BaseSteamworks - { - /// - /// A singleton accessor to get the current client instance. - /// - public static Server Instance { get; private set; } - - internal override bool IsGameServer { get { return true; } } - - public ServerQuery Query { get; internal set; } - public ServerStats Stats { get; internal set; } - public ServerAuth Auth { get; internal set; } - - /// - /// Initialize a Steam Server instance - /// - public Server( uint appId, ServerInit init) : base( appId ) - { - if ( Instance != null ) - { - throw new System.Exception( "Only one Facepunch.Steamworks.Server can exist - dispose the old one before trying to create a new one." ); - } - - Instance = this; - native = new Interop.NativeInterface(); - uint ipaddress = 0; // Any Port - - if ( init.SteamPort == 0 ) init.RandomSteamPort(); - if ( init.IpAddress != null ) ipaddress = Utility.IpToInt32( init.IpAddress ); - - // - // Get other interfaces - // - if ( !native.InitServer( this, ipaddress, init.SteamPort, init.GamePort, init.QueryPort, init.Secure ? 3 : 2, init.VersionString ) ) - { - native.Dispose(); - native = null; - Instance = null; - return; - } - - // - // Register Callbacks - // - - SteamNative.Callbacks.RegisterCallbacks( this ); - - // - // Setup interfaces that client and server both have - // - SetupCommonInterfaces(); - - - - // - // Initial settings - // - native.gameServer.EnableHeartbeats( true ); - MaxPlayers = 32; - BotCount = 0; - Product = $"{AppId}"; - ModDir = init.ModDir; - GameDescription = init.GameDescription; - Passworded = false; - DedicatedServer = true; - - // - // Child classes - // - Query = new ServerQuery( this ); - Stats = new ServerStats( this ); - Auth = new ServerAuth( this ); - - // - // Run update, first call does some initialization - // - Update(); - } - - ~Server() - { - Dispose(); - } - - /// - /// Should be called at least once every frame - /// - public override void Update() - { - if ( !IsValid ) - return; - - native.api.SteamGameServer_RunCallbacks(); - - base.Update(); - } - - /// - /// Sets whether this should be marked as a dedicated server. - /// If not, it is assumed to be a listen server. - /// - public bool DedicatedServer - { - get { return _dedicatedServer; } - set { if ( _dedicatedServer == value ) return; native.gameServer.SetDedicatedServer( value ); _dedicatedServer = value; } - } - private bool _dedicatedServer; - - /// - /// Gets or sets the current MaxPlayers. - /// This doesn't enforce any kind of limit, it just updates the master server. - /// - public int MaxPlayers - { - get { return _maxplayers; } - set { if ( _maxplayers == value ) return; native.gameServer.SetMaxPlayerCount( value ); _maxplayers = value; } - } - private int _maxplayers = 0; - - /// - /// Gets or sets the current BotCount. - /// This doesn't enforce any kind of limit, it just updates the master server. - /// - public int BotCount - { - get { return _botcount; } - set { if ( _botcount == value ) return; native.gameServer.SetBotPlayerCount( value ); _botcount = value; } - } - private int _botcount = 0; - - /// - /// Gets or sets the current Map Name. - /// - public string MapName - { - get { return _mapname; } - set { if ( _mapname == value ) return; native.gameServer.SetMapName( value ); _mapname = value; } - } - private string _mapname; - - /// - /// Gets or sets the current ModDir - /// - public string ModDir - { - get { return _modDir; } - internal set { if ( _modDir == value ) return; native.gameServer.SetModDir( value ); _modDir = value; } - } - private string _modDir = ""; - - /// - /// Gets the current product - /// - public string Product - { - get { return _product; } - internal set { if ( _product == value ) return; native.gameServer.SetProduct( value ); _product = value; } - } - private string _product = ""; - - /// - /// Gets or sets the current Product - /// - public string GameDescription - { - get { return _gameDescription; } - internal set { if ( _gameDescription == value ) return; native.gameServer.SetGameDescription( value ); _gameDescription = value; } - } - private string _gameDescription = ""; - - /// - /// Gets or sets the current ServerName - /// - public string ServerName - { - get { return _serverName; } - set { if ( _serverName == value ) return; native.gameServer.SetServerName( value ); _serverName = value; } - } - private string _serverName = ""; - - /// - /// Set whether the server should report itself as passworded - /// - public bool Passworded - { - get { return _passworded; } - set { if ( _passworded == value ) return; native.gameServer.SetPasswordProtected( value ); _passworded = value; } - } - private bool _passworded; - - /// - /// Gets or sets the current GameTags. This is a comma seperated list of tags for this server. - /// When querying the server list you can filter by these tags. - /// - public string GameTags - { - get { return _gametags; } - set { if ( _gametags == value ) return; native.gameServer.SetGameTags( value ); _gametags = value; } - } - private string _gametags = ""; - - /// - /// Log onto Steam anonymously. - /// - public void LogOnAnonymous() - { - native.gameServer.LogOnAnonymous(); - ForceHeartbeat(); - } - - /// - /// Returns true if the server is connected and registered with the Steam master server - /// You should have called LogOnAnonymous etc on startup. - /// - public bool LoggedOn => native.gameServer.BLoggedOn(); - - Dictionary KeyValue = new Dictionary(); - - /// - /// Sets a Key Value. These can be anything you like, and are accessible - /// when querying servers from the server list. - /// - /// Information describing gamemodes are common here. - /// - public void SetKey( string Key, string Value ) - { - if ( KeyValue.ContainsKey( Key ) ) - { - if ( KeyValue[Key] == Value ) - return; - - KeyValue[Key] = Value; - } - else - { - KeyValue.Add( Key, Value ); - } - - native.gameServer.SetKeyValue( Key, Value ); - } - - /// - /// Update this connected player's information. You should really call this - /// any time a player's name or score changes. This keeps the information shown - /// to server queries up to date. - /// - public void UpdatePlayer( ulong steamid, string name, int score ) - { - native.gameServer.BUpdateUserData( steamid, name, (uint) score ); - } - - - /// - /// Shutdown interface, disconnect from Steam - /// - public override void Dispose() - { - if ( disposed ) return; - - if ( Query != null ) - { - Query = null; - } - - if ( Stats != null ) - { - Stats = null; - } - - if ( Auth != null ) - { - Auth = null; - } - - if ( Instance == this ) - { - Instance = null; - } - - base.Dispose(); - } - - /// - /// To the best of its ability this tries to get the server's - /// current public ip address. Be aware that this is likely to return - /// null for the first few seconds after initialization. - /// - public System.Net.IPAddress PublicIp - { - get - { - var ip = native.gameServer.GetPublicIP(); - if ( ip == 0 ) return null; - - return Utility.Int32ToIp( ip ); - } - } - - /// - /// Enable or disable heartbeats, which are sent regularly to the master server. - /// Enabled by default. - /// - public bool AutomaticHeartbeats - { - set { native.gameServer.EnableHeartbeats( value ); } - } - - /// - /// Set heartbeat interval, if automatic heartbeats are enabled. - /// You can leave this at the default. - /// - public int AutomaticHeartbeatRate - { - set { native.gameServer.SetHeartbeatInterval( value ); } - } - - /// - /// Force send a heartbeat to the master server instead of waiting - /// for the next automatic update (if you've left them enabled) - /// - public void ForceHeartbeat() - { - native.gameServer.ForceHeartbeat(); - } - - - } -} diff --git a/Facepunch.Steamworks/Server/Auth.cs b/Facepunch.Steamworks/Server/Auth.cs deleted file mode 100644 index f94cddc..0000000 --- a/Facepunch.Steamworks/Server/Auth.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Facepunch.Steamworks -{ - public class ServerAuth - { - internal Server server; - - /// - /// Steamid, Ownerid, Status - /// - public Action OnAuthChange; - - /// - /// Steam authetication statuses - /// - public enum Status : int - { - OK = 0, - UserNotConnectedToSteam = 1, - NoLicenseOrExpired = 2, - VACBanned = 3, - LoggedInElseWhere = 4, - VACCheckTimedOut = 5, - AuthTicketCanceled = 6, - AuthTicketInvalidAlreadyUsed = 7, - AuthTicketInvalid = 8, - PublisherIssuedBan = 9, - } - - internal ServerAuth( Server s ) - { - server = s; - - server.RegisterCallback( OnAuthTicketValidate ); - } - - void OnAuthTicketValidate( SteamNative.ValidateAuthTicketResponse_t data ) - { - if ( OnAuthChange != null ) - OnAuthChange( data.SteamID, data.OwnerSteamID, (Status) data.AuthSessionResponse ); - } - - /// - /// Start authorizing a ticket. This user isn't authorized yet. Wait for a call to OnAuthChange. - /// - public unsafe bool StartSession( byte[] data, ulong steamid ) - { - fixed ( byte* p = data ) - { - var result = server.native.gameServer.BeginAuthSession( (IntPtr)p, data.Length, steamid ); - - if ( result == SteamNative.BeginAuthSessionResult.OK ) - return true; - - return false; - } - } - - /// - /// Forget this guy. They're no longer in the game. - /// - public void EndSession( ulong steamid ) - { - server.native.gameServer.EndAuthSession( steamid ); - } - - } -} diff --git a/Facepunch.Steamworks/Server/Query.cs b/Facepunch.Steamworks/Server/Query.cs deleted file mode 100644 index 7ae8321..0000000 --- a/Facepunch.Steamworks/Server/Query.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - /// - /// If you're manually processing the server queries, you should use this class. - /// - public class ServerQuery - { - internal Server server; - internal static byte[] buffer = new byte[64*1024]; - - internal ServerQuery( Server s ) - { - server = s; - } - - /// - /// A server query packet. - /// - public struct Packet - { - /// - /// Target IP address - /// - public uint Address { get; internal set; } - - /// - /// Target port - /// - public ushort Port { get; internal set; } - - /// - /// This data is pooled. Make a copy if you don't use it immediately. - /// This buffer is also quite large - so pay attention to Size. - /// - public byte[] Data { get; internal set; } - - /// - /// Size of the data - /// - public int Size { get; internal set; } - } - - /// - /// If true, Steam wants to send a packet. You should respond by sending - /// this packet in an unconnected way to the returned Address and Port. - /// - /// Packet to send. The Data passed is pooled - so use it immediately. - /// True if we want to send a packet - public unsafe bool GetOutgoingPacket( out Packet packet ) - { - packet = new Packet(); - - fixed ( byte* ptr = buffer ) - { - uint addr = 0; - ushort port = 0; - - var size = server.native.gameServer.GetNextOutgoingPacket( (IntPtr)ptr, buffer.Length, out addr, out port ); - if ( size == 0 ) - return false; - - packet.Size = size; - packet.Data = buffer; - packet.Address = addr; - packet.Port = port; - return true; - } - } - - /// - /// We have received a server query on our game port. Pass it to Steam to handle. - /// - public unsafe void Handle( byte[] data, int size, uint address, ushort port ) - { - fixed ( byte* ptr = data ) - { - server.native.gameServer.HandleIncomingPacket( (IntPtr)ptr, size, address, port ); - } - } - - } -} diff --git a/Facepunch.Steamworks/Server/Stats.cs b/Facepunch.Steamworks/Server/Stats.cs deleted file mode 100644 index e30a22d..0000000 --- a/Facepunch.Steamworks/Server/Stats.cs +++ /dev/null @@ -1,146 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using System.Text; - -namespace Facepunch.Steamworks -{ - /// - /// Allows getting and setting stats on users from the gameserver. These stats - /// should have been set up on the Steamworks website for your app. - /// - public class ServerStats - { - internal Server server; - - internal ServerStats( Server s ) - { - server = s; - } - - [StructLayout( LayoutKind.Sequential )] - public struct StatsReceived - { - public int Result; - public ulong SteamId; - } - - /// - /// Retrieve the stats for this user. If you pass a callback function in - /// this will be called when the stats are recieved, the bool will signify whether - /// it was successful or not. - /// - public void Refresh( ulong steamid, Action Callback = null ) - { - if ( Callback == null ) - { - server.native.gameServerStats.RequestUserStats( steamid ); - return; - } - - server.native.gameServerStats.RequestUserStats( steamid, ( o, failed ) => - { - Callback( steamid, o.Result == SteamNative.Result.OK && !failed ); - } ); - } - - /// - /// Once you've set a stat change on a user you need to commit your changes. - /// You can do that using this function. The callback will let you know if - /// your action succeeded, but most of the time you can fire and forget. - /// - public void Commit( ulong steamid, Action Callback = null ) - { - if ( Callback == null ) - { - server.native.gameServerStats.StoreUserStats( steamid ); - return; - } - - server.native.gameServerStats.StoreUserStats( steamid, ( o, failed ) => - { - Callback( steamid, o.Result == SteamNative.Result.OK && !failed ); - } ); - } - - /// - /// Set the named stat for this user. Setting stats should follow the rules - /// you defined in Steamworks. - /// - public bool SetInt( ulong steamid, string name, int stat ) - { - return server.native.gameServerStats.SetUserStat( steamid, name, stat ); - } - - /// - /// Set the named stat for this user. Setting stats should follow the rules - /// you defined in Steamworks. - /// - public bool SetFloat( ulong steamid, string name, float stat ) - { - return server.native.gameServerStats.SetUserStat0( steamid, name, stat ); - } - - /// - /// Get the named stat for this user. If getting the stat failed, will return - /// defaultValue. You should have called Refresh for this userid - which downloads - /// the stats from the backend. If you didn't call it this will always return defaultValue. - /// - public int GetInt( ulong steamid, string name, int defaultValue = 0 ) - { - int data = defaultValue; - - if ( !server.native.gameServerStats.GetUserStat( steamid, name, out data ) ) - return defaultValue; - - return data; - } - - /// - /// Get the named stat for this user. If getting the stat failed, will return - /// defaultValue. You should have called Refresh for this userid - which downloads - /// the stats from the backend. If you didn't call it this will always return defaultValue. - /// - public float GetFloat( ulong steamid, string name, float defaultValue = 0 ) - { - float data = defaultValue; - - if ( !server.native.gameServerStats.GetUserStat0( steamid, name, out data ) ) - return defaultValue; - - return data; - } - - /// - /// Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first. - /// Remember to use Commit after use. - /// - public bool SetAchievement( ulong steamid, string name ) - { - return server.native.gameServerStats.SetUserAchievement( steamid, name ); - } - - /// - /// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. - /// Remember to use Commit after use. - /// - public bool ClearAchievement( ulong steamid, string name ) - { - return server.native.gameServerStats.ClearUserAchievement( steamid, name ); - } - - /// - /// Return true if available, exists and unlocked - /// - public bool GetAchievement( ulong steamid, string name ) - { - bool achieved = false; - - if ( !server.native.gameServerStats.GetUserAchievement( steamid, name, ref achieved ) ) - return false; - - return achieved; - } - } -} diff --git a/Facepunch.Steamworks/ServerList/Base.cs b/Facepunch.Steamworks/ServerList/Base.cs new file mode 100644 index 0000000..4b66225 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/Base.cs @@ -0,0 +1,217 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks.ServerList +{ + public abstract class Base : IDisposable + { + + #region ISteamMatchmakingServers + + static ISteamMatchmakingServers _internal; + internal static ISteamMatchmakingServers Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamMatchmakingServers(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + #endregion + + + /// + /// Which app we're querying. Defaults to the current app. + /// + public AppId AppId { get; set; } + + /// + /// When a new server is added, this function will get called + /// + public event Action OnChanges; + + /// + /// Called for every responsive server + /// + public event Action OnResponsiveServer; + + /// + /// A list of servers that responded. If you're only interested in servers that responded since you + /// last updated, then simply clear this list. + /// + public List Responsive = new List(); + + /// + /// A list of servers that were in the master list but didn't respond. + /// + public List Unresponsive = new List(); + + + public Base() + { + AppId = SteamClient.AppId; // Default AppId is this + } + + /// + /// Query the server list. Task result will be true when finished + /// + /// + public virtual async Task RunQueryAsync( float timeoutSeconds = 10 ) + { + var stopwatch = System.Diagnostics.Stopwatch.StartNew(); + + Reset(); + LaunchQuery(); + + var thisRequest = request; + + while ( IsRefreshing ) + { + await Task.Delay( 33 ); + + // + // The request has been cancelled or changed in some way + // + if ( request.Value == IntPtr.Zero || thisRequest.Value != request.Value ) + return false; + + if ( !SteamClient.IsValid ) + return false; + + var r = Responsive.Count; + + UpdatePending(); + UpdateResponsive(); + + if ( r != Responsive.Count ) + { + InvokeChanges(); + } + + if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds ) + break; + } + + MovePendingToUnresponsive(); + InvokeChanges(); + + return true; + } + + public virtual void Cancel() => Internal.CancelQuery( request ); + + // Overrides + internal abstract void LaunchQuery(); + + internal HServerListRequest request; + + #region Filters + + internal List filters = new List(); + internal virtual MatchMakingKeyValuePair[] GetFilters() => filters.ToArray(); + + public void AddFilter( string key, string value ) + { + filters.Add( new MatchMakingKeyValuePair { Key = key, Value = value } ); + } + + #endregion + + internal int Count => Internal.GetServerCount( request ); + internal bool IsRefreshing => request.Value != IntPtr.Zero && Internal.IsRefreshing( request ); + internal List watchList = new List(); + internal int LastCount = 0; + + void Reset() + { + ReleaseQuery(); + LastCount = 0; + watchList.Clear(); + } + + void ReleaseQuery() + { + if ( request.Value != IntPtr.Zero ) + { + Cancel(); + Internal.ReleaseRequest( request ); + request = IntPtr.Zero; + } + } + + public void Dispose() + { + ReleaseQuery(); + } + + internal void InvokeChanges() + { + OnChanges?.Invoke(); + } + + void UpdatePending() + { + var count = Count; + if ( count == LastCount ) return; + + for ( int i = LastCount; i < count; i++ ) + { + watchList.Add( i ); + } + + LastCount = count; + } + + public void UpdateResponsive() + { + watchList.RemoveAll( x => + { + var info = Internal.GetServerDetails( request, x ); + if ( info.HadSuccessfulResponse ) + { + OnServer( ServerInfo.From( info ), info.HadSuccessfulResponse ); + return true; + } + + return false; + } ); + } + + void MovePendingToUnresponsive() + { + watchList.RemoveAll( x => + { + var info = Internal.GetServerDetails( request, x ); + OnServer( ServerInfo.From( info ), info.HadSuccessfulResponse ); + return true; + } ); + } + + private void OnServer( ServerInfo serverInfo, bool responded ) + { + if ( responded ) + { + Responsive.Add( serverInfo ); + OnResponsiveServer?.Invoke( serverInfo ); + return; + } + + Unresponsive.Add( serverInfo ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/Favourites.cs b/Facepunch.Steamworks/ServerList/Favourites.cs new file mode 100644 index 0000000..6f1ffa3 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/Favourites.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class Favourites : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestFavoritesServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/Friends.cs b/Facepunch.Steamworks/ServerList/Friends.cs new file mode 100644 index 0000000..eb66a69 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/Friends.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class Friends : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestFriendsServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/History.cs b/Facepunch.Steamworks/ServerList/History.cs new file mode 100644 index 0000000..55ccc16 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/History.cs @@ -0,0 +1,17 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class History : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + request = Internal.RequestHistoryServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/Internet.cs b/Facepunch.Steamworks/ServerList/Internet.cs new file mode 100644 index 0000000..abb2fd0 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/Internet.cs @@ -0,0 +1,18 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class Internet : Base + { + internal override void LaunchQuery() + { + var filters = GetFilters(); + + request = Internal.RequestInternetServerList( AppId.Value, ref filters, (uint)filters.Length, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/IpList.cs b/Facepunch.Steamworks/ServerList/IpList.cs new file mode 100644 index 0000000..c76e88c --- /dev/null +++ b/Facepunch.Steamworks/ServerList/IpList.cs @@ -0,0 +1,72 @@ +using Steamworks.Data; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class IpList : Internet + { + public List Ips = new List(); + bool wantsCancel; + + public IpList( IEnumerable list ) + { + Ips.AddRange( list ); + } + + public IpList( params string[] list ) + { + Ips.AddRange( list ); + } + + public override async Task RunQueryAsync( float timeoutSeconds = 10 ) + { + int blockSize = 16; + int pointer = 0; + + var ips = Ips.ToArray(); + + while ( true ) + { + var sublist = ips.Skip( pointer ).Take( blockSize ); + if ( sublist.Count() == 0 ) + break; + + using ( var list = new ServerList.Internet() ) + { + list.AddFilter( "or", sublist.Count().ToString() ); + + foreach ( var server in sublist ) + { + list.AddFilter( "gameaddr", server ); + } + + await list.RunQueryAsync( timeoutSeconds ); + + if ( wantsCancel ) + return false; + + Responsive.AddRange( list.Responsive ); + Responsive = Responsive.Distinct().ToList(); + Unresponsive.AddRange( list.Unresponsive ); + Unresponsive = Unresponsive.Distinct().ToList(); + } + + pointer += sublist.Count(); + + InvokeChanges(); + } + + return true; + } + + public override void Cancel() + { + wantsCancel = true; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/ServerList/LocalNetwork.cs b/Facepunch.Steamworks/ServerList/LocalNetwork.cs new file mode 100644 index 0000000..7468873 --- /dev/null +++ b/Facepunch.Steamworks/ServerList/LocalNetwork.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.ServerList +{ + public class LocalNetwork : Base + { + internal override void LaunchQuery() + { + request = Internal.RequestLANServerList( AppId.Value, IntPtr.Zero ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamApps.cs b/Facepunch.Steamworks/SteamApps.cs new file mode 100644 index 0000000..b01210f --- /dev/null +++ b/Facepunch.Steamworks/SteamApps.cs @@ -0,0 +1,285 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Exposes a wide range of information and actions for applications and Downloadable Content (DLC). + /// + public static class SteamApps + { + static ISteamApps _internal; + internal static ISteamApps Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamApps(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + DlcInstalled_t.Install( x => OnDlcInstalled?.Invoke( x.AppID ) ); + NewUrlLaunchParameters_t.Install( x => OnNewLaunchParameters?.Invoke() ); + } + + /// + /// posted after the user gains ownership of DLC and that DLC is installed + /// + public static event Action OnDlcInstalled; + + /// + /// posted after the user gains executes a Steam URL with command line or query parameters + /// such as steam://run/appid//-commandline/?param1=value1(and)param2=value2(and)param3=value3 etc + /// while the game is already running. The new params can be queried + /// with GetLaunchQueryParam and GetLaunchCommandLine + /// + public static event Action OnNewLaunchParameters; + + /// + /// Checks if the active user is subscribed to the current App ID + /// + public static bool IsSubscribed => Internal.BIsSubscribed(); + + /// + /// Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID + /// + public static bool IsSubscribedFromFamilySharing => Internal.BIsSubscribedFromFamilySharing(); + + /// + /// Checks if the license owned by the user provides low violence depots. + /// Low violence depots are useful for copies sold in countries that have content restrictions + /// + public static bool IsLowVoilence => Internal.BIsLowViolence(); + + /// + /// Checks whether the current App ID license is for Cyber Cafes. + /// + public static bool IsCybercafe => Internal.BIsCybercafe(); + + /// + /// CChecks if the user has a VAC ban on their account + /// + public static bool IsVACBanned => Internal.BIsVACBanned(); + + /// + /// Gets the current language that the user has set. + /// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title. + /// + public static string GameLanguage => Internal.GetCurrentGameLanguage(); + + /// + /// Gets a list of the languages the current app supports. + /// + public static string[] AvailableLanguages => Internal.GetAvailableGameLanguages().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); + + /// + /// Checks if the active user is subscribed to a specified AppId. + /// Only use this if you need to check ownership of another game related to yours, a demo for example. + /// + public static bool IsSubscribedToApp( AppId appid ) => Internal.BIsSubscribedApp( appid.Value ); + + /// + /// Checks if the user owns a specific DLC and if the DLC is installed + /// + public static bool IsDlcInstalled( AppId appid ) => Internal.BIsDlcInstalled( appid.Value ); + + /// + /// Returns the time of the purchase of the app + /// + public static DateTime PurchaseTime( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + return Epoch.ToDateTime(Internal.GetEarliestPurchaseUnixTime(appid.Value ) ); + } + + /// + /// Checks if the user is subscribed to the current app through a free weekend + /// This function will return false for users who have a retail or other type of license + /// Before using, please ask your Valve technical contact how to package and secure your free weekened + /// + public static bool IsSubscribedFromFreeWeekend => Internal.BIsSubscribedFromFreeWeekend(); + + /// + /// Returns metadata for all available DLC + /// + public static IEnumerable DlcInformation() + { + var appid = default( AppId ); + var available = false; + + for ( int i = 0; i < Internal.GetDLCCount(); i++ ) + { + if ( !Internal.BGetDLCDataByIndex( i, ref appid, ref available, out var strVal ) ) + continue; + + yield return new DlcInformation + { + AppId = appid.Value, + Name = strVal, + Available = available + }; + } + } + + /// + /// Install/Uninstall control for optional DLC + /// + public static void InstallDlc( AppId appid ) => Internal.InstallDLC( appid.Value ); + + /// + /// Install/Uninstall control for optional DLC + /// + public static void UninstallDlc( AppId appid ) => Internal.UninstallDLC( appid.Value ); + + /// + /// Returns null if we're not on a beta branch, else the name of the branch + /// + public static string CurrentBetaName + { + get + { + if ( !Internal.GetCurrentBetaName( out var strVal ) ) + return null; + + return strVal; + } + } + + /// + /// Allows you to force verify game content on next launch. + /// + /// If you detect the game is out-of-date(for example, by having the client detect a version mismatch with a server), + /// you can call use MarkContentCorrupt to force a verify, show a message to the user, and then quit. + /// + public static void MarkContentCorrupt( bool missingFilesOnly ) => Internal.MarkContentCorrupt( missingFilesOnly ); + + /// + /// Gets a list of all installed depots for a given App ID in mount order + /// + public static IEnumerable InstalledDepots( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + var depots = new DepotId_t[32]; + uint count = 0; + + count = Internal.GetInstalledDepots( appid.Value, depots, (uint) depots.Length ); + + for ( int i = 0; i < count; i++ ) + { + yield return new DepotId { Value = depots[i].Value }; + } + } + + /// + /// Gets the install folder for a specific AppID. + /// This works even if the application is not installed, based on where the game would be installed with the default Steam library location. + /// + public static string AppInstallDir( AppId appid = default ) + { + if ( appid == 0 ) + appid = SteamClient.AppId; + + if ( Internal.GetAppInstallDir( appid.Value, out var strVal ) == 0 ) + return null; + + return strVal; + } + + /// + /// The app may not actually be owned by the current user, they may have it left over from a free weekend, etc. + /// + public static bool IsAppInstalled( AppId appid ) => Internal.BIsAppInstalled( appid.Value ); + + /// + /// Gets the Steam ID of the original owner of the current app. If it's different from the current user then it is borrowed.. + /// + public static SteamId AppOwner => Internal.GetAppOwner().Value; + + /// + /// Gets the associated launch parameter if the game is run via steam://run/appid/?param1=value1;param2=value2;param3=value3 etc. + /// Parameter names starting with the character '@' are reserved for internal use and will always return an empty string. + /// Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, + /// but it is advised that you not param names beginning with an underscore for your own features. + /// + public static string GetLaunchParam( string param ) => Internal.GetLaunchQueryParam( param ); + + /// + /// Gets the download progress for optional DLC. + /// + public static DownloadProgress DlcDownloadProgress( AppId appid ) + { + ulong punBytesDownloaded = 0; + ulong punBytesTotal = 0; + + if ( !Internal.GetDlcDownloadProgress( appid.Value, ref punBytesDownloaded, ref punBytesTotal ) ) + return default( DownloadProgress ); + + return new DownloadProgress { BytesDownloaded = punBytesDownloaded, BytesTotal = punBytesTotal, Active = true }; + } + + /// + /// Gets the buildid of this app, may change at any time based on backend updates to the game. + /// Defaults to 0 if you're not running a build downloaded from steam. + /// + public static int BuildId => Internal.GetAppBuildId(); + + + /// + /// Asynchronously retrieves metadata details about a specific file in the depot manifest. + /// Currently provides: + /// + public static async Task GetFileDetailsAsync( string filename ) + { + var r = await Internal.GetFileDetails( filename ); + + if ( !r.HasValue || r.Value.Result != Result.OK ) + return null; + + return new FileDetails + { + SizeInBytes = r.Value.FileSize, + Flags = r.Value.Flags, + Sha1 = string.Join( "", r.Value.FileSHA.Select( x => x.ToString( "x" ) ) ) + }; + } + + /// + /// Get command line if game was launched via Steam URL, e.g. steam://run/appid//command line/. + /// This method of passing a connect string (used when joining via rich presence, accepting an + /// invite, etc) is preferable to passing the connect string on the operating system command + /// line, which is a security risk. In order for rich presence joins to go through this + /// path and not be placed on the OS command line, you must set a value in your app's + /// configuration on Steam. Ask Valve for help with this. + /// + public static string CommandLine + { + get + { + var len = Internal.GetLaunchCommandLine( out var strVal ); + return strVal; + } + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamClient.cs b/Facepunch.Steamworks/SteamClient.cs new file mode 100644 index 0000000..e7fd15c --- /dev/null +++ b/Facepunch.Steamworks/SteamClient.cs @@ -0,0 +1,214 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamClient + { + static bool initialized; + + /// + /// Initialize the steam client. + /// If asyncCallbacks is false you need to call RunCallbacks manually every frame. + /// + public static void Init( uint appid, bool asyncCallbacks = true ) + { + System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + + if ( !SteamAPI.Init() ) + { + throw new System.Exception( "SteamApi_Init returned false. Steam isn't running, couldn't find Steam, AppId is ureleased, Don't own AppId." ); + } + + AppId = appid; + + initialized = true; + + SteamApps.InstallEvents(); + SteamUtils.InstallEvents(); + SteamParental.InstallEvents(); + SteamMusic.InstallEvents(); + SteamVideo.InstallEvents(); + SteamUser.InstallEvents(); + SteamFriends.InstallEvents(); + SteamScreenshots.InstallEvents(); + SteamUserStats.InstallEvents(); + SteamInventory.InstallEvents(); + SteamNetworking.InstallEvents(); + SteamMatchmaking.InstallEvents(); + SteamParties.InstallEvents(); + SteamNetworkingSockets.InstallEvents(); + SteamInput.InstallEvents(); + SteamUGC.InstallEvents(); + + if ( asyncCallbacks ) + { + RunCallbacksAsync(); + } + } + + static List openIterfaces = new List(); + + internal static void WatchInterface( SteamInterface steamInterface ) + { + if ( openIterfaces.Contains( steamInterface ) ) + throw new System.Exception( "openIterfaces already contains interface!" ); + + openIterfaces.Add( steamInterface ); + } + + internal static void ShutdownInterfaces() + { + foreach ( var e in openIterfaces ) + { + e.Shutdown(); + } + + openIterfaces.Clear(); + } + + public static Action OnCallbackException; + + public static bool IsValid => initialized; + + internal static async void RunCallbacksAsync() + { + while ( IsValid ) + { + await Task.Delay( 16 ); + + try + { + RunCallbacks(); + } + catch ( System.Exception e ) + { + OnCallbackException?.Invoke( e ); + } + } + } + + public static void Shutdown() + { + if ( !IsValid ) return; + + SteamInput.Shutdown(); + + Cleanup(); + + SteamAPI.Shutdown(); + } + + internal static void Cleanup() + { + initialized = false; + + Event.DisposeAllClient(); + ShutdownInterfaces(); + + SteamInput.Shutdown(); + SteamApps.Shutdown(); + SteamUtils.Shutdown(); + SteamParental.Shutdown(); + SteamMusic.Shutdown(); + SteamVideo.Shutdown(); + SteamUser.Shutdown(); + SteamFriends.Shutdown(); + SteamScreenshots.Shutdown(); + SteamUserStats.Shutdown(); + SteamInventory.Shutdown(); + SteamNetworking.Shutdown(); + SteamMatchmaking.Shutdown(); + SteamParties.Shutdown(); + SteamNetworkingUtils.Shutdown(); + SteamNetworkingSockets.Shutdown(); + ServerList.Base.Shutdown(); + } + + internal static void RegisterCallback( IntPtr intPtr, int callbackId ) + { + SteamAPI.RegisterCallback( intPtr, callbackId ); + } + + public static void RunCallbacks() + { + if ( !IsValid ) return; + + SteamAPI.RunCallbacks(); + } + + internal static void UnregisterCallback( IntPtr intPtr ) + { + SteamAPI.UnregisterCallback( intPtr ); + } + + /// + /// Checks if the current user's Steam client is connected to the Steam servers. + /// If it's not then no real-time services provided by the Steamworks API will be enabled. The Steam + /// client will automatically be trying to recreate the connection as often as possible. When the + /// connection is restored a SteamServersConnected_t callback will be posted. + /// You usually don't need to check for this yourself. All of the API calls that rely on this will + /// check internally. Forcefully disabling stuff when the player loses access is usually not a + /// very good experience for the player and you could be preventing them from accessing APIs that do not + /// need a live connection to Steam. + /// + public static bool IsLoggedOn => SteamUser.Internal.BLoggedOn(); + + /// + /// Gets the Steam ID of the account currently logged into the Steam client. This is + /// commonly called the 'current user', or 'local user'. + /// A Steam ID is a unique identifier for a Steam accounts, Steam groups, Lobbies and Chat + /// rooms, and used to differentiate users in all parts of the Steamworks API. + /// + public static SteamId SteamId => SteamUser.Internal.GetSteamID(); + + /// + /// returns the local players name - guaranteed to not be NULL. + /// this is the same name as on the users community profile page + /// + public static string Name => SteamFriends.Internal.GetPersonaName(); + + /// + /// gets the status of the current user + /// + public static FriendState State => SteamFriends.Internal.GetPersonaState(); + + /// + /// returns the appID of the current process + /// + public static AppId AppId { get; internal set; } + + /// + /// Checks if your executable was launched through Steam and relaunches it through Steam if it wasn't + /// this returns true then it starts the Steam client if required and launches your game again through it, + /// and you should quit your process as soon as possible. This effectively runs steam://run/AppId so it + /// may not relaunch the exact executable that called it, as it will always relaunch from the version + /// installed in your Steam library folder/ + /// Note that during development, when not launching via Steam, this might always return true. + /// + public static bool RestartAppIfNecessary( uint appid ) + { + // Having these here would probably mean it always returns false? + + //System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + //System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + + return SteamAPI.RestartAppIfNecessary( appid ); + } + + /// + /// Called in interfaces that rely on this being initialized + /// + internal static void ValidCheck() + { + if ( !IsValid ) + throw new System.Exception( "SteamClient isn't initialized" ); + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamFriends.cs b/Facepunch.Steamworks/SteamFriends.cs new file mode 100644 index 0000000..8be5d34 --- /dev/null +++ b/Facepunch.Steamworks/SteamFriends.cs @@ -0,0 +1,302 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamFriends + { + static ISteamFriends _internal; + internal static ISteamFriends Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamFriends(); + _internal.Init(); + + richPresence = new Dictionary(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + static Dictionary richPresence; + + internal static void InstallEvents() + { + FriendStateChange_t.Install( x => OnPersonaStateChange?.Invoke( new Friend( x.SteamID ) ) ); + GameRichPresenceJoinRequested_t.Install( x => OnGameRichPresenceJoinRequested?.Invoke( new Friend( x.SteamIDFriend), x.ConnectUTF8() ) ); + GameConnectedFriendChatMsg_t.Install( OnFriendChatMessage ); + GameOverlayActivated_t.Install( x => OnGameOverlayActivated?.Invoke() ); + GameServerChangeRequested_t.Install( x => OnGameServerChangeRequested?.Invoke( x.ServerUTF8(), x.PasswordUTF8() ) ); + GameLobbyJoinRequested_t.Install( x => OnGameLobbyJoinRequested?.Invoke( new Lobby( x.SteamIDLobby ), x.SteamIDFriend ) ); + FriendRichPresenceUpdate_t.Install( x => OnFriendRichPresenceUpdate?.Invoke( new Friend( x.SteamIDFriend ) ) ); + } + + /// + /// Called when chat message has been received from a friend. You'll need to turn on + /// ListenForFriendsMessages to recieve this. (friend, msgtype, message) + /// + public static event Action OnChatMessage; + + /// + /// called when a friends' status changes + /// + public static event Action OnPersonaStateChange; + + + /// + /// Called when the user tries to join a game from their friends list + /// rich presence will have been set with the "connect" key which is set here + /// + public static event Action OnGameRichPresenceJoinRequested; + + /// + /// Posted when game overlay activates or deactivates + /// the game can use this to be pause or resume single player games + /// + public static event Action OnGameOverlayActivated; + + /// + /// Called when the user tries to join a different game server from their friends list + /// game client should attempt to connect to specified server when this is received + /// + public static event Action OnGameServerChangeRequested; + + /// + /// Called when the user tries to join a lobby from their friends list + /// game client should attempt to connect to specified lobby when this is received + /// + public static event Action OnGameLobbyJoinRequested; + + /// + /// Callback indicating updated data about friends rich presence information + /// + public static event Action OnFriendRichPresenceUpdate; + + static unsafe void OnFriendChatMessage( GameConnectedFriendChatMsg_t data ) + { + if ( OnChatMessage == null ) return; + + var friend = new Friend( data.SteamIDUser ); + + var buffer = Helpers.TakeBuffer( 1024 * 32 ); + var type = ChatEntryType.ChatMsg; + + fixed ( byte* ptr = buffer ) + { + var len = Internal.GetFriendMessage( data.SteamIDUser, data.MessageID, (IntPtr)ptr, buffer.Length, ref type ); + + if ( len == 0 && type == ChatEntryType.Invalid ) + return; + + var typeName = type.ToString(); + var message = Encoding.UTF8.GetString( buffer, 0, len ); + + OnChatMessage( friend, typeName, message ); + } + } + + public static IEnumerable GetFriendsWithFlag(FriendFlags flag) + { + for ( int i=0; i GetFriends() + { + return GetFriendsWithFlag(FriendFlags.Immediate); + } + + public static IEnumerable GetBlocked() + { + return GetFriendsWithFlag(FriendFlags.Blocked); + } + + public static IEnumerable GetPlayedWith() + { + for ( int i = 0; i < Internal.GetCoplayFriendCount(); i++ ) + { + yield return new Friend( Internal.GetCoplayFriend( i ) ); + } + } + + public static IEnumerable GetFromSource( SteamId steamid ) + { + for ( int i = 0; i < Internal.GetFriendCountFromSource( steamid ); i++ ) + { + yield return new Friend( Internal.GetFriendFromSourceByIndex( steamid, i ) ); + } + } + + /// + /// The dialog to open. Valid options are: + /// "friends", + /// "community", + /// "players", + /// "settings", + /// "officialgamegroup", + /// "stats", + /// "achievements". + /// + public static void OpenOverlay( string type ) => Internal.ActivateGameOverlay( type ); + + /// + /// "steamid" - Opens the overlay web browser to the specified user or groups profile. + /// "chat" - Opens a chat window to the specified user, or joins the group chat. + /// "jointrade" - Opens a window to a Steam Trading session that was started with the ISteamEconomy/StartTrade Web API. + /// "stats" - Opens the overlay web browser to the specified user's stats. + /// "achievements" - Opens the overlay web browser to the specified user's achievements. + /// "friendadd" - Opens the overlay in minimal mode prompting the user to add the target user as a friend. + /// "friendremove" - Opens the overlay in minimal mode prompting the user to remove the target friend. + /// "friendrequestaccept" - Opens the overlay in minimal mode prompting the user to accept an incoming friend invite. + /// "friendrequestignore" - Opens the overlay in minimal mode prompting the user to ignore an incoming friend invite. + /// + public static void OpenUserOverlay( SteamId id, string type ) => Internal.ActivateGameOverlayToUser( type, id ); + + /// + /// Activates the Steam Overlay to the Steam store page for the provided app. + /// + public static void OpenStoreOverlay( AppId id ) => Internal.ActivateGameOverlayToStore( id.Value, OverlayToStoreFlag.None ); + + /// + /// Activates Steam Overlay web browser directly to the specified URL. + /// + public static void OpenWebOverlay( string url, bool modal = false ) => Internal.ActivateGameOverlayToWebPage( url, modal ? ActivateGameOverlayToWebPageMode.Modal : ActivateGameOverlayToWebPageMode.Default ); + + /// + /// Activates the Steam Overlay to open the invite dialog. Invitations sent from this dialog will be for the provided lobby. + /// + public static void OpenGameInviteOverlay( SteamId lobby ) => Internal.ActivateGameOverlayInviteDialog( lobby ); + + /// + /// Mark a target user as 'played with'. + /// NOTE: The current user must be in game with the other player for the association to work. + /// + public static void SetPlayedWith( SteamId steamid ) => Internal.SetPlayedWith( steamid ); + + /// + /// Requests the persona name and optionally the avatar of a specified user. + /// NOTE: It's a lot slower to download avatars and churns the local cache, so if you don't need avatars, don't request them. + /// returns true if we're fetching the data, false if we already have it + /// + public static bool RequestUserInformation( SteamId steamid, bool nameonly = true ) => Internal.RequestUserInformation( steamid, nameonly ); + + + internal static async Task CacheUserInformationAsync( SteamId steamid, bool nameonly ) + { + // Got it straight away, skip any waiting. + if ( !RequestUserInformation( steamid, nameonly ) ) + return; + + await Task.Delay( 100 ); + + while ( RequestUserInformation( steamid, nameonly ) ) + { + await Task.Delay( 50 ); + } + + // + // And extra wait here seems to solve avatars loading as [?] + // + await Task.Delay( 500 ); + } + + public static async Task GetSmallAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + return SteamUtils.GetImage( Internal.GetSmallFriendAvatar( steamid ) ); + } + + public static async Task GetMediumAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + return SteamUtils.GetImage( Internal.GetMediumFriendAvatar( steamid ) ); + } + + public static async Task GetLargeAvatarAsync( SteamId steamid ) + { + await CacheUserInformationAsync( steamid, false ); + + var imageid = Internal.GetLargeFriendAvatar( steamid ); + + // Wait for the image to download + while ( imageid == -1 ) + { + await Task.Delay( 50 ); + imageid = Internal.GetLargeFriendAvatar( steamid ); + } + + return SteamUtils.GetImage( imageid ); + } + + /// + /// Find a rich presence value by key for current user. Will be null if not found. + /// + public static string GetRichPresence( string key ) + { + if ( richPresence.TryGetValue( key, out var val ) ) + return val; + + return null; + } + + /// + /// Sets a rich presence value by key for current user. + /// + public static bool SetRichPresence( string key, string value ) + { + bool success = Internal.SetRichPresence( key, value ); + + if ( success ) + richPresence[key] = value; + + return success; + } + + /// + /// Clears all of the current user's rich presence data. + /// + public static void ClearRichPresence() + { + richPresence.Clear(); + Internal.ClearRichPresence(); + } + + static bool _listenForFriendsMessages; + + /// + /// Listens for Steam friends chat messages. + /// You can then show these chats inline in the game. For example with a Blizzard style chat message system or the chat system in Dota 2. + /// After enabling this you will receive callbacks when ever the user receives a chat message. + /// + public static bool ListenForFriendsMessages + { + get => _listenForFriendsMessages; + + set + { + _listenForFriendsMessages = value; + Internal.SetListenForFriendsMessages( value ); + } + } + + } +} diff --git a/Facepunch.Steamworks/SteamInput.cs b/Facepunch.Steamworks/SteamInput.cs new file mode 100644 index 0000000..5d897dc --- /dev/null +++ b/Facepunch.Steamworks/SteamInput.cs @@ -0,0 +1,129 @@ +using Steamworks.Data; +using System.Collections.Generic; + +namespace Steamworks +{ + public static class SteamInput + { + internal const int STEAM_CONTROLLER_MAX_COUNT = 16; + + static ISteamInput _internal; + internal static ISteamInput Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamInput(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + if ( _internal != null && _internal.IsValid ) + { + _internal.DoShutdown(); + } + + _internal = null; + } + + internal static void InstallEvents() + { + Internal.DoInit(); + Internal.RunFrame(); + + // None? + } + + /// + /// You shouldn't really need to call this because it get called by RunCallbacks on SteamClient + /// but Valve think it might be a nice idea if you call it right before you get input info - + /// just to make sure the info you're getting is 100% up to date. + /// + public static void RunFrame() + { + Internal.RunFrame(); + } + + static InputHandle_t[] queryArray = new InputHandle_t[STEAM_CONTROLLER_MAX_COUNT]; + + /// + /// Return a list of connected controllers. + /// + public static IEnumerable Controllers + { + get + { + var num = Internal.GetConnectedControllers( queryArray ); + + for ( int i = 0; i < num; i++ ) + { + yield return new Controller( queryArray[i] ); + } + } + } + + + /// + /// Return an absolute path to the PNG image glyph for the provided digital action name. The current + /// action set in use for the controller will be used for the lookup. You should cache the result and + /// maintain your own list of loaded PNG assets. + /// + /// + /// + /// + public static string GetDigitalActionGlyph( Controller controller, string action ) + { + InputActionOrigin origin = InputActionOrigin.None; + + Internal.GetDigitalActionOrigins( + controller.Handle, + Internal.GetCurrentActionSet(controller.Handle), + GetDigitalActionHandle(action), + ref origin + ); + + return Internal.GetGlyphForActionOrigin(origin); + } + + internal static Dictionary DigitalHandles = new Dictionary(); + internal static InputDigitalActionHandle_t GetDigitalActionHandle( string name ) + { + if ( DigitalHandles.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetDigitalActionHandle( name ); + DigitalHandles.Add( name, val ); + return val; + } + + internal static Dictionary AnalogHandles = new Dictionary(); + internal static InputAnalogActionHandle_t GetAnalogActionHandle( string name ) + { + if ( AnalogHandles.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetAnalogActionHandle( name ); + AnalogHandles.Add( name, val ); + return val; + } + + internal static Dictionary ActionSets = new Dictionary(); + internal static InputActionSetHandle_t GetActionSetHandle( string name ) + { + if ( ActionSets.TryGetValue( name, out var val ) ) + return val; + + val = Internal.GetActionSetHandle( name ); + ActionSets.Add( name, val ); + return val; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamInventory.cs b/Facepunch.Steamworks/SteamInventory.cs new file mode 100644 index 0000000..784db4a --- /dev/null +++ b/Facepunch.Steamworks/SteamInventory.cs @@ -0,0 +1,372 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamInventory + { + static ISteamInventory _internal; + internal static ISteamInventory Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamInventory(); + _internal.Init(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + SteamInventoryFullUpdate_t.Install( x => InventoryUpdated( x ) ); + SteamInventoryDefinitionUpdate_t.Install( x => LoadDefinitions() ); + SteamInventoryDefinitionUpdate_t.Install( x => LoadDefinitions(), true ); + } + + private static void InventoryUpdated( SteamInventoryFullUpdate_t x ) + { + var r = new InventoryResult( x.Handle, false ); + Items = r.GetItems( false ); + + OnInventoryUpdated?.Invoke( r ); + } + + public static event Action OnInventoryUpdated; + public static event Action OnDefinitionsUpdated; + + static void LoadDefinitions() + { + Definitions = GetDefinitions(); + + if ( Definitions == null ) + return; + + _defMap = new Dictionary(); + + foreach ( var d in Definitions ) + { + _defMap[d.Id] = d; + } + + OnDefinitionsUpdated?.Invoke(); + } + + + /// + /// Call this if you're going to want to access definition information. You should be able to get + /// away with calling this once at the start if your game, assuming your items don't change all the time. + /// This will trigger OnDefinitionsUpdated at which point Definitions should be set. + /// + public static void LoadItemDefinitions() + { + // If they're null, try to load them immediately + // my hunch is that this loads a disk cached version + // but waiting for LoadItemDefinitions downloads a new copy + // from Steam's servers. So this will give us immediate data + // where as Steam's inventory servers could be slow/down + if ( Definitions == null ) + { + LoadDefinitions(); + } + + Internal.LoadItemDefinitions(); + } + + /// + /// Will call LoadItemDefinitions and wait until Definitions is not null + /// + public static async Task WaitForDefinitions( float timeoutSeconds = 30 ) + { + if ( Definitions != null ) + return true; + + LoadDefinitions(); + LoadItemDefinitions(); + + if ( Definitions != null ) + return true; + + var sw = Stopwatch.StartNew(); + + while ( Definitions == null ) + { + if ( sw.Elapsed.TotalSeconds > timeoutSeconds ) + return false; + + await Task.Delay( 10 ); + } + + return true; + } + + /// + /// Try to find the definition that matches this definition ID. + /// Uses a dictionary so should be about as fast as possible. + /// + public static InventoryDef FindDefinition( InventoryDefId defId ) + { + if ( _defMap == null ) + return null; + + if ( _defMap.TryGetValue( defId, out var val ) ) + return val; + + return null; + } + + public static string Currency { get; internal set; } + + public static async Task GetDefinitionsWithPricesAsync() + { + var priceRequest = await Internal.RequestPrices(); + if ( !priceRequest.HasValue || priceRequest.Value.Result != Result.OK ) + return null; + + Currency = priceRequest?.CurrencyUTF8(); + + var num = Internal.GetNumItemsWithPrices(); + + if ( num <= 0 ) + return null; + + var defs = new InventoryDefId[num]; + var currentPrices = new ulong[num]; + var baseprices = new ulong[num]; + + var gotPrices = Internal.GetItemsWithPrices( defs, currentPrices, baseprices, num ); + if ( !gotPrices ) + return null; + + return defs.Select( x => new InventoryDef( x ) ).ToArray(); + } + + /// + /// We will try to keep this list of your items automatically up to date. + /// + public static InventoryItem[] Items { get; internal set; } + + public static InventoryDef[] Definitions { get; internal set; } + static Dictionary _defMap; + + internal static InventoryDef[] GetDefinitions() + { + uint num = 0; + if ( !Internal.GetItemDefinitionIDs( null, ref num ) ) + return null; + + var defs = new InventoryDefId[num]; + + if ( !Internal.GetItemDefinitionIDs( defs, ref num ) ) + return null; + + return defs.Select( x => new InventoryDef( x ) ).ToArray(); + } + + /// + /// Update the list of Items[] + /// + public static bool GetAllItems() + { + var sresult = default( SteamInventoryResult_t ); + return Internal.GetAllItems( ref sresult ); + } + + /// + /// Get all items and return the InventoryResult + /// + public static async Task GetAllItemsAsync() + { + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.GetAllItems( ref sresult ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// This is used to grant a specific item to the user. This should + /// only be used for development prototyping, from a trusted server, + /// or if you don't care about hacked clients granting arbitrary items. + /// This call can be disabled by a setting on Steamworks. + /// + public static async Task GenerateItemAsync( InventoryDef target, int amount ) + { + var sresult = default( SteamInventoryResult_t ); + + var defs = new InventoryDefId[] { target.Id }; + var cnts = new uint[] { (uint)amount }; + + if ( !Internal.GenerateItems( ref sresult, defs, cnts, 1 ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Crafting! Uses the passed items to buy the target item. + /// You need to have set up the appropriate exchange rules in your item + /// definitions. This assumes all the items passed in aren't stacked. + /// + public static async Task CraftItemAsync( InventoryItem[] list, InventoryDef target ) + { + var sresult = default( SteamInventoryResult_t ); + + var give = new InventoryDefId[] { target.Id }; + var givec = new uint[] { 1 }; + + var sell = list.Select( x => x.Id ).ToArray(); + var sellc = list.Select( x => (uint)1 ).ToArray(); + + if ( !Internal.ExchangeItems( ref sresult, give, givec, 1, sell, sellc, (uint)sell.Length ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Crafting! Uses the passed items to buy the target item. + /// You need to have set up the appropriate exchange rules in your item + /// definitions. This assumes all the items passed in aren't stacked. + /// + public static async Task CraftItemAsync( InventoryItem.Amount[] list, InventoryDef target ) + { + var sresult = default( SteamInventoryResult_t ); + + var give = new InventoryDefId[] { target.Id }; + var givec = new uint[] { 1 }; + + var sell = list.Select( x => x.Item.Id ).ToArray(); + var sellc = list.Select( x => (uint) x.Quantity ).ToArray(); + + if ( !Internal.ExchangeItems( ref sresult, give, givec, 1, sell, sellc, (uint)sell.Length ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Deserializes a result set and verifies the signature bytes. + /// This call has a potential soft-failure mode where the Result is expired, it will + /// still succeed in this mode.The "expired" + /// result could indicate that the data may be out of date - not just due to timed + /// expiration( one hour ), but also because one of the items in the result set may + /// have been traded or consumed since the result set was generated.You could compare + /// the timestamp from GetResultTimestamp to ISteamUtils::GetServerRealTime to determine + /// how old the data is. You could simply ignore the "expired" result code and + /// continue as normal, or you could request the player with expired data to send + /// an updated result set. + /// You should call CheckResultSteamID on the result handle when it completes to verify + /// that a remote player is not pretending to have a different user's inventory. + /// + public static async Task DeserializeAsync( byte[] data, int dataLength = -1 ) + { + if ( data == null ) + throw new ArgumentException( "data should not be null" ); + + if ( dataLength == -1 ) + dataLength = data.Length; + + var ptr = Marshal.AllocHGlobal( dataLength ); + + try + { + Marshal.Copy( data, 0, ptr, dataLength ); + + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.DeserializeResult( ref sresult, (IntPtr)ptr, (uint)dataLength, false ) ) + return null; + + + + return await InventoryResult.GetAsync( sresult.Value ); + } + finally + { + Marshal.FreeHGlobal( ptr ); + } + } + + + /// + /// Grant all promotional items the user is eligible for + /// + public static async Task GrantPromoItemsAsync() + { + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.GrantPromoItems( ref sresult ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + /// + /// Trigger an item drop for this user. This is for timed drops. + /// + public static async Task TriggerItemDropAsync( InventoryDefId id ) + { + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.TriggerItemDrop( ref sresult, id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Trigger a promo item drop. You can call this at startup, it won't + /// give users multiple promo drops. + /// + public static async Task AddPromoItemAsync( InventoryDefId id ) + { + var sresult = default( SteamInventoryResult_t ); + + if ( !Internal.AddPromoItem( ref sresult, id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + /// + /// Start buying a cart load of items. This will return a positive result is the purchase has + /// begun. You should listen out for SteamUser.OnMicroTxnAuthorizationResponse for a success. + /// + public static async Task StartPurchaseAsync( InventoryDef[] items ) + { + var item_i = items.Select( x => x._id ).ToArray(); + var item_q = items.Select( x => (uint)1 ).ToArray(); + + var r = await Internal.StartPurchase( item_i, item_q, (uint)item_i.Length ); + if ( !r.HasValue ) return null; + + return new InventoryPurchaseResult + { + Result = r.Value.Result, + OrderID = r.Value.OrderID, + TransID = r.Value.TransID + }; + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamMatchmaking.cs b/Facepunch.Steamworks/SteamMatchmaking.cs new file mode 100644 index 0000000..71c2c22 --- /dev/null +++ b/Facepunch.Steamworks/SteamMatchmaking.cs @@ -0,0 +1,235 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Functions for clients to access matchmaking services, favorites, and to operate on game lobbies + /// + public static class SteamMatchmaking + { + /// + /// Maximum number of characters a lobby metadata key can be + /// + internal static int MaxLobbyKeyLength => 255; + + + static ISteamMatchmaking _internal; + + internal static ISteamMatchmaking Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamMatchmaking(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + LobbyInvite_t.Install( x => OnLobbyInvite?.Invoke( new Friend( x.SteamIDUser ), new Lobby( x.SteamIDLobby ) ) ); + + LobbyEnter_t.Install( x => OnLobbyEntered?.Invoke( new Lobby( x.SteamIDLobby ) ) ); + + LobbyCreated_t.Install( x => OnLobbyCreated?.Invoke( x.Result, new Lobby( x.SteamIDLobby ) ) ); + + LobbyGameCreated_t.Install( x => OnLobbyGameCreated?.Invoke( new Lobby( x.SteamIDLobby ), x.IP, x.Port, x.SteamIDGameServer ) ); + + LobbyDataUpdate_t.Install( x => + { + if ( x.Success == 0 ) return; + + if ( x.SteamIDLobby == x.SteamIDMember ) + OnLobbyDataChanged?.Invoke( new Lobby( x.SteamIDLobby ) ); + else + OnLobbyMemberDataChanged?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDMember ) ); + } ); + + LobbyChatUpdate_t.Install( x => + { + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Entered) != 0 ) + OnLobbyMemberJoined?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Left) != 0 ) + OnLobbyMemberLeave?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Disconnected) != 0 ) + OnLobbyMemberDisconnected?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Kicked) != 0 ) + OnLobbyMemberKicked?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ), new Friend( x.SteamIDMakingChange ) ); + + if ( (x.GfChatMemberStateChange & (int)ChatMemberStateChange.Banned) != 0 ) + OnLobbyMemberBanned?.Invoke( new Lobby( x.SteamIDLobby ), new Friend( x.SteamIDUserChanged ), new Friend( x.SteamIDMakingChange ) ); + } ); + + LobbyChatMsg_t.Install( OnLobbyChatMessageRecievedAPI ); + } + + static private unsafe void OnLobbyChatMessageRecievedAPI( LobbyChatMsg_t callback ) + { + SteamId steamid = default; + ChatEntryType chatEntryType = default; + var buffer = Helpers.TakeBuffer( 1024 * 4 ); + + fixed ( byte* p = buffer ) + { + var readData = Internal.GetLobbyChatEntry( callback.SteamIDLobby, (int)callback.ChatID, ref steamid, (IntPtr)p, buffer.Length, ref chatEntryType ); + + if ( readData > 0 ) + { + OnChatMessage?.Invoke( new Lobby( callback.SteamIDLobby ), new Friend( steamid ), Encoding.UTF8.GetString( buffer, 0, readData ) ); + } + } + } + + /// + /// Someone invited you to a lobby + /// + public static event Action OnLobbyInvite; + + /// + /// You joined a lobby + /// + public static event Action OnLobbyEntered; + + /// + /// You created a lobby + /// + public static event Action OnLobbyCreated; + + /// + /// A game server has been associated with the lobby + /// + public static event Action OnLobbyGameCreated; + + /// + /// The lobby metadata has changed + /// + public static event Action OnLobbyDataChanged; + + /// + /// The lobby member metadata has changed + /// + public static event Action OnLobbyMemberDataChanged; + + /// + /// The lobby member joined + /// + public static event Action OnLobbyMemberJoined; + + /// + /// The lobby member left the room + /// + public static event Action OnLobbyMemberLeave; + + /// + /// The lobby member left the room + /// + public static event Action OnLobbyMemberDisconnected; + + /// + /// The lobby member was kicked. The 3rd param is the user that kicked them. + /// + public static event Action OnLobbyMemberKicked; + + /// + /// The lobby member was banned. The 3rd param is the user that banned them. + /// + public static event Action OnLobbyMemberBanned; + + /// + /// A chat message was recieved from a member of a lobby + /// + public static event Action OnChatMessage; + + public static LobbyQuery LobbyList => new LobbyQuery(); + + /// + /// Creates a new invisible lobby. Call lobby.SetPublic to take it online. + /// + public static async Task CreateLobbyAsync( int maxMembers = 100 ) + { + var lobby = await Internal.CreateLobby( LobbyType.Invisible, maxMembers ); + if ( !lobby.HasValue || lobby.Value.Result != Result.OK ) return null; + + return new Lobby { Id = lobby.Value.SteamIDLobby }; + } + + /// + /// Attempts to directly join the specified lobby + /// + public static async Task JoinLobbyAsync( SteamId lobbyId ) + { + var lobby = await Internal.JoinLobby( lobbyId ); + if ( !lobby.HasValue ) return null; + + return new Lobby { Id = lobby.Value.SteamIDLobby }; + } + + /// + /// Get a list of servers that are on your favorites list + /// + public static IEnumerable GetFavoriteServers() + { + var count = Internal.GetFavoriteGameCount(); + + for( int i=0; i + /// Get a list of servers that you have added to your play history + /// + public static IEnumerable GetHistoryServers() + { + var count = Internal.GetFavoriteGameCount(); + + for ( int i = 0; i < count; i++ ) + { + uint timeplayed = 0; + uint flags = 0; + ushort qport = 0; + ushort cport = 0; + uint ip = 0; + AppId appid = default; + + if ( Internal.GetFavoriteGame( i, ref appid, ref ip, ref cport, ref qport, ref flags, ref timeplayed ) ) + { + if ( (flags & ServerInfo.k_unFavoriteFlagHistory) == 0 ) continue; + yield return new ServerInfo( ip, cport, qport, timeplayed ); + } + } + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamMusic.cs b/Facepunch.Steamworks/SteamMusic.cs new file mode 100644 index 0000000..ac45724 --- /dev/null +++ b/Facepunch.Steamworks/SteamMusic.cs @@ -0,0 +1,94 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Functions to control music playback in the steam client. + /// This gives games the opportunity to do things like pause the music or lower the volume, + /// when an important cut scene is shown, and start playing afterwards. + /// Nothing uses Steam Music though so this can probably get fucked + /// + public static class SteamMusic + { + static ISteamMusic _internal; + internal static ISteamMusic Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamMusic(); + _internal.Init(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + PlaybackStatusHasChanged_t.Install( x => OnPlaybackChanged?.Invoke() ); + VolumeHasChanged_t.Install( x => OnVolumeChanged?.Invoke( x.NewVolume ) ); + } + + /// + /// Playback status changed + /// + public static event Action OnPlaybackChanged; + + /// + /// Volume changed, parameter is new volume + /// + public static event Action OnVolumeChanged; + + /// + /// Checks if Steam Music is enabled + /// + public static bool IsEnabled => Internal.BIsEnabled(); + + /// + /// true if a song is currently playing, paused, or queued up to play; otherwise false. + /// + public static bool IsPlaying => Internal.BIsPlaying(); + + /// + /// Gets the current status of the Steam Music player + /// + public static MusicStatus Status => Internal.GetPlaybackStatus(); + + + public static void Play() => Internal.Play(); + + public static void Pause() => Internal.Pause(); + + /// + /// Have the Steam Music player play the previous song. + /// + public static void PlayPrevious() => Internal.PlayPrevious(); + + /// + /// Have the Steam Music player skip to the next song + /// + public static void PlayNext() => Internal.PlayNext(); + + /// + /// Gets/Sets the current volume of the Steam Music player + /// + public static float Volume + { + get => Internal.GetVolume(); + set => Internal.SetVolume( value ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs deleted file mode 100644 index 238b63f..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Callback.cs +++ /dev/null @@ -1,198 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Facepunch.Steamworks; - -namespace SteamNative -{ - [StructLayout( LayoutKind.Sequential )] - internal class Callback - { - internal enum Flags : byte - { - Registered = 0x01, - GameServer = 0x02 - } - - public IntPtr vTablePtr; - public byte CallbackFlags; - public int CallbackId; - - [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, SteamNative.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, SteamNative.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, SteamNative.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, SteamNative.SteamAPICall_t hSteamAPICall ); - [UnmanagedFunctionPointer( CallingConvention.ThisCall )] public delegate int GetSizeD( IntPtr thisptr ); - - public ResultWithInfoD ResultB; - public ResultD ResultA; - public GetSizeD GetSize; - } - }; - - // - // Created on registration of a callback - // - internal class CallbackHandle : IDisposable - { - internal BaseSteamworks Steamworks; - - // Get Rid - internal GCHandle FuncA; - internal GCHandle FuncB; - internal GCHandle FuncC; - internal IntPtr vTablePtr; - internal GCHandle PinnedCallback; - - internal CallbackHandle( Facepunch.Steamworks.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 ) - return; - - Steamworks.native.api.SteamAPI_UnregisterCallback( PinnedCallback.AddrOfPinnedObject() ); - } - - public virtual bool IsValid { get { return true; } } - } - - internal abstract class CallResult : CallbackHandle - { - internal SteamAPICall_t Call; - public override bool IsValid { get { return Call > 0; } } - - - internal CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call ) : base( steamworks ) - { - Call = call; - } - - internal void Try() - { - bool failed = false; - - if ( !Steamworks.native.utils.IsAPICallCompleted( Call, ref failed )) - return; - - Steamworks.UnregisterCallResult( this ); - - RunCallback(); - } - - internal abstract void RunCallback(); - } - - - internal class CallResult : CallResult - { - private static byte[] resultBuffer = new byte[1024 * 16]; - - internal delegate T ConvertFromPointer( IntPtr p ); - - Action CallbackFunction; - ConvertFromPointer ConvertFromPointerFunction; - - internal int ResultSize = -1; - internal int CallbackId = 0; - - internal CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action 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 )"; - } - - unsafe internal override void RunCallback() - { - bool failed = false; - - fixed ( byte* ptr = resultBuffer ) - { - if ( !Steamworks.native.utils.GetAPICallResult( Call, (IntPtr)ptr, resultBuffer.Length, CallbackId, ref failed ) || failed ) - { - CallbackFunction( default(T), true ); - return; - } - - var val = ConvertFromPointerFunction( (IntPtr)ptr ); - CallbackFunction( val, false ); - } - } - } - - internal class MonoPInvokeCallbackAttribute : Attribute - { - public MonoPInvokeCallbackAttribute() { } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Helpers.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Helpers.cs deleted file mode 100644 index 6f2db07..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Helpers.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Text; -using System.Collections.Generic; - -namespace SteamNative -{ - internal static class Helpers - { - private static StringBuilder[] StringBuilderPool; - private static int StringBuilderPoolIndex; - - /// - /// Returns a StringBuilder. This will get returned and reused later on. - /// - public static StringBuilder TakeStringBuilder() - { - if ( StringBuilderPool == null ) - { - // - // The pool has 8 items. This should be safe because we shouldn't really - // ever be using more than 2 StringBuilders at the same time. - // - 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]; - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs deleted file mode 100644 index adbdb16..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Interface.cs +++ /dev/null @@ -1,717 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal interface Interface : IDisposable - { - // Implementation should return true if _ptr is non null - bool IsValid { get; } - - uint /*uint32*/ ISteamAppList_GetNumInstalledApps(); - uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ); - bool /*bool*/ ISteamApps_BIsSubscribed(); - bool /*bool*/ ISteamApps_BIsLowViolence(); - bool /*bool*/ ISteamApps_BIsCybercafe(); - bool /*bool*/ ISteamApps_BIsVACBanned(); - IntPtr ISteamApps_GetCurrentGameLanguage(); - IntPtr ISteamApps_GetAvailableGameLanguages(); - bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ); - bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ); - uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ); - bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend(); - int /*int*/ ISteamApps_GetDLCCount(); - bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - void /*void*/ ISteamApps_InstallDLC( uint nAppID ); - void /*void*/ ISteamApps_UninstallDLC( uint nAppID ); - void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ); - bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ); - CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner(); - IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ); - bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - int /*int*/ ISteamApps_GetAppBuildId(); - void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ); - HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe(); - bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ); - HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ); - HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ); - IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - uint /*uint32*/ ISteamClient_GetIPCCallCount(); - void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed(); - IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - bool /*bool*/ ISteamController_Init(); - bool /*bool*/ ISteamController_Shutdown(); - void /*void*/ ISteamController_RunFrame(); - int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ); - bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ); - ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ); - void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ); - ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ); - void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ); - void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ); - void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ); - int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ); - ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ); - int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ); - ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ); - int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ); - void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ); - ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ); - ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ); - bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ); - IntPtr ISteamFriends_GetPersonaName(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ); - PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState(); - int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ); - FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ); - PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ); - IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ); - bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ); - IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ); - int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ); - IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ); - int /*int*/ ISteamFriends_GetFriendsGroupCount(); - FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ); - IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ); - int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ); - void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ); - int /*int*/ ISteamFriends_GetClanCount(); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ); - IntPtr ISteamFriends_GetClanName( ulong steamIDClan ); - IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ); - bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ); - bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ); - void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ); - void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ); - void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ); - void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ); - void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ); - int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ); - int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ); - int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ); - bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ); - int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ); - uint /*uint32*/ ISteamFriends_GetUserRestrictions(); - bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ); - void /*void*/ ISteamFriends_ClearRichPresence(); - IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ); - int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ); - IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ); - void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ); - bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ); - int /*int*/ ISteamFriends_GetCoplayFriendCount(); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ); - int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ); - AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ); - bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ); - int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ); - CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ); - bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ); - int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ); - bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ); - bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ); - bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ); - bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ); - bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ); - bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ); - bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ); - void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ); - void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ); - void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ); - void /*void*/ ISteamGameServer_LogOnAnonymous(); - void /*void*/ ISteamGameServer_LogOff(); - bool /*bool*/ ISteamGameServer_BLoggedOn(); - bool /*bool*/ ISteamGameServer_BSecure(); - CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID(); - bool /*bool*/ ISteamGameServer_WasRestartRequested(); - void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ); - void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ); - void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ); - void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ); - void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ); - void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ); - void /*void*/ ISteamGameServer_ClearAllKeyValues(); - void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ); - void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ); - void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ); - void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ); - bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection(); - void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ); - bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ); - void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ); - UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ); - bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ); - void /*void*/ ISteamGameServer_GetGameplayStats(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation(); - uint /*uint32*/ ISteamGameServer_GetPublicIP(); - bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ); - void /*void*/ ISteamGameServer_ForceHeartbeat(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ); - bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ); - bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ); - void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface(); - bool /*bool*/ ISteamHTMLSurface_Init(); - bool /*bool*/ ISteamHTMLSurface_Shutdown(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ); - void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ); - void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ); - void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ); - void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ); - bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ); - bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ); - bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ); - bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ); - bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ); - bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ); - bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ); - bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ); - bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ); - bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ); - void /*void*/ ISteamInventory_DestroyResult( int resultHandle ); - bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ); - bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ); - bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ); - bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - void /*void*/ ISteamInventory_SendItemDropHeartbeat(); - bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ); - bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - bool /*bool*/ ISteamInventory_LoadItemDefinitions(); - bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ); - bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices(); - uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices(); - bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ); - SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties(); - bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ); - int /*int*/ ISteamMatchmaking_GetFavoriteGameCount(); - bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList(); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ); - void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ); - CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ); - void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ); - bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ); - int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ); - CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ); - IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ); - bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ); - bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ); - IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ); - void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ); - int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ); - bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ); - bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ); - bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ); - IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ); - void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ); - void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ); - bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ); - int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ); - void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ); - HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ); - bool /*bool*/ ISteamMusic_BIsEnabled(); - bool /*bool*/ ISteamMusic_BIsPlaying(); - AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus(); - void /*void*/ ISteamMusic_Play(); - void /*void*/ ISteamMusic_Pause(); - void /*void*/ ISteamMusic_PlayPrevious(); - void /*void*/ ISteamMusic_PlayNext(); - void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ); - float /*float*/ ISteamMusic_GetVolume(); - bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ); - bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote(); - bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote(); - bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ); - bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ); - bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange(); - bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ); - bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ); - bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange(); - bool /*bool*/ ISteamMusicRemote_QueueWillChange(); - bool /*bool*/ ISteamMusicRemote_ResetQueueEntries(); - bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ); - bool /*bool*/ ISteamMusicRemote_QueueDidChange(); - bool /*bool*/ ISteamMusicRemote_PlaylistWillChange(); - bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries(); - bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ); - bool /*bool*/ ISteamMusicRemote_PlaylistDidChange(); - bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ); - bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ); - bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ); - bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ); - bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ); - int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ); - bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled(); - bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked(); - bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ); - bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ); - bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ); - bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ); - bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ); - bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ); - bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ); - bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ); - bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ); - bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ); - bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ); - int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ); - long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ); - RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ); - int /*int32*/ ISteamRemoteStorage_GetFileCount(); - IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount(); - bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp(); - void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ); - bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount(); - UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ); - bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - void /*void*/ ISteamScreenshots_TriggerScreenshot(); - void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ); - bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ); - bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ); - bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked(); - ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ); - bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ); - bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ); - bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ); - bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ); - bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ); - bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ); - bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ); - bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ); - bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ); - bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ); - bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ); - bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ); - bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ); - bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ); - bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ); - bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ); - bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); - bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ); - bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ); - bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ); - bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ); - bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ); - ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ); - uint /*uint32*/ ISteamUGC_GetNumSubscribedItems(); - uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ); - bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ); - void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ); - HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser(); - bool /*bool*/ ISteamUser_BLoggedOn(); - CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID(); - int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - void /*void*/ ISteamUser_StartVoiceRecording(); - void /*void*/ ISteamUser_StopVoiceRecording(); - VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate(); - HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - void /*void*/ ISteamUser_EndAuthSession( ulong steamID ); - void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ); - UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ); - bool /*bool*/ ISteamUser_BIsBehindNAT(); - void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - int /*int*/ ISteamUser_GetPlayerSteamLevel(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ); - bool /*bool*/ ISteamUser_BIsPhoneVerified(); - bool /*bool*/ ISteamUser_BIsTwoFactorEnabled(); - bool /*bool*/ ISteamUser_BIsPhoneIdentifying(); - bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification(); - bool /*bool*/ ISteamUserStats_RequestCurrentStats(); - bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ); - bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ); - bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ); - bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ); - bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ); - bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ); - bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - bool /*bool*/ ISteamUserStats_StoreStats(); - int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ); - IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ); - bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - uint /*uint32*/ ISteamUserStats_GetNumAchievements(); - IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ); - bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ); - IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ); - int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ); - LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ); - LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages(); - int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ); - bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ); - bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ); - int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive(); - uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive(); - Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse(); - uint /*uint32*/ ISteamUtils_GetServerRealTime(); - IntPtr ISteamUtils_GetIPCountry(); - bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower(); - uint /*uint32*/ ISteamUtils_GetAppID(); - void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ); - bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - uint /*uint32*/ ISteamUtils_GetIPCCallCount(); - void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - bool /*bool*/ ISteamUtils_IsOverlayEnabled(); - bool /*bool*/ ISteamUtils_BOverlayNeedsPresent(); - SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ); - bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength(); - bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - IntPtr ISteamUtils_GetSteamUILanguage(); - bool /*bool*/ ISteamUtils_IsSteamRunningInVR(); - void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode(); - void /*void*/ ISteamUtils_StartVRDashboard(); - bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled(); - void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ); - bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ); - void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ); - bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - bool /*bool*/ SteamApi_SteamAPI_Init(); - void /*void*/ SteamApi_SteamAPI_RunCallbacks(); - void /*void*/ SteamApi_SteamGameServer_RunCallbacks(); - void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - void /*void*/ SteamApi_SteamAPI_Shutdown(); - void /*void*/ SteamApi_SteamGameServer_Shutdown(); - HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser(); - HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe(); - HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser(); - HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe(); - IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ); - bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs deleted file mode 100644 index cef1b83..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux32.cs +++ /dev/null @@ -1,5063 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal class Linux32 : Interface - { - internal IntPtr _ptr; - public bool IsValid { get{ return _ptr != IntPtr.Zero; } } - - // - // Constructor sets pointer to native class - // - internal Linux32( IntPtr pointer ) - { - _ptr = pointer; - } - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - _ptr = IntPtr.Zero; - } - - public virtual HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateSteamPipe(_ptr); - } - public virtual bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BReleaseSteamPipe(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_ConnectToGlobalUser(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateLocalUser(_ptr, out phSteamPipe, eAccountType); - } - public virtual void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_ReleaseUser(_ptr, hSteamPipe, hUser); - } - public virtual IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUser(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServer(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetLocalIPBinding(_ptr, unIP, usPort); - } - public virtual IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamFriends(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUtils(_ptr, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmaking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmakingServers(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGenericInterface(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUserStats(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServerStats(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamApps(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamNetworking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamRemoteStorage(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamScreenshots(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual uint /*uint32*/ ISteamClient_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(_ptr); - } - public virtual IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTTP(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamController(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUGC(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamAppList(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusic(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusicRemote(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTMLSurface(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamInventory(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamVideo(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamParentalSettings(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - - public virtual HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetHSteamUser(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BLoggedOn(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetSteamID(_ptr); - } - public virtual int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_InitiateGameConnection(_ptr, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); - } - public virtual void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TerminateGameConnection(_ptr, unIPServer, usPortServer); - } - public virtual void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TrackAppUsageEvent(_ptr, gameID, eAppUsageEvent, pchExtraInfo); - } - public virtual bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetUserDataFolder(_ptr, pchBuffer, cubBuffer); - } - public virtual void /*void*/ ISteamUser_StartVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StartVoiceRecording(_ptr); - } - public virtual void /*void*/ ISteamUser_StopVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StopVoiceRecording(_ptr); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAvailableVoice(_ptr, out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoice(_ptr, bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_DecompressVoice(_ptr, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); - } - public virtual uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(_ptr); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamUser_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamUser_BIsBehindNAT() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsBehindNAT(_ptr); - } - public virtual void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_AdvertiseGame(_ptr, steamIDGameServer, unIPServer, usPortServer); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestEncryptedAppTicket(_ptr, pDataToInclude, cbDataToInclude); - } - public virtual bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetEncryptedAppTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetGameBadgeLevel(_ptr, nSeries, bFoil); - } - public virtual int /*int*/ ISteamUser_GetPlayerSteamLevel() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetPlayerSteamLevel(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestStoreAuthURL(_ptr, pchRedirectURL); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneVerified() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneVerified(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsTwoFactorEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsTwoFactorEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneIdentifying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneIdentifying(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(_ptr); - } - - public virtual IntPtr ISteamFriends_GetPersonaName() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaName(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetPersonaName(_ptr, pchPersonaName); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaState(_ptr); - } - public virtual int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCount(_ptr, iFriendFlags); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendByIndex(_ptr, iFriend, iFriendFlags); - } - public virtual FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRelationship(_ptr, steamIDFriend); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaState(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaName(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - var pFriendGameInfo_ps = new FriendGameInfo_t.PackSmall(); - var ret = Native.SteamAPI_ISteamFriends_GetFriendGamePlayed(_ptr, steamIDFriend, ref pFriendGameInfo_ps); - pFriendGameInfo = pFriendGameInfo_ps; - return ret; - } - public virtual IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(_ptr, steamIDFriend, iPersonaName); - } - public virtual int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendSteamLevel(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPlayerNickname(_ptr, steamIDPlayer); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupCount(_ptr); - } - public virtual FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(_ptr, iFG); - } - public virtual IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupName(_ptr, friendsGroupID); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(_ptr, friendsGroupID); - } - public virtual void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(_ptr, friendsGroupID, pOutSteamIDMembers, nMembersCount); - } - public virtual bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_HasFriend(_ptr, steamIDFriend, iFriendFlags); - } - public virtual int /*int*/ ISteamFriends_GetClanCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanByIndex(_ptr, iClan); - } - public virtual IntPtr ISteamFriends_GetClanName( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanName(_ptr, steamIDClan); - } - public virtual IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanTag(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanActivityCounts(_ptr, steamIDClan, out pnOnline, out pnInGame, out pnChatting); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_DownloadClanActivityCounts(_ptr, psteamIDClans, cClansToRequest); - } - public virtual int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCountFromSource(_ptr, steamIDSource); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(_ptr, steamIDSource, iFriend); - } - public virtual bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsUserInSource(_ptr, steamIDUser, steamIDSource); - } - public virtual void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(_ptr, steamIDUser, bSpeaking); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlay(_ptr, pchDialog); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(_ptr, pchDialog, steamID); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(_ptr, pchURL); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(_ptr, nAppID, eFlag); - } - public virtual void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetPlayedWith(_ptr, steamIDUserPlayedWith); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(_ptr, steamIDLobby); - } - public virtual int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetSmallFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetMediumFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetLargeFriendAvatar(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestUserInformation(_ptr, steamIDUser, bRequireNameOnly); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestClanOfficerList(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOwner(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerByIndex(_ptr, steamIDClan, iOfficer); - } - public virtual uint /*uint32*/ ISteamFriends_GetUserRestrictions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetUserRestrictions(_ptr); - } - public virtual bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetRichPresence(_ptr, pchKey, pchValue); - } - public virtual void /*void*/ ISteamFriends_ClearRichPresence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ClearRichPresence(_ptr); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresence(_ptr, steamIDFriend, pchKey); - } - public virtual int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(_ptr, steamIDFriend, iKey); - } - public virtual void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_RequestFriendRichPresence(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_InviteUserToGame(_ptr, steamIDFriend, pchConnectString); - } - public virtual int /*int*/ ISteamFriends_GetCoplayFriendCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriendCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriend(_ptr, iCoplayFriend); - } - public virtual int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayTime(_ptr, steamIDFriend); - } - public virtual AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayGame(_ptr, steamIDFriend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_JoinClanChatRoom(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_LeaveClanChatRoom(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMemberCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetChatMemberByIndex(_ptr, steamIDClan, iUser); - } - public virtual bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SendClanChatMessage(_ptr, steamIDClanChat, pchText); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMessage(_ptr, steamIDClanChat, iMessage, prgchText, cchTextMax, out peChatEntryType, out psteamidChatter); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatAdmin(_ptr, steamIDClanChat, steamIDUser); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetListenForFriendsMessages(_ptr, bInterceptEnabled); - } - public virtual bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_ReplyToFriendMessage(_ptr, steamIDFriend, pchMsgToSend); - } - public virtual int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendMessage(_ptr, steamIDFriend, iMessageID, pvData, cubData, out peChatEntryType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFollowerCount(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsFollowing(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_EnumerateFollowingList(_ptr, unStartIndex); - } - public virtual bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanPublic(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(_ptr, steamIDClan); - } - - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(_ptr); - } - public virtual Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetConnectedUniverse(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetServerRealTime() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetServerRealTime(_ptr); - } - public virtual IntPtr ISteamUtils_GetIPCountry() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCountry(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageSize(_ptr, iImage, out pnWidth, out pnHeight); - } - public virtual bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageRGBA(_ptr, iImage, pubDest, nDestBufferSize); - } - public virtual bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCSERIPPort(_ptr, out unIP, out usPort); - } - public virtual byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCurrentBatteryPower(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetAppID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAppID(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(_ptr, eNotificationPosition); - } - public virtual bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsAPICallCompleted(_ptr, hSteamAPICall, ref pbFailed); - } - public virtual SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallFailureReason(_ptr, hSteamAPICall); - } - public virtual bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallResult(_ptr, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed); - } - public virtual uint /*uint32*/ ISteamUtils_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamUtils_IsOverlayEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsOverlayEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_BOverlayNeedsPresent() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_BOverlayNeedsPresent(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_CheckFileSignature(_ptr, szFileName); - } - public virtual bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_ShowGamepadTextInput(_ptr, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText); - } - public virtual uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(_ptr, pchText, cchText); - } - public virtual IntPtr ISteamUtils_GetSteamUILanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSteamUILanguage(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamRunningInVR() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamRunningInVR(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationInset(_ptr, nHorizontalInset, nVerticalInset); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamInBigPictureMode(_ptr); - } - public virtual void /*void*/ ISteamUtils_StartVRDashboard() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_StartVRDashboard(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(_ptr, bEnabled); - } - - public virtual int /*int*/ ISteamMatchmaking_GetFavoriteGameCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(_ptr); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGame(_ptr, iGame, ref pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); - } - public virtual int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_AddFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyList(_ptr); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(_ptr, pchKeyToMatch, pchValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(_ptr, pchKeyToMatch, nValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(_ptr, pchKeyToMatch, nValueToBeCloseTo); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(_ptr, nSlotsAvailable); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(_ptr, eLobbyDistanceFilter); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(_ptr, cMaxResults); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(_ptr, iLobby); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_CreateLobby(_ptr, eLobbyType, cMaxMembers); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_JoinLobby(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_LeaveLobby(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_InviteUserToLobby(_ptr, steamIDLobby, steamIDInvitee); - } - public virtual int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(_ptr, steamIDLobby, iMember); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(_ptr, steamIDLobby, iLobbyData, pchKey, cchKeyBufferSize, pchValue, cchValueBufferSize); - } - public virtual bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_DeleteLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(_ptr, steamIDLobby, steamIDUser, pchKey); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(_ptr, steamIDLobby, pvMsgBody, cubMsgBody); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(_ptr, steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); - } - public virtual bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyData(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(_ptr, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(_ptr, steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(_ptr, steamIDLobby, cMaxMembers); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyType(_ptr, steamIDLobby, eLobbyType); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(_ptr, steamIDLobby, bLobbyJoinable); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyOwner(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyOwner(_ptr, steamIDLobby, steamIDNewOwner); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLinkedLobby(_ptr, steamIDLobby, steamIDLobbyDependent); - } - - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(_ptr, iApp, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(_ptr, hServerListRequest); - } - public virtual IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerDetails(_ptr, hRequest, iServer); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelQuery(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshQuery(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_IsRefreshing(_ptr, hRequest); - } - public virtual int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerCount(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshServer(_ptr, hRequest, iServer); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PingServer(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PlayerDetails(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_ServerRules(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(_ptr, hServerQuery); - } - - public virtual bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWrite(_ptr, pchFile, pvData, cubData); - } - public virtual int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileRead(_ptr, pchFile, pvData, cubDataToRead); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteAsync(_ptr, pchFile, pvData, cubData); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsync(_ptr, pchFile, nOffset, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(_ptr, hReadCall, pvBuffer, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileForget(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileDelete(_ptr, pchFile); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileShare(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(_ptr, pchFile, eRemoteStoragePlatform); - } - public virtual UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(_ptr, writeHandle, pvData, cubData); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileExists(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FilePersisted(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileSize(_ptr, pchFile); - } - public virtual long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(_ptr, pchFile); - } - public virtual RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileCount(_ptr); - } - public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(_ptr, iFile, out pnFileSizeInBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetQuota(_ptr, out pnTotalBytes, out puAvailableBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(_ptr); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(_ptr); - } - public virtual void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - Native.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(_ptr, bEnabled); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownload(_ptr, hContent, unPriority); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(_ptr, hContent, out pnBytesDownloaded, out pnBytesExpected); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDetails(_ptr, hContent, ref pnAppID, ppchName, out pnFileSizeInBytes, out pSteamIDOwner); - } - public virtual int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCRead(_ptr, hContent, pvData, cubDataToRead, cOffset, eAction); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(_ptr); - } - public virtual UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(_ptr, iCachedContent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); - pTags = pTags_ps; - return ret; - } - public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(_ptr, updateHandle, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(_ptr, updateHandle, pchPreviewFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(_ptr, updateHandle, pchTitle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(_ptr, updateHandle, pchDescription); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(_ptr, updateHandle); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(_ptr, unPublishedFileId, unMaxSecondsOld); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(_ptr, updateHandle, pchChangeDescription); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(_ptr, unPublishedFileId, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); - var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); - pRequiredTags = pRequiredTags_ps; - pExcludedTags = pExcludedTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(_ptr, unPublishedFileId, eAction); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); - pTags = pTags_ps; - pUserTags = pUserTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(_ptr, hContent, pchLocation, unPriority); - } - - public virtual bool /*bool*/ ISteamUserStats_RequestCurrentStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestCurrentStats(_ptr); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat0(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat(_ptr, pchName, nData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat0(_ptr, pchName, fData); - } - public virtual bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UpdateAvgRateStat(_ptr, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievement(_ptr, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ClearAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(_ptr, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_StoreStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_StoreStats(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementIcon(_ptr, pchName); - } - public virtual IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(_ptr, pchName, pchKey); - } - public virtual bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_IndicateAchievementProgress(_ptr, pchName, nCurProgress, nMaxProgress); - } - public virtual uint /*uint32*/ ISteamUserStats_GetNumAchievements() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumAchievements(_ptr); - } - public virtual IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementName(_ptr, iAchievement); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(_ptr, steamIDUser, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ResetAllStats(_ptr, bAchievementsToo); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(_ptr, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindLeaderboard(_ptr, pchLeaderboardName); - } - public virtual IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardName(_ptr, hSteamLeaderboard); - } - public virtual int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(_ptr, hSteamLeaderboard); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(_ptr, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(_ptr, hSteamLeaderboard, prgUsers, cUsers); - } - public virtual bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - var pLeaderboardEntry_ps = new LeaderboardEntry_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(_ptr, hSteamLeaderboardEntries, index, ref pLeaderboardEntry_ps, pDetails, cDetailsMax); - pLeaderboardEntry = pLeaderboardEntry_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UploadLeaderboardScore(_ptr, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(_ptr, hSteamLeaderboard, hUGC); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(_ptr, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(_ptr, iIteratorPrevious, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(_ptr, pchName, out pflPercent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalStats(_ptr, nHistoryDays); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat(_ptr, pchStatName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat0(_ptr, pchStatName, out pData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory(_ptr, pchStatName, out pData, cubData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(_ptr, pchStatName, out pData, cubData); - } - - public virtual bool /*bool*/ ISteamApps_BIsSubscribed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribed(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsLowViolence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsLowViolence(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsCybercafe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsCybercafe(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsVACBanned() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsVACBanned(_ptr); - } - public virtual IntPtr ISteamApps_GetCurrentGameLanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentGameLanguage(_ptr); - } - public virtual IntPtr ISteamApps_GetAvailableGameLanguages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAvailableGameLanguages(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedApp(_ptr, appID); - } - public virtual bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsDlcInstalled(_ptr, appID); - } - public virtual uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(_ptr); - } - public virtual int /*int*/ ISteamApps_GetDLCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDLCCount(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BGetDLCDataByIndex(_ptr, iDLC, ref pAppID, ref pbAvailable, pchName, cchNameBufferSize); - } - public virtual void /*void*/ ISteamApps_InstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_InstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_UninstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_UninstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentBetaName(_ptr, pchName, cchNameBufferSize); - } - public virtual bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_MarkContentCorrupt(_ptr, bMissingFilesOnly); - } - public virtual uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetInstalledDepots(_ptr, appID, pvecDepots, cMaxDepots); - } - public virtual uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppInstallDir(_ptr, appID, pchFolder, cchFolderBufferSize); - } - public virtual bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsAppInstalled(_ptr, appID); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppOwner(_ptr); - } - public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetLaunchQueryParam(_ptr, pchKey); - } - public virtual bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDlcDownloadProgress(_ptr, nAppID, out punBytesDownloaded, out punBytesTotal); - } - public virtual int /*int*/ ISteamApps_GetAppBuildId() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppBuildId(_ptr); - } - public virtual void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetFileDetails(_ptr, pszFileName); - } - - public virtual bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendP2PPacket(_ptr, steamIDRemote, pubData, cubData, eP2PSendType, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(_ptr, out pcubMsgSize, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_ReadP2PPacket(_ptr, pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(_ptr, steamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - var pConnectionState_ps = new P2PSessionState_t.PackSmall(); - var ret = Native.SteamAPI_ISteamNetworking_GetP2PSessionState(_ptr, steamIDRemote, ref pConnectionState_ps); - pConnectionState = pConnectionState_ps; - return ret; - } - public virtual bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(_ptr, bAllow); - } - public virtual SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateListenSocket(_ptr, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(_ptr, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateConnectionSocket(_ptr, nIP, nPort, nTimeoutSec); - } - public virtual bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroySocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroyListenSocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendDataOnSocket(_ptr, hSocket, pubData, cubData, bReliable); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(_ptr, hSocket, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(_ptr, hSocket, pubDest, cubDest, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailable(_ptr, hListenSocket, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveData(_ptr, hListenSocket, pubDest, cubDest, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketInfo(_ptr, hSocket, out pSteamIDRemote, peSocketStatus, out punIPRemote, out punPortRemote); - } - public virtual bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetListenSocketInfo(_ptr, hListenSocket, out pnIP, out pnPort); - } - public virtual SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketConnectionType(_ptr, hSocket); - } - public virtual int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetMaxPacketSize(_ptr, hSocket); - } - - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_WriteScreenshot(_ptr, pubRGB, cubRGB, nWidth, nHeight); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(_ptr, pchFilename, pchThumbnailFilename, nWidth, nHeight); - } - public virtual void /*void*/ ISteamScreenshots_TriggerScreenshot() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_TriggerScreenshot(_ptr); - } - public virtual void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_HookScreenshots(_ptr, bHook); - } - public virtual bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_SetLocation(_ptr, hScreenshot, pchLocation); - } - public virtual bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagUser(_ptr, hScreenshot, steamID); - } - public virtual bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagPublishedFile(_ptr, hScreenshot, unPublishedFileID); - } - public virtual bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_IsScreenshotsHooked(_ptr); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary(_ptr, eType, pchFilename, pchVRFilename); - } - - public virtual bool /*bool*/ ISteamMusic_BIsEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamMusic_BIsPlaying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsPlaying(_ptr); - } - public virtual AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetPlaybackStatus(_ptr); - } - public virtual void /*void*/ ISteamMusic_Play() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Play(_ptr); - } - public virtual void /*void*/ ISteamMusic_Pause() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Pause(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayPrevious() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayPrevious(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayNext() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayNext(_ptr); - } - public virtual void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_SetVolume(_ptr, flVolume); - } - public virtual float /*float*/ ISteamMusic_GetVolume() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetVolume(_ptr); - } - - public virtual bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BActivationSuccess(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetDisplayName(_ptr, pchDisplayName); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayNext(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableQueue(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlaylists(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(_ptr, nStatus); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateVolume(_ptr, flValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(_ptr, bAvailable); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(_ptr, pchText); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(_ptr, nValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetQueueEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetQueueEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetQueueEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistDidChange(_ptr); - } - - public virtual HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateHTTPRequest(_ptr, eHTTPRequestMethod, pchAbsoluteURL); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(_ptr, hRequest, ulContextValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(_ptr, hRequest, unTimeoutSeconds); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(_ptr, hRequest, pchHeaderName, pchHeaderValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(_ptr, hRequest, pchParamName, pchParamValue); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequest(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_DeferHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(_ptr, hRequest, pchHeaderName, out unResponseHeaderSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(_ptr, hRequest, pchHeaderName, out pHeaderValueBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(_ptr, hRequest, out unBodySize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(_ptr, hRequest, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(_ptr, hRequest, cOffset, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(_ptr, hRequest, out pflPercentOut); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(_ptr, hRequest, pchContentType, out pubBody, unBodyLen); - } - public virtual HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateCookieContainer(_ptr, bAllowResponsesToModify); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseCookieContainer(_ptr, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetCookie(_ptr, hCookieContainer, pchHost, pchUrl, pchCookie); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(_ptr, hRequest, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(_ptr, hRequest, pchUserAgentInfo); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(_ptr, hRequest, bRequireVerifiedCertificate); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(_ptr, hRequest, unMilliseconds); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(_ptr, hRequest, ref pbWasTimedOut); - } - - public virtual bool /*bool*/ ISteamController_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Init(_ptr); - } - public virtual bool /*bool*/ ISteamController_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Shutdown(_ptr); - } - public virtual void /*void*/ ISteamController_RunFrame() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_RunFrame(_ptr); - } - public virtual int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetConnectedControllers(_ptr, handlesOut); - } - public virtual bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowBindingPanel(_ptr, controllerHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActionSetHandle(_ptr, pszActionSetName); - } - public virtual void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSet(_ptr, controllerHandle, actionSetHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetCurrentActionSet(_ptr, controllerHandle); - } - public virtual void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateAllActionSetLayers(_ptr, controllerHandle); - } - public virtual int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActiveActionSetLayers(_ptr, controllerHandle, handlesOut); - } - public virtual ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionHandle(_ptr, pszActionName); - } - public virtual ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionData(_ptr, controllerHandle, digitalActionHandle); - } - public virtual int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionOrigins(_ptr, controllerHandle, actionSetHandle, digitalActionHandle, out originsOut); - } - public virtual ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionHandle(_ptr, pszActionName); - } - public virtual ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionData(_ptr, controllerHandle, analogActionHandle); - } - public virtual int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionOrigins(_ptr, controllerHandle, actionSetHandle, analogActionHandle, out originsOut); - } - public virtual void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_StopAnalogActionMomentum(_ptr, controllerHandle, eAction); - } - public virtual void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec); - } - public virtual void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerRepeatedHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); - } - public virtual void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerVibration(_ptr, controllerHandle, usLeftSpeed, usRightSpeed); - } - public virtual void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_SetLEDColor(_ptr, controllerHandle, nColorR, nColorG, nColorB, nFlags); - } - public virtual int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGamepadIndexForController(_ptr, ulControllerHandle); - } - public virtual ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetControllerForGamepadIndex(_ptr, nIndex); - } - public virtual ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetMotionData(_ptr, controllerHandle); - } - public virtual bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowDigitalActionOrigins(_ptr, controllerHandle, digitalActionHandle, flScale, flXPosition, flYPosition); - } - public virtual bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowAnalogActionOrigins(_ptr, controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition); - } - public virtual IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetStringForActionOrigin(_ptr, eOrigin); - } - public virtual IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGlyphForActionOrigin(_ptr, eOrigin); - } - public virtual SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetInputTypeForHandle(_ptr, controllerHandle); - } - - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(_ptr, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(_ptr, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SendQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pDetails_ps = new SteamUGCDetails_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_GetQueryUGCResult(_ptr, handle, index, ref pDetails_ps); - pDetails = pDetails_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(_ptr, handle, index, pchURL, cchURLSize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCMetadata(_ptr, handle, index, pchMetadata, cchMetadatasize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCChildren(_ptr, handle, index, pvecPublishedFileID, cMaxEntries); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCStatistic(_ptr, handle, index, eStatType, out pStatValue); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(_ptr, handle, index, previewIndex, pchURLOrVideoID, cchURLSize, pchOriginalFileName, cchOriginalFileNameSize, out pPreviewType); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(_ptr, handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize); - } - public virtual bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddExcludedTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnOnlyIDs(_ptr, handle, bReturnOnlyIDs); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnKeyValueTags(_ptr, handle, bReturnKeyValueTags); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnLongDescription(_ptr, handle, bReturnLongDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnMetadata(_ptr, handle, bReturnMetadata); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnChildren(_ptr, handle, bReturnChildren); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(_ptr, handle, bReturnAdditionalPreviews); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnTotalOnly(_ptr, handle, bReturnTotalOnly); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnPlaytimeStats(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetAllowCachedResponse(_ptr, handle, unMaxAgeSeconds); - } - public virtual bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetCloudFileNameFilter(_ptr, handle, pMatchCloudFileName); - } - public virtual bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetMatchAnyTag(_ptr, handle, bMatchAnyTag); - } - public virtual bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetSearchText(_ptr, handle, pSearchText); - } - public virtual bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetRankedByTrendDays(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(_ptr, handle, pKey, pValue); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RequestUGCDetails(_ptr, nPublishedFileID, unMaxAgeSeconds); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateItem(_ptr, nConsumerAppId, eFileType); - } - public virtual UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartItemUpdate(_ptr, nConsumerAppId, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTitle(_ptr, handle, pchTitle); - } - public virtual bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemDescription(_ptr, handle, pchDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemUpdateLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemMetadata(_ptr, handle, pchMetaData); - } - public virtual bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemVisibility(_ptr, handle, eVisibility); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_SetItemTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemContent(_ptr, handle, pszContentFolder); - } - public virtual bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemPreview(_ptr, handle, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(_ptr, handle, pchKey); - } - public virtual bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemKeyValueTag(_ptr, handle, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewFile(_ptr, handle, pszPreviewFile, type); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewVideo(_ptr, handle, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewFile(_ptr, handle, index, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewVideo(_ptr, handle, index, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemPreview(_ptr, handle, index); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubmitItemUpdate(_ptr, handle, pchChangeNote); - } - public virtual ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemUpdateProgress(_ptr, handle, out punBytesProcessed, out punBytesTotal); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetUserItemVote(_ptr, nPublishedFileID, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetUserItemVote(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemToFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemFromFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubscribeItem(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UnsubscribeItem(_ptr, nPublishedFileID); - } - public virtual uint /*uint32*/ ISteamUGC_GetNumSubscribedItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetNumSubscribedItems(_ptr); - } - public virtual uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetSubscribedItems(_ptr, pvecPublishedFileID, cMaxEntries); - } - public virtual uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemState(_ptr, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemInstallInfo(_ptr, nPublishedFileID, out punSizeOnDisk, pchFolder, cchFolderSize, out punTimeStamp); - } - public virtual bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemDownloadInfo(_ptr, nPublishedFileID, out punBytesDownloaded, out punBytesTotal); - } - public virtual bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DownloadItem(_ptr, nPublishedFileID, bHighPriority); - } - public virtual bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(_ptr, unWorkshopDepotID, pszFolder); - } - public virtual void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - Native.SteamAPI_ISteamUGC_SuspendDownloads(_ptr, bSuspend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetAppDependencies(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DeleteItem(_ptr, nPublishedFileID); - } - - public virtual uint /*uint32*/ ISteamAppList_GetNumInstalledApps() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetNumInstalledApps(_ptr); - } - public virtual uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetInstalledApps(_ptr, pvecAppID, unMaxAppIDs); - } - public virtual int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppName(_ptr, nAppID, pchName, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppInstallDir(_ptr, nAppID, pchDirectory, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppBuildId(_ptr, nAppID); - } - - public virtual void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Init(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Shutdown(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_CreateBrowser(_ptr, pchUserAgent, pchUserCSS); - } - public virtual void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_RemoveBrowser(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_LoadURL(_ptr, unBrowserHandle, pchURL, pchPostData); - } - public virtual void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetSize(_ptr, unBrowserHandle, unWidth, unHeight); - } - public virtual void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopLoad(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Reload(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoBack(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoForward(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AddHeader(_ptr, unBrowserHandle, pchKey, pchValue); - } - public virtual void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(_ptr, unBrowserHandle, pchScript); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseUp(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDown(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseMove(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseWheel(_ptr, unBrowserHandle, nDelta); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyDown(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyUp(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyChar(_ptr, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetKeyFocus(_ptr, unBrowserHandle, bHasKeyFocus); - } - public virtual void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ViewSource(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_CopyToClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Find(_ptr, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); - } - public virtual void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopFind(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetCookie(_ptr, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); - } - public virtual void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(_ptr, unBrowserHandle, flZoom, nPointX, nPointY); - } - public virtual void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(_ptr, unBrowserHandle, bBackgroundMode); - } - public virtual void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(_ptr, unBrowserHandle, flDPIScaling); - } - public virtual void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AllowStartRequest(_ptr, unBrowserHandle, bAllowed); - } - public virtual void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_JSDialogResponse(_ptr, unBrowserHandle, bResult); - } - - public virtual Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultStatus(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItems(_ptr, resultHandle, pOutItemsArray, out punOutItemsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItemProperty(_ptr, resultHandle, unItemIndex, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultTimestamp(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_CheckResultSteamID(_ptr, resultHandle, steamIDExpected); - } - public virtual void /*void*/ ISteamInventory_DestroyResult( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_DestroyResult(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetAllItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsByID(_ptr, ref pResultHandle, pInstanceIDs, unCountInstanceIDs); - } - public virtual bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SerializeResult(_ptr, resultHandle, pOutBuffer, out punOutBufferSize); - } - public virtual bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_DeserializeResult(_ptr, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); - } - public virtual bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GenerateItems(_ptr, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GrantPromoItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItem(_ptr, ref pResultHandle, itemDef); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItems(_ptr, ref pResultHandle, pArrayItemDefs, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ConsumeItem(_ptr, ref pResultHandle, itemConsume, unQuantity); - } - public virtual bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ExchangeItems(_ptr, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); - } - public virtual bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TransferItemQuantity(_ptr, ref pResultHandle, itemIdSource, unQuantity, itemIdDest); - } - public virtual void /*void*/ ISteamInventory_SendItemDropHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_SendItemDropHeartbeat(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TriggerItemDrop(_ptr, ref pResultHandle, dropListDefinition); - } - public virtual bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TradeItems(_ptr, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); - } - public virtual bool /*bool*/ ISteamInventory_LoadItemDefinitions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_LoadItemDefinitions(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionIDs(_ptr, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionProperty(_ptr, iDefinition, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(_ptr, steamID); - } - public virtual bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(_ptr, steamID, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartPurchase(_ptr, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestPrices(_ptr); - } - public virtual uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetNumItemsWithPrices(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsWithPrices(_ptr, pArrayItemDefs, pPrices, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemPrice(_ptr, iDefinition, out pPrice); - } - public virtual SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartUpdateProperties(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RemoveProperty(_ptr, handle, nItemID, pchPropertyName); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty(_ptr, handle, nItemID, pchPropertyName, pchPropertyValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, bValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, nValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, flValue); - } - public virtual bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SubmitUpdateProperties(_ptr, handle, ref pResultHandle); - } - - public virtual void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetVideoURL(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_IsBroadcasting(_ptr, pnNumViewers); - } - public virtual void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetOPFSettings(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_GetOPFStringForApp(_ptr, unVideoAppID, pchBuffer, out pnBufferSize); - } - - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppBlocked(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppInBlockList(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(_ptr, eFeature); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(_ptr, eFeature); - } - - public virtual bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_InitGameServer(_ptr, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); - } - public virtual void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetProduct(_ptr, pszProduct); - } - public virtual void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameDescription(_ptr, pszGameDescription); - } - public virtual void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetModDir(_ptr, pszModDir); - } - public virtual void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetDedicatedServer(_ptr, bDedicated); - } - public virtual void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOn(_ptr, pszToken); - } - public virtual void /*void*/ ISteamGameServer_LogOnAnonymous() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOnAnonymous(_ptr); - } - public virtual void /*void*/ ISteamGameServer_LogOff() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOff(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BLoggedOn(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BSecure() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BSecure(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetSteamID(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_WasRestartRequested() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_WasRestartRequested(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMaxPlayerCount(_ptr, cPlayersMax); - } - public virtual void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetBotPlayerCount(_ptr, cBotplayers); - } - public virtual void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetServerName(_ptr, pszServerName); - } - public virtual void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMapName(_ptr, pszMapName); - } - public virtual void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetPasswordProtected(_ptr, bPasswordProtected); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorPort(_ptr, unSpectatorPort); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorServerName(_ptr, pszSpectatorServerName); - } - public virtual void /*void*/ ISteamGameServer_ClearAllKeyValues() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ClearAllKeyValues(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetKeyValue(_ptr, pKey, pValue); - } - public virtual void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameTags(_ptr, pchGameTags); - } - public virtual void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameData(_ptr, pchGameData); - } - public virtual void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetRegion(_ptr, pszRegion); - } - public virtual bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(_ptr, unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SendUserDisconnect(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BUpdateUserData(_ptr, steamIDUser, pchPlayerName, uScore); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_RequestUserGroupStatus(_ptr, steamIDUser, steamIDGroup); - } - public virtual void /*void*/ ISteamGameServer_GetGameplayStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_GetGameplayStats(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetServerReputation(_ptr); - } - public virtual uint /*uint32*/ ISteamGameServer_GetPublicIP() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetPublicIP(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_HandleIncomingPacket(_ptr, pData, cbData, srcIP, srcPort); - } - public virtual int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(_ptr, pOut, cbMaxOut, out pNetAdr, out pPort); - } - public virtual void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EnableHeartbeats(_ptr, bActive); - } - public virtual void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetHeartbeatInterval(_ptr, iHeartbeatInterval); - } - public virtual void /*void*/ ISteamGameServer_ForceHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ForceHeartbeat(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_AssociateWithClan(_ptr, steamIDClan); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(_ptr, steamIDNewPlayer); - } - - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat(_ptr, steamIDUser, pchName, nData); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat0(_ptr, steamIDUser, pchName, fData); - } - public virtual bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(_ptr, steamIDUser, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_ClearUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_StoreUserStats(_ptr, steamIDUser); - } - - public virtual bool /*bool*/ SteamApi_SteamAPI_Init() - { - return Native.SteamAPI_Init(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RunCallbacks() - { - Native.SteamAPI_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_RunCallbacks() - { - Native.SteamGameServer_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ) - { - Native.SteamAPI_RegisterCallback(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ) - { - Native.SteamAPI_UnregisterCallback(pCallback); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_RegisterCallResult(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_UnregisterCallResult(pCallback, callback); - } - public virtual bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ) - { - return Native.SteamInternal_GameServer_Init(unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString); - } - public virtual void /*void*/ SteamApi_SteamAPI_Shutdown() - { - Native.SteamAPI_Shutdown(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_Shutdown() - { - Native.SteamGameServer_Shutdown(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser() - { - return Native.SteamAPI_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe() - { - return Native.SteamAPI_GetHSteamPipe(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser() - { - return Native.SteamGameServer_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe() - { - return Native.SteamGameServer_GetHSteamPipe(); - } - public virtual IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ) - { - return Native.SteamInternal_CreateInterface(version); - } - public virtual bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ) - { - return Native.SteamAPI_RestartAppIfNecessary(unOwnAppID); - } - - internal static unsafe class Native - { - // - // ISteamClient - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - - // - // ISteamUser - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_InitiateGameConnection( IntPtr ISteamUser, IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetVoice( IntPtr ISteamUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_DecompressVoice( IntPtr ISteamUser, IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr ISteamUser ); - - // - // ISteamFriends - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetClanActivityCounts( IntPtr ISteamFriends, ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); - - // - // ISteamUtils - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetAPICallResult( IntPtr ISteamUtils, ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_ShowGamepadTextInput( IntPtr ISteamUtils, GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - - // - // ISteamMatchmaking - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetFavoriteGame( IntPtr ISteamMatchmaking, int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_AddFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); - - // - // ISteamMatchmakingServers - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); - - // - // ISteamRemoteStorage - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDetails( IntPtr ISteamRemoteStorage, ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_UGCRead( IntPtr ISteamRemoteStorage, ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - - // - // ISteamUserStats - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( IntPtr ISteamUserStats, ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t.PackSmall /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_UploadLeaderboardScore( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( IntPtr ISteamUserStats, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( IntPtr ISteamUserStats, int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - - // - // ISteamApps - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BGetDLCDataByIndex( IntPtr ISteamApps, int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); - - // - // ISteamNetworking - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendP2PPacket( IntPtr ISteamNetworking, ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_ReadP2PPacket( IntPtr ISteamNetworking, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetListenSocket_t /*(SNetListenSocket_t)*/ SteamAPI_ISteamNetworking_CreateListenSocket( IntPtr ISteamNetworking, int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( IntPtr ISteamNetworking, ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendDataOnSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveData( IntPtr ISteamNetworking, uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetSocketInfo( IntPtr ISteamNetworking, uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); - - // - // ISteamScreenshots - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( IntPtr ISteamScreenshots, string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - - // - // ISteamMusic - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr ISteamMusic ); - - // - // ISteamMusicRemote - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr ISteamMusicRemote ); - - // - // ISteamHTTP - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetCookie( IntPtr ISteamHTTP, uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - - // - // ISteamController - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerRepeatedHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_SetLEDColor( IntPtr ISteamController, ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); - - // - // ISteamUGC - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( IntPtr ISteamUGC, uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryAllUGCRequest( IntPtr ISteamUGC, UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t.PackSmall /*struct SteamUGCDetails_t **/ pDetails ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemInstallInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - - // - // ISteamAppList - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); - - // - // ISteamHTMLSurface - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Find( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetCookie( IntPtr ISteamHTMLSurface, string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - - // - // ISteamInventory - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItemProperty( IntPtr ISteamInventory, int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_DeserializeResult( IntPtr ISteamInventory, ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ExchangeItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TradeItems( IntPtr ISteamInventory, ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionProperty( IntPtr ISteamInventory, int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); - - // - // ISteamVideo - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - - // - // ISteamParentalSettings - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - - // - // ISteamGameServer - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_InitGameServer( IntPtr ISteamGameServer, uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamGameServer_GetNextOutgoingPacket( IntPtr ISteamGameServer, IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); - - // - // ISteamGameServerStats - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - - // - // SteamApi - // - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImport( "libsteam_api.so", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - - } - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs deleted file mode 100644 index 3b155bf..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Linux64.cs +++ /dev/null @@ -1,5063 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal class Linux64 : Interface - { - internal IntPtr _ptr; - public bool IsValid { get{ return _ptr != IntPtr.Zero; } } - - // - // Constructor sets pointer to native class - // - internal Linux64( IntPtr pointer ) - { - _ptr = pointer; - } - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - _ptr = IntPtr.Zero; - } - - public virtual HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateSteamPipe(_ptr); - } - public virtual bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BReleaseSteamPipe(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_ConnectToGlobalUser(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateLocalUser(_ptr, out phSteamPipe, eAccountType); - } - public virtual void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_ReleaseUser(_ptr, hSteamPipe, hUser); - } - public virtual IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUser(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServer(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetLocalIPBinding(_ptr, unIP, usPort); - } - public virtual IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamFriends(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUtils(_ptr, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmaking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmakingServers(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGenericInterface(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUserStats(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServerStats(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamApps(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamNetworking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamRemoteStorage(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamScreenshots(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual uint /*uint32*/ ISteamClient_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(_ptr); - } - public virtual IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTTP(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamController(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUGC(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamAppList(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusic(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusicRemote(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTMLSurface(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamInventory(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamVideo(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamParentalSettings(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - - public virtual HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetHSteamUser(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BLoggedOn(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetSteamID(_ptr); - } - public virtual int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_InitiateGameConnection(_ptr, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); - } - public virtual void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TerminateGameConnection(_ptr, unIPServer, usPortServer); - } - public virtual void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TrackAppUsageEvent(_ptr, gameID, eAppUsageEvent, pchExtraInfo); - } - public virtual bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetUserDataFolder(_ptr, pchBuffer, cubBuffer); - } - public virtual void /*void*/ ISteamUser_StartVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StartVoiceRecording(_ptr); - } - public virtual void /*void*/ ISteamUser_StopVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StopVoiceRecording(_ptr); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAvailableVoice(_ptr, out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoice(_ptr, bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_DecompressVoice(_ptr, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); - } - public virtual uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(_ptr); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamUser_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamUser_BIsBehindNAT() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsBehindNAT(_ptr); - } - public virtual void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_AdvertiseGame(_ptr, steamIDGameServer, unIPServer, usPortServer); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestEncryptedAppTicket(_ptr, pDataToInclude, cbDataToInclude); - } - public virtual bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetEncryptedAppTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetGameBadgeLevel(_ptr, nSeries, bFoil); - } - public virtual int /*int*/ ISteamUser_GetPlayerSteamLevel() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetPlayerSteamLevel(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestStoreAuthURL(_ptr, pchRedirectURL); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneVerified() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneVerified(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsTwoFactorEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsTwoFactorEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneIdentifying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneIdentifying(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(_ptr); - } - - public virtual IntPtr ISteamFriends_GetPersonaName() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaName(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetPersonaName(_ptr, pchPersonaName); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaState(_ptr); - } - public virtual int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCount(_ptr, iFriendFlags); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendByIndex(_ptr, iFriend, iFriendFlags); - } - public virtual FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRelationship(_ptr, steamIDFriend); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaState(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaName(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - var pFriendGameInfo_ps = new FriendGameInfo_t.PackSmall(); - var ret = Native.SteamAPI_ISteamFriends_GetFriendGamePlayed(_ptr, steamIDFriend, ref pFriendGameInfo_ps); - pFriendGameInfo = pFriendGameInfo_ps; - return ret; - } - public virtual IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(_ptr, steamIDFriend, iPersonaName); - } - public virtual int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendSteamLevel(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPlayerNickname(_ptr, steamIDPlayer); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupCount(_ptr); - } - public virtual FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(_ptr, iFG); - } - public virtual IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupName(_ptr, friendsGroupID); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(_ptr, friendsGroupID); - } - public virtual void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(_ptr, friendsGroupID, pOutSteamIDMembers, nMembersCount); - } - public virtual bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_HasFriend(_ptr, steamIDFriend, iFriendFlags); - } - public virtual int /*int*/ ISteamFriends_GetClanCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanByIndex(_ptr, iClan); - } - public virtual IntPtr ISteamFriends_GetClanName( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanName(_ptr, steamIDClan); - } - public virtual IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanTag(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanActivityCounts(_ptr, steamIDClan, out pnOnline, out pnInGame, out pnChatting); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_DownloadClanActivityCounts(_ptr, psteamIDClans, cClansToRequest); - } - public virtual int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCountFromSource(_ptr, steamIDSource); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(_ptr, steamIDSource, iFriend); - } - public virtual bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsUserInSource(_ptr, steamIDUser, steamIDSource); - } - public virtual void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(_ptr, steamIDUser, bSpeaking); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlay(_ptr, pchDialog); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(_ptr, pchDialog, steamID); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(_ptr, pchURL); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(_ptr, nAppID, eFlag); - } - public virtual void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetPlayedWith(_ptr, steamIDUserPlayedWith); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(_ptr, steamIDLobby); - } - public virtual int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetSmallFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetMediumFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetLargeFriendAvatar(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestUserInformation(_ptr, steamIDUser, bRequireNameOnly); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestClanOfficerList(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOwner(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerByIndex(_ptr, steamIDClan, iOfficer); - } - public virtual uint /*uint32*/ ISteamFriends_GetUserRestrictions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetUserRestrictions(_ptr); - } - public virtual bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetRichPresence(_ptr, pchKey, pchValue); - } - public virtual void /*void*/ ISteamFriends_ClearRichPresence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ClearRichPresence(_ptr); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresence(_ptr, steamIDFriend, pchKey); - } - public virtual int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(_ptr, steamIDFriend, iKey); - } - public virtual void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_RequestFriendRichPresence(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_InviteUserToGame(_ptr, steamIDFriend, pchConnectString); - } - public virtual int /*int*/ ISteamFriends_GetCoplayFriendCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriendCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriend(_ptr, iCoplayFriend); - } - public virtual int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayTime(_ptr, steamIDFriend); - } - public virtual AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayGame(_ptr, steamIDFriend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_JoinClanChatRoom(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_LeaveClanChatRoom(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMemberCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetChatMemberByIndex(_ptr, steamIDClan, iUser); - } - public virtual bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SendClanChatMessage(_ptr, steamIDClanChat, pchText); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMessage(_ptr, steamIDClanChat, iMessage, prgchText, cchTextMax, out peChatEntryType, out psteamidChatter); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatAdmin(_ptr, steamIDClanChat, steamIDUser); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetListenForFriendsMessages(_ptr, bInterceptEnabled); - } - public virtual bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_ReplyToFriendMessage(_ptr, steamIDFriend, pchMsgToSend); - } - public virtual int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendMessage(_ptr, steamIDFriend, iMessageID, pvData, cubData, out peChatEntryType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFollowerCount(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsFollowing(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_EnumerateFollowingList(_ptr, unStartIndex); - } - public virtual bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanPublic(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(_ptr, steamIDClan); - } - - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(_ptr); - } - public virtual Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetConnectedUniverse(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetServerRealTime() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetServerRealTime(_ptr); - } - public virtual IntPtr ISteamUtils_GetIPCountry() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCountry(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageSize(_ptr, iImage, out pnWidth, out pnHeight); - } - public virtual bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageRGBA(_ptr, iImage, pubDest, nDestBufferSize); - } - public virtual bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCSERIPPort(_ptr, out unIP, out usPort); - } - public virtual byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCurrentBatteryPower(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetAppID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAppID(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(_ptr, eNotificationPosition); - } - public virtual bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsAPICallCompleted(_ptr, hSteamAPICall, ref pbFailed); - } - public virtual SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallFailureReason(_ptr, hSteamAPICall); - } - public virtual bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallResult(_ptr, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed); - } - public virtual uint /*uint32*/ ISteamUtils_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamUtils_IsOverlayEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsOverlayEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_BOverlayNeedsPresent() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_BOverlayNeedsPresent(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_CheckFileSignature(_ptr, szFileName); - } - public virtual bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_ShowGamepadTextInput(_ptr, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText); - } - public virtual uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(_ptr, pchText, cchText); - } - public virtual IntPtr ISteamUtils_GetSteamUILanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSteamUILanguage(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamRunningInVR() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamRunningInVR(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationInset(_ptr, nHorizontalInset, nVerticalInset); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamInBigPictureMode(_ptr); - } - public virtual void /*void*/ ISteamUtils_StartVRDashboard() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_StartVRDashboard(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(_ptr, bEnabled); - } - - public virtual int /*int*/ ISteamMatchmaking_GetFavoriteGameCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(_ptr); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGame(_ptr, iGame, ref pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); - } - public virtual int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_AddFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyList(_ptr); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(_ptr, pchKeyToMatch, pchValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(_ptr, pchKeyToMatch, nValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(_ptr, pchKeyToMatch, nValueToBeCloseTo); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(_ptr, nSlotsAvailable); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(_ptr, eLobbyDistanceFilter); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(_ptr, cMaxResults); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(_ptr, iLobby); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_CreateLobby(_ptr, eLobbyType, cMaxMembers); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_JoinLobby(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_LeaveLobby(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_InviteUserToLobby(_ptr, steamIDLobby, steamIDInvitee); - } - public virtual int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(_ptr, steamIDLobby, iMember); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(_ptr, steamIDLobby, iLobbyData, pchKey, cchKeyBufferSize, pchValue, cchValueBufferSize); - } - public virtual bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_DeleteLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(_ptr, steamIDLobby, steamIDUser, pchKey); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(_ptr, steamIDLobby, pvMsgBody, cubMsgBody); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(_ptr, steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); - } - public virtual bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyData(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(_ptr, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(_ptr, steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(_ptr, steamIDLobby, cMaxMembers); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyType(_ptr, steamIDLobby, eLobbyType); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(_ptr, steamIDLobby, bLobbyJoinable); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyOwner(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyOwner(_ptr, steamIDLobby, steamIDNewOwner); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLinkedLobby(_ptr, steamIDLobby, steamIDLobbyDependent); - } - - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(_ptr, iApp, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(_ptr, hServerListRequest); - } - public virtual IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerDetails(_ptr, hRequest, iServer); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelQuery(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshQuery(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_IsRefreshing(_ptr, hRequest); - } - public virtual int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerCount(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshServer(_ptr, hRequest, iServer); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PingServer(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PlayerDetails(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_ServerRules(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(_ptr, hServerQuery); - } - - public virtual bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWrite(_ptr, pchFile, pvData, cubData); - } - public virtual int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileRead(_ptr, pchFile, pvData, cubDataToRead); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteAsync(_ptr, pchFile, pvData, cubData); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsync(_ptr, pchFile, nOffset, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(_ptr, hReadCall, pvBuffer, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileForget(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileDelete(_ptr, pchFile); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileShare(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(_ptr, pchFile, eRemoteStoragePlatform); - } - public virtual UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(_ptr, writeHandle, pvData, cubData); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileExists(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FilePersisted(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileSize(_ptr, pchFile); - } - public virtual long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(_ptr, pchFile); - } - public virtual RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileCount(_ptr); - } - public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(_ptr, iFile, out pnFileSizeInBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetQuota(_ptr, out pnTotalBytes, out puAvailableBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(_ptr); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(_ptr); - } - public virtual void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - Native.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(_ptr, bEnabled); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownload(_ptr, hContent, unPriority); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(_ptr, hContent, out pnBytesDownloaded, out pnBytesExpected); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDetails(_ptr, hContent, ref pnAppID, ppchName, out pnFileSizeInBytes, out pSteamIDOwner); - } - public virtual int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCRead(_ptr, hContent, pvData, cubDataToRead, cOffset, eAction); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(_ptr); - } - public virtual UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(_ptr, iCachedContent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); - pTags = pTags_ps; - return ret; - } - public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(_ptr, updateHandle, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(_ptr, updateHandle, pchPreviewFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(_ptr, updateHandle, pchTitle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(_ptr, updateHandle, pchDescription); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(_ptr, updateHandle); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(_ptr, unPublishedFileId, unMaxSecondsOld); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(_ptr, updateHandle, pchChangeDescription); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(_ptr, unPublishedFileId, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); - var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); - pRequiredTags = pRequiredTags_ps; - pExcludedTags = pExcludedTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(_ptr, unPublishedFileId, eAction); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); - pTags = pTags_ps; - pUserTags = pUserTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(_ptr, hContent, pchLocation, unPriority); - } - - public virtual bool /*bool*/ ISteamUserStats_RequestCurrentStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestCurrentStats(_ptr); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat0(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat(_ptr, pchName, nData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat0(_ptr, pchName, fData); - } - public virtual bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UpdateAvgRateStat(_ptr, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievement(_ptr, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ClearAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(_ptr, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_StoreStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_StoreStats(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementIcon(_ptr, pchName); - } - public virtual IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(_ptr, pchName, pchKey); - } - public virtual bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_IndicateAchievementProgress(_ptr, pchName, nCurProgress, nMaxProgress); - } - public virtual uint /*uint32*/ ISteamUserStats_GetNumAchievements() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumAchievements(_ptr); - } - public virtual IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementName(_ptr, iAchievement); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(_ptr, steamIDUser, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ResetAllStats(_ptr, bAchievementsToo); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(_ptr, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindLeaderboard(_ptr, pchLeaderboardName); - } - public virtual IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardName(_ptr, hSteamLeaderboard); - } - public virtual int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(_ptr, hSteamLeaderboard); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(_ptr, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(_ptr, hSteamLeaderboard, prgUsers, cUsers); - } - public virtual bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - var pLeaderboardEntry_ps = new LeaderboardEntry_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(_ptr, hSteamLeaderboardEntries, index, ref pLeaderboardEntry_ps, pDetails, cDetailsMax); - pLeaderboardEntry = pLeaderboardEntry_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UploadLeaderboardScore(_ptr, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(_ptr, hSteamLeaderboard, hUGC); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(_ptr, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(_ptr, iIteratorPrevious, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(_ptr, pchName, out pflPercent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalStats(_ptr, nHistoryDays); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat(_ptr, pchStatName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat0(_ptr, pchStatName, out pData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory(_ptr, pchStatName, out pData, cubData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(_ptr, pchStatName, out pData, cubData); - } - - public virtual bool /*bool*/ ISteamApps_BIsSubscribed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribed(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsLowViolence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsLowViolence(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsCybercafe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsCybercafe(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsVACBanned() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsVACBanned(_ptr); - } - public virtual IntPtr ISteamApps_GetCurrentGameLanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentGameLanguage(_ptr); - } - public virtual IntPtr ISteamApps_GetAvailableGameLanguages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAvailableGameLanguages(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedApp(_ptr, appID); - } - public virtual bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsDlcInstalled(_ptr, appID); - } - public virtual uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(_ptr); - } - public virtual int /*int*/ ISteamApps_GetDLCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDLCCount(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BGetDLCDataByIndex(_ptr, iDLC, ref pAppID, ref pbAvailable, pchName, cchNameBufferSize); - } - public virtual void /*void*/ ISteamApps_InstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_InstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_UninstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_UninstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentBetaName(_ptr, pchName, cchNameBufferSize); - } - public virtual bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_MarkContentCorrupt(_ptr, bMissingFilesOnly); - } - public virtual uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetInstalledDepots(_ptr, appID, pvecDepots, cMaxDepots); - } - public virtual uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppInstallDir(_ptr, appID, pchFolder, cchFolderBufferSize); - } - public virtual bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsAppInstalled(_ptr, appID); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppOwner(_ptr); - } - public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetLaunchQueryParam(_ptr, pchKey); - } - public virtual bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDlcDownloadProgress(_ptr, nAppID, out punBytesDownloaded, out punBytesTotal); - } - public virtual int /*int*/ ISteamApps_GetAppBuildId() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppBuildId(_ptr); - } - public virtual void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetFileDetails(_ptr, pszFileName); - } - - public virtual bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendP2PPacket(_ptr, steamIDRemote, pubData, cubData, eP2PSendType, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(_ptr, out pcubMsgSize, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_ReadP2PPacket(_ptr, pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(_ptr, steamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - var pConnectionState_ps = new P2PSessionState_t.PackSmall(); - var ret = Native.SteamAPI_ISteamNetworking_GetP2PSessionState(_ptr, steamIDRemote, ref pConnectionState_ps); - pConnectionState = pConnectionState_ps; - return ret; - } - public virtual bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(_ptr, bAllow); - } - public virtual SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateListenSocket(_ptr, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(_ptr, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateConnectionSocket(_ptr, nIP, nPort, nTimeoutSec); - } - public virtual bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroySocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroyListenSocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendDataOnSocket(_ptr, hSocket, pubData, cubData, bReliable); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(_ptr, hSocket, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(_ptr, hSocket, pubDest, cubDest, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailable(_ptr, hListenSocket, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveData(_ptr, hListenSocket, pubDest, cubDest, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketInfo(_ptr, hSocket, out pSteamIDRemote, peSocketStatus, out punIPRemote, out punPortRemote); - } - public virtual bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetListenSocketInfo(_ptr, hListenSocket, out pnIP, out pnPort); - } - public virtual SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketConnectionType(_ptr, hSocket); - } - public virtual int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetMaxPacketSize(_ptr, hSocket); - } - - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_WriteScreenshot(_ptr, pubRGB, cubRGB, nWidth, nHeight); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(_ptr, pchFilename, pchThumbnailFilename, nWidth, nHeight); - } - public virtual void /*void*/ ISteamScreenshots_TriggerScreenshot() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_TriggerScreenshot(_ptr); - } - public virtual void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_HookScreenshots(_ptr, bHook); - } - public virtual bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_SetLocation(_ptr, hScreenshot, pchLocation); - } - public virtual bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagUser(_ptr, hScreenshot, steamID); - } - public virtual bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagPublishedFile(_ptr, hScreenshot, unPublishedFileID); - } - public virtual bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_IsScreenshotsHooked(_ptr); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary(_ptr, eType, pchFilename, pchVRFilename); - } - - public virtual bool /*bool*/ ISteamMusic_BIsEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamMusic_BIsPlaying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsPlaying(_ptr); - } - public virtual AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetPlaybackStatus(_ptr); - } - public virtual void /*void*/ ISteamMusic_Play() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Play(_ptr); - } - public virtual void /*void*/ ISteamMusic_Pause() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Pause(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayPrevious() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayPrevious(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayNext() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayNext(_ptr); - } - public virtual void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_SetVolume(_ptr, flVolume); - } - public virtual float /*float*/ ISteamMusic_GetVolume() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetVolume(_ptr); - } - - public virtual bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BActivationSuccess(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetDisplayName(_ptr, pchDisplayName); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayNext(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableQueue(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlaylists(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(_ptr, nStatus); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateVolume(_ptr, flValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(_ptr, bAvailable); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(_ptr, pchText); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(_ptr, nValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetQueueEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetQueueEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetQueueEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistDidChange(_ptr); - } - - public virtual HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateHTTPRequest(_ptr, eHTTPRequestMethod, pchAbsoluteURL); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(_ptr, hRequest, ulContextValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(_ptr, hRequest, unTimeoutSeconds); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(_ptr, hRequest, pchHeaderName, pchHeaderValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(_ptr, hRequest, pchParamName, pchParamValue); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequest(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_DeferHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(_ptr, hRequest, pchHeaderName, out unResponseHeaderSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(_ptr, hRequest, pchHeaderName, out pHeaderValueBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(_ptr, hRequest, out unBodySize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(_ptr, hRequest, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(_ptr, hRequest, cOffset, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(_ptr, hRequest, out pflPercentOut); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(_ptr, hRequest, pchContentType, out pubBody, unBodyLen); - } - public virtual HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateCookieContainer(_ptr, bAllowResponsesToModify); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseCookieContainer(_ptr, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetCookie(_ptr, hCookieContainer, pchHost, pchUrl, pchCookie); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(_ptr, hRequest, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(_ptr, hRequest, pchUserAgentInfo); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(_ptr, hRequest, bRequireVerifiedCertificate); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(_ptr, hRequest, unMilliseconds); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(_ptr, hRequest, ref pbWasTimedOut); - } - - public virtual bool /*bool*/ ISteamController_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Init(_ptr); - } - public virtual bool /*bool*/ ISteamController_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Shutdown(_ptr); - } - public virtual void /*void*/ ISteamController_RunFrame() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_RunFrame(_ptr); - } - public virtual int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetConnectedControllers(_ptr, handlesOut); - } - public virtual bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowBindingPanel(_ptr, controllerHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActionSetHandle(_ptr, pszActionSetName); - } - public virtual void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSet(_ptr, controllerHandle, actionSetHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetCurrentActionSet(_ptr, controllerHandle); - } - public virtual void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateAllActionSetLayers(_ptr, controllerHandle); - } - public virtual int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActiveActionSetLayers(_ptr, controllerHandle, handlesOut); - } - public virtual ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionHandle(_ptr, pszActionName); - } - public virtual ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionData(_ptr, controllerHandle, digitalActionHandle); - } - public virtual int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionOrigins(_ptr, controllerHandle, actionSetHandle, digitalActionHandle, out originsOut); - } - public virtual ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionHandle(_ptr, pszActionName); - } - public virtual ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionData(_ptr, controllerHandle, analogActionHandle); - } - public virtual int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionOrigins(_ptr, controllerHandle, actionSetHandle, analogActionHandle, out originsOut); - } - public virtual void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_StopAnalogActionMomentum(_ptr, controllerHandle, eAction); - } - public virtual void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec); - } - public virtual void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerRepeatedHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); - } - public virtual void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerVibration(_ptr, controllerHandle, usLeftSpeed, usRightSpeed); - } - public virtual void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_SetLEDColor(_ptr, controllerHandle, nColorR, nColorG, nColorB, nFlags); - } - public virtual int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGamepadIndexForController(_ptr, ulControllerHandle); - } - public virtual ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetControllerForGamepadIndex(_ptr, nIndex); - } - public virtual ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetMotionData(_ptr, controllerHandle); - } - public virtual bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowDigitalActionOrigins(_ptr, controllerHandle, digitalActionHandle, flScale, flXPosition, flYPosition); - } - public virtual bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowAnalogActionOrigins(_ptr, controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition); - } - public virtual IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetStringForActionOrigin(_ptr, eOrigin); - } - public virtual IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGlyphForActionOrigin(_ptr, eOrigin); - } - public virtual SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetInputTypeForHandle(_ptr, controllerHandle); - } - - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(_ptr, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(_ptr, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SendQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pDetails_ps = new SteamUGCDetails_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_GetQueryUGCResult(_ptr, handle, index, ref pDetails_ps); - pDetails = pDetails_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(_ptr, handle, index, pchURL, cchURLSize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCMetadata(_ptr, handle, index, pchMetadata, cchMetadatasize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCChildren(_ptr, handle, index, pvecPublishedFileID, cMaxEntries); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCStatistic(_ptr, handle, index, eStatType, out pStatValue); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(_ptr, handle, index, previewIndex, pchURLOrVideoID, cchURLSize, pchOriginalFileName, cchOriginalFileNameSize, out pPreviewType); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(_ptr, handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize); - } - public virtual bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddExcludedTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnOnlyIDs(_ptr, handle, bReturnOnlyIDs); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnKeyValueTags(_ptr, handle, bReturnKeyValueTags); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnLongDescription(_ptr, handle, bReturnLongDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnMetadata(_ptr, handle, bReturnMetadata); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnChildren(_ptr, handle, bReturnChildren); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(_ptr, handle, bReturnAdditionalPreviews); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnTotalOnly(_ptr, handle, bReturnTotalOnly); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnPlaytimeStats(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetAllowCachedResponse(_ptr, handle, unMaxAgeSeconds); - } - public virtual bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetCloudFileNameFilter(_ptr, handle, pMatchCloudFileName); - } - public virtual bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetMatchAnyTag(_ptr, handle, bMatchAnyTag); - } - public virtual bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetSearchText(_ptr, handle, pSearchText); - } - public virtual bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetRankedByTrendDays(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(_ptr, handle, pKey, pValue); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RequestUGCDetails(_ptr, nPublishedFileID, unMaxAgeSeconds); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateItem(_ptr, nConsumerAppId, eFileType); - } - public virtual UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartItemUpdate(_ptr, nConsumerAppId, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTitle(_ptr, handle, pchTitle); - } - public virtual bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemDescription(_ptr, handle, pchDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemUpdateLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemMetadata(_ptr, handle, pchMetaData); - } - public virtual bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemVisibility(_ptr, handle, eVisibility); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_SetItemTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemContent(_ptr, handle, pszContentFolder); - } - public virtual bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemPreview(_ptr, handle, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(_ptr, handle, pchKey); - } - public virtual bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemKeyValueTag(_ptr, handle, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewFile(_ptr, handle, pszPreviewFile, type); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewVideo(_ptr, handle, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewFile(_ptr, handle, index, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewVideo(_ptr, handle, index, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemPreview(_ptr, handle, index); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubmitItemUpdate(_ptr, handle, pchChangeNote); - } - public virtual ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemUpdateProgress(_ptr, handle, out punBytesProcessed, out punBytesTotal); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetUserItemVote(_ptr, nPublishedFileID, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetUserItemVote(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemToFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemFromFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubscribeItem(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UnsubscribeItem(_ptr, nPublishedFileID); - } - public virtual uint /*uint32*/ ISteamUGC_GetNumSubscribedItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetNumSubscribedItems(_ptr); - } - public virtual uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetSubscribedItems(_ptr, pvecPublishedFileID, cMaxEntries); - } - public virtual uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemState(_ptr, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemInstallInfo(_ptr, nPublishedFileID, out punSizeOnDisk, pchFolder, cchFolderSize, out punTimeStamp); - } - public virtual bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemDownloadInfo(_ptr, nPublishedFileID, out punBytesDownloaded, out punBytesTotal); - } - public virtual bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DownloadItem(_ptr, nPublishedFileID, bHighPriority); - } - public virtual bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(_ptr, unWorkshopDepotID, pszFolder); - } - public virtual void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - Native.SteamAPI_ISteamUGC_SuspendDownloads(_ptr, bSuspend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetAppDependencies(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DeleteItem(_ptr, nPublishedFileID); - } - - public virtual uint /*uint32*/ ISteamAppList_GetNumInstalledApps() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetNumInstalledApps(_ptr); - } - public virtual uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetInstalledApps(_ptr, pvecAppID, unMaxAppIDs); - } - public virtual int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppName(_ptr, nAppID, pchName, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppInstallDir(_ptr, nAppID, pchDirectory, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppBuildId(_ptr, nAppID); - } - - public virtual void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Init(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Shutdown(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_CreateBrowser(_ptr, pchUserAgent, pchUserCSS); - } - public virtual void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_RemoveBrowser(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_LoadURL(_ptr, unBrowserHandle, pchURL, pchPostData); - } - public virtual void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetSize(_ptr, unBrowserHandle, unWidth, unHeight); - } - public virtual void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopLoad(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Reload(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoBack(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoForward(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AddHeader(_ptr, unBrowserHandle, pchKey, pchValue); - } - public virtual void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(_ptr, unBrowserHandle, pchScript); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseUp(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDown(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseMove(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseWheel(_ptr, unBrowserHandle, nDelta); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyDown(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyUp(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyChar(_ptr, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetKeyFocus(_ptr, unBrowserHandle, bHasKeyFocus); - } - public virtual void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ViewSource(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_CopyToClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Find(_ptr, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); - } - public virtual void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopFind(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetCookie(_ptr, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); - } - public virtual void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(_ptr, unBrowserHandle, flZoom, nPointX, nPointY); - } - public virtual void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(_ptr, unBrowserHandle, bBackgroundMode); - } - public virtual void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(_ptr, unBrowserHandle, flDPIScaling); - } - public virtual void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AllowStartRequest(_ptr, unBrowserHandle, bAllowed); - } - public virtual void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_JSDialogResponse(_ptr, unBrowserHandle, bResult); - } - - public virtual Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultStatus(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItems(_ptr, resultHandle, pOutItemsArray, out punOutItemsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItemProperty(_ptr, resultHandle, unItemIndex, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultTimestamp(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_CheckResultSteamID(_ptr, resultHandle, steamIDExpected); - } - public virtual void /*void*/ ISteamInventory_DestroyResult( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_DestroyResult(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetAllItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsByID(_ptr, ref pResultHandle, pInstanceIDs, unCountInstanceIDs); - } - public virtual bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SerializeResult(_ptr, resultHandle, pOutBuffer, out punOutBufferSize); - } - public virtual bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_DeserializeResult(_ptr, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); - } - public virtual bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GenerateItems(_ptr, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GrantPromoItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItem(_ptr, ref pResultHandle, itemDef); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItems(_ptr, ref pResultHandle, pArrayItemDefs, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ConsumeItem(_ptr, ref pResultHandle, itemConsume, unQuantity); - } - public virtual bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ExchangeItems(_ptr, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); - } - public virtual bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TransferItemQuantity(_ptr, ref pResultHandle, itemIdSource, unQuantity, itemIdDest); - } - public virtual void /*void*/ ISteamInventory_SendItemDropHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_SendItemDropHeartbeat(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TriggerItemDrop(_ptr, ref pResultHandle, dropListDefinition); - } - public virtual bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TradeItems(_ptr, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); - } - public virtual bool /*bool*/ ISteamInventory_LoadItemDefinitions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_LoadItemDefinitions(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionIDs(_ptr, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionProperty(_ptr, iDefinition, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(_ptr, steamID); - } - public virtual bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(_ptr, steamID, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartPurchase(_ptr, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestPrices(_ptr); - } - public virtual uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetNumItemsWithPrices(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsWithPrices(_ptr, pArrayItemDefs, pPrices, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemPrice(_ptr, iDefinition, out pPrice); - } - public virtual SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartUpdateProperties(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RemoveProperty(_ptr, handle, nItemID, pchPropertyName); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty(_ptr, handle, nItemID, pchPropertyName, pchPropertyValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, bValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, nValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, flValue); - } - public virtual bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SubmitUpdateProperties(_ptr, handle, ref pResultHandle); - } - - public virtual void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetVideoURL(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_IsBroadcasting(_ptr, pnNumViewers); - } - public virtual void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetOPFSettings(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_GetOPFStringForApp(_ptr, unVideoAppID, pchBuffer, out pnBufferSize); - } - - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppBlocked(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppInBlockList(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(_ptr, eFeature); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(_ptr, eFeature); - } - - public virtual bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_InitGameServer(_ptr, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); - } - public virtual void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetProduct(_ptr, pszProduct); - } - public virtual void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameDescription(_ptr, pszGameDescription); - } - public virtual void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetModDir(_ptr, pszModDir); - } - public virtual void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetDedicatedServer(_ptr, bDedicated); - } - public virtual void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOn(_ptr, pszToken); - } - public virtual void /*void*/ ISteamGameServer_LogOnAnonymous() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOnAnonymous(_ptr); - } - public virtual void /*void*/ ISteamGameServer_LogOff() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOff(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BLoggedOn(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BSecure() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BSecure(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetSteamID(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_WasRestartRequested() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_WasRestartRequested(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMaxPlayerCount(_ptr, cPlayersMax); - } - public virtual void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetBotPlayerCount(_ptr, cBotplayers); - } - public virtual void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetServerName(_ptr, pszServerName); - } - public virtual void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMapName(_ptr, pszMapName); - } - public virtual void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetPasswordProtected(_ptr, bPasswordProtected); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorPort(_ptr, unSpectatorPort); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorServerName(_ptr, pszSpectatorServerName); - } - public virtual void /*void*/ ISteamGameServer_ClearAllKeyValues() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ClearAllKeyValues(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetKeyValue(_ptr, pKey, pValue); - } - public virtual void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameTags(_ptr, pchGameTags); - } - public virtual void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameData(_ptr, pchGameData); - } - public virtual void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetRegion(_ptr, pszRegion); - } - public virtual bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(_ptr, unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SendUserDisconnect(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BUpdateUserData(_ptr, steamIDUser, pchPlayerName, uScore); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_RequestUserGroupStatus(_ptr, steamIDUser, steamIDGroup); - } - public virtual void /*void*/ ISteamGameServer_GetGameplayStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_GetGameplayStats(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetServerReputation(_ptr); - } - public virtual uint /*uint32*/ ISteamGameServer_GetPublicIP() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetPublicIP(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_HandleIncomingPacket(_ptr, pData, cbData, srcIP, srcPort); - } - public virtual int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(_ptr, pOut, cbMaxOut, out pNetAdr, out pPort); - } - public virtual void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EnableHeartbeats(_ptr, bActive); - } - public virtual void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetHeartbeatInterval(_ptr, iHeartbeatInterval); - } - public virtual void /*void*/ ISteamGameServer_ForceHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ForceHeartbeat(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_AssociateWithClan(_ptr, steamIDClan); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(_ptr, steamIDNewPlayer); - } - - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat(_ptr, steamIDUser, pchName, nData); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat0(_ptr, steamIDUser, pchName, fData); - } - public virtual bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(_ptr, steamIDUser, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_ClearUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_StoreUserStats(_ptr, steamIDUser); - } - - public virtual bool /*bool*/ SteamApi_SteamAPI_Init() - { - return Native.SteamAPI_Init(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RunCallbacks() - { - Native.SteamAPI_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_RunCallbacks() - { - Native.SteamGameServer_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ) - { - Native.SteamAPI_RegisterCallback(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ) - { - Native.SteamAPI_UnregisterCallback(pCallback); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_RegisterCallResult(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_UnregisterCallResult(pCallback, callback); - } - public virtual bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ) - { - return Native.SteamInternal_GameServer_Init(unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString); - } - public virtual void /*void*/ SteamApi_SteamAPI_Shutdown() - { - Native.SteamAPI_Shutdown(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_Shutdown() - { - Native.SteamGameServer_Shutdown(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser() - { - return Native.SteamAPI_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe() - { - return Native.SteamAPI_GetHSteamPipe(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser() - { - return Native.SteamGameServer_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe() - { - return Native.SteamGameServer_GetHSteamPipe(); - } - public virtual IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ) - { - return Native.SteamInternal_CreateInterface(version); - } - public virtual bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ) - { - return Native.SteamAPI_RestartAppIfNecessary(unOwnAppID); - } - - internal static unsafe class Native - { - // - // ISteamClient - // - [DllImport( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - - // - // ISteamUser - // - [DllImport( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_InitiateGameConnection( IntPtr ISteamUser, IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api64.so" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetVoice( IntPtr ISteamUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api64.so" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_DecompressVoice( IntPtr ISteamUser, IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api64.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImport( "libsteam_api64.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr ISteamUser ); - - // - // ISteamFriends - // - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImport( "libsteam_api64.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetClanActivityCounts( IntPtr ISteamFriends, ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); - - // - // ISteamUtils - // - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImport( "libsteam_api64.so" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetAPICallResult( IntPtr ISteamUtils, ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_ShowGamepadTextInput( IntPtr ISteamUtils, GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - - // - // ISteamMatchmaking - // - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetFavoriteGame( IntPtr ISteamMatchmaking, int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_AddFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); - - // - // ISteamMatchmakingServers - // - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); - - // - // ISteamRemoteStorage - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImport( "libsteam_api64.so" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDetails( IntPtr ISteamRemoteStorage, ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_UGCRead( IntPtr ISteamRemoteStorage, ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api64.so" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - [DllImport( "libsteam_api64.so" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - - // - // ISteamUserStats - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api64.so" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api64.so" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( IntPtr ISteamUserStats, ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t.PackSmall /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_UploadLeaderboardScore( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( IntPtr ISteamUserStats, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( IntPtr ISteamUserStats, int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - - // - // ISteamApps - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BGetDLCDataByIndex( IntPtr ISteamApps, int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); - - // - // ISteamNetworking - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendP2PPacket( IntPtr ISteamNetworking, ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_ReadP2PPacket( IntPtr ISteamNetworking, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImport( "libsteam_api64.so" )] internal static extern SNetListenSocket_t /*(SNetListenSocket_t)*/ SteamAPI_ISteamNetworking_CreateListenSocket( IntPtr ISteamNetworking, int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api64.so" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( IntPtr ISteamNetworking, ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api64.so" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendDataOnSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveData( IntPtr ISteamNetworking, uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetSocketInfo( IntPtr ISteamNetworking, uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImport( "libsteam_api64.so" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); - - // - // ISteamScreenshots - // - [DllImport( "libsteam_api64.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api64.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( IntPtr ISteamScreenshots, string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api64.so" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - - // - // ISteamMusic - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImport( "libsteam_api64.so" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr ISteamMusic ); - - // - // ISteamMusicRemote - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr ISteamMusicRemote ); - - // - // ISteamHTTP - // - [DllImport( "libsteam_api64.so" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImport( "libsteam_api64.so" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetCookie( IntPtr ISteamHTTP, uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - - // - // ISteamController - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerRepeatedHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamController_SetLEDColor( IntPtr ISteamController, ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImport( "libsteam_api64.so" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); - - // - // ISteamUGC - // - [DllImport( "libsteam_api64.so" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( IntPtr ISteamUGC, uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api64.so" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryAllUGCRequest( IntPtr ISteamUGC, UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api64.so" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t.PackSmall /*struct SteamUGCDetails_t **/ pDetails ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImport( "libsteam_api64.so" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImport( "libsteam_api64.so" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemInstallInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - - // - // ISteamAppList - // - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); - - // - // ISteamHTMLSurface - // - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Find( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetCookie( IntPtr ISteamHTMLSurface, string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - - // - // ISteamInventory - // - [DllImport( "libsteam_api64.so" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItemProperty( IntPtr ISteamInventory, int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_DeserializeResult( IntPtr ISteamInventory, ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ExchangeItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TradeItems( IntPtr ISteamInventory, ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionProperty( IntPtr ISteamInventory, int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); - - // - // ISteamVideo - // - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - - // - // ISteamParentalSettings - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - - // - // ISteamGameServer - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_InitGameServer( IntPtr ISteamGameServer, uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImport( "libsteam_api64.so" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImport( "libsteam_api64.so" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api64.so" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImport( "libsteam_api64.so" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImport( "libsteam_api64.so" )] internal static extern int /*int*/ SteamAPI_ISteamGameServer_GetNextOutgoingPacket( IntPtr ISteamGameServer, IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); - - // - // ISteamGameServerStats - // - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api64.so" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - - // - // SteamApi - // - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImport( "libsteam_api64.so" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImport( "libsteam_api64.so" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImport( "libsteam_api64.so" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImport( "libsteam_api64.so" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - - } - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs deleted file mode 100644 index 989ad11..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Mac.cs +++ /dev/null @@ -1,5063 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal class Mac : Interface - { - internal IntPtr _ptr; - public bool IsValid { get{ return _ptr != IntPtr.Zero; } } - - // - // Constructor sets pointer to native class - // - internal Mac( IntPtr pointer ) - { - _ptr = pointer; - } - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - _ptr = IntPtr.Zero; - } - - public virtual HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateSteamPipe(_ptr); - } - public virtual bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BReleaseSteamPipe(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_ConnectToGlobalUser(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateLocalUser(_ptr, out phSteamPipe, eAccountType); - } - public virtual void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_ReleaseUser(_ptr, hSteamPipe, hUser); - } - public virtual IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUser(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServer(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetLocalIPBinding(_ptr, unIP, usPort); - } - public virtual IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamFriends(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUtils(_ptr, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmaking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmakingServers(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGenericInterface(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUserStats(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServerStats(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamApps(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamNetworking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamRemoteStorage(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamScreenshots(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual uint /*uint32*/ ISteamClient_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(_ptr); - } - public virtual IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTTP(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamController(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUGC(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamAppList(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusic(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusicRemote(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTMLSurface(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamInventory(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamVideo(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamParentalSettings(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - - public virtual HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetHSteamUser(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BLoggedOn(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetSteamID(_ptr); - } - public virtual int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_InitiateGameConnection(_ptr, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); - } - public virtual void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TerminateGameConnection(_ptr, unIPServer, usPortServer); - } - public virtual void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TrackAppUsageEvent(_ptr, gameID, eAppUsageEvent, pchExtraInfo); - } - public virtual bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetUserDataFolder(_ptr, pchBuffer, cubBuffer); - } - public virtual void /*void*/ ISteamUser_StartVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StartVoiceRecording(_ptr); - } - public virtual void /*void*/ ISteamUser_StopVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StopVoiceRecording(_ptr); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAvailableVoice(_ptr, out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoice(_ptr, bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_DecompressVoice(_ptr, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); - } - public virtual uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(_ptr); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamUser_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamUser_BIsBehindNAT() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsBehindNAT(_ptr); - } - public virtual void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_AdvertiseGame(_ptr, steamIDGameServer, unIPServer, usPortServer); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestEncryptedAppTicket(_ptr, pDataToInclude, cbDataToInclude); - } - public virtual bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetEncryptedAppTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetGameBadgeLevel(_ptr, nSeries, bFoil); - } - public virtual int /*int*/ ISteamUser_GetPlayerSteamLevel() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetPlayerSteamLevel(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestStoreAuthURL(_ptr, pchRedirectURL); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneVerified() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneVerified(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsTwoFactorEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsTwoFactorEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneIdentifying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneIdentifying(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(_ptr); - } - - public virtual IntPtr ISteamFriends_GetPersonaName() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaName(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetPersonaName(_ptr, pchPersonaName); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaState(_ptr); - } - public virtual int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCount(_ptr, iFriendFlags); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendByIndex(_ptr, iFriend, iFriendFlags); - } - public virtual FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRelationship(_ptr, steamIDFriend); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaState(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaName(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - var pFriendGameInfo_ps = new FriendGameInfo_t.PackSmall(); - var ret = Native.SteamAPI_ISteamFriends_GetFriendGamePlayed(_ptr, steamIDFriend, ref pFriendGameInfo_ps); - pFriendGameInfo = pFriendGameInfo_ps; - return ret; - } - public virtual IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(_ptr, steamIDFriend, iPersonaName); - } - public virtual int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendSteamLevel(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPlayerNickname(_ptr, steamIDPlayer); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupCount(_ptr); - } - public virtual FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(_ptr, iFG); - } - public virtual IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupName(_ptr, friendsGroupID); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(_ptr, friendsGroupID); - } - public virtual void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(_ptr, friendsGroupID, pOutSteamIDMembers, nMembersCount); - } - public virtual bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_HasFriend(_ptr, steamIDFriend, iFriendFlags); - } - public virtual int /*int*/ ISteamFriends_GetClanCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanByIndex(_ptr, iClan); - } - public virtual IntPtr ISteamFriends_GetClanName( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanName(_ptr, steamIDClan); - } - public virtual IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanTag(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanActivityCounts(_ptr, steamIDClan, out pnOnline, out pnInGame, out pnChatting); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_DownloadClanActivityCounts(_ptr, psteamIDClans, cClansToRequest); - } - public virtual int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCountFromSource(_ptr, steamIDSource); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(_ptr, steamIDSource, iFriend); - } - public virtual bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsUserInSource(_ptr, steamIDUser, steamIDSource); - } - public virtual void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(_ptr, steamIDUser, bSpeaking); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlay(_ptr, pchDialog); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(_ptr, pchDialog, steamID); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(_ptr, pchURL); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(_ptr, nAppID, eFlag); - } - public virtual void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetPlayedWith(_ptr, steamIDUserPlayedWith); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(_ptr, steamIDLobby); - } - public virtual int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetSmallFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetMediumFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetLargeFriendAvatar(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestUserInformation(_ptr, steamIDUser, bRequireNameOnly); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestClanOfficerList(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOwner(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerByIndex(_ptr, steamIDClan, iOfficer); - } - public virtual uint /*uint32*/ ISteamFriends_GetUserRestrictions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetUserRestrictions(_ptr); - } - public virtual bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetRichPresence(_ptr, pchKey, pchValue); - } - public virtual void /*void*/ ISteamFriends_ClearRichPresence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ClearRichPresence(_ptr); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresence(_ptr, steamIDFriend, pchKey); - } - public virtual int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(_ptr, steamIDFriend, iKey); - } - public virtual void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_RequestFriendRichPresence(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_InviteUserToGame(_ptr, steamIDFriend, pchConnectString); - } - public virtual int /*int*/ ISteamFriends_GetCoplayFriendCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriendCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriend(_ptr, iCoplayFriend); - } - public virtual int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayTime(_ptr, steamIDFriend); - } - public virtual AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayGame(_ptr, steamIDFriend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_JoinClanChatRoom(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_LeaveClanChatRoom(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMemberCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetChatMemberByIndex(_ptr, steamIDClan, iUser); - } - public virtual bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SendClanChatMessage(_ptr, steamIDClanChat, pchText); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMessage(_ptr, steamIDClanChat, iMessage, prgchText, cchTextMax, out peChatEntryType, out psteamidChatter); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatAdmin(_ptr, steamIDClanChat, steamIDUser); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetListenForFriendsMessages(_ptr, bInterceptEnabled); - } - public virtual bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_ReplyToFriendMessage(_ptr, steamIDFriend, pchMsgToSend); - } - public virtual int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendMessage(_ptr, steamIDFriend, iMessageID, pvData, cubData, out peChatEntryType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFollowerCount(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsFollowing(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_EnumerateFollowingList(_ptr, unStartIndex); - } - public virtual bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanPublic(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(_ptr, steamIDClan); - } - - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(_ptr); - } - public virtual Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetConnectedUniverse(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetServerRealTime() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetServerRealTime(_ptr); - } - public virtual IntPtr ISteamUtils_GetIPCountry() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCountry(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageSize(_ptr, iImage, out pnWidth, out pnHeight); - } - public virtual bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageRGBA(_ptr, iImage, pubDest, nDestBufferSize); - } - public virtual bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCSERIPPort(_ptr, out unIP, out usPort); - } - public virtual byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCurrentBatteryPower(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetAppID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAppID(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(_ptr, eNotificationPosition); - } - public virtual bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsAPICallCompleted(_ptr, hSteamAPICall, ref pbFailed); - } - public virtual SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallFailureReason(_ptr, hSteamAPICall); - } - public virtual bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallResult(_ptr, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed); - } - public virtual uint /*uint32*/ ISteamUtils_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamUtils_IsOverlayEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsOverlayEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_BOverlayNeedsPresent() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_BOverlayNeedsPresent(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_CheckFileSignature(_ptr, szFileName); - } - public virtual bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_ShowGamepadTextInput(_ptr, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText); - } - public virtual uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(_ptr, pchText, cchText); - } - public virtual IntPtr ISteamUtils_GetSteamUILanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSteamUILanguage(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamRunningInVR() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamRunningInVR(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationInset(_ptr, nHorizontalInset, nVerticalInset); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamInBigPictureMode(_ptr); - } - public virtual void /*void*/ ISteamUtils_StartVRDashboard() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_StartVRDashboard(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(_ptr, bEnabled); - } - - public virtual int /*int*/ ISteamMatchmaking_GetFavoriteGameCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(_ptr); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGame(_ptr, iGame, ref pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); - } - public virtual int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_AddFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyList(_ptr); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(_ptr, pchKeyToMatch, pchValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(_ptr, pchKeyToMatch, nValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(_ptr, pchKeyToMatch, nValueToBeCloseTo); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(_ptr, nSlotsAvailable); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(_ptr, eLobbyDistanceFilter); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(_ptr, cMaxResults); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(_ptr, iLobby); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_CreateLobby(_ptr, eLobbyType, cMaxMembers); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_JoinLobby(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_LeaveLobby(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_InviteUserToLobby(_ptr, steamIDLobby, steamIDInvitee); - } - public virtual int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(_ptr, steamIDLobby, iMember); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(_ptr, steamIDLobby, iLobbyData, pchKey, cchKeyBufferSize, pchValue, cchValueBufferSize); - } - public virtual bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_DeleteLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(_ptr, steamIDLobby, steamIDUser, pchKey); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(_ptr, steamIDLobby, pvMsgBody, cubMsgBody); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(_ptr, steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); - } - public virtual bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyData(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(_ptr, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(_ptr, steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(_ptr, steamIDLobby, cMaxMembers); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyType(_ptr, steamIDLobby, eLobbyType); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(_ptr, steamIDLobby, bLobbyJoinable); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyOwner(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyOwner(_ptr, steamIDLobby, steamIDNewOwner); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLinkedLobby(_ptr, steamIDLobby, steamIDLobbyDependent); - } - - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(_ptr, iApp, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(_ptr, hServerListRequest); - } - public virtual IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerDetails(_ptr, hRequest, iServer); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelQuery(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshQuery(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_IsRefreshing(_ptr, hRequest); - } - public virtual int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerCount(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshServer(_ptr, hRequest, iServer); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PingServer(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PlayerDetails(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_ServerRules(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(_ptr, hServerQuery); - } - - public virtual bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWrite(_ptr, pchFile, pvData, cubData); - } - public virtual int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileRead(_ptr, pchFile, pvData, cubDataToRead); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteAsync(_ptr, pchFile, pvData, cubData); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsync(_ptr, pchFile, nOffset, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(_ptr, hReadCall, pvBuffer, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileForget(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileDelete(_ptr, pchFile); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileShare(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(_ptr, pchFile, eRemoteStoragePlatform); - } - public virtual UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(_ptr, writeHandle, pvData, cubData); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileExists(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FilePersisted(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileSize(_ptr, pchFile); - } - public virtual long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(_ptr, pchFile); - } - public virtual RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileCount(_ptr); - } - public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(_ptr, iFile, out pnFileSizeInBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetQuota(_ptr, out pnTotalBytes, out puAvailableBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(_ptr); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(_ptr); - } - public virtual void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - Native.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(_ptr, bEnabled); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownload(_ptr, hContent, unPriority); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(_ptr, hContent, out pnBytesDownloaded, out pnBytesExpected); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDetails(_ptr, hContent, ref pnAppID, ppchName, out pnFileSizeInBytes, out pSteamIDOwner); - } - public virtual int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCRead(_ptr, hContent, pvData, cubDataToRead, cOffset, eAction); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(_ptr); - } - public virtual UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(_ptr, iCachedContent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps, eWorkshopFileType); - pTags = pTags_ps; - return ret; - } - public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(_ptr, updateHandle, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(_ptr, updateHandle, pchPreviewFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(_ptr, updateHandle, pchTitle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(_ptr, updateHandle, pchDescription); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(_ptr, updateHandle); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(_ptr, unPublishedFileId, unMaxSecondsOld); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(_ptr, updateHandle, pchChangeDescription); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(_ptr, unPublishedFileId, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pRequiredTags_ps = new SteamParamStringArray_t.PackSmall(); - var pExcludedTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags_ps, ref pExcludedTags_ps); - pRequiredTags = pRequiredTags_ps; - pExcludedTags = pExcludedTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(_ptr, unPublishedFileId, eAction); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var pUserTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags_ps, ref pUserTags_ps); - pTags = pTags_ps; - pUserTags = pUserTags_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(_ptr, hContent, pchLocation, unPriority); - } - - public virtual bool /*bool*/ ISteamUserStats_RequestCurrentStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestCurrentStats(_ptr); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat0(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat(_ptr, pchName, nData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat0(_ptr, pchName, fData); - } - public virtual bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UpdateAvgRateStat(_ptr, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievement(_ptr, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ClearAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(_ptr, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_StoreStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_StoreStats(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementIcon(_ptr, pchName); - } - public virtual IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(_ptr, pchName, pchKey); - } - public virtual bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_IndicateAchievementProgress(_ptr, pchName, nCurProgress, nMaxProgress); - } - public virtual uint /*uint32*/ ISteamUserStats_GetNumAchievements() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumAchievements(_ptr); - } - public virtual IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementName(_ptr, iAchievement); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(_ptr, steamIDUser, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ResetAllStats(_ptr, bAchievementsToo); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(_ptr, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindLeaderboard(_ptr, pchLeaderboardName); - } - public virtual IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardName(_ptr, hSteamLeaderboard); - } - public virtual int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(_ptr, hSteamLeaderboard); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(_ptr, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(_ptr, hSteamLeaderboard, prgUsers, cUsers); - } - public virtual bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - var pLeaderboardEntry_ps = new LeaderboardEntry_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(_ptr, hSteamLeaderboardEntries, index, ref pLeaderboardEntry_ps, pDetails, cDetailsMax); - pLeaderboardEntry = pLeaderboardEntry_ps; - return ret; - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UploadLeaderboardScore(_ptr, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(_ptr, hSteamLeaderboard, hUGC); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(_ptr, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(_ptr, iIteratorPrevious, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(_ptr, pchName, out pflPercent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalStats(_ptr, nHistoryDays); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat(_ptr, pchStatName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat0(_ptr, pchStatName, out pData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory(_ptr, pchStatName, out pData, cubData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(_ptr, pchStatName, out pData, cubData); - } - - public virtual bool /*bool*/ ISteamApps_BIsSubscribed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribed(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsLowViolence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsLowViolence(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsCybercafe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsCybercafe(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsVACBanned() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsVACBanned(_ptr); - } - public virtual IntPtr ISteamApps_GetCurrentGameLanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentGameLanguage(_ptr); - } - public virtual IntPtr ISteamApps_GetAvailableGameLanguages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAvailableGameLanguages(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedApp(_ptr, appID); - } - public virtual bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsDlcInstalled(_ptr, appID); - } - public virtual uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(_ptr); - } - public virtual int /*int*/ ISteamApps_GetDLCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDLCCount(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BGetDLCDataByIndex(_ptr, iDLC, ref pAppID, ref pbAvailable, pchName, cchNameBufferSize); - } - public virtual void /*void*/ ISteamApps_InstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_InstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_UninstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_UninstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentBetaName(_ptr, pchName, cchNameBufferSize); - } - public virtual bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_MarkContentCorrupt(_ptr, bMissingFilesOnly); - } - public virtual uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetInstalledDepots(_ptr, appID, pvecDepots, cMaxDepots); - } - public virtual uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppInstallDir(_ptr, appID, pchFolder, cchFolderBufferSize); - } - public virtual bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsAppInstalled(_ptr, appID); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppOwner(_ptr); - } - public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetLaunchQueryParam(_ptr, pchKey); - } - public virtual bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDlcDownloadProgress(_ptr, nAppID, out punBytesDownloaded, out punBytesTotal); - } - public virtual int /*int*/ ISteamApps_GetAppBuildId() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppBuildId(_ptr); - } - public virtual void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetFileDetails(_ptr, pszFileName); - } - - public virtual bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendP2PPacket(_ptr, steamIDRemote, pubData, cubData, eP2PSendType, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(_ptr, out pcubMsgSize, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_ReadP2PPacket(_ptr, pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(_ptr, steamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - var pConnectionState_ps = new P2PSessionState_t.PackSmall(); - var ret = Native.SteamAPI_ISteamNetworking_GetP2PSessionState(_ptr, steamIDRemote, ref pConnectionState_ps); - pConnectionState = pConnectionState_ps; - return ret; - } - public virtual bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(_ptr, bAllow); - } - public virtual SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateListenSocket(_ptr, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(_ptr, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateConnectionSocket(_ptr, nIP, nPort, nTimeoutSec); - } - public virtual bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroySocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroyListenSocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendDataOnSocket(_ptr, hSocket, pubData, cubData, bReliable); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(_ptr, hSocket, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(_ptr, hSocket, pubDest, cubDest, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailable(_ptr, hListenSocket, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveData(_ptr, hListenSocket, pubDest, cubDest, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketInfo(_ptr, hSocket, out pSteamIDRemote, peSocketStatus, out punIPRemote, out punPortRemote); - } - public virtual bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetListenSocketInfo(_ptr, hListenSocket, out pnIP, out pnPort); - } - public virtual SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketConnectionType(_ptr, hSocket); - } - public virtual int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetMaxPacketSize(_ptr, hSocket); - } - - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_WriteScreenshot(_ptr, pubRGB, cubRGB, nWidth, nHeight); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(_ptr, pchFilename, pchThumbnailFilename, nWidth, nHeight); - } - public virtual void /*void*/ ISteamScreenshots_TriggerScreenshot() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_TriggerScreenshot(_ptr); - } - public virtual void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_HookScreenshots(_ptr, bHook); - } - public virtual bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_SetLocation(_ptr, hScreenshot, pchLocation); - } - public virtual bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagUser(_ptr, hScreenshot, steamID); - } - public virtual bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagPublishedFile(_ptr, hScreenshot, unPublishedFileID); - } - public virtual bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_IsScreenshotsHooked(_ptr); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary(_ptr, eType, pchFilename, pchVRFilename); - } - - public virtual bool /*bool*/ ISteamMusic_BIsEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamMusic_BIsPlaying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsPlaying(_ptr); - } - public virtual AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetPlaybackStatus(_ptr); - } - public virtual void /*void*/ ISteamMusic_Play() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Play(_ptr); - } - public virtual void /*void*/ ISteamMusic_Pause() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Pause(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayPrevious() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayPrevious(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayNext() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayNext(_ptr); - } - public virtual void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_SetVolume(_ptr, flVolume); - } - public virtual float /*float*/ ISteamMusic_GetVolume() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetVolume(_ptr); - } - - public virtual bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BActivationSuccess(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetDisplayName(_ptr, pchDisplayName); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayNext(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableQueue(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlaylists(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(_ptr, nStatus); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateVolume(_ptr, flValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(_ptr, bAvailable); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(_ptr, pchText); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(_ptr, nValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetQueueEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetQueueEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetQueueEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistDidChange(_ptr); - } - - public virtual HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateHTTPRequest(_ptr, eHTTPRequestMethod, pchAbsoluteURL); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(_ptr, hRequest, ulContextValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(_ptr, hRequest, unTimeoutSeconds); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(_ptr, hRequest, pchHeaderName, pchHeaderValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(_ptr, hRequest, pchParamName, pchParamValue); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequest(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_DeferHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(_ptr, hRequest, pchHeaderName, out unResponseHeaderSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(_ptr, hRequest, pchHeaderName, out pHeaderValueBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(_ptr, hRequest, out unBodySize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(_ptr, hRequest, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(_ptr, hRequest, cOffset, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(_ptr, hRequest, out pflPercentOut); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(_ptr, hRequest, pchContentType, out pubBody, unBodyLen); - } - public virtual HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateCookieContainer(_ptr, bAllowResponsesToModify); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseCookieContainer(_ptr, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetCookie(_ptr, hCookieContainer, pchHost, pchUrl, pchCookie); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(_ptr, hRequest, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(_ptr, hRequest, pchUserAgentInfo); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(_ptr, hRequest, bRequireVerifiedCertificate); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(_ptr, hRequest, unMilliseconds); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(_ptr, hRequest, ref pbWasTimedOut); - } - - public virtual bool /*bool*/ ISteamController_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Init(_ptr); - } - public virtual bool /*bool*/ ISteamController_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Shutdown(_ptr); - } - public virtual void /*void*/ ISteamController_RunFrame() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_RunFrame(_ptr); - } - public virtual int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetConnectedControllers(_ptr, handlesOut); - } - public virtual bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowBindingPanel(_ptr, controllerHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActionSetHandle(_ptr, pszActionSetName); - } - public virtual void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSet(_ptr, controllerHandle, actionSetHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetCurrentActionSet(_ptr, controllerHandle); - } - public virtual void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateAllActionSetLayers(_ptr, controllerHandle); - } - public virtual int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActiveActionSetLayers(_ptr, controllerHandle, handlesOut); - } - public virtual ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionHandle(_ptr, pszActionName); - } - public virtual ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionData(_ptr, controllerHandle, digitalActionHandle); - } - public virtual int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionOrigins(_ptr, controllerHandle, actionSetHandle, digitalActionHandle, out originsOut); - } - public virtual ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionHandle(_ptr, pszActionName); - } - public virtual ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionData(_ptr, controllerHandle, analogActionHandle); - } - public virtual int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionOrigins(_ptr, controllerHandle, actionSetHandle, analogActionHandle, out originsOut); - } - public virtual void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_StopAnalogActionMomentum(_ptr, controllerHandle, eAction); - } - public virtual void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec); - } - public virtual void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerRepeatedHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); - } - public virtual void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerVibration(_ptr, controllerHandle, usLeftSpeed, usRightSpeed); - } - public virtual void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_SetLEDColor(_ptr, controllerHandle, nColorR, nColorG, nColorB, nFlags); - } - public virtual int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGamepadIndexForController(_ptr, ulControllerHandle); - } - public virtual ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetControllerForGamepadIndex(_ptr, nIndex); - } - public virtual ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetMotionData(_ptr, controllerHandle); - } - public virtual bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowDigitalActionOrigins(_ptr, controllerHandle, digitalActionHandle, flScale, flXPosition, flYPosition); - } - public virtual bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowAnalogActionOrigins(_ptr, controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition); - } - public virtual IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetStringForActionOrigin(_ptr, eOrigin); - } - public virtual IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGlyphForActionOrigin(_ptr, eOrigin); - } - public virtual SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetInputTypeForHandle(_ptr, controllerHandle); - } - - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(_ptr, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(_ptr, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SendQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pDetails_ps = new SteamUGCDetails_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_GetQueryUGCResult(_ptr, handle, index, ref pDetails_ps); - pDetails = pDetails_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(_ptr, handle, index, pchURL, cchURLSize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCMetadata(_ptr, handle, index, pchMetadata, cchMetadatasize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCChildren(_ptr, handle, index, pvecPublishedFileID, cMaxEntries); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCStatistic(_ptr, handle, index, eStatType, out pStatValue); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(_ptr, handle, index, previewIndex, pchURLOrVideoID, cchURLSize, pchOriginalFileName, cchOriginalFileNameSize, out pPreviewType); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(_ptr, handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize); - } - public virtual bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddExcludedTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnOnlyIDs(_ptr, handle, bReturnOnlyIDs); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnKeyValueTags(_ptr, handle, bReturnKeyValueTags); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnLongDescription(_ptr, handle, bReturnLongDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnMetadata(_ptr, handle, bReturnMetadata); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnChildren(_ptr, handle, bReturnChildren); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(_ptr, handle, bReturnAdditionalPreviews); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnTotalOnly(_ptr, handle, bReturnTotalOnly); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnPlaytimeStats(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetAllowCachedResponse(_ptr, handle, unMaxAgeSeconds); - } - public virtual bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetCloudFileNameFilter(_ptr, handle, pMatchCloudFileName); - } - public virtual bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetMatchAnyTag(_ptr, handle, bMatchAnyTag); - } - public virtual bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetSearchText(_ptr, handle, pSearchText); - } - public virtual bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetRankedByTrendDays(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(_ptr, handle, pKey, pValue); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RequestUGCDetails(_ptr, nPublishedFileID, unMaxAgeSeconds); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateItem(_ptr, nConsumerAppId, eFileType); - } - public virtual UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartItemUpdate(_ptr, nConsumerAppId, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTitle(_ptr, handle, pchTitle); - } - public virtual bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemDescription(_ptr, handle, pchDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemUpdateLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemMetadata(_ptr, handle, pchMetaData); - } - public virtual bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemVisibility(_ptr, handle, eVisibility); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - var pTags_ps = new SteamParamStringArray_t.PackSmall(); - var ret = Native.SteamAPI_ISteamUGC_SetItemTags(_ptr, updateHandle, ref pTags_ps); - pTags = pTags_ps; - return ret; - } - public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemContent(_ptr, handle, pszContentFolder); - } - public virtual bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemPreview(_ptr, handle, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(_ptr, handle, pchKey); - } - public virtual bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemKeyValueTag(_ptr, handle, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewFile(_ptr, handle, pszPreviewFile, type); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewVideo(_ptr, handle, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewFile(_ptr, handle, index, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewVideo(_ptr, handle, index, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemPreview(_ptr, handle, index); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubmitItemUpdate(_ptr, handle, pchChangeNote); - } - public virtual ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemUpdateProgress(_ptr, handle, out punBytesProcessed, out punBytesTotal); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetUserItemVote(_ptr, nPublishedFileID, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetUserItemVote(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemToFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemFromFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubscribeItem(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UnsubscribeItem(_ptr, nPublishedFileID); - } - public virtual uint /*uint32*/ ISteamUGC_GetNumSubscribedItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetNumSubscribedItems(_ptr); - } - public virtual uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetSubscribedItems(_ptr, pvecPublishedFileID, cMaxEntries); - } - public virtual uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemState(_ptr, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemInstallInfo(_ptr, nPublishedFileID, out punSizeOnDisk, pchFolder, cchFolderSize, out punTimeStamp); - } - public virtual bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemDownloadInfo(_ptr, nPublishedFileID, out punBytesDownloaded, out punBytesTotal); - } - public virtual bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DownloadItem(_ptr, nPublishedFileID, bHighPriority); - } - public virtual bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(_ptr, unWorkshopDepotID, pszFolder); - } - public virtual void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - Native.SteamAPI_ISteamUGC_SuspendDownloads(_ptr, bSuspend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetAppDependencies(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DeleteItem(_ptr, nPublishedFileID); - } - - public virtual uint /*uint32*/ ISteamAppList_GetNumInstalledApps() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetNumInstalledApps(_ptr); - } - public virtual uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetInstalledApps(_ptr, pvecAppID, unMaxAppIDs); - } - public virtual int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppName(_ptr, nAppID, pchName, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppInstallDir(_ptr, nAppID, pchDirectory, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppBuildId(_ptr, nAppID); - } - - public virtual void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Init(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Shutdown(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_CreateBrowser(_ptr, pchUserAgent, pchUserCSS); - } - public virtual void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_RemoveBrowser(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_LoadURL(_ptr, unBrowserHandle, pchURL, pchPostData); - } - public virtual void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetSize(_ptr, unBrowserHandle, unWidth, unHeight); - } - public virtual void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopLoad(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Reload(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoBack(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoForward(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AddHeader(_ptr, unBrowserHandle, pchKey, pchValue); - } - public virtual void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(_ptr, unBrowserHandle, pchScript); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseUp(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDown(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseMove(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseWheel(_ptr, unBrowserHandle, nDelta); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyDown(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyUp(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyChar(_ptr, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetKeyFocus(_ptr, unBrowserHandle, bHasKeyFocus); - } - public virtual void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ViewSource(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_CopyToClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Find(_ptr, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); - } - public virtual void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopFind(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetCookie(_ptr, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); - } - public virtual void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(_ptr, unBrowserHandle, flZoom, nPointX, nPointY); - } - public virtual void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(_ptr, unBrowserHandle, bBackgroundMode); - } - public virtual void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(_ptr, unBrowserHandle, flDPIScaling); - } - public virtual void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AllowStartRequest(_ptr, unBrowserHandle, bAllowed); - } - public virtual void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_JSDialogResponse(_ptr, unBrowserHandle, bResult); - } - - public virtual Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultStatus(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItems(_ptr, resultHandle, pOutItemsArray, out punOutItemsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItemProperty(_ptr, resultHandle, unItemIndex, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultTimestamp(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_CheckResultSteamID(_ptr, resultHandle, steamIDExpected); - } - public virtual void /*void*/ ISteamInventory_DestroyResult( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_DestroyResult(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetAllItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsByID(_ptr, ref pResultHandle, pInstanceIDs, unCountInstanceIDs); - } - public virtual bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SerializeResult(_ptr, resultHandle, pOutBuffer, out punOutBufferSize); - } - public virtual bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_DeserializeResult(_ptr, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); - } - public virtual bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GenerateItems(_ptr, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GrantPromoItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItem(_ptr, ref pResultHandle, itemDef); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItems(_ptr, ref pResultHandle, pArrayItemDefs, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ConsumeItem(_ptr, ref pResultHandle, itemConsume, unQuantity); - } - public virtual bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ExchangeItems(_ptr, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); - } - public virtual bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TransferItemQuantity(_ptr, ref pResultHandle, itemIdSource, unQuantity, itemIdDest); - } - public virtual void /*void*/ ISteamInventory_SendItemDropHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_SendItemDropHeartbeat(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TriggerItemDrop(_ptr, ref pResultHandle, dropListDefinition); - } - public virtual bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TradeItems(_ptr, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); - } - public virtual bool /*bool*/ ISteamInventory_LoadItemDefinitions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_LoadItemDefinitions(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionIDs(_ptr, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionProperty(_ptr, iDefinition, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(_ptr, steamID); - } - public virtual bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(_ptr, steamID, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartPurchase(_ptr, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestPrices(_ptr); - } - public virtual uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetNumItemsWithPrices(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsWithPrices(_ptr, pArrayItemDefs, pPrices, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemPrice(_ptr, iDefinition, out pPrice); - } - public virtual SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartUpdateProperties(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RemoveProperty(_ptr, handle, nItemID, pchPropertyName); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty(_ptr, handle, nItemID, pchPropertyName, pchPropertyValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, bValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, nValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, flValue); - } - public virtual bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SubmitUpdateProperties(_ptr, handle, ref pResultHandle); - } - - public virtual void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetVideoURL(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_IsBroadcasting(_ptr, pnNumViewers); - } - public virtual void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetOPFSettings(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_GetOPFStringForApp(_ptr, unVideoAppID, pchBuffer, out pnBufferSize); - } - - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppBlocked(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppInBlockList(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(_ptr, eFeature); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(_ptr, eFeature); - } - - public virtual bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_InitGameServer(_ptr, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); - } - public virtual void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetProduct(_ptr, pszProduct); - } - public virtual void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameDescription(_ptr, pszGameDescription); - } - public virtual void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetModDir(_ptr, pszModDir); - } - public virtual void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetDedicatedServer(_ptr, bDedicated); - } - public virtual void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOn(_ptr, pszToken); - } - public virtual void /*void*/ ISteamGameServer_LogOnAnonymous() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOnAnonymous(_ptr); - } - public virtual void /*void*/ ISteamGameServer_LogOff() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOff(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BLoggedOn(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BSecure() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BSecure(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetSteamID(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_WasRestartRequested() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_WasRestartRequested(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMaxPlayerCount(_ptr, cPlayersMax); - } - public virtual void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetBotPlayerCount(_ptr, cBotplayers); - } - public virtual void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetServerName(_ptr, pszServerName); - } - public virtual void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMapName(_ptr, pszMapName); - } - public virtual void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetPasswordProtected(_ptr, bPasswordProtected); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorPort(_ptr, unSpectatorPort); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorServerName(_ptr, pszSpectatorServerName); - } - public virtual void /*void*/ ISteamGameServer_ClearAllKeyValues() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ClearAllKeyValues(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetKeyValue(_ptr, pKey, pValue); - } - public virtual void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameTags(_ptr, pchGameTags); - } - public virtual void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameData(_ptr, pchGameData); - } - public virtual void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetRegion(_ptr, pszRegion); - } - public virtual bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(_ptr, unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SendUserDisconnect(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BUpdateUserData(_ptr, steamIDUser, pchPlayerName, uScore); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_RequestUserGroupStatus(_ptr, steamIDUser, steamIDGroup); - } - public virtual void /*void*/ ISteamGameServer_GetGameplayStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_GetGameplayStats(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetServerReputation(_ptr); - } - public virtual uint /*uint32*/ ISteamGameServer_GetPublicIP() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetPublicIP(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_HandleIncomingPacket(_ptr, pData, cbData, srcIP, srcPort); - } - public virtual int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(_ptr, pOut, cbMaxOut, out pNetAdr, out pPort); - } - public virtual void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EnableHeartbeats(_ptr, bActive); - } - public virtual void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetHeartbeatInterval(_ptr, iHeartbeatInterval); - } - public virtual void /*void*/ ISteamGameServer_ForceHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ForceHeartbeat(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_AssociateWithClan(_ptr, steamIDClan); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(_ptr, steamIDNewPlayer); - } - - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat(_ptr, steamIDUser, pchName, nData); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat0(_ptr, steamIDUser, pchName, fData); - } - public virtual bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(_ptr, steamIDUser, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_ClearUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_StoreUserStats(_ptr, steamIDUser); - } - - public virtual bool /*bool*/ SteamApi_SteamAPI_Init() - { - return Native.SteamAPI_Init(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RunCallbacks() - { - Native.SteamAPI_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_RunCallbacks() - { - Native.SteamGameServer_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ) - { - Native.SteamAPI_RegisterCallback(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ) - { - Native.SteamAPI_UnregisterCallback(pCallback); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_RegisterCallResult(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_UnregisterCallResult(pCallback, callback); - } - public virtual bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ) - { - return Native.SteamInternal_GameServer_Init(unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString); - } - public virtual void /*void*/ SteamApi_SteamAPI_Shutdown() - { - Native.SteamAPI_Shutdown(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_Shutdown() - { - Native.SteamGameServer_Shutdown(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser() - { - return Native.SteamAPI_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe() - { - return Native.SteamAPI_GetHSteamPipe(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser() - { - return Native.SteamGameServer_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe() - { - return Native.SteamGameServer_GetHSteamPipe(); - } - public virtual IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ) - { - return Native.SteamInternal_CreateInterface(version); - } - public virtual bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ) - { - return Native.SteamAPI_RestartAppIfNecessary(unOwnAppID); - } - - internal static unsafe class Native - { - // - // ISteamClient - // - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - - // - // ISteamUser - // - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUser_InitiateGameConnection( IntPtr ISteamUser, IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api.dylib" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetVoice( IntPtr ISteamUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "libsteam_api.dylib" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_DecompressVoice( IntPtr ISteamUser, IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.dylib" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImport( "libsteam_api.dylib" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr ISteamUser ); - - // - // ISteamFriends - // - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImport( "libsteam_api.dylib" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t.PackSmall /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetClanActivityCounts( IntPtr ISteamFriends, ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); - - // - // ISteamUtils - // - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetAPICallResult( IntPtr ISteamUtils, ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_ShowGamepadTextInput( IntPtr ISteamUtils, GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - - // - // ISteamMatchmaking - // - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetFavoriteGame( IntPtr ISteamMatchmaking, int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_AddFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); - - // - // ISteamMatchmakingServers - // - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); - - // - // ISteamRemoteStorage - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImport( "libsteam_api.dylib" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDetails( IntPtr ISteamRemoteStorage, ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_UGCRead( IntPtr ISteamRemoteStorage, ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImport( "libsteam_api.dylib" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - [DllImport( "libsteam_api.dylib" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pExcludedTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t.PackSmall /*struct SteamParamStringArray_t **/ pUserTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - - // - // ISteamUserStats - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.dylib" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.dylib" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( IntPtr ISteamUserStats, ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t.PackSmall /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_UploadLeaderboardScore( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( IntPtr ISteamUserStats, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( IntPtr ISteamUserStats, int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - - // - // ISteamApps - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BGetDLCDataByIndex( IntPtr ISteamApps, int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); - - // - // ISteamNetworking - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendP2PPacket( IntPtr ISteamNetworking, ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_ReadP2PPacket( IntPtr ISteamNetworking, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t.PackSmall /*struct P2PSessionState_t **/ pConnectionState ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImport( "libsteam_api.dylib" )] internal static extern SNetListenSocket_t /*(SNetListenSocket_t)*/ SteamAPI_ISteamNetworking_CreateListenSocket( IntPtr ISteamNetworking, int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api.dylib" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( IntPtr ISteamNetworking, ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "libsteam_api.dylib" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendDataOnSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveData( IntPtr ISteamNetworking, uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetSocketInfo( IntPtr ISteamNetworking, uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); - - // - // ISteamScreenshots - // - [DllImport( "libsteam_api.dylib" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api.dylib" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( IntPtr ISteamScreenshots, string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImport( "libsteam_api.dylib" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - - // - // ISteamMusic - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImport( "libsteam_api.dylib" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr ISteamMusic ); - - // - // ISteamMusicRemote - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr ISteamMusicRemote ); - - // - // ISteamHTTP - // - [DllImport( "libsteam_api.dylib" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImport( "libsteam_api.dylib" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetCookie( IntPtr ISteamHTTP, uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - - // - // ISteamController - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerRepeatedHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamController_SetLEDColor( IntPtr ISteamController, ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImport( "libsteam_api.dylib" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); - - // - // ISteamUGC - // - [DllImport( "libsteam_api.dylib" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( IntPtr ISteamUGC, uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api.dylib" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryAllUGCRequest( IntPtr ISteamUGC, UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "libsteam_api.dylib" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t.PackSmall /*struct SteamUGCDetails_t **/ pDetails ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImport( "libsteam_api.dylib" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t.PackSmall /*const struct SteamParamStringArray_t **/ pTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImport( "libsteam_api.dylib" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemInstallInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - - // - // ISteamAppList - // - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); - - // - // ISteamHTMLSurface - // - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Find( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetCookie( IntPtr ISteamHTMLSurface, string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - - // - // ISteamInventory - // - [DllImport( "libsteam_api.dylib" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItemProperty( IntPtr ISteamInventory, int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_DeserializeResult( IntPtr ISteamInventory, ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ExchangeItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TradeItems( IntPtr ISteamInventory, ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionProperty( IntPtr ISteamInventory, int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); - - // - // ISteamVideo - // - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - - // - // ISteamParentalSettings - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - - // - // ISteamGameServer - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_InitGameServer( IntPtr ISteamGameServer, uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImport( "libsteam_api.dylib" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "libsteam_api.dylib" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImport( "libsteam_api.dylib" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern int /*int*/ SteamAPI_ISteamGameServer_GetNextOutgoingPacket( IntPtr ISteamGameServer, IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); - - // - // ISteamGameServerStats - // - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "libsteam_api.dylib" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - - // - // SteamApi - // - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImport( "libsteam_api.dylib" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImport( "libsteam_api.dylib" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImport( "libsteam_api.dylib" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImport( "libsteam_api.dylib" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - - } - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs deleted file mode 100644 index 8343ee2..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win32.cs +++ /dev/null @@ -1,5029 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal class Win32 : Interface - { - internal IntPtr _ptr; - public bool IsValid { get{ return _ptr != IntPtr.Zero; } } - - // - // Constructor sets pointer to native class - // - internal Win32( IntPtr pointer ) - { - _ptr = pointer; - } - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - _ptr = IntPtr.Zero; - } - - public virtual HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateSteamPipe(_ptr); - } - public virtual bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BReleaseSteamPipe(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_ConnectToGlobalUser(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateLocalUser(_ptr, out phSteamPipe, eAccountType); - } - public virtual void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_ReleaseUser(_ptr, hSteamPipe, hUser); - } - public virtual IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUser(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServer(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetLocalIPBinding(_ptr, unIP, usPort); - } - public virtual IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamFriends(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUtils(_ptr, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmaking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmakingServers(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGenericInterface(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUserStats(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServerStats(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamApps(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamNetworking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamRemoteStorage(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamScreenshots(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual uint /*uint32*/ ISteamClient_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(_ptr); - } - public virtual IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTTP(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamController(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUGC(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamAppList(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusic(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusicRemote(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTMLSurface(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamInventory(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamVideo(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamParentalSettings(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - - public virtual HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetHSteamUser(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BLoggedOn(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetSteamID(_ptr); - } - public virtual int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_InitiateGameConnection(_ptr, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); - } - public virtual void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TerminateGameConnection(_ptr, unIPServer, usPortServer); - } - public virtual void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TrackAppUsageEvent(_ptr, gameID, eAppUsageEvent, pchExtraInfo); - } - public virtual bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetUserDataFolder(_ptr, pchBuffer, cubBuffer); - } - public virtual void /*void*/ ISteamUser_StartVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StartVoiceRecording(_ptr); - } - public virtual void /*void*/ ISteamUser_StopVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StopVoiceRecording(_ptr); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAvailableVoice(_ptr, out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoice(_ptr, bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_DecompressVoice(_ptr, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); - } - public virtual uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(_ptr); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamUser_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamUser_BIsBehindNAT() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsBehindNAT(_ptr); - } - public virtual void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_AdvertiseGame(_ptr, steamIDGameServer, unIPServer, usPortServer); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestEncryptedAppTicket(_ptr, pDataToInclude, cbDataToInclude); - } - public virtual bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetEncryptedAppTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetGameBadgeLevel(_ptr, nSeries, bFoil); - } - public virtual int /*int*/ ISteamUser_GetPlayerSteamLevel() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetPlayerSteamLevel(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestStoreAuthURL(_ptr, pchRedirectURL); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneVerified() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneVerified(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsTwoFactorEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsTwoFactorEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneIdentifying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneIdentifying(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(_ptr); - } - - public virtual IntPtr ISteamFriends_GetPersonaName() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaName(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetPersonaName(_ptr, pchPersonaName); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaState(_ptr); - } - public virtual int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCount(_ptr, iFriendFlags); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendByIndex(_ptr, iFriend, iFriendFlags); - } - public virtual FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRelationship(_ptr, steamIDFriend); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaState(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaName(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendGamePlayed(_ptr, steamIDFriend, ref pFriendGameInfo); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(_ptr, steamIDFriend, iPersonaName); - } - public virtual int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendSteamLevel(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPlayerNickname(_ptr, steamIDPlayer); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupCount(_ptr); - } - public virtual FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(_ptr, iFG); - } - public virtual IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupName(_ptr, friendsGroupID); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(_ptr, friendsGroupID); - } - public virtual void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(_ptr, friendsGroupID, pOutSteamIDMembers, nMembersCount); - } - public virtual bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_HasFriend(_ptr, steamIDFriend, iFriendFlags); - } - public virtual int /*int*/ ISteamFriends_GetClanCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanByIndex(_ptr, iClan); - } - public virtual IntPtr ISteamFriends_GetClanName( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanName(_ptr, steamIDClan); - } - public virtual IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanTag(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanActivityCounts(_ptr, steamIDClan, out pnOnline, out pnInGame, out pnChatting); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_DownloadClanActivityCounts(_ptr, psteamIDClans, cClansToRequest); - } - public virtual int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCountFromSource(_ptr, steamIDSource); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(_ptr, steamIDSource, iFriend); - } - public virtual bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsUserInSource(_ptr, steamIDUser, steamIDSource); - } - public virtual void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(_ptr, steamIDUser, bSpeaking); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlay(_ptr, pchDialog); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(_ptr, pchDialog, steamID); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(_ptr, pchURL); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(_ptr, nAppID, eFlag); - } - public virtual void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetPlayedWith(_ptr, steamIDUserPlayedWith); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(_ptr, steamIDLobby); - } - public virtual int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetSmallFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetMediumFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetLargeFriendAvatar(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestUserInformation(_ptr, steamIDUser, bRequireNameOnly); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestClanOfficerList(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOwner(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerByIndex(_ptr, steamIDClan, iOfficer); - } - public virtual uint /*uint32*/ ISteamFriends_GetUserRestrictions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetUserRestrictions(_ptr); - } - public virtual bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetRichPresence(_ptr, pchKey, pchValue); - } - public virtual void /*void*/ ISteamFriends_ClearRichPresence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ClearRichPresence(_ptr); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresence(_ptr, steamIDFriend, pchKey); - } - public virtual int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(_ptr, steamIDFriend, iKey); - } - public virtual void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_RequestFriendRichPresence(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_InviteUserToGame(_ptr, steamIDFriend, pchConnectString); - } - public virtual int /*int*/ ISteamFriends_GetCoplayFriendCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriendCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriend(_ptr, iCoplayFriend); - } - public virtual int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayTime(_ptr, steamIDFriend); - } - public virtual AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayGame(_ptr, steamIDFriend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_JoinClanChatRoom(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_LeaveClanChatRoom(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMemberCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetChatMemberByIndex(_ptr, steamIDClan, iUser); - } - public virtual bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SendClanChatMessage(_ptr, steamIDClanChat, pchText); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMessage(_ptr, steamIDClanChat, iMessage, prgchText, cchTextMax, out peChatEntryType, out psteamidChatter); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatAdmin(_ptr, steamIDClanChat, steamIDUser); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetListenForFriendsMessages(_ptr, bInterceptEnabled); - } - public virtual bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_ReplyToFriendMessage(_ptr, steamIDFriend, pchMsgToSend); - } - public virtual int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendMessage(_ptr, steamIDFriend, iMessageID, pvData, cubData, out peChatEntryType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFollowerCount(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsFollowing(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_EnumerateFollowingList(_ptr, unStartIndex); - } - public virtual bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanPublic(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(_ptr, steamIDClan); - } - - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(_ptr); - } - public virtual Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetConnectedUniverse(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetServerRealTime() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetServerRealTime(_ptr); - } - public virtual IntPtr ISteamUtils_GetIPCountry() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCountry(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageSize(_ptr, iImage, out pnWidth, out pnHeight); - } - public virtual bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageRGBA(_ptr, iImage, pubDest, nDestBufferSize); - } - public virtual bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCSERIPPort(_ptr, out unIP, out usPort); - } - public virtual byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCurrentBatteryPower(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetAppID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAppID(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(_ptr, eNotificationPosition); - } - public virtual bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsAPICallCompleted(_ptr, hSteamAPICall, ref pbFailed); - } - public virtual SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallFailureReason(_ptr, hSteamAPICall); - } - public virtual bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallResult(_ptr, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed); - } - public virtual uint /*uint32*/ ISteamUtils_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamUtils_IsOverlayEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsOverlayEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_BOverlayNeedsPresent() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_BOverlayNeedsPresent(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_CheckFileSignature(_ptr, szFileName); - } - public virtual bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_ShowGamepadTextInput(_ptr, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText); - } - public virtual uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(_ptr, pchText, cchText); - } - public virtual IntPtr ISteamUtils_GetSteamUILanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSteamUILanguage(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamRunningInVR() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamRunningInVR(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationInset(_ptr, nHorizontalInset, nVerticalInset); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamInBigPictureMode(_ptr); - } - public virtual void /*void*/ ISteamUtils_StartVRDashboard() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_StartVRDashboard(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(_ptr, bEnabled); - } - - public virtual int /*int*/ ISteamMatchmaking_GetFavoriteGameCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(_ptr); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGame(_ptr, iGame, ref pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); - } - public virtual int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_AddFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyList(_ptr); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(_ptr, pchKeyToMatch, pchValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(_ptr, pchKeyToMatch, nValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(_ptr, pchKeyToMatch, nValueToBeCloseTo); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(_ptr, nSlotsAvailable); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(_ptr, eLobbyDistanceFilter); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(_ptr, cMaxResults); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(_ptr, iLobby); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_CreateLobby(_ptr, eLobbyType, cMaxMembers); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_JoinLobby(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_LeaveLobby(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_InviteUserToLobby(_ptr, steamIDLobby, steamIDInvitee); - } - public virtual int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(_ptr, steamIDLobby, iMember); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(_ptr, steamIDLobby, iLobbyData, pchKey, cchKeyBufferSize, pchValue, cchValueBufferSize); - } - public virtual bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_DeleteLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(_ptr, steamIDLobby, steamIDUser, pchKey); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(_ptr, steamIDLobby, pvMsgBody, cubMsgBody); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(_ptr, steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); - } - public virtual bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyData(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(_ptr, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(_ptr, steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(_ptr, steamIDLobby, cMaxMembers); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyType(_ptr, steamIDLobby, eLobbyType); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(_ptr, steamIDLobby, bLobbyJoinable); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyOwner(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyOwner(_ptr, steamIDLobby, steamIDNewOwner); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLinkedLobby(_ptr, steamIDLobby, steamIDLobbyDependent); - } - - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(_ptr, iApp, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(_ptr, hServerListRequest); - } - public virtual IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerDetails(_ptr, hRequest, iServer); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelQuery(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshQuery(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_IsRefreshing(_ptr, hRequest); - } - public virtual int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerCount(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshServer(_ptr, hRequest, iServer); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PingServer(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PlayerDetails(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_ServerRules(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(_ptr, hServerQuery); - } - - public virtual bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWrite(_ptr, pchFile, pvData, cubData); - } - public virtual int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileRead(_ptr, pchFile, pvData, cubDataToRead); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteAsync(_ptr, pchFile, pvData, cubData); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsync(_ptr, pchFile, nOffset, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(_ptr, hReadCall, pvBuffer, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileForget(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileDelete(_ptr, pchFile); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileShare(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(_ptr, pchFile, eRemoteStoragePlatform); - } - public virtual UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(_ptr, writeHandle, pvData, cubData); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileExists(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FilePersisted(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileSize(_ptr, pchFile); - } - public virtual long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(_ptr, pchFile); - } - public virtual RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileCount(_ptr); - } - public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(_ptr, iFile, out pnFileSizeInBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetQuota(_ptr, out pnTotalBytes, out puAvailableBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(_ptr); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(_ptr); - } - public virtual void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - Native.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(_ptr, bEnabled); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownload(_ptr, hContent, unPriority); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(_ptr, hContent, out pnBytesDownloaded, out pnBytesExpected); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDetails(_ptr, hContent, ref pnAppID, ppchName, out pnFileSizeInBytes, out pSteamIDOwner); - } - public virtual int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCRead(_ptr, hContent, pvData, cubDataToRead, cOffset, eAction); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(_ptr); - } - public virtual UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(_ptr, iCachedContent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags, eWorkshopFileType); - } - public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(_ptr, updateHandle, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(_ptr, updateHandle, pchPreviewFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(_ptr, updateHandle, pchTitle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(_ptr, updateHandle, pchDescription); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(_ptr, updateHandle, ref pTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(_ptr, updateHandle); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(_ptr, unPublishedFileId, unMaxSecondsOld); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(_ptr, updateHandle, pchChangeDescription); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(_ptr, unPublishedFileId, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags, ref pExcludedTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(_ptr, unPublishedFileId, eAction); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags, ref pUserTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(_ptr, hContent, pchLocation, unPriority); - } - - public virtual bool /*bool*/ ISteamUserStats_RequestCurrentStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestCurrentStats(_ptr); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat0(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat(_ptr, pchName, nData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat0(_ptr, pchName, fData); - } - public virtual bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UpdateAvgRateStat(_ptr, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievement(_ptr, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ClearAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(_ptr, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_StoreStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_StoreStats(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementIcon(_ptr, pchName); - } - public virtual IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(_ptr, pchName, pchKey); - } - public virtual bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_IndicateAchievementProgress(_ptr, pchName, nCurProgress, nMaxProgress); - } - public virtual uint /*uint32*/ ISteamUserStats_GetNumAchievements() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumAchievements(_ptr); - } - public virtual IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementName(_ptr, iAchievement); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(_ptr, steamIDUser, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ResetAllStats(_ptr, bAchievementsToo); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(_ptr, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindLeaderboard(_ptr, pchLeaderboardName); - } - public virtual IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardName(_ptr, hSteamLeaderboard); - } - public virtual int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(_ptr, hSteamLeaderboard); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(_ptr, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(_ptr, hSteamLeaderboard, prgUsers, cUsers); - } - public virtual bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(_ptr, hSteamLeaderboardEntries, index, ref pLeaderboardEntry, pDetails, cDetailsMax); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UploadLeaderboardScore(_ptr, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(_ptr, hSteamLeaderboard, hUGC); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(_ptr, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(_ptr, iIteratorPrevious, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(_ptr, pchName, out pflPercent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalStats(_ptr, nHistoryDays); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat(_ptr, pchStatName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat0(_ptr, pchStatName, out pData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory(_ptr, pchStatName, out pData, cubData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(_ptr, pchStatName, out pData, cubData); - } - - public virtual bool /*bool*/ ISteamApps_BIsSubscribed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribed(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsLowViolence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsLowViolence(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsCybercafe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsCybercafe(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsVACBanned() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsVACBanned(_ptr); - } - public virtual IntPtr ISteamApps_GetCurrentGameLanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentGameLanguage(_ptr); - } - public virtual IntPtr ISteamApps_GetAvailableGameLanguages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAvailableGameLanguages(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedApp(_ptr, appID); - } - public virtual bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsDlcInstalled(_ptr, appID); - } - public virtual uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(_ptr); - } - public virtual int /*int*/ ISteamApps_GetDLCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDLCCount(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BGetDLCDataByIndex(_ptr, iDLC, ref pAppID, ref pbAvailable, pchName, cchNameBufferSize); - } - public virtual void /*void*/ ISteamApps_InstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_InstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_UninstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_UninstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentBetaName(_ptr, pchName, cchNameBufferSize); - } - public virtual bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_MarkContentCorrupt(_ptr, bMissingFilesOnly); - } - public virtual uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetInstalledDepots(_ptr, appID, pvecDepots, cMaxDepots); - } - public virtual uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppInstallDir(_ptr, appID, pchFolder, cchFolderBufferSize); - } - public virtual bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsAppInstalled(_ptr, appID); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppOwner(_ptr); - } - public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetLaunchQueryParam(_ptr, pchKey); - } - public virtual bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDlcDownloadProgress(_ptr, nAppID, out punBytesDownloaded, out punBytesTotal); - } - public virtual int /*int*/ ISteamApps_GetAppBuildId() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppBuildId(_ptr); - } - public virtual void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetFileDetails(_ptr, pszFileName); - } - - public virtual bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendP2PPacket(_ptr, steamIDRemote, pubData, cubData, eP2PSendType, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(_ptr, out pcubMsgSize, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_ReadP2PPacket(_ptr, pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(_ptr, steamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetP2PSessionState(_ptr, steamIDRemote, ref pConnectionState); - } - public virtual bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(_ptr, bAllow); - } - public virtual SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateListenSocket(_ptr, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(_ptr, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateConnectionSocket(_ptr, nIP, nPort, nTimeoutSec); - } - public virtual bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroySocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroyListenSocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendDataOnSocket(_ptr, hSocket, pubData, cubData, bReliable); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(_ptr, hSocket, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(_ptr, hSocket, pubDest, cubDest, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailable(_ptr, hListenSocket, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveData(_ptr, hListenSocket, pubDest, cubDest, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketInfo(_ptr, hSocket, out pSteamIDRemote, peSocketStatus, out punIPRemote, out punPortRemote); - } - public virtual bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetListenSocketInfo(_ptr, hListenSocket, out pnIP, out pnPort); - } - public virtual SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketConnectionType(_ptr, hSocket); - } - public virtual int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetMaxPacketSize(_ptr, hSocket); - } - - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_WriteScreenshot(_ptr, pubRGB, cubRGB, nWidth, nHeight); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(_ptr, pchFilename, pchThumbnailFilename, nWidth, nHeight); - } - public virtual void /*void*/ ISteamScreenshots_TriggerScreenshot() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_TriggerScreenshot(_ptr); - } - public virtual void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_HookScreenshots(_ptr, bHook); - } - public virtual bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_SetLocation(_ptr, hScreenshot, pchLocation); - } - public virtual bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagUser(_ptr, hScreenshot, steamID); - } - public virtual bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagPublishedFile(_ptr, hScreenshot, unPublishedFileID); - } - public virtual bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_IsScreenshotsHooked(_ptr); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary(_ptr, eType, pchFilename, pchVRFilename); - } - - public virtual bool /*bool*/ ISteamMusic_BIsEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamMusic_BIsPlaying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsPlaying(_ptr); - } - public virtual AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetPlaybackStatus(_ptr); - } - public virtual void /*void*/ ISteamMusic_Play() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Play(_ptr); - } - public virtual void /*void*/ ISteamMusic_Pause() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Pause(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayPrevious() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayPrevious(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayNext() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayNext(_ptr); - } - public virtual void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_SetVolume(_ptr, flVolume); - } - public virtual float /*float*/ ISteamMusic_GetVolume() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetVolume(_ptr); - } - - public virtual bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BActivationSuccess(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetDisplayName(_ptr, pchDisplayName); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayNext(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableQueue(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlaylists(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(_ptr, nStatus); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateVolume(_ptr, flValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(_ptr, bAvailable); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(_ptr, pchText); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(_ptr, nValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetQueueEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetQueueEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetQueueEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistDidChange(_ptr); - } - - public virtual HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateHTTPRequest(_ptr, eHTTPRequestMethod, pchAbsoluteURL); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(_ptr, hRequest, ulContextValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(_ptr, hRequest, unTimeoutSeconds); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(_ptr, hRequest, pchHeaderName, pchHeaderValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(_ptr, hRequest, pchParamName, pchParamValue); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequest(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_DeferHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(_ptr, hRequest, pchHeaderName, out unResponseHeaderSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(_ptr, hRequest, pchHeaderName, out pHeaderValueBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(_ptr, hRequest, out unBodySize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(_ptr, hRequest, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(_ptr, hRequest, cOffset, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(_ptr, hRequest, out pflPercentOut); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(_ptr, hRequest, pchContentType, out pubBody, unBodyLen); - } - public virtual HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateCookieContainer(_ptr, bAllowResponsesToModify); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseCookieContainer(_ptr, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetCookie(_ptr, hCookieContainer, pchHost, pchUrl, pchCookie); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(_ptr, hRequest, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(_ptr, hRequest, pchUserAgentInfo); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(_ptr, hRequest, bRequireVerifiedCertificate); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(_ptr, hRequest, unMilliseconds); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(_ptr, hRequest, ref pbWasTimedOut); - } - - public virtual bool /*bool*/ ISteamController_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Init(_ptr); - } - public virtual bool /*bool*/ ISteamController_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Shutdown(_ptr); - } - public virtual void /*void*/ ISteamController_RunFrame() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_RunFrame(_ptr); - } - public virtual int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetConnectedControllers(_ptr, handlesOut); - } - public virtual bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowBindingPanel(_ptr, controllerHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActionSetHandle(_ptr, pszActionSetName); - } - public virtual void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSet(_ptr, controllerHandle, actionSetHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetCurrentActionSet(_ptr, controllerHandle); - } - public virtual void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateAllActionSetLayers(_ptr, controllerHandle); - } - public virtual int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActiveActionSetLayers(_ptr, controllerHandle, handlesOut); - } - public virtual ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionHandle(_ptr, pszActionName); - } - public virtual ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionData(_ptr, controllerHandle, digitalActionHandle); - } - public virtual int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionOrigins(_ptr, controllerHandle, actionSetHandle, digitalActionHandle, out originsOut); - } - public virtual ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionHandle(_ptr, pszActionName); - } - public virtual ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionData(_ptr, controllerHandle, analogActionHandle); - } - public virtual int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionOrigins(_ptr, controllerHandle, actionSetHandle, analogActionHandle, out originsOut); - } - public virtual void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_StopAnalogActionMomentum(_ptr, controllerHandle, eAction); - } - public virtual void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec); - } - public virtual void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerRepeatedHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); - } - public virtual void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerVibration(_ptr, controllerHandle, usLeftSpeed, usRightSpeed); - } - public virtual void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_SetLEDColor(_ptr, controllerHandle, nColorR, nColorG, nColorB, nFlags); - } - public virtual int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGamepadIndexForController(_ptr, ulControllerHandle); - } - public virtual ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetControllerForGamepadIndex(_ptr, nIndex); - } - public virtual ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetMotionData(_ptr, controllerHandle); - } - public virtual bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowDigitalActionOrigins(_ptr, controllerHandle, digitalActionHandle, flScale, flXPosition, flYPosition); - } - public virtual bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowAnalogActionOrigins(_ptr, controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition); - } - public virtual IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetStringForActionOrigin(_ptr, eOrigin); - } - public virtual IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGlyphForActionOrigin(_ptr, eOrigin); - } - public virtual SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetInputTypeForHandle(_ptr, controllerHandle); - } - - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(_ptr, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(_ptr, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SendQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCResult(_ptr, handle, index, ref pDetails); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(_ptr, handle, index, pchURL, cchURLSize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCMetadata(_ptr, handle, index, pchMetadata, cchMetadatasize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCChildren(_ptr, handle, index, pvecPublishedFileID, cMaxEntries); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCStatistic(_ptr, handle, index, eStatType, out pStatValue); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(_ptr, handle, index, previewIndex, pchURLOrVideoID, cchURLSize, pchOriginalFileName, cchOriginalFileNameSize, out pPreviewType); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(_ptr, handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize); - } - public virtual bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddExcludedTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnOnlyIDs(_ptr, handle, bReturnOnlyIDs); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnKeyValueTags(_ptr, handle, bReturnKeyValueTags); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnLongDescription(_ptr, handle, bReturnLongDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnMetadata(_ptr, handle, bReturnMetadata); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnChildren(_ptr, handle, bReturnChildren); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(_ptr, handle, bReturnAdditionalPreviews); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnTotalOnly(_ptr, handle, bReturnTotalOnly); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnPlaytimeStats(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetAllowCachedResponse(_ptr, handle, unMaxAgeSeconds); - } - public virtual bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetCloudFileNameFilter(_ptr, handle, pMatchCloudFileName); - } - public virtual bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetMatchAnyTag(_ptr, handle, bMatchAnyTag); - } - public virtual bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetSearchText(_ptr, handle, pSearchText); - } - public virtual bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetRankedByTrendDays(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(_ptr, handle, pKey, pValue); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RequestUGCDetails(_ptr, nPublishedFileID, unMaxAgeSeconds); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateItem(_ptr, nConsumerAppId, eFileType); - } - public virtual UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartItemUpdate(_ptr, nConsumerAppId, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTitle(_ptr, handle, pchTitle); - } - public virtual bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemDescription(_ptr, handle, pchDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemUpdateLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemMetadata(_ptr, handle, pchMetaData); - } - public virtual bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemVisibility(_ptr, handle, eVisibility); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTags(_ptr, updateHandle, ref pTags); - } - public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemContent(_ptr, handle, pszContentFolder); - } - public virtual bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemPreview(_ptr, handle, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(_ptr, handle, pchKey); - } - public virtual bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemKeyValueTag(_ptr, handle, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewFile(_ptr, handle, pszPreviewFile, type); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewVideo(_ptr, handle, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewFile(_ptr, handle, index, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewVideo(_ptr, handle, index, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemPreview(_ptr, handle, index); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubmitItemUpdate(_ptr, handle, pchChangeNote); - } - public virtual ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemUpdateProgress(_ptr, handle, out punBytesProcessed, out punBytesTotal); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetUserItemVote(_ptr, nPublishedFileID, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetUserItemVote(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemToFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemFromFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubscribeItem(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UnsubscribeItem(_ptr, nPublishedFileID); - } - public virtual uint /*uint32*/ ISteamUGC_GetNumSubscribedItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetNumSubscribedItems(_ptr); - } - public virtual uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetSubscribedItems(_ptr, pvecPublishedFileID, cMaxEntries); - } - public virtual uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemState(_ptr, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemInstallInfo(_ptr, nPublishedFileID, out punSizeOnDisk, pchFolder, cchFolderSize, out punTimeStamp); - } - public virtual bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemDownloadInfo(_ptr, nPublishedFileID, out punBytesDownloaded, out punBytesTotal); - } - public virtual bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DownloadItem(_ptr, nPublishedFileID, bHighPriority); - } - public virtual bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(_ptr, unWorkshopDepotID, pszFolder); - } - public virtual void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - Native.SteamAPI_ISteamUGC_SuspendDownloads(_ptr, bSuspend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetAppDependencies(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DeleteItem(_ptr, nPublishedFileID); - } - - public virtual uint /*uint32*/ ISteamAppList_GetNumInstalledApps() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetNumInstalledApps(_ptr); - } - public virtual uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetInstalledApps(_ptr, pvecAppID, unMaxAppIDs); - } - public virtual int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppName(_ptr, nAppID, pchName, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppInstallDir(_ptr, nAppID, pchDirectory, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppBuildId(_ptr, nAppID); - } - - public virtual void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Init(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Shutdown(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_CreateBrowser(_ptr, pchUserAgent, pchUserCSS); - } - public virtual void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_RemoveBrowser(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_LoadURL(_ptr, unBrowserHandle, pchURL, pchPostData); - } - public virtual void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetSize(_ptr, unBrowserHandle, unWidth, unHeight); - } - public virtual void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopLoad(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Reload(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoBack(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoForward(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AddHeader(_ptr, unBrowserHandle, pchKey, pchValue); - } - public virtual void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(_ptr, unBrowserHandle, pchScript); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseUp(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDown(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseMove(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseWheel(_ptr, unBrowserHandle, nDelta); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyDown(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyUp(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyChar(_ptr, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetKeyFocus(_ptr, unBrowserHandle, bHasKeyFocus); - } - public virtual void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ViewSource(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_CopyToClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Find(_ptr, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); - } - public virtual void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopFind(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetCookie(_ptr, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); - } - public virtual void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(_ptr, unBrowserHandle, flZoom, nPointX, nPointY); - } - public virtual void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(_ptr, unBrowserHandle, bBackgroundMode); - } - public virtual void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(_ptr, unBrowserHandle, flDPIScaling); - } - public virtual void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AllowStartRequest(_ptr, unBrowserHandle, bAllowed); - } - public virtual void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_JSDialogResponse(_ptr, unBrowserHandle, bResult); - } - - public virtual Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultStatus(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItems(_ptr, resultHandle, pOutItemsArray, out punOutItemsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItemProperty(_ptr, resultHandle, unItemIndex, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultTimestamp(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_CheckResultSteamID(_ptr, resultHandle, steamIDExpected); - } - public virtual void /*void*/ ISteamInventory_DestroyResult( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_DestroyResult(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetAllItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsByID(_ptr, ref pResultHandle, pInstanceIDs, unCountInstanceIDs); - } - public virtual bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SerializeResult(_ptr, resultHandle, pOutBuffer, out punOutBufferSize); - } - public virtual bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_DeserializeResult(_ptr, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); - } - public virtual bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GenerateItems(_ptr, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GrantPromoItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItem(_ptr, ref pResultHandle, itemDef); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItems(_ptr, ref pResultHandle, pArrayItemDefs, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ConsumeItem(_ptr, ref pResultHandle, itemConsume, unQuantity); - } - public virtual bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ExchangeItems(_ptr, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); - } - public virtual bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TransferItemQuantity(_ptr, ref pResultHandle, itemIdSource, unQuantity, itemIdDest); - } - public virtual void /*void*/ ISteamInventory_SendItemDropHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_SendItemDropHeartbeat(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TriggerItemDrop(_ptr, ref pResultHandle, dropListDefinition); - } - public virtual bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TradeItems(_ptr, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); - } - public virtual bool /*bool*/ ISteamInventory_LoadItemDefinitions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_LoadItemDefinitions(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionIDs(_ptr, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionProperty(_ptr, iDefinition, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(_ptr, steamID); - } - public virtual bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(_ptr, steamID, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartPurchase(_ptr, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestPrices(_ptr); - } - public virtual uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetNumItemsWithPrices(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsWithPrices(_ptr, pArrayItemDefs, pPrices, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemPrice(_ptr, iDefinition, out pPrice); - } - public virtual SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartUpdateProperties(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RemoveProperty(_ptr, handle, nItemID, pchPropertyName); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty(_ptr, handle, nItemID, pchPropertyName, pchPropertyValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, bValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, nValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, flValue); - } - public virtual bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SubmitUpdateProperties(_ptr, handle, ref pResultHandle); - } - - public virtual void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetVideoURL(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_IsBroadcasting(_ptr, pnNumViewers); - } - public virtual void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetOPFSettings(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_GetOPFStringForApp(_ptr, unVideoAppID, pchBuffer, out pnBufferSize); - } - - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppBlocked(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppInBlockList(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(_ptr, eFeature); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(_ptr, eFeature); - } - - public virtual bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_InitGameServer(_ptr, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); - } - public virtual void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetProduct(_ptr, pszProduct); - } - public virtual void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameDescription(_ptr, pszGameDescription); - } - public virtual void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetModDir(_ptr, pszModDir); - } - public virtual void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetDedicatedServer(_ptr, bDedicated); - } - public virtual void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOn(_ptr, pszToken); - } - public virtual void /*void*/ ISteamGameServer_LogOnAnonymous() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOnAnonymous(_ptr); - } - public virtual void /*void*/ ISteamGameServer_LogOff() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOff(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BLoggedOn(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BSecure() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BSecure(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetSteamID(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_WasRestartRequested() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_WasRestartRequested(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMaxPlayerCount(_ptr, cPlayersMax); - } - public virtual void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetBotPlayerCount(_ptr, cBotplayers); - } - public virtual void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetServerName(_ptr, pszServerName); - } - public virtual void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMapName(_ptr, pszMapName); - } - public virtual void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetPasswordProtected(_ptr, bPasswordProtected); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorPort(_ptr, unSpectatorPort); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorServerName(_ptr, pszSpectatorServerName); - } - public virtual void /*void*/ ISteamGameServer_ClearAllKeyValues() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ClearAllKeyValues(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetKeyValue(_ptr, pKey, pValue); - } - public virtual void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameTags(_ptr, pchGameTags); - } - public virtual void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameData(_ptr, pchGameData); - } - public virtual void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetRegion(_ptr, pszRegion); - } - public virtual bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(_ptr, unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SendUserDisconnect(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BUpdateUserData(_ptr, steamIDUser, pchPlayerName, uScore); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_RequestUserGroupStatus(_ptr, steamIDUser, steamIDGroup); - } - public virtual void /*void*/ ISteamGameServer_GetGameplayStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_GetGameplayStats(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetServerReputation(_ptr); - } - public virtual uint /*uint32*/ ISteamGameServer_GetPublicIP() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetPublicIP(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_HandleIncomingPacket(_ptr, pData, cbData, srcIP, srcPort); - } - public virtual int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(_ptr, pOut, cbMaxOut, out pNetAdr, out pPort); - } - public virtual void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EnableHeartbeats(_ptr, bActive); - } - public virtual void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetHeartbeatInterval(_ptr, iHeartbeatInterval); - } - public virtual void /*void*/ ISteamGameServer_ForceHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ForceHeartbeat(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_AssociateWithClan(_ptr, steamIDClan); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(_ptr, steamIDNewPlayer); - } - - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat(_ptr, steamIDUser, pchName, nData); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat0(_ptr, steamIDUser, pchName, fData); - } - public virtual bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(_ptr, steamIDUser, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_ClearUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_StoreUserStats(_ptr, steamIDUser); - } - - public virtual bool /*bool*/ SteamApi_SteamAPI_Init() - { - return Native.SteamAPI_Init(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RunCallbacks() - { - Native.SteamAPI_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_RunCallbacks() - { - Native.SteamGameServer_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ) - { - Native.SteamAPI_RegisterCallback(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ) - { - Native.SteamAPI_UnregisterCallback(pCallback); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_RegisterCallResult(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_UnregisterCallResult(pCallback, callback); - } - public virtual bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ) - { - return Native.SteamInternal_GameServer_Init(unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString); - } - public virtual void /*void*/ SteamApi_SteamAPI_Shutdown() - { - Native.SteamAPI_Shutdown(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_Shutdown() - { - Native.SteamGameServer_Shutdown(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser() - { - return Native.SteamAPI_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe() - { - return Native.SteamAPI_GetHSteamPipe(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser() - { - return Native.SteamGameServer_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe() - { - return Native.SteamGameServer_GetHSteamPipe(); - } - public virtual IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ) - { - return Native.SteamInternal_CreateInterface(version); - } - public virtual bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ) - { - return Native.SteamAPI_RestartAppIfNecessary(unOwnAppID); - } - - internal static unsafe class Native - { - // - // ISteamClient - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - - // - // ISteamUser - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_InitiateGameConnection( IntPtr ISteamUser, IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetVoice( IntPtr ISteamUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_DecompressVoice( IntPtr ISteamUser, IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr ISteamUser ); - - // - // ISteamFriends - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetClanActivityCounts( IntPtr ISteamFriends, ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); - - // - // ISteamUtils - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetAPICallResult( IntPtr ISteamUtils, ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_ShowGamepadTextInput( IntPtr ISteamUtils, GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - - // - // ISteamMatchmaking - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetFavoriteGame( IntPtr ISteamMatchmaking, int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_AddFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); - - // - // ISteamMatchmakingServers - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); - - // - // ISteamRemoteStorage - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDetails( IntPtr ISteamRemoteStorage, ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_UGCRead( IntPtr ISteamRemoteStorage, ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - - // - // ISteamUserStats - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( IntPtr ISteamUserStats, ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_UploadLeaderboardScore( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( IntPtr ISteamUserStats, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( IntPtr ISteamUserStats, int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - - // - // ISteamApps - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BGetDLCDataByIndex( IntPtr ISteamApps, int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); - - // - // ISteamNetworking - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendP2PPacket( IntPtr ISteamNetworking, ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_ReadP2PPacket( IntPtr ISteamNetworking, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetListenSocket_t /*(SNetListenSocket_t)*/ SteamAPI_ISteamNetworking_CreateListenSocket( IntPtr ISteamNetworking, int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( IntPtr ISteamNetworking, ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendDataOnSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveData( IntPtr ISteamNetworking, uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetSocketInfo( IntPtr ISteamNetworking, uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); - - // - // ISteamScreenshots - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( IntPtr ISteamScreenshots, string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - - // - // ISteamMusic - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr ISteamMusic ); - - // - // ISteamMusicRemote - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr ISteamMusicRemote ); - - // - // ISteamHTTP - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetCookie( IntPtr ISteamHTTP, uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - - // - // ISteamController - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerRepeatedHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamController_SetLEDColor( IntPtr ISteamController, ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); - - // - // ISteamUGC - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( IntPtr ISteamUGC, uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryAllUGCRequest( IntPtr ISteamUGC, UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemInstallInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - - // - // ISteamAppList - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); - - // - // ISteamHTMLSurface - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Find( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetCookie( IntPtr ISteamHTMLSurface, string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - - // - // ISteamInventory - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItemProperty( IntPtr ISteamInventory, int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_DeserializeResult( IntPtr ISteamInventory, ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ExchangeItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TradeItems( IntPtr ISteamInventory, ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionProperty( IntPtr ISteamInventory, int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); - - // - // ISteamVideo - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - - // - // ISteamParentalSettings - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - - // - // ISteamGameServer - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_InitGameServer( IntPtr ISteamGameServer, uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern int /*int*/ SteamAPI_ISteamGameServer_GetNextOutgoingPacket( IntPtr ISteamGameServer, IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); - - // - // ISteamGameServerStats - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - - // - // SteamApi - // - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImport( "steam_api.dll", CallingConvention = CallingConvention.Cdecl )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - - } - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs deleted file mode 100644 index 9b5fd80..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.Win64.cs +++ /dev/null @@ -1,5029 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal static partial class Platform - { - internal class Win64 : Interface - { - internal IntPtr _ptr; - public bool IsValid { get{ return _ptr != IntPtr.Zero; } } - - // - // Constructor sets pointer to native class - // - internal Win64( IntPtr pointer ) - { - _ptr = pointer; - } - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - _ptr = IntPtr.Zero; - } - - public virtual HSteamPipe /*(HSteamPipe)*/ ISteamClient_CreateSteamPipe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateSteamPipe(_ptr); - } - public virtual bool /*bool*/ ISteamClient_BReleaseSteamPipe( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BReleaseSteamPipe(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_ConnectToGlobalUser( int hSteamPipe ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_ConnectToGlobalUser(_ptr, hSteamPipe); - } - public virtual HSteamUser /*(HSteamUser)*/ ISteamClient_CreateLocalUser( out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_CreateLocalUser(_ptr, out phSteamPipe, eAccountType); - } - public virtual void /*void*/ ISteamClient_ReleaseUser( int hSteamPipe, int hUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_ReleaseUser(_ptr, hSteamPipe, hUser); - } - public virtual IntPtr /*class ISteamUser **/ ISteamClient_GetISteamUser( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUser(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServer **/ ISteamClient_GetISteamGameServer( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServer(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual void /*void*/ ISteamClient_SetLocalIPBinding( uint /*uint32*/ unIP, ushort /*uint16*/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetLocalIPBinding(_ptr, unIP, usPort); - } - public virtual IntPtr /*class ISteamFriends **/ ISteamClient_GetISteamFriends( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamFriends(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUtils **/ ISteamClient_GetISteamUtils( int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUtils(_ptr, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmaking **/ ISteamClient_GetISteamMatchmaking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmaking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMatchmakingServers **/ ISteamClient_GetISteamMatchmakingServers( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMatchmakingServers(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*void **/ ISteamClient_GetISteamGenericInterface( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGenericInterface(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUserStats **/ ISteamClient_GetISteamUserStats( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUserStats(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamGameServerStats **/ ISteamClient_GetISteamGameServerStats( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamGameServerStats(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamApps **/ ISteamClient_GetISteamApps( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamApps(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamNetworking **/ ISteamClient_GetISteamNetworking( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamNetworking(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamRemoteStorage **/ ISteamClient_GetISteamRemoteStorage( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamRemoteStorage(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamScreenshots **/ ISteamClient_GetISteamScreenshots( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamScreenshots(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual uint /*uint32*/ ISteamClient_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamClient_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - Native.SteamAPI_ISteamClient_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamClient_BShutdownIfAllPipesClosed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(_ptr); - } - public virtual IntPtr /*class ISteamHTTP **/ ISteamClient_GetISteamHTTP( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTTP(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamController **/ ISteamClient_GetISteamController( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamController(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamUGC **/ ISteamClient_GetISteamUGC( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamUGC(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamAppList **/ ISteamClient_GetISteamAppList( int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamAppList(_ptr, hSteamUser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusic **/ ISteamClient_GetISteamMusic( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusic(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamMusicRemote **/ ISteamClient_GetISteamMusicRemote( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamMusicRemote(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamHTMLSurface **/ ISteamClient_GetISteamHTMLSurface( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamHTMLSurface(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamInventory **/ ISteamClient_GetISteamInventory( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamInventory(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamVideo **/ ISteamClient_GetISteamVideo( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamVideo(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - public virtual IntPtr /*class ISteamParentalSettings **/ ISteamClient_GetISteamParentalSettings( int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamClient _ptr is null!" ); - - return Native.SteamAPI_ISteamClient_GetISteamParentalSettings(_ptr, hSteamuser, hSteamPipe, pchVersion); - } - - public virtual HSteamUser /*(HSteamUser)*/ ISteamUser_GetHSteamUser() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetHSteamUser(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BLoggedOn(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamUser_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetSteamID(_ptr); - } - public virtual int /*int*/ ISteamUser_InitiateGameConnection( IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_InitiateGameConnection(_ptr, pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure); - } - public virtual void /*void*/ ISteamUser_TerminateGameConnection( uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TerminateGameConnection(_ptr, unIPServer, usPortServer); - } - public virtual void /*void*/ ISteamUser_TrackAppUsageEvent( ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_TrackAppUsageEvent(_ptr, gameID, eAppUsageEvent, pchExtraInfo); - } - public virtual bool /*bool*/ ISteamUser_GetUserDataFolder( System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetUserDataFolder(_ptr, pchBuffer, cubBuffer); - } - public virtual void /*void*/ ISteamUser_StartVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StartVoiceRecording(_ptr); - } - public virtual void /*void*/ ISteamUser_StopVoiceRecording() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_StopVoiceRecording(_ptr); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetAvailableVoice( out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAvailableVoice(_ptr, out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_GetVoice( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoice(_ptr, bWantCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated); - } - public virtual VoiceResult /*EVoiceResult*/ ISteamUser_DecompressVoice( IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_DecompressVoice(_ptr, pCompressed, cbCompressed, pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate); - } - public virtual uint /*uint32*/ ISteamUser_GetVoiceOptimalSampleRate() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetVoiceOptimalSampleRate(_ptr); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamUser_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamUser_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamUser_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamUser_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamUser_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamUser_BIsBehindNAT() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsBehindNAT(_ptr); - } - public virtual void /*void*/ ISteamUser_AdvertiseGame( ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - Native.SteamAPI_ISteamUser_AdvertiseGame(_ptr, steamIDGameServer, unIPServer, usPortServer); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestEncryptedAppTicket( IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestEncryptedAppTicket(_ptr, pDataToInclude, cbDataToInclude); - } - public virtual bool /*bool*/ ISteamUser_GetEncryptedAppTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetEncryptedAppTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual int /*int*/ ISteamUser_GetGameBadgeLevel( int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetGameBadgeLevel(_ptr, nSeries, bFoil); - } - public virtual int /*int*/ ISteamUser_GetPlayerSteamLevel() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_GetPlayerSteamLevel(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUser_RequestStoreAuthURL( string /*const char **/ pchRedirectURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_RequestStoreAuthURL(_ptr, pchRedirectURL); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneVerified() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneVerified(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsTwoFactorEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsTwoFactorEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneIdentifying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneIdentifying(_ptr); - } - public virtual bool /*bool*/ ISteamUser_BIsPhoneRequiringVerification() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUser _ptr is null!" ); - - return Native.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(_ptr); - } - - public virtual IntPtr ISteamFriends_GetPersonaName() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaName(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_SetPersonaName( string /*const char **/ pchPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetPersonaName(_ptr, pchPersonaName); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetPersonaState() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPersonaState(_ptr); - } - public virtual int /*int*/ ISteamFriends_GetFriendCount( int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCount(_ptr, iFriendFlags); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendByIndex( int /*int*/ iFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendByIndex(_ptr, iFriend, iFriendFlags); - } - public virtual FriendRelationship /*EFriendRelationship*/ ISteamFriends_GetFriendRelationship( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRelationship(_ptr, steamIDFriend); - } - public virtual PersonaState /*EPersonaState*/ ISteamFriends_GetFriendPersonaState( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaState(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaName( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaName(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_GetFriendGamePlayed( ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendGamePlayed(_ptr, steamIDFriend, ref pFriendGameInfo); - } - public virtual IntPtr ISteamFriends_GetFriendPersonaNameHistory( ulong steamIDFriend, int /*int*/ iPersonaName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendPersonaNameHistory(_ptr, steamIDFriend, iPersonaName); - } - public virtual int /*int*/ ISteamFriends_GetFriendSteamLevel( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendSteamLevel(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetPlayerNickname( ulong steamIDPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetPlayerNickname(_ptr, steamIDPlayer); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupCount(_ptr); - } - public virtual FriendsGroupID_t /*(FriendsGroupID_t)*/ ISteamFriends_GetFriendsGroupIDByIndex( int /*int*/ iFG ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex(_ptr, iFG); - } - public virtual IntPtr ISteamFriends_GetFriendsGroupName( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupName(_ptr, friendsGroupID); - } - public virtual int /*int*/ ISteamFriends_GetFriendsGroupMembersCount( short friendsGroupID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersCount(_ptr, friendsGroupID); - } - public virtual void /*void*/ ISteamFriends_GetFriendsGroupMembersList( short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_GetFriendsGroupMembersList(_ptr, friendsGroupID, pOutSteamIDMembers, nMembersCount); - } - public virtual bool /*bool*/ ISteamFriends_HasFriend( ulong steamIDFriend, int /*int*/ iFriendFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_HasFriend(_ptr, steamIDFriend, iFriendFlags); - } - public virtual int /*int*/ ISteamFriends_GetClanCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanByIndex( int /*int*/ iClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanByIndex(_ptr, iClan); - } - public virtual IntPtr ISteamFriends_GetClanName( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanName(_ptr, steamIDClan); - } - public virtual IntPtr ISteamFriends_GetClanTag( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanTag(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_GetClanActivityCounts( ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanActivityCounts(_ptr, steamIDClan, out pnOnline, out pnInGame, out pnChatting); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_DownloadClanActivityCounts( IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_DownloadClanActivityCounts(_ptr, psteamIDClans, cClansToRequest); - } - public virtual int /*int*/ ISteamFriends_GetFriendCountFromSource( ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCountFromSource(_ptr, steamIDSource); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetFriendFromSourceByIndex( ulong steamIDSource, int /*int*/ iFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendFromSourceByIndex(_ptr, steamIDSource, iFriend); - } - public virtual bool /*bool*/ ISteamFriends_IsUserInSource( ulong steamIDUser, ulong steamIDSource ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsUserInSource(_ptr, steamIDUser, steamIDSource); - } - public virtual void /*void*/ ISteamFriends_SetInGameVoiceSpeaking( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(_ptr, steamIDUser, bSpeaking); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlay( string /*const char **/ pchDialog ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlay(_ptr, pchDialog); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToUser( string /*const char **/ pchDialog, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(_ptr, pchDialog, steamID); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToWebPage( string /*const char **/ pchURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(_ptr, pchURL); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayToStore( uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayToStore(_ptr, nAppID, eFlag); - } - public virtual void /*void*/ ISteamFriends_SetPlayedWith( ulong steamIDUserPlayedWith ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_SetPlayedWith(_ptr, steamIDUserPlayedWith); - } - public virtual void /*void*/ ISteamFriends_ActivateGameOverlayInviteDialog( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(_ptr, steamIDLobby); - } - public virtual int /*int*/ ISteamFriends_GetSmallFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetSmallFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetMediumFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetMediumFriendAvatar(_ptr, steamIDFriend); - } - public virtual int /*int*/ ISteamFriends_GetLargeFriendAvatar( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetLargeFriendAvatar(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_RequestUserInformation( ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestUserInformation(_ptr, steamIDUser, bRequireNameOnly); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_RequestClanOfficerList( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_RequestClanOfficerList(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOwner( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOwner(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanOfficerCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetClanOfficerByIndex( ulong steamIDClan, int /*int*/ iOfficer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanOfficerByIndex(_ptr, steamIDClan, iOfficer); - } - public virtual uint /*uint32*/ ISteamFriends_GetUserRestrictions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetUserRestrictions(_ptr); - } - public virtual bool /*bool*/ ISteamFriends_SetRichPresence( string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetRichPresence(_ptr, pchKey, pchValue); - } - public virtual void /*void*/ ISteamFriends_ClearRichPresence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_ClearRichPresence(_ptr); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresence( ulong steamIDFriend, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresence(_ptr, steamIDFriend, pchKey); - } - public virtual int /*int*/ ISteamFriends_GetFriendRichPresenceKeyCount( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount(_ptr, steamIDFriend); - } - public virtual IntPtr ISteamFriends_GetFriendRichPresenceKeyByIndex( ulong steamIDFriend, int /*int*/ iKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex(_ptr, steamIDFriend, iKey); - } - public virtual void /*void*/ ISteamFriends_RequestFriendRichPresence( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - Native.SteamAPI_ISteamFriends_RequestFriendRichPresence(_ptr, steamIDFriend); - } - public virtual bool /*bool*/ ISteamFriends_InviteUserToGame( ulong steamIDFriend, string /*const char **/ pchConnectString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_InviteUserToGame(_ptr, steamIDFriend, pchConnectString); - } - public virtual int /*int*/ ISteamFriends_GetCoplayFriendCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriendCount(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetCoplayFriend( int /*int*/ iCoplayFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetCoplayFriend(_ptr, iCoplayFriend); - } - public virtual int /*int*/ ISteamFriends_GetFriendCoplayTime( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayTime(_ptr, steamIDFriend); - } - public virtual AppId_t /*(AppId_t)*/ ISteamFriends_GetFriendCoplayGame( ulong steamIDFriend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendCoplayGame(_ptr, steamIDFriend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_JoinClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_JoinClanChatRoom(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_LeaveClanChatRoom( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_LeaveClanChatRoom(_ptr, steamIDClan); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMemberCount( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMemberCount(_ptr, steamIDClan); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamFriends_GetChatMemberByIndex( ulong steamIDClan, int /*int*/ iUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetChatMemberByIndex(_ptr, steamIDClan, iUser); - } - public virtual bool /*bool*/ ISteamFriends_SendClanChatMessage( ulong steamIDClanChat, string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SendClanChatMessage(_ptr, steamIDClanChat, pchText); - } - public virtual int /*int*/ ISteamFriends_GetClanChatMessage( ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetClanChatMessage(_ptr, steamIDClanChat, iMessage, prgchText, cchTextMax, out peChatEntryType, out psteamidChatter); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatAdmin( ulong steamIDClanChat, ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatAdmin(_ptr, steamIDClanChat, steamIDUser); - } - public virtual bool /*bool*/ ISteamFriends_IsClanChatWindowOpenInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_OpenClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_OpenClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_CloseClanChatWindowInSteam( ulong steamIDClanChat ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_CloseClanChatWindowInSteam(_ptr, steamIDClanChat); - } - public virtual bool /*bool*/ ISteamFriends_SetListenForFriendsMessages( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_SetListenForFriendsMessages(_ptr, bInterceptEnabled); - } - public virtual bool /*bool*/ ISteamFriends_ReplyToFriendMessage( ulong steamIDFriend, string /*const char **/ pchMsgToSend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_ReplyToFriendMessage(_ptr, steamIDFriend, pchMsgToSend); - } - public virtual int /*int*/ ISteamFriends_GetFriendMessage( ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFriendMessage(_ptr, steamIDFriend, iMessageID, pvData, cubData, out peChatEntryType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_GetFollowerCount( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_GetFollowerCount(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_IsFollowing( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsFollowing(_ptr, steamID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamFriends_EnumerateFollowingList( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_EnumerateFollowingList(_ptr, unStartIndex); - } - public virtual bool /*bool*/ ISteamFriends_IsClanPublic( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanPublic(_ptr, steamIDClan); - } - public virtual bool /*bool*/ ISteamFriends_IsClanOfficialGameGroup( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamFriends _ptr is null!" ); - - return Native.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(_ptr, steamIDClan); - } - - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceAppActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceAppActive(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetSecondsSinceComputerActive() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(_ptr); - } - public virtual Universe /*EUniverse*/ ISteamUtils_GetConnectedUniverse() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetConnectedUniverse(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetServerRealTime() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetServerRealTime(_ptr); - } - public virtual IntPtr ISteamUtils_GetIPCountry() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCountry(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetImageSize( int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageSize(_ptr, iImage, out pnWidth, out pnHeight); - } - public virtual bool /*bool*/ ISteamUtils_GetImageRGBA( int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetImageRGBA(_ptr, iImage, pubDest, nDestBufferSize); - } - public virtual bool /*bool*/ ISteamUtils_GetCSERIPPort( out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCSERIPPort(_ptr, out unIP, out usPort); - } - public virtual byte /*uint8*/ ISteamUtils_GetCurrentBatteryPower() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetCurrentBatteryPower(_ptr); - } - public virtual uint /*uint32*/ ISteamUtils_GetAppID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAppID(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationPosition( NotificationPosition /*ENotificationPosition*/ eNotificationPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationPosition(_ptr, eNotificationPosition); - } - public virtual bool /*bool*/ ISteamUtils_IsAPICallCompleted( ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsAPICallCompleted(_ptr, hSteamAPICall, ref pbFailed); - } - public virtual SteamAPICallFailure /*ESteamAPICallFailure*/ ISteamUtils_GetAPICallFailureReason( ulong hSteamAPICall ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallFailureReason(_ptr, hSteamAPICall); - } - public virtual bool /*bool*/ ISteamUtils_GetAPICallResult( ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetAPICallResult(_ptr, hSteamAPICall, pCallback, cubCallback, iCallbackExpected, ref pbFailed); - } - public virtual uint /*uint32*/ ISteamUtils_GetIPCCallCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetIPCCallCount(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetWarningMessageHook( IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetWarningMessageHook(_ptr, pFunction); - } - public virtual bool /*bool*/ ISteamUtils_IsOverlayEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsOverlayEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_BOverlayNeedsPresent() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_BOverlayNeedsPresent(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUtils_CheckFileSignature( string /*const char **/ szFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_CheckFileSignature(_ptr, szFileName); - } - public virtual bool /*bool*/ ISteamUtils_ShowGamepadTextInput( GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_ShowGamepadTextInput(_ptr, eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText); - } - public virtual uint /*uint32*/ ISteamUtils_GetEnteredGamepadTextLength() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextLength(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_GetEnteredGamepadTextInput( System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetEnteredGamepadTextInput(_ptr, pchText, cchText); - } - public virtual IntPtr ISteamUtils_GetSteamUILanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_GetSteamUILanguage(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamRunningInVR() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamRunningInVR(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetOverlayNotificationInset( int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetOverlayNotificationInset(_ptr, nHorizontalInset, nVerticalInset); - } - public virtual bool /*bool*/ ISteamUtils_IsSteamInBigPictureMode() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsSteamInBigPictureMode(_ptr); - } - public virtual void /*void*/ ISteamUtils_StartVRDashboard() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_StartVRDashboard(_ptr); - } - public virtual bool /*bool*/ ISteamUtils_IsVRHeadsetStreamingEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - return Native.SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled(_ptr); - } - public virtual void /*void*/ ISteamUtils_SetVRHeadsetStreamingEnabled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUtils _ptr is null!" ); - - Native.SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled(_ptr, bEnabled); - } - - public virtual int /*int*/ ISteamMatchmaking_GetFavoriteGameCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGameCount(_ptr); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetFavoriteGame( int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetFavoriteGame(_ptr, iGame, ref pnAppID, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer); - } - public virtual int /*int*/ ISteamMatchmaking_AddFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_AddFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_RemoveFavoriteGame( uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RemoveFavoriteGame(_ptr, nAppID, nIP, nConnPort, nQueryPort, unFlags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_RequestLobbyList() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyList(_ptr); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListStringFilter( string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter(_ptr, pchKeyToMatch, pchValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNumericalFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter(_ptr, pchKeyToMatch, nValueToMatch, eComparisonType); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListNearValueFilter( string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter(_ptr, pchKeyToMatch, nValueToBeCloseTo); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( int /*int*/ nSlotsAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable(_ptr, nSlotsAvailable); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListDistanceFilter( LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter(_ptr, eLobbyDistanceFilter); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListResultCountFilter( int /*int*/ cMaxResults ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter(_ptr, cMaxResults); - } - public virtual void /*void*/ ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyByIndex( int /*int*/ iLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyByIndex(_ptr, iLobby); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_CreateLobby( LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_CreateLobby(_ptr, eLobbyType, cMaxMembers); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamMatchmaking_JoinLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_JoinLobby(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_LeaveLobby( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_LeaveLobby(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_InviteUserToLobby( ulong steamIDLobby, ulong steamIDInvitee ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_InviteUserToLobby(_ptr, steamIDLobby, steamIDInvitee); - } - public virtual int /*int*/ ISteamMatchmaking_GetNumLobbyMembers( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetNumLobbyMembers(_ptr, steamIDLobby); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyMemberByIndex( ulong steamIDLobby, int /*int*/ iMember ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex(_ptr, steamIDLobby, iMember); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyDataCount( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataCount(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyDataByIndex( ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex(_ptr, steamIDLobby, iLobbyData, pchKey, cchKeyBufferSize, pchValue, cchValueBufferSize); - } - public virtual bool /*bool*/ ISteamMatchmaking_DeleteLobbyData( ulong steamIDLobby, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_DeleteLobbyData(_ptr, steamIDLobby, pchKey); - } - public virtual IntPtr ISteamMatchmaking_GetLobbyMemberData( ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberData(_ptr, steamIDLobby, steamIDUser, pchKey); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyMemberData( ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberData(_ptr, steamIDLobby, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamMatchmaking_SendLobbyChatMsg( ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SendLobbyChatMsg(_ptr, steamIDLobby, pvMsgBody, cubMsgBody); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyChatEntry( ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyChatEntry(_ptr, steamIDLobby, iChatID, out pSteamIDUser, pvData, cubData, out peChatEntryType); - } - public virtual bool /*bool*/ ISteamMatchmaking_RequestLobbyData( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_RequestLobbyData(_ptr, steamIDLobby); - } - public virtual void /*void*/ ISteamMatchmaking_SetLobbyGameServer( ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmaking_SetLobbyGameServer(_ptr, steamIDLobby, unGameServerIP, unGameServerPort, steamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_GetLobbyGameServer( ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyGameServer(_ptr, steamIDLobby, out punGameServerIP, out punGameServerPort, out psteamIDGameServer); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyMemberLimit( ulong steamIDLobby, int /*int*/ cMaxMembers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit(_ptr, steamIDLobby, cMaxMembers); - } - public virtual int /*int*/ ISteamMatchmaking_GetLobbyMemberLimit( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyType( ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyType(_ptr, steamIDLobby, eLobbyType); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyJoinable( ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyJoinable(_ptr, steamIDLobby, bLobbyJoinable); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamMatchmaking_GetLobbyOwner( ulong steamIDLobby ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_GetLobbyOwner(_ptr, steamIDLobby); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLobbyOwner( ulong steamIDLobby, ulong steamIDNewOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLobbyOwner(_ptr, steamIDLobby, steamIDNewOwner); - } - public virtual bool /*bool*/ ISteamMatchmaking_SetLinkedLobby( ulong steamIDLobby, ulong steamIDLobbyDependent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmaking _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmaking_SetLinkedLobby(_ptr, steamIDLobby, steamIDLobbyDependent); - } - - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestInternetServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestInternetServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestLANServerList( uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestLANServerList(_ptr, iApp, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFriendsServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestFavoritesServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestHistoryServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual HServerListRequest /*(HServerListRequest)*/ ISteamMatchmakingServers_RequestSpectatorServerList( uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList(_ptr, iApp, ppchFilters, nFilters, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_ReleaseRequest( IntPtr hServerListRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_ReleaseRequest(_ptr, hServerListRequest); - } - public virtual IntPtr /*class gameserveritem_t **/ ISteamMatchmakingServers_GetServerDetails( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerDetails(_ptr, hRequest, iServer); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelQuery(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshQuery( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshQuery(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamMatchmakingServers_IsRefreshing( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_IsRefreshing(_ptr, hRequest); - } - public virtual int /*int*/ ISteamMatchmakingServers_GetServerCount( IntPtr hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_GetServerCount(_ptr, hRequest); - } - public virtual void /*void*/ ISteamMatchmakingServers_RefreshServer( IntPtr hRequest, int /*int*/ iServer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_RefreshServer(_ptr, hRequest, iServer); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PingServer( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PingServer(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_PlayerDetails( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_PlayerDetails(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual HServerQuery /*(HServerQuery)*/ ISteamMatchmakingServers_ServerRules( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - return Native.SteamAPI_ISteamMatchmakingServers_ServerRules(_ptr, unIP, usPort, pRequestServersResponse); - } - public virtual void /*void*/ ISteamMatchmakingServers_CancelServerQuery( int hServerQuery ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMatchmakingServers _ptr is null!" ); - - Native.SteamAPI_ISteamMatchmakingServers_CancelServerQuery(_ptr, hServerQuery); - } - - public virtual bool /*bool*/ ISteamRemoteStorage_FileWrite( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWrite(_ptr, pchFile, pvData, cubData); - } - public virtual int /*int32*/ ISteamRemoteStorage_FileRead( string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileRead(_ptr, pchFile, pvData, cubDataToRead); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileWriteAsync( string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteAsync(_ptr, pchFile, pvData, cubData); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileReadAsync( string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsync(_ptr, pchFile, nOffset, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileReadAsyncComplete( ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete(_ptr, hReadCall, pvBuffer, cubToRead); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileForget( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileForget(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileDelete( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileDelete(_ptr, pchFile); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_FileShare( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileShare(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_SetSyncPlatforms( string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetSyncPlatforms(_ptr, pchFile, eRemoteStoragePlatform); - } - public virtual UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ ISteamRemoteStorage_FileWriteStreamOpen( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamWriteChunk( ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk(_ptr, writeHandle, pvData, cubData); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamClose( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamClose(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileWriteStreamCancel( ulong writeHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel(_ptr, writeHandle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FileExists( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FileExists(_ptr, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_FilePersisted( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_FilePersisted(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileSize( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileSize(_ptr, pchFile); - } - public virtual long /*int64*/ ISteamRemoteStorage_GetFileTimestamp( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileTimestamp(_ptr, pchFile); - } - public virtual RemoteStoragePlatform /*ERemoteStoragePlatform*/ ISteamRemoteStorage_GetSyncPlatforms( string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetSyncPlatforms(_ptr, pchFile); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetFileCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileCount(_ptr); - } - public virtual IntPtr ISteamRemoteStorage_GetFileNameAndSize( int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetFileNameAndSize(_ptr, iFile, out pnFileSizeInBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetQuota( out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetQuota(_ptr, out pnTotalBytes, out puAvailableBytes); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForAccount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount(_ptr); - } - public virtual bool /*bool*/ ISteamRemoteStorage_IsCloudEnabledForApp() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp(_ptr); - } - public virtual void /*void*/ ISteamRemoteStorage_SetCloudEnabledForApp( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - Native.SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp(_ptr, bEnabled); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownload( ulong hContent, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownload(_ptr, hContent, unPriority); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDownloadProgress( ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress(_ptr, hContent, out pnBytesDownloaded, out pnBytesExpected); - } - public virtual bool /*bool*/ ISteamRemoteStorage_GetUGCDetails( ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUGCDetails(_ptr, hContent, ref pnAppID, ppchName, out pnFileSizeInBytes, out pSteamIDOwner); - } - public virtual int /*int32*/ ISteamRemoteStorage_UGCRead( ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCRead(_ptr, hContent, pvData, cubDataToRead, cOffset, eAction); - } - public virtual int /*int32*/ ISteamRemoteStorage_GetCachedUGCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCCount(_ptr); - } - public virtual UGCHandle_t /*(UGCHandle_t)*/ ISteamRemoteStorage_GetCachedUGCHandle( int /*int32*/ iCachedContent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle(_ptr, iCachedContent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishWorkshopFile( string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_PublishWorkshopFile(_ptr, pchFile, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags, eWorkshopFileType); - } - public virtual PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ ISteamRemoteStorage_CreatePublishedFileUpdateRequest( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileFile( ulong updateHandle, string /*const char **/ pchFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile(_ptr, updateHandle, pchFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFilePreviewFile( ulong updateHandle, string /*const char **/ pchPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile(_ptr, updateHandle, pchPreviewFile); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTitle( ulong updateHandle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle(_ptr, updateHandle, pchTitle); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileDescription( ulong updateHandle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription(_ptr, updateHandle, pchDescription); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileVisibility( ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility(_ptr, updateHandle, eVisibility); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileTags( ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags(_ptr, updateHandle, ref pTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_CommitPublishedFileUpdate( ulong updateHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate(_ptr, updateHandle); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedFileDetails( ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails(_ptr, unPublishedFileId, unMaxSecondsOld); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_DeletePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_DeletePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserPublishedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSubscribedFiles( uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles(_ptr, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UnsubscribePublishedFile( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile(_ptr, unPublishedFileId); - } - public virtual bool /*bool*/ ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( ulong updateHandle, string /*const char **/ pchChangeDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription(_ptr, updateHandle, pchChangeDescription); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UpdateUserPublishedItemVote( ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote(_ptr, unPublishedFileId, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_GetUserPublishedItemVoteDetails( ulong unPublishedFileId ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails(_ptr, unPublishedFileId); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(_ptr, steamId, unStartIndex, ref pRequiredTags, ref pExcludedTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_PublishVideo( WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_PublishVideo(_ptr, eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId, pchTitle, pchDescription, eVisibility, ref pTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_SetUserPublishedFileAction( ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction(_ptr, unPublishedFileId, eAction); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction(_ptr, eAction, unStartIndex); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles(_ptr, eEnumerationType, unStartIndex, unCount, unDays, ref pTags, ref pUserTags); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamRemoteStorage_UGCDownloadToLocation( ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamRemoteStorage _ptr is null!" ); - - return Native.SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation(_ptr, hContent, pchLocation, unPriority); - } - - public virtual bool /*bool*/ ISteamUserStats_RequestCurrentStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestCurrentStats(_ptr); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat( string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetStat0( string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetStat0(_ptr, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat( string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat(_ptr, pchName, nData); - } - public virtual bool /*bool*/ ISteamUserStats_SetStat0( string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetStat0(_ptr, pchName, fData); - } - public virtual bool /*bool*/ ISteamUserStats_UpdateAvgRateStat( string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UpdateAvgRateStat(_ptr, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievement( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievement(_ptr, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_SetAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_SetAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_ClearAchievement( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ClearAchievement(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAndUnlockTime( string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime(_ptr, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_StoreStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_StoreStats(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetAchievementIcon( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementIcon(_ptr, pchName); - } - public virtual IntPtr ISteamUserStats_GetAchievementDisplayAttribute( string /*const char **/ pchName, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute(_ptr, pchName, pchKey); - } - public virtual bool /*bool*/ ISteamUserStats_IndicateAchievementProgress( string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_IndicateAchievementProgress(_ptr, pchName, nCurProgress, nMaxProgress); - } - public virtual uint /*uint32*/ ISteamUserStats_GetNumAchievements() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumAchievements(_ptr); - } - public virtual IntPtr ISteamUserStats_GetAchievementName( uint /*uint32*/ iAchievement ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementName(_ptr, iAchievement); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetUserAchievementAndUnlockTime( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime(_ptr, steamIDUser, pchName, ref pbAchieved, out punUnlockTime); - } - public virtual bool /*bool*/ ISteamUserStats_ResetAllStats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_ResetAllStats(_ptr, bAchievementsToo); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindOrCreateLeaderboard( string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindOrCreateLeaderboard(_ptr, pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_FindLeaderboard( string /*const char **/ pchLeaderboardName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_FindLeaderboard(_ptr, pchLeaderboardName); - } - public virtual IntPtr ISteamUserStats_GetLeaderboardName( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardName(_ptr, hSteamLeaderboard); - } - public virtual int /*int*/ ISteamUserStats_GetLeaderboardEntryCount( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardEntryCount(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardSortMethod /*ELeaderboardSortMethod*/ ISteamUserStats_GetLeaderboardSortMethod( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardSortMethod(_ptr, hSteamLeaderboard); - } - public virtual LeaderboardDisplayType /*ELeaderboardDisplayType*/ ISteamUserStats_GetLeaderboardDisplayType( ulong hSteamLeaderboard ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetLeaderboardDisplayType(_ptr, hSteamLeaderboard); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntries( ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntries(_ptr, hSteamLeaderboard, eLeaderboardDataRequest, nRangeStart, nRangeEnd); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_DownloadLeaderboardEntriesForUsers( ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers(_ptr, hSteamLeaderboard, prgUsers, cUsers); - } - public virtual bool /*bool*/ ISteamUserStats_GetDownloadedLeaderboardEntry( ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry(_ptr, hSteamLeaderboardEntries, index, ref pLeaderboardEntry, pDetails, cDetailsMax); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_UploadLeaderboardScore( ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_UploadLeaderboardScore(_ptr, hSteamLeaderboard, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_AttachLeaderboardUGC( ulong hSteamLeaderboard, ulong hUGC ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_AttachLeaderboardUGC(_ptr, hSteamLeaderboard, hUGC); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_GetNumberOfCurrentPlayers() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalAchievementPercentages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages(_ptr); - } - public virtual int /*int*/ ISteamUserStats_GetMostAchievedAchievementInfo( System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo(_ptr, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual int /*int*/ ISteamUserStats_GetNextMostAchievedAchievementInfo( int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo(_ptr, iIteratorPrevious, pchName, unNameBufLen, out pflPercent, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamUserStats_GetAchievementAchievedPercent( string /*const char **/ pchName, out float /*float **/ pflPercent ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetAchievementAchievedPercent(_ptr, pchName, out pflPercent); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUserStats_RequestGlobalStats( int /*int*/ nHistoryDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_RequestGlobalStats(_ptr, nHistoryDays); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat( string /*const char **/ pchStatName, out long /*int64 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat(_ptr, pchStatName, out pData); - } - public virtual bool /*bool*/ ISteamUserStats_GetGlobalStat0( string /*const char **/ pchStatName, out double /*double **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStat0(_ptr, pchStatName, out pData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory( string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory(_ptr, pchStatName, out pData, cubData); - } - public virtual int /*int32*/ ISteamUserStats_GetGlobalStatHistory0( string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUserStats _ptr is null!" ); - - return Native.SteamAPI_ISteamUserStats_GetGlobalStatHistory0(_ptr, pchStatName, out pData, cubData); - } - - public virtual bool /*bool*/ ISteamApps_BIsSubscribed() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribed(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsLowViolence() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsLowViolence(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsCybercafe() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsCybercafe(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsVACBanned() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsVACBanned(_ptr); - } - public virtual IntPtr ISteamApps_GetCurrentGameLanguage() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentGameLanguage(_ptr); - } - public virtual IntPtr ISteamApps_GetAvailableGameLanguages() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAvailableGameLanguages(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedApp( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedApp(_ptr, appID); - } - public virtual bool /*bool*/ ISteamApps_BIsDlcInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsDlcInstalled(_ptr, appID); - } - public virtual uint /*uint32*/ ISteamApps_GetEarliestPurchaseUnixTime( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_BIsSubscribedFromFreeWeekend() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend(_ptr); - } - public virtual int /*int*/ ISteamApps_GetDLCCount() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDLCCount(_ptr); - } - public virtual bool /*bool*/ ISteamApps_BGetDLCDataByIndex( int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BGetDLCDataByIndex(_ptr, iDLC, ref pAppID, ref pbAvailable, pchName, cchNameBufferSize); - } - public virtual void /*void*/ ISteamApps_InstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_InstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_UninstallDLC( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_UninstallDLC(_ptr, nAppID); - } - public virtual void /*void*/ ISteamApps_RequestAppProofOfPurchaseKey( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamApps_GetCurrentBetaName( System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetCurrentBetaName(_ptr, pchName, cchNameBufferSize); - } - public virtual bool /*bool*/ ISteamApps_MarkContentCorrupt( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_MarkContentCorrupt(_ptr, bMissingFilesOnly); - } - public virtual uint /*uint32*/ ISteamApps_GetInstalledDepots( uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetInstalledDepots(_ptr, appID, pvecDepots, cMaxDepots); - } - public virtual uint /*uint32*/ ISteamApps_GetAppInstallDir( uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppInstallDir(_ptr, appID, pchFolder, cchFolderBufferSize); - } - public virtual bool /*bool*/ ISteamApps_BIsAppInstalled( uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_BIsAppInstalled(_ptr, appID); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamApps_GetAppOwner() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppOwner(_ptr); - } - public virtual IntPtr ISteamApps_GetLaunchQueryParam( string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetLaunchQueryParam(_ptr, pchKey); - } - public virtual bool /*bool*/ ISteamApps_GetDlcDownloadProgress( uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetDlcDownloadProgress(_ptr, nAppID, out punBytesDownloaded, out punBytesTotal); - } - public virtual int /*int*/ ISteamApps_GetAppBuildId() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetAppBuildId(_ptr); - } - public virtual void /*void*/ ISteamApps_RequestAllProofOfPurchaseKeys() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - Native.SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamApps_GetFileDetails( string /*const char **/ pszFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamApps _ptr is null!" ); - - return Native.SteamAPI_ISteamApps_GetFileDetails(_ptr, pszFileName); - } - - public virtual bool /*bool*/ ISteamNetworking_SendP2PPacket( ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendP2PPacket(_ptr, steamIDRemote, pubData, cubData, eP2PSendType, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_IsP2PPacketAvailable( out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsP2PPacketAvailable(_ptr, out pcubMsgSize, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_ReadP2PPacket( IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_ReadP2PPacket(_ptr, pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_AcceptP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PSessionWithUser( ulong steamIDRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PSessionWithUser(_ptr, steamIDRemote); - } - public virtual bool /*bool*/ ISteamNetworking_CloseP2PChannelWithUser( ulong steamIDRemote, int /*int*/ nChannel ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CloseP2PChannelWithUser(_ptr, steamIDRemote, nChannel); - } - public virtual bool /*bool*/ ISteamNetworking_GetP2PSessionState( ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetP2PSessionState(_ptr, steamIDRemote, ref pConnectionState); - } - public virtual bool /*bool*/ ISteamNetworking_AllowP2PPacketRelay( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_AllowP2PPacketRelay(_ptr, bAllow); - } - public virtual SNetListenSocket_t /*(SNetListenSocket_t)*/ ISteamNetworking_CreateListenSocket( int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateListenSocket(_ptr, nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateP2PConnectionSocket( ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateP2PConnectionSocket(_ptr, steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay); - } - public virtual SNetSocket_t /*(SNetSocket_t)*/ ISteamNetworking_CreateConnectionSocket( uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_CreateConnectionSocket(_ptr, nIP, nPort, nTimeoutSec); - } - public virtual bool /*bool*/ ISteamNetworking_DestroySocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroySocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_DestroyListenSocket( uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_DestroyListenSocket(_ptr, hSocket, bNotifyRemoteEnd); - } - public virtual bool /*bool*/ ISteamNetworking_SendDataOnSocket( uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_SendDataOnSocket(_ptr, hSocket, pubData, cubData, bReliable); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailableOnSocket( uint hSocket, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailableOnSocket(_ptr, hSocket, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveDataFromSocket( uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveDataFromSocket(_ptr, hSocket, pubDest, cubDest, out pcubMsgSize); - } - public virtual bool /*bool*/ ISteamNetworking_IsDataAvailable( uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_IsDataAvailable(_ptr, hListenSocket, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_RetrieveData( uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_RetrieveData(_ptr, hListenSocket, pubDest, cubDest, out pcubMsgSize, ref phSocket); - } - public virtual bool /*bool*/ ISteamNetworking_GetSocketInfo( uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketInfo(_ptr, hSocket, out pSteamIDRemote, peSocketStatus, out punIPRemote, out punPortRemote); - } - public virtual bool /*bool*/ ISteamNetworking_GetListenSocketInfo( uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetListenSocketInfo(_ptr, hListenSocket, out pnIP, out pnPort); - } - public virtual SNetSocketConnectionType /*ESNetSocketConnectionType*/ ISteamNetworking_GetSocketConnectionType( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetSocketConnectionType(_ptr, hSocket); - } - public virtual int /*int*/ ISteamNetworking_GetMaxPacketSize( uint hSocket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamNetworking _ptr is null!" ); - - return Native.SteamAPI_ISteamNetworking_GetMaxPacketSize(_ptr, hSocket); - } - - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_WriteScreenshot( IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_WriteScreenshot(_ptr, pubRGB, cubRGB, nWidth, nHeight); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddScreenshotToLibrary( string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddScreenshotToLibrary(_ptr, pchFilename, pchThumbnailFilename, nWidth, nHeight); - } - public virtual void /*void*/ ISteamScreenshots_TriggerScreenshot() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_TriggerScreenshot(_ptr); - } - public virtual void /*void*/ ISteamScreenshots_HookScreenshots( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - Native.SteamAPI_ISteamScreenshots_HookScreenshots(_ptr, bHook); - } - public virtual bool /*bool*/ ISteamScreenshots_SetLocation( uint hScreenshot, string /*const char **/ pchLocation ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_SetLocation(_ptr, hScreenshot, pchLocation); - } - public virtual bool /*bool*/ ISteamScreenshots_TagUser( uint hScreenshot, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagUser(_ptr, hScreenshot, steamID); - } - public virtual bool /*bool*/ ISteamScreenshots_TagPublishedFile( uint hScreenshot, ulong unPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_TagPublishedFile(_ptr, hScreenshot, unPublishedFileID); - } - public virtual bool /*bool*/ ISteamScreenshots_IsScreenshotsHooked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_IsScreenshotsHooked(_ptr); - } - public virtual ScreenshotHandle /*(ScreenshotHandle)*/ ISteamScreenshots_AddVRScreenshotToLibrary( VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamScreenshots _ptr is null!" ); - - return Native.SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary(_ptr, eType, pchFilename, pchVRFilename); - } - - public virtual bool /*bool*/ ISteamMusic_BIsEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamMusic_BIsPlaying() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_BIsPlaying(_ptr); - } - public virtual AudioPlayback_Status /*AudioPlayback_Status*/ ISteamMusic_GetPlaybackStatus() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetPlaybackStatus(_ptr); - } - public virtual void /*void*/ ISteamMusic_Play() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Play(_ptr); - } - public virtual void /*void*/ ISteamMusic_Pause() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_Pause(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayPrevious() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayPrevious(_ptr); - } - public virtual void /*void*/ ISteamMusic_PlayNext() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_PlayNext(_ptr); - } - public virtual void /*void*/ ISteamMusic_SetVolume( float /*float*/ flVolume ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - Native.SteamAPI_ISteamMusic_SetVolume(_ptr, flVolume); - } - public virtual float /*float*/ ISteamMusic_GetVolume() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusic _ptr is null!" ); - - return Native.SteamAPI_ISteamMusic_GetVolume(_ptr); - } - - public virtual bool /*bool*/ ISteamMusicRemote_RegisterSteamMusicRemote( string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote(_ptr, pchName); - } - public virtual bool /*bool*/ ISteamMusicRemote_DeregisterSteamMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BIsCurrentMusicRemote() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_BActivationSuccess( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_BActivationSuccess(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetDisplayName( string /*const char **/ pchDisplayName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetDisplayName(_ptr, pchDisplayName); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPNGIcon_64x64( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayPrevious( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayPrevious(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlayNext( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlayNext(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnableQueue( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnableQueue(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_EnablePlaylists( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_EnablePlaylists(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdatePlaybackStatus( AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus(_ptr, nStatus); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateShuffled( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateShuffled(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateLooped( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateLooped(_ptr, bValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateVolume( float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateVolume(_ptr, flValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryIsAvailable( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable(_ptr, bAvailable); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryText( string /*const char **/ pchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText(_ptr, pchText); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( int /*int*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds(_ptr, nValue); - } - public virtual bool /*bool*/ ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt(_ptr, pvBuffer, cbBufferLength); - } - public virtual bool /*bool*/ ISteamMusicRemote_CurrentEntryDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_CurrentEntryDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetQueueEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetQueueEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetQueueEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetQueueEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentQueueEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_QueueDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_QueueDidChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistWillChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistWillChange(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_ResetPlaylistEntries() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_ResetPlaylistEntries(_ptr); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetPlaylistEntry( int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetPlaylistEntry(_ptr, nID, nPosition, pchEntryText); - } - public virtual bool /*bool*/ ISteamMusicRemote_SetCurrentPlaylistEntry( int /*int*/ nID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry(_ptr, nID); - } - public virtual bool /*bool*/ ISteamMusicRemote_PlaylistDidChange() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamMusicRemote _ptr is null!" ); - - return Native.SteamAPI_ISteamMusicRemote_PlaylistDidChange(_ptr); - } - - public virtual HTTPRequestHandle /*(HTTPRequestHandle)*/ ISteamHTTP_CreateHTTPRequest( HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateHTTPRequest(_ptr, eHTTPRequestMethod, pchAbsoluteURL); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestContextValue( uint hRequest, ulong /*uint64*/ ulContextValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestContextValue(_ptr, hRequest, ulContextValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( uint hRequest, uint /*uint32*/ unTimeoutSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout(_ptr, hRequest, unTimeoutSeconds); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue(_ptr, hRequest, pchHeaderName, pchHeaderValue); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestGetOrPostParameter( uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter(_ptr, hRequest, pchParamName, pchParamValue); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequest( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequest(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_SendHTTPRequestAndStreamResponse( uint hRequest, ref ulong pCallHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse(_ptr, hRequest, ref pCallHandle); - } - public virtual bool /*bool*/ ISteamHTTP_DeferHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_DeferHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_PrioritizeHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_PrioritizeHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderSize( uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize(_ptr, hRequest, pchHeaderName, out unResponseHeaderSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseHeaderValue( uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue(_ptr, hRequest, pchHeaderName, out pHeaderValueBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodySize( uint hRequest, out uint /*uint32 **/ unBodySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodySize(_ptr, hRequest, out unBodySize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPResponseBodyData( uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPResponseBodyData(_ptr, hRequest, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPStreamingResponseBodyData( uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData(_ptr, hRequest, cOffset, out pBodyDataBuffer, unBufferSize); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseHTTPRequest( uint hRequest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseHTTPRequest(_ptr, hRequest); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPDownloadProgressPct( uint hRequest, out float /*float **/ pflPercentOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct(_ptr, hRequest, out pflPercentOut); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRawPostBody( uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody(_ptr, hRequest, pchContentType, out pubBody, unBodyLen); - } - public virtual HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ ISteamHTTP_CreateCookieContainer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_CreateCookieContainer(_ptr, bAllowResponsesToModify); - } - public virtual bool /*bool*/ ISteamHTTP_ReleaseCookieContainer( uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_ReleaseCookieContainer(_ptr, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetCookie( uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetCookie(_ptr, hCookieContainer, pchHost, pchUrl, pchCookie); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestCookieContainer( uint hRequest, uint hCookieContainer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer(_ptr, hRequest, hCookieContainer); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestUserAgentInfo( uint hRequest, string /*const char **/ pchUserAgentInfo ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(_ptr, hRequest, pchUserAgentInfo); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(_ptr, hRequest, bRequireVerifiedCertificate); - } - public virtual bool /*bool*/ ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( uint hRequest, uint /*uint32*/ unMilliseconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(_ptr, hRequest, unMilliseconds); - } - public virtual bool /*bool*/ ISteamHTTP_GetHTTPRequestWasTimedOut( uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTTP _ptr is null!" ); - - return Native.SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(_ptr, hRequest, ref pbWasTimedOut); - } - - public virtual bool /*bool*/ ISteamController_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Init(_ptr); - } - public virtual bool /*bool*/ ISteamController_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_Shutdown(_ptr); - } - public virtual void /*void*/ ISteamController_RunFrame() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_RunFrame(_ptr); - } - public virtual int /*int*/ ISteamController_GetConnectedControllers( IntPtr /*ControllerHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetConnectedControllers(_ptr, handlesOut); - } - public virtual bool /*bool*/ ISteamController_ShowBindingPanel( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowBindingPanel(_ptr, controllerHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetActionSetHandle( string /*const char **/ pszActionSetName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActionSetHandle(_ptr, pszActionSetName); - } - public virtual void /*void*/ ISteamController_ActivateActionSet( ulong controllerHandle, ulong actionSetHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSet(_ptr, controllerHandle, actionSetHandle); - } - public virtual ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ ISteamController_GetCurrentActionSet( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetCurrentActionSet(_ptr, controllerHandle); - } - public virtual void /*void*/ ISteamController_ActivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_ActivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateActionSetLayer( ulong controllerHandle, ulong actionSetLayerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateActionSetLayer(_ptr, controllerHandle, actionSetLayerHandle); - } - public virtual void /*void*/ ISteamController_DeactivateAllActionSetLayers( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_DeactivateAllActionSetLayers(_ptr, controllerHandle); - } - public virtual int /*int*/ ISteamController_GetActiveActionSetLayers( ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetActiveActionSetLayers(_ptr, controllerHandle, handlesOut); - } - public virtual ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ ISteamController_GetDigitalActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionHandle(_ptr, pszActionName); - } - public virtual ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ ISteamController_GetDigitalActionData( ulong controllerHandle, ulong digitalActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionData(_ptr, controllerHandle, digitalActionHandle); - } - public virtual int /*int*/ ISteamController_GetDigitalActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetDigitalActionOrigins(_ptr, controllerHandle, actionSetHandle, digitalActionHandle, out originsOut); - } - public virtual ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ ISteamController_GetAnalogActionHandle( string /*const char **/ pszActionName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionHandle(_ptr, pszActionName); - } - public virtual ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ ISteamController_GetAnalogActionData( ulong controllerHandle, ulong analogActionHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionData(_ptr, controllerHandle, analogActionHandle); - } - public virtual int /*int*/ ISteamController_GetAnalogActionOrigins( ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetAnalogActionOrigins(_ptr, controllerHandle, actionSetHandle, analogActionHandle, out originsOut); - } - public virtual void /*void*/ ISteamController_StopAnalogActionMomentum( ulong controllerHandle, ulong eAction ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_StopAnalogActionMomentum(_ptr, controllerHandle, eAction); - } - public virtual void /*void*/ ISteamController_TriggerHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec); - } - public virtual void /*void*/ ISteamController_TriggerRepeatedHapticPulse( ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerRepeatedHapticPulse(_ptr, controllerHandle, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags); - } - public virtual void /*void*/ ISteamController_TriggerVibration( ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_TriggerVibration(_ptr, controllerHandle, usLeftSpeed, usRightSpeed); - } - public virtual void /*void*/ ISteamController_SetLEDColor( ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - Native.SteamAPI_ISteamController_SetLEDColor(_ptr, controllerHandle, nColorR, nColorG, nColorB, nFlags); - } - public virtual int /*int*/ ISteamController_GetGamepadIndexForController( ulong ulControllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGamepadIndexForController(_ptr, ulControllerHandle); - } - public virtual ControllerHandle_t /*(ControllerHandle_t)*/ ISteamController_GetControllerForGamepadIndex( int /*int*/ nIndex ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetControllerForGamepadIndex(_ptr, nIndex); - } - public virtual ControllerMotionData_t /*struct ControllerMotionData_t*/ ISteamController_GetMotionData( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetMotionData(_ptr, controllerHandle); - } - public virtual bool /*bool*/ ISteamController_ShowDigitalActionOrigins( ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowDigitalActionOrigins(_ptr, controllerHandle, digitalActionHandle, flScale, flXPosition, flYPosition); - } - public virtual bool /*bool*/ ISteamController_ShowAnalogActionOrigins( ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_ShowAnalogActionOrigins(_ptr, controllerHandle, analogActionHandle, flScale, flXPosition, flYPosition); - } - public virtual IntPtr ISteamController_GetStringForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetStringForActionOrigin(_ptr, eOrigin); - } - public virtual IntPtr ISteamController_GetGlyphForActionOrigin( ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetGlyphForActionOrigin(_ptr, eOrigin); - } - public virtual SteamInputType /*ESteamInputType*/ ISteamController_GetInputTypeForHandle( ulong controllerHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamController _ptr is null!" ); - - return Native.SteamAPI_ISteamController_GetInputTypeForHandle(_ptr, controllerHandle); - } - - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUserUGCRequest( uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(_ptr, unAccountID, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryAllUGCRequest( UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(_ptr, eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID, nConsumerAppID, unPage); - } - public virtual UGCQueryHandle_t /*(UGCQueryHandle_t)*/ ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SendQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SendQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCResult( ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCResult(_ptr, handle, index, ref pDetails); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCPreviewURL( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCPreviewURL(_ptr, handle, index, pchURL, cchURLSize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCMetadata( ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCMetadata(_ptr, handle, index, pchMetadata, cchMetadatasize); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCChildren( ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCChildren(_ptr, handle, index, pvecPublishedFileID, cMaxEntries); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCStatistic( ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCStatistic(_ptr, handle, index, eStatType, out pStatValue); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumAdditionalPreviews( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCAdditionalPreview( ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview(_ptr, handle, index, previewIndex, pchURLOrVideoID, cchURLSize, pchOriginalFileName, cchOriginalFileNameSize, out pPreviewType); - } - public virtual uint /*uint32*/ ISteamUGC_GetQueryUGCNumKeyValueTags( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags(_ptr, handle, index); - } - public virtual bool /*bool*/ ISteamUGC_GetQueryUGCKeyValueTag( ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag(_ptr, handle, index, keyValueTagIndex, pchKey, cchKeySize, pchValue, cchValueSize); - } - public virtual bool /*bool*/ ISteamUGC_ReleaseQueryUGCRequest( ulong handle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_ReleaseQueryUGCRequest(_ptr, handle); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_AddExcludedTag( ulong handle, string /*const char **/ pTagName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddExcludedTag(_ptr, handle, pTagName); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnOnlyIDs( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnOnlyIDs(_ptr, handle, bReturnOnlyIDs); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnKeyValueTags( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnKeyValueTags(_ptr, handle, bReturnKeyValueTags); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnLongDescription( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnLongDescription(_ptr, handle, bReturnLongDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnMetadata( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnMetadata(_ptr, handle, bReturnMetadata); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnChildren( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnChildren(_ptr, handle, bReturnChildren); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnAdditionalPreviews( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnAdditionalPreviews(_ptr, handle, bReturnAdditionalPreviews); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnTotalOnly( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnTotalOnly(_ptr, handle, bReturnTotalOnly); - } - public virtual bool /*bool*/ ISteamUGC_SetReturnPlaytimeStats( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetReturnPlaytimeStats(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_SetLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetAllowCachedResponse( ulong handle, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetAllowCachedResponse(_ptr, handle, unMaxAgeSeconds); - } - public virtual bool /*bool*/ ISteamUGC_SetCloudFileNameFilter( ulong handle, string /*const char **/ pMatchCloudFileName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetCloudFileNameFilter(_ptr, handle, pMatchCloudFileName); - } - public virtual bool /*bool*/ ISteamUGC_SetMatchAnyTag( ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetMatchAnyTag(_ptr, handle, bMatchAnyTag); - } - public virtual bool /*bool*/ ISteamUGC_SetSearchText( ulong handle, string /*const char **/ pSearchText ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetSearchText(_ptr, handle, pSearchText); - } - public virtual bool /*bool*/ ISteamUGC_SetRankedByTrendDays( ulong handle, uint /*uint32*/ unDays ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetRankedByTrendDays(_ptr, handle, unDays); - } - public virtual bool /*bool*/ ISteamUGC_AddRequiredKeyValueTag( ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddRequiredKeyValueTag(_ptr, handle, pKey, pValue); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RequestUGCDetails( ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RequestUGCDetails(_ptr, nPublishedFileID, unMaxAgeSeconds); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_CreateItem( uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_CreateItem(_ptr, nConsumerAppId, eFileType); - } - public virtual UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ ISteamUGC_StartItemUpdate( uint nConsumerAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartItemUpdate(_ptr, nConsumerAppId, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTitle( ulong handle, string /*const char **/ pchTitle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTitle(_ptr, handle, pchTitle); - } - public virtual bool /*bool*/ ISteamUGC_SetItemDescription( ulong handle, string /*const char **/ pchDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemDescription(_ptr, handle, pchDescription); - } - public virtual bool /*bool*/ ISteamUGC_SetItemUpdateLanguage( ulong handle, string /*const char **/ pchLanguage ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemUpdateLanguage(_ptr, handle, pchLanguage); - } - public virtual bool /*bool*/ ISteamUGC_SetItemMetadata( ulong handle, string /*const char **/ pchMetaData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemMetadata(_ptr, handle, pchMetaData); - } - public virtual bool /*bool*/ ISteamUGC_SetItemVisibility( ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemVisibility(_ptr, handle, eVisibility); - } - public virtual bool /*bool*/ ISteamUGC_SetItemTags( ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemTags(_ptr, updateHandle, ref pTags); - } - public virtual bool /*bool*/ ISteamUGC_SetItemContent( ulong handle, string /*const char **/ pszContentFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemContent(_ptr, handle, pszContentFolder); - } - public virtual bool /*bool*/ ISteamUGC_SetItemPreview( ulong handle, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetItemPreview(_ptr, handle, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemKeyValueTags( ulong handle, string /*const char **/ pchKey ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemKeyValueTags(_ptr, handle, pchKey); - } - public virtual bool /*bool*/ ISteamUGC_AddItemKeyValueTag( ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemKeyValueTag(_ptr, handle, pchKey, pchValue); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewFile( ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewFile(_ptr, handle, pszPreviewFile, type); - } - public virtual bool /*bool*/ ISteamUGC_AddItemPreviewVideo( ulong handle, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemPreviewVideo(_ptr, handle, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewFile( ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewFile(_ptr, handle, index, pszPreviewFile); - } - public virtual bool /*bool*/ ISteamUGC_UpdateItemPreviewVideo( ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UpdateItemPreviewVideo(_ptr, handle, index, pszVideoID); - } - public virtual bool /*bool*/ ISteamUGC_RemoveItemPreview( ulong handle, uint /*uint32*/ index ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemPreview(_ptr, handle, index); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubmitItemUpdate( ulong handle, string /*const char **/ pchChangeNote ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubmitItemUpdate(_ptr, handle, pchChangeNote); - } - public virtual ItemUpdateStatus /*EItemUpdateStatus*/ ISteamUGC_GetItemUpdateProgress( ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemUpdateProgress(_ptr, handle, out punBytesProcessed, out punBytesTotal); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SetUserItemVote( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SetUserItemVote(_ptr, nPublishedFileID, bVoteUp); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetUserItemVote( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetUserItemVote(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddItemToFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddItemToFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveItemFromFavorites( uint nAppId, ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveItemFromFavorites(_ptr, nAppId, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_SubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_SubscribeItem(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_UnsubscribeItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_UnsubscribeItem(_ptr, nPublishedFileID); - } - public virtual uint /*uint32*/ ISteamUGC_GetNumSubscribedItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetNumSubscribedItems(_ptr); - } - public virtual uint /*uint32*/ ISteamUGC_GetSubscribedItems( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetSubscribedItems(_ptr, pvecPublishedFileID, cMaxEntries); - } - public virtual uint /*uint32*/ ISteamUGC_GetItemState( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemState(_ptr, nPublishedFileID); - } - public virtual bool /*bool*/ ISteamUGC_GetItemInstallInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemInstallInfo(_ptr, nPublishedFileID, out punSizeOnDisk, pchFolder, cchFolderSize, out punTimeStamp); - } - public virtual bool /*bool*/ ISteamUGC_GetItemDownloadInfo( ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetItemDownloadInfo(_ptr, nPublishedFileID, out punBytesDownloaded, out punBytesTotal); - } - public virtual bool /*bool*/ ISteamUGC_DownloadItem( ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DownloadItem(_ptr, nPublishedFileID, bHighPriority); - } - public virtual bool /*bool*/ ISteamUGC_BInitWorkshopForGameServer( uint unWorkshopDepotID, string /*const char **/ pszFolder ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_BInitWorkshopForGameServer(_ptr, unWorkshopDepotID, pszFolder); - } - public virtual void /*void*/ ISteamUGC_SuspendDownloads( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - Native.SteamAPI_ISteamUGC_SuspendDownloads(_ptr, bSuspend); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StartPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StartPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTracking( IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTracking(_ptr, pvecPublishedFileID, unNumPublishedFileIDs); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_StopPlaytimeTrackingForAllItems() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveDependency( ulong nParentPublishedFileID, ulong nChildPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveDependency(_ptr, nParentPublishedFileID, nChildPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_AddAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_AddAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_RemoveAppDependency( ulong nPublishedFileID, uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_RemoveAppDependency(_ptr, nPublishedFileID, nAppID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_GetAppDependencies( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_GetAppDependencies(_ptr, nPublishedFileID); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamUGC_DeleteItem( ulong nPublishedFileID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamUGC _ptr is null!" ); - - return Native.SteamAPI_ISteamUGC_DeleteItem(_ptr, nPublishedFileID); - } - - public virtual uint /*uint32*/ ISteamAppList_GetNumInstalledApps() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetNumInstalledApps(_ptr); - } - public virtual uint /*uint32*/ ISteamAppList_GetInstalledApps( IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetInstalledApps(_ptr, pvecAppID, unMaxAppIDs); - } - public virtual int /*int*/ ISteamAppList_GetAppName( uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppName(_ptr, nAppID, pchName, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppInstallDir( uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppInstallDir(_ptr, nAppID, pchDirectory, cchNameMax); - } - public virtual int /*int*/ ISteamAppList_GetAppBuildId( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamAppList _ptr is null!" ); - - return Native.SteamAPI_ISteamAppList_GetAppBuildId(_ptr, nAppID); - } - - public virtual void /*void*/ ISteamHTMLSurface_DestructISteamHTMLSurface() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Init() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Init(_ptr); - } - public virtual bool /*bool*/ ISteamHTMLSurface_Shutdown() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_Shutdown(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamHTMLSurface_CreateBrowser( string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - return Native.SteamAPI_ISteamHTMLSurface_CreateBrowser(_ptr, pchUserAgent, pchUserCSS); - } - public virtual void /*void*/ ISteamHTMLSurface_RemoveBrowser( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_RemoveBrowser(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_LoadURL( uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_LoadURL(_ptr, unBrowserHandle, pchURL, pchPostData); - } - public virtual void /*void*/ ISteamHTMLSurface_SetSize( uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetSize(_ptr, unBrowserHandle, unWidth, unHeight); - } - public virtual void /*void*/ ISteamHTMLSurface_StopLoad( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopLoad(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Reload( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Reload(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoBack( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoBack(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GoForward( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GoForward(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_AddHeader( uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AddHeader(_ptr, unBrowserHandle, pchKey, pchValue); - } - public virtual void /*void*/ ISteamHTMLSurface_ExecuteJavascript( uint unBrowserHandle, string /*const char **/ pchScript ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ExecuteJavascript(_ptr, unBrowserHandle, pchScript); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseUp( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseUp(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDown( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDown(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseDoubleClick( uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseDoubleClick(_ptr, unBrowserHandle, eMouseButton); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseMove( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseMove(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_MouseWheel( uint unBrowserHandle, int /*int32*/ nDelta ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_MouseWheel(_ptr, unBrowserHandle, nDelta); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyDown( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyDown(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyUp( uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyUp(_ptr, unBrowserHandle, nNativeKeyCode, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_KeyChar( uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_KeyChar(_ptr, unBrowserHandle, cUnicodeChar, eHTMLKeyModifiers); - } - public virtual void /*void*/ ISteamHTMLSurface_SetHorizontalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetVerticalScroll( uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetVerticalScroll(_ptr, unBrowserHandle, nAbsolutePixelScroll); - } - public virtual void /*void*/ ISteamHTMLSurface_SetKeyFocus( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetKeyFocus(_ptr, unBrowserHandle, bHasKeyFocus); - } - public virtual void /*void*/ ISteamHTMLSurface_ViewSource( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_ViewSource(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_CopyToClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_CopyToClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_PasteFromClipboard( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_PasteFromClipboard(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_Find( uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_Find(_ptr, unBrowserHandle, pchSearchStr, bCurrentlyInFind, bReverse); - } - public virtual void /*void*/ ISteamHTMLSurface_StopFind( uint unBrowserHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_StopFind(_ptr, unBrowserHandle); - } - public virtual void /*void*/ ISteamHTMLSurface_GetLinkAtPosition( uint unBrowserHandle, int /*int*/ x, int /*int*/ y ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_GetLinkAtPosition(_ptr, unBrowserHandle, x, y); - } - public virtual void /*void*/ ISteamHTMLSurface_SetCookie( string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetCookie(_ptr, pchHostname, pchKey, pchValue, pchPath, nExpires, bSecure, bHTTPOnly); - } - public virtual void /*void*/ ISteamHTMLSurface_SetPageScaleFactor( uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(_ptr, unBrowserHandle, flZoom, nPointX, nPointY); - } - public virtual void /*void*/ ISteamHTMLSurface_SetBackgroundMode( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetBackgroundMode(_ptr, unBrowserHandle, bBackgroundMode); - } - public virtual void /*void*/ ISteamHTMLSurface_SetDPIScalingFactor( uint unBrowserHandle, float /*float*/ flDPIScaling ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(_ptr, unBrowserHandle, flDPIScaling); - } - public virtual void /*void*/ ISteamHTMLSurface_AllowStartRequest( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_AllowStartRequest(_ptr, unBrowserHandle, bAllowed); - } - public virtual void /*void*/ ISteamHTMLSurface_JSDialogResponse( uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamHTMLSurface _ptr is null!" ); - - Native.SteamAPI_ISteamHTMLSurface_JSDialogResponse(_ptr, unBrowserHandle, bResult); - } - - public virtual Result /*EResult*/ ISteamInventory_GetResultStatus( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultStatus(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItems( int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItems(_ptr, resultHandle, pOutItemsArray, out punOutItemsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetResultItemProperty( int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultItemProperty(_ptr, resultHandle, unItemIndex, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual uint /*uint32*/ ISteamInventory_GetResultTimestamp( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetResultTimestamp(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_CheckResultSteamID( int resultHandle, ulong steamIDExpected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_CheckResultSteamID(_ptr, resultHandle, steamIDExpected); - } - public virtual void /*void*/ ISteamInventory_DestroyResult( int resultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_DestroyResult(_ptr, resultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetAllItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetAllItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsByID( ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsByID(_ptr, ref pResultHandle, pInstanceIDs, unCountInstanceIDs); - } - public virtual bool /*bool*/ ISteamInventory_SerializeResult( int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SerializeResult(_ptr, resultHandle, pOutBuffer, out punOutBufferSize); - } - public virtual bool /*bool*/ ISteamInventory_DeserializeResult( ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_DeserializeResult(_ptr, ref pOutResultHandle, pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE); - } - public virtual bool /*bool*/ ISteamInventory_GenerateItems( ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GenerateItems(_ptr, ref pResultHandle, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GrantPromoItems( ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GrantPromoItems(_ptr, ref pResultHandle); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItem( ref int pResultHandle, int itemDef ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItem(_ptr, ref pResultHandle, itemDef); - } - public virtual bool /*bool*/ ISteamInventory_AddPromoItems( ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_AddPromoItems(_ptr, ref pResultHandle, pArrayItemDefs, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_ConsumeItem( ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ConsumeItem(_ptr, ref pResultHandle, itemConsume, unQuantity); - } - public virtual bool /*bool*/ ISteamInventory_ExchangeItems( ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_ExchangeItems(_ptr, ref pResultHandle, pArrayGenerate, punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy, punArrayDestroyQuantity, unArrayDestroyLength); - } - public virtual bool /*bool*/ ISteamInventory_TransferItemQuantity( ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TransferItemQuantity(_ptr, ref pResultHandle, itemIdSource, unQuantity, itemIdDest); - } - public virtual void /*void*/ ISteamInventory_SendItemDropHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - Native.SteamAPI_ISteamInventory_SendItemDropHeartbeat(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_TriggerItemDrop( ref int pResultHandle, int dropListDefinition ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TriggerItemDrop(_ptr, ref pResultHandle, dropListDefinition); - } - public virtual bool /*bool*/ ISteamInventory_TradeItems( ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_TradeItems(_ptr, ref pResultHandle, steamIDTradePartner, pArrayGive, pArrayGiveQuantity, nArrayGiveLength, pArrayGet, pArrayGetQuantity, nArrayGetLength); - } - public virtual bool /*bool*/ ISteamInventory_LoadItemDefinitions() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_LoadItemDefinitions(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionIDs( IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionIDs(_ptr, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual bool /*bool*/ ISteamInventory_GetItemDefinitionProperty( int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemDefinitionProperty(_ptr, iDefinition, pchPropertyName, pchValueBuffer, out punValueBufferSizeOut); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs(_ptr, steamID); - } - public virtual bool /*bool*/ ISteamInventory_GetEligiblePromoItemDefinitionIDs( ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(_ptr, steamID, pItemDefIDs, out punItemDefIDsArraySize); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_StartPurchase( int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartPurchase(_ptr, pArrayItemDefs, punArrayQuantity, unArrayLength); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamInventory_RequestPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RequestPrices(_ptr); - } - public virtual uint /*uint32*/ ISteamInventory_GetNumItemsWithPrices() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetNumItemsWithPrices(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_GetItemsWithPrices( IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemsWithPrices(_ptr, pArrayItemDefs, pPrices, unArrayLength); - } - public virtual bool /*bool*/ ISteamInventory_GetItemPrice( int iDefinition, out ulong /*uint64 **/ pPrice ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_GetItemPrice(_ptr, iDefinition, out pPrice); - } - public virtual SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ ISteamInventory_StartUpdateProperties() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_StartUpdateProperties(_ptr); - } - public virtual bool /*bool*/ ISteamInventory_RemoveProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_RemoveProperty(_ptr, handle, nItemID, pchPropertyName); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty(_ptr, handle, nItemID, pchPropertyName, pchPropertyValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, bValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, nValue); - } - public virtual bool /*bool*/ ISteamInventory_SetProperty0( ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SetProperty0(_ptr, handle, nItemID, pchPropertyName, flValue); - } - public virtual bool /*bool*/ ISteamInventory_SubmitUpdateProperties( ulong handle, ref int pResultHandle ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamInventory _ptr is null!" ); - - return Native.SteamAPI_ISteamInventory_SubmitUpdateProperties(_ptr, handle, ref pResultHandle); - } - - public virtual void /*void*/ ISteamVideo_GetVideoURL( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetVideoURL(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_IsBroadcasting( IntPtr /*int **/ pnNumViewers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_IsBroadcasting(_ptr, pnNumViewers); - } - public virtual void /*void*/ ISteamVideo_GetOPFSettings( uint unVideoAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - Native.SteamAPI_ISteamVideo_GetOPFSettings(_ptr, unVideoAppID); - } - public virtual bool /*bool*/ ISteamVideo_GetOPFStringForApp( uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamVideo _ptr is null!" ); - - return Native.SteamAPI_ISteamVideo_GetOPFStringForApp(_ptr, unVideoAppID, pchBuffer, out pnBufferSize); - } - - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockEnabled() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsParentalLockLocked() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsParentalLockLocked(_ptr); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppBlocked( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppBlocked(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsAppInBlockList( uint nAppID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsAppInBlockList(_ptr, nAppID); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureBlocked( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureBlocked(_ptr, eFeature); - } - public virtual bool /*bool*/ ISteamParentalSettings_BIsFeatureInBlockList( ParentalFeature /*EParentalFeature*/ eFeature ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamParentalSettings _ptr is null!" ); - - return Native.SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList(_ptr, eFeature); - } - - public virtual bool /*bool*/ ISteamGameServer_InitGameServer( uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_InitGameServer(_ptr, unIP, usGamePort, usQueryPort, unFlags, nGameAppId, pchVersionString); - } - public virtual void /*void*/ ISteamGameServer_SetProduct( string /*const char **/ pszProduct ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetProduct(_ptr, pszProduct); - } - public virtual void /*void*/ ISteamGameServer_SetGameDescription( string /*const char **/ pszGameDescription ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameDescription(_ptr, pszGameDescription); - } - public virtual void /*void*/ ISteamGameServer_SetModDir( string /*const char **/ pszModDir ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetModDir(_ptr, pszModDir); - } - public virtual void /*void*/ ISteamGameServer_SetDedicatedServer( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetDedicatedServer(_ptr, bDedicated); - } - public virtual void /*void*/ ISteamGameServer_LogOn( string /*const char **/ pszToken ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOn(_ptr, pszToken); - } - public virtual void /*void*/ ISteamGameServer_LogOnAnonymous() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOnAnonymous(_ptr); - } - public virtual void /*void*/ ISteamGameServer_LogOff() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_LogOff(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BLoggedOn() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BLoggedOn(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_BSecure() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BSecure(_ptr); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_GetSteamID() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetSteamID(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_WasRestartRequested() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_WasRestartRequested(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetMaxPlayerCount( int /*int*/ cPlayersMax ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMaxPlayerCount(_ptr, cPlayersMax); - } - public virtual void /*void*/ ISteamGameServer_SetBotPlayerCount( int /*int*/ cBotplayers ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetBotPlayerCount(_ptr, cBotplayers); - } - public virtual void /*void*/ ISteamGameServer_SetServerName( string /*const char **/ pszServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetServerName(_ptr, pszServerName); - } - public virtual void /*void*/ ISteamGameServer_SetMapName( string /*const char **/ pszMapName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetMapName(_ptr, pszMapName); - } - public virtual void /*void*/ ISteamGameServer_SetPasswordProtected( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetPasswordProtected(_ptr, bPasswordProtected); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorPort( ushort /*uint16*/ unSpectatorPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorPort(_ptr, unSpectatorPort); - } - public virtual void /*void*/ ISteamGameServer_SetSpectatorServerName( string /*const char **/ pszSpectatorServerName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetSpectatorServerName(_ptr, pszSpectatorServerName); - } - public virtual void /*void*/ ISteamGameServer_ClearAllKeyValues() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ClearAllKeyValues(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SetKeyValue( string /*const char **/ pKey, string /*const char **/ pValue ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetKeyValue(_ptr, pKey, pValue); - } - public virtual void /*void*/ ISteamGameServer_SetGameTags( string /*const char **/ pchGameTags ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameTags(_ptr, pchGameTags); - } - public virtual void /*void*/ ISteamGameServer_SetGameData( string /*const char **/ pchGameData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetGameData(_ptr, pchGameData); - } - public virtual void /*void*/ ISteamGameServer_SetRegion( string /*const char **/ pszRegion ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetRegion(_ptr, pszRegion); - } - public virtual bool /*bool*/ ISteamGameServer_SendUserConnectAndAuthenticate( uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate(_ptr, unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser); - } - public virtual CSteamID /*(class CSteamID)*/ ISteamGameServer_CreateUnauthenticatedUserConnection() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection(_ptr); - } - public virtual void /*void*/ ISteamGameServer_SendUserDisconnect( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SendUserDisconnect(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServer_BUpdateUserData( ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BUpdateUserData(_ptr, steamIDUser, pchPlayerName, uScore); - } - public virtual HAuthTicket /*(HAuthTicket)*/ ISteamGameServer_GetAuthSessionTicket( IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetAuthSessionTicket(_ptr, pTicket, cbMaxTicket, out pcbTicket); - } - public virtual BeginAuthSessionResult /*EBeginAuthSessionResult*/ ISteamGameServer_BeginAuthSession( IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_BeginAuthSession(_ptr, pAuthTicket, cbAuthTicket, steamID); - } - public virtual void /*void*/ ISteamGameServer_EndAuthSession( ulong steamID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EndAuthSession(_ptr, steamID); - } - public virtual void /*void*/ ISteamGameServer_CancelAuthTicket( uint hAuthTicket ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_CancelAuthTicket(_ptr, hAuthTicket); - } - public virtual UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ ISteamGameServer_UserHasLicenseForApp( ulong steamID, uint appID ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_UserHasLicenseForApp(_ptr, steamID, appID); - } - public virtual bool /*bool*/ ISteamGameServer_RequestUserGroupStatus( ulong steamIDUser, ulong steamIDGroup ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_RequestUserGroupStatus(_ptr, steamIDUser, steamIDGroup); - } - public virtual void /*void*/ ISteamGameServer_GetGameplayStats() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_GetGameplayStats(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_GetServerReputation() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetServerReputation(_ptr); - } - public virtual uint /*uint32*/ ISteamGameServer_GetPublicIP() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetPublicIP(_ptr); - } - public virtual bool /*bool*/ ISteamGameServer_HandleIncomingPacket( IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_HandleIncomingPacket(_ptr, pData, cbData, srcIP, srcPort); - } - public virtual int /*int*/ ISteamGameServer_GetNextOutgoingPacket( IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_GetNextOutgoingPacket(_ptr, pOut, cbMaxOut, out pNetAdr, out pPort); - } - public virtual void /*void*/ ISteamGameServer_EnableHeartbeats( [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_EnableHeartbeats(_ptr, bActive); - } - public virtual void /*void*/ ISteamGameServer_SetHeartbeatInterval( int /*int*/ iHeartbeatInterval ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_SetHeartbeatInterval(_ptr, iHeartbeatInterval); - } - public virtual void /*void*/ ISteamGameServer_ForceHeartbeat() - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - Native.SteamAPI_ISteamGameServer_ForceHeartbeat(_ptr); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_AssociateWithClan( ulong steamIDClan ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_AssociateWithClan(_ptr, steamIDClan); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServer_ComputeNewPlayerCompatibility( ulong steamIDNewPlayer ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServer _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility(_ptr, steamIDNewPlayer); - } - - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_RequestUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_RequestUserStats(_ptr, steamIDUser); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat( ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserStat0( ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserStat0(_ptr, steamIDUser, pchName, out pData); - } - public virtual bool /*bool*/ ISteamGameServerStats_GetUserAchievement( ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_GetUserAchievement(_ptr, steamIDUser, pchName, ref pbAchieved); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat( ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat(_ptr, steamIDUser, pchName, nData); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserStat0( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserStat0(_ptr, steamIDUser, pchName, fData); - } - public virtual bool /*bool*/ ISteamGameServerStats_UpdateUserAvgRateStat( ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat(_ptr, steamIDUser, pchName, flCountThisSession, dSessionLength); - } - public virtual bool /*bool*/ ISteamGameServerStats_SetUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_SetUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual bool /*bool*/ ISteamGameServerStats_ClearUserAchievement( ulong steamIDUser, string /*const char **/ pchName ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_ClearUserAchievement(_ptr, steamIDUser, pchName); - } - public virtual SteamAPICall_t /*(SteamAPICall_t)*/ ISteamGameServerStats_StoreUserStats( ulong steamIDUser ) - { - if ( _ptr == IntPtr.Zero ) throw new System.Exception( "ISteamGameServerStats _ptr is null!" ); - - return Native.SteamAPI_ISteamGameServerStats_StoreUserStats(_ptr, steamIDUser); - } - - public virtual bool /*bool*/ SteamApi_SteamAPI_Init() - { - return Native.SteamAPI_Init(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RunCallbacks() - { - Native.SteamAPI_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_RunCallbacks() - { - Native.SteamGameServer_RunCallbacks(); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ) - { - Native.SteamAPI_RegisterCallback(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ) - { - Native.SteamAPI_UnregisterCallback(pCallback); - } - public virtual void /*void*/ SteamApi_SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_RegisterCallResult(pCallback, callback); - } - public virtual void /*void*/ SteamApi_SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ) - { - Native.SteamAPI_UnregisterCallResult(pCallback, callback); - } - public virtual bool /*bool*/ SteamApi_SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ) - { - return Native.SteamInternal_GameServer_Init(unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString); - } - public virtual void /*void*/ SteamApi_SteamAPI_Shutdown() - { - Native.SteamAPI_Shutdown(); - } - public virtual void /*void*/ SteamApi_SteamGameServer_Shutdown() - { - Native.SteamGameServer_Shutdown(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamAPI_GetHSteamUser() - { - return Native.SteamAPI_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamAPI_GetHSteamPipe() - { - return Native.SteamAPI_GetHSteamPipe(); - } - public virtual HSteamUser /*(HSteamUser)*/ SteamApi_SteamGameServer_GetHSteamUser() - { - return Native.SteamGameServer_GetHSteamUser(); - } - public virtual HSteamPipe /*(HSteamPipe)*/ SteamApi_SteamGameServer_GetHSteamPipe() - { - return Native.SteamGameServer_GetHSteamPipe(); - } - public virtual IntPtr /*void **/ SteamApi_SteamInternal_CreateInterface( string /*const char **/ version ) - { - return Native.SteamInternal_CreateInterface(version); - } - public virtual bool /*bool*/ SteamApi_SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ) - { - return Native.SteamAPI_RestartAppIfNecessary(unOwnAppID); - } - - internal static unsafe class Native - { - // - // ISteamClient - // - [DllImport( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_ISteamClient_CreateSteamPipe( IntPtr ISteamClient ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BReleaseSteamPipe( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_ConnectToGlobalUser( IntPtr ISteamClient, int hSteamPipe ); - [DllImport( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamClient_CreateLocalUser( IntPtr ISteamClient, out int phSteamPipe, AccountType /*EAccountType*/ eAccountType ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_ReleaseUser( IntPtr ISteamClient, int hSteamPipe, int hUser ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUser **/ SteamAPI_ISteamClient_GetISteamUser( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamGameServer **/ SteamAPI_ISteamClient_GetISteamGameServer( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetLocalIPBinding( IntPtr ISteamClient, uint /*uint32*/ unIP, ushort /*uint16*/ usPort ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamFriends **/ SteamAPI_ISteamClient_GetISteamFriends( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUtils **/ SteamAPI_ISteamClient_GetISteamUtils( IntPtr ISteamClient, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMatchmaking **/ SteamAPI_ISteamClient_GetISteamMatchmaking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMatchmakingServers **/ SteamAPI_ISteamClient_GetISteamMatchmakingServers( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*void **/ SteamAPI_ISteamClient_GetISteamGenericInterface( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUserStats **/ SteamAPI_ISteamClient_GetISteamUserStats( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamGameServerStats **/ SteamAPI_ISteamClient_GetISteamGameServerStats( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamApps **/ SteamAPI_ISteamClient_GetISteamApps( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamNetworking **/ SteamAPI_ISteamClient_GetISteamNetworking( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamRemoteStorage **/ SteamAPI_ISteamClient_GetISteamRemoteStorage( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamScreenshots **/ SteamAPI_ISteamClient_GetISteamScreenshots( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamClient_GetIPCCallCount( IntPtr ISteamClient ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamClient_SetWarningMessageHook( IntPtr ISteamClient, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamClient_BShutdownIfAllPipesClosed( IntPtr ISteamClient ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamHTTP **/ SteamAPI_ISteamClient_GetISteamHTTP( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamController **/ SteamAPI_ISteamClient_GetISteamController( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamUGC **/ SteamAPI_ISteamClient_GetISteamUGC( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamAppList **/ SteamAPI_ISteamClient_GetISteamAppList( IntPtr ISteamClient, int hSteamUser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMusic **/ SteamAPI_ISteamClient_GetISteamMusic( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamMusicRemote **/ SteamAPI_ISteamClient_GetISteamMusicRemote( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamHTMLSurface **/ SteamAPI_ISteamClient_GetISteamHTMLSurface( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamInventory **/ SteamAPI_ISteamClient_GetISteamInventory( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamVideo **/ SteamAPI_ISteamClient_GetISteamVideo( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class ISteamParentalSettings **/ SteamAPI_ISteamClient_GetISteamParentalSettings( IntPtr ISteamClient, int hSteamuser, int hSteamPipe, string /*const char **/ pchVersion ); - - // - // ISteamUser - // - [DllImport( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_ISteamUser_GetHSteamUser( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BLoggedOn( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamUser_GetSteamID( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_InitiateGameConnection( IntPtr ISteamUser, IntPtr /*void **/ pAuthBlob, int /*int*/ cbMaxAuthBlob, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TerminateGameConnection( IntPtr ISteamUser, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_TrackAppUsageEvent( IntPtr ISteamUser, ulong gameID, int /*int*/ eAppUsageEvent, string /*const char **/ pchExtraInfo ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetUserDataFolder( IntPtr ISteamUser, System.Text.StringBuilder /*char **/ pchBuffer, int /*int*/ cubBuffer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StartVoiceRecording( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_StopVoiceRecording( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetAvailableVoice( IntPtr ISteamUser, out uint /*uint32 **/ pcbCompressed, out uint /*uint32 **/ pcbUncompressed_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "steam_api64.dll" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_GetVoice( IntPtr ISteamUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bWantUncompressed_Deprecated, IntPtr /*void **/ pUncompressedDestBuffer_Deprecated, uint /*uint32*/ cbUncompressedDestBufferSize_Deprecated, out uint /*uint32 **/ nUncompressBytesWritten_Deprecated, uint /*uint32*/ nUncompressedVoiceDesiredSampleRate_Deprecated ); - [DllImport( "steam_api64.dll" )] internal static extern VoiceResult /*EVoiceResult*/ SteamAPI_ISteamUser_DecompressVoice( IntPtr ISteamUser, IntPtr /*const void **/ pCompressed, uint /*uint32*/ cbCompressed, IntPtr /*void **/ pDestBuffer, uint /*uint32*/ cbDestBufferSize, out uint /*uint32 **/ nBytesWritten, uint /*uint32*/ nDesiredSampleRate ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUser_GetVoiceOptimalSampleRate( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamUser_GetAuthSessionTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api64.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamUser_BeginAuthSession( IntPtr ISteamUser, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_EndAuthSession( IntPtr ISteamUser, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_CancelAuthTicket( IntPtr ISteamUser, uint hAuthTicket ); - [DllImport( "steam_api64.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamUser_UserHasLicenseForApp( IntPtr ISteamUser, ulong steamID, uint appID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsBehindNAT( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUser_AdvertiseGame( IntPtr ISteamUser, ulong steamIDGameServer, uint /*uint32*/ unIPServer, ushort /*uint16*/ usPortServer ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pDataToInclude, int /*int*/ cbDataToInclude ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_GetEncryptedAppTicket( IntPtr ISteamUser, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetGameBadgeLevel( IntPtr ISteamUser, int /*int*/ nSeries, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bFoil ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUser_GetPlayerSteamLevel( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUser_RequestStoreAuthURL( IntPtr ISteamUser, string /*const char **/ pchRedirectURL ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneVerified( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsTwoFactorEnabled( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneIdentifying( IntPtr ISteamUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUser_BIsPhoneRequiringVerification( IntPtr ISteamUser ); - - // - // ISteamFriends - // - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_SetPersonaName( IntPtr ISteamFriends, string /*const char **/ pchPersonaName ); - [DllImport( "steam_api64.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetPersonaState( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCount( IntPtr ISteamFriends, int /*int*/ iFriendFlags ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendByIndex( IntPtr ISteamFriends, int /*int*/ iFriend, int /*int*/ iFriendFlags ); - [DllImport( "steam_api64.dll" )] internal static extern FriendRelationship /*EFriendRelationship*/ SteamAPI_ISteamFriends_GetFriendRelationship( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern PersonaState /*EPersonaState*/ SteamAPI_ISteamFriends_GetFriendPersonaState( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaName( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetFriendGamePlayed( IntPtr ISteamFriends, ulong steamIDFriend, ref FriendGameInfo_t /*struct FriendGameInfo_t **/ pFriendGameInfo ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendPersonaNameHistory( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iPersonaName ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendSteamLevel( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetPlayerNickname( IntPtr ISteamFriends, ulong steamIDPlayer ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupCount( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern FriendsGroupID_t /*(FriendsGroupID_t)*/ SteamAPI_ISteamFriends_GetFriendsGroupIDByIndex( IntPtr ISteamFriends, int /*int*/ iFG ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendsGroupName( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersCount( IntPtr ISteamFriends, short friendsGroupID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_GetFriendsGroupMembersList( IntPtr ISteamFriends, short friendsGroupID, IntPtr /*class CSteamID **/ pOutSteamIDMembers, int /*int*/ nMembersCount ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_HasFriend( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iFriendFlags ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanCount( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanByIndex( IntPtr ISteamFriends, int /*int*/ iClan ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanName( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetClanTag( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_GetClanActivityCounts( IntPtr ISteamFriends, ulong steamIDClan, out int /*int **/ pnOnline, out int /*int **/ pnInGame, out int /*int **/ pnChatting ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_DownloadClanActivityCounts( IntPtr ISteamFriends, IntPtr /*class CSteamID **/ psteamIDClans, int /*int*/ cClansToRequest ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCountFromSource( IntPtr ISteamFriends, ulong steamIDSource ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetFriendFromSourceByIndex( IntPtr ISteamFriends, ulong steamIDSource, int /*int*/ iFriend ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsUserInSource( IntPtr ISteamFriends, ulong steamIDUser, ulong steamIDSource ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetInGameVoiceSpeaking( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSpeaking ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlay( IntPtr ISteamFriends, string /*const char **/ pchDialog ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToUser( IntPtr ISteamFriends, string /*const char **/ pchDialog, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage( IntPtr ISteamFriends, string /*const char **/ pchURL ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayToStore( IntPtr ISteamFriends, uint nAppID, OverlayToStoreFlag /*EOverlayToStoreFlag*/ eFlag ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_SetPlayedWith( IntPtr ISteamFriends, ulong steamIDUserPlayedWith ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog( IntPtr ISteamFriends, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetSmallFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetMediumFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetLargeFriendAvatar( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_RequestUserInformation( IntPtr ISteamFriends, ulong steamIDUser, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireNameOnly ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_RequestClanOfficerList( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOwner( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanOfficerCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetClanOfficerByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iOfficer ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamFriends_GetUserRestrictions( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetRichPresence( IntPtr ISteamFriends, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_ClearRichPresence( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendRichPresenceKeyCount( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamFriends_GetFriendRichPresenceKeyByIndex( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iKey ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamFriends_RequestFriendRichPresence( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_InviteUserToGame( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchConnectString ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetCoplayFriendCount( IntPtr ISteamFriends ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetCoplayFriend( IntPtr ISteamFriends, int /*int*/ iCoplayFriend ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendCoplayTime( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern AppId_t /*(AppId_t)*/ SteamAPI_ISteamFriends_GetFriendCoplayGame( IntPtr ISteamFriends, ulong steamIDFriend ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_JoinClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_LeaveClanChatRoom( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMemberCount( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamFriends_GetChatMemberByIndex( IntPtr ISteamFriends, ulong steamIDClan, int /*int*/ iUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SendClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, string /*const char **/ pchText ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetClanChatMessage( IntPtr ISteamFriends, ulong steamIDClanChat, int /*int*/ iMessage, IntPtr /*void **/ prgchText, int /*int*/ cchTextMax, out ChatEntryType /*EChatEntryType **/ peChatEntryType, out ulong psteamidChatter ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatAdmin( IntPtr ISteamFriends, ulong steamIDClanChat, ulong steamIDUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanChatWindowOpenInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_OpenClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_CloseClanChatWindowInSteam( IntPtr ISteamFriends, ulong steamIDClanChat ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_SetListenForFriendsMessages( IntPtr ISteamFriends, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bInterceptEnabled ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_ReplyToFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, string /*const char **/ pchMsgToSend ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamFriends_GetFriendMessage( IntPtr ISteamFriends, ulong steamIDFriend, int /*int*/ iMessageID, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_GetFollowerCount( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_IsFollowing( IntPtr ISteamFriends, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamFriends_EnumerateFollowingList( IntPtr ISteamFriends, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanPublic( IntPtr ISteamFriends, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamFriends_IsClanOfficialGameGroup( IntPtr ISteamFriends, ulong steamIDClan ); - - // - // ISteamUtils - // - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceAppActive( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetSecondsSinceComputerActive( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern Universe /*EUniverse*/ SteamAPI_ISteamUtils_GetConnectedUniverse( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetServerRealTime( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetIPCountry( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageSize( IntPtr ISteamUtils, int /*int*/ iImage, out uint /*uint32 **/ pnWidth, out uint /*uint32 **/ pnHeight ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetImageRGBA( IntPtr ISteamUtils, int /*int*/ iImage, IntPtr /*uint8 **/ pubDest, int /*int*/ nDestBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetCSERIPPort( IntPtr ISteamUtils, out uint /*uint32 **/ unIP, out ushort /*uint16 **/ usPort ); - [DllImport( "steam_api64.dll" )] internal static extern byte /*uint8*/ SteamAPI_ISteamUtils_GetCurrentBatteryPower( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetAppID( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationPosition( IntPtr ISteamUtils, NotificationPosition /*ENotificationPosition*/ eNotificationPosition ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsAPICallCompleted( IntPtr ISteamUtils, ulong hSteamAPICall, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICallFailure /*ESteamAPICallFailure*/ SteamAPI_ISteamUtils_GetAPICallFailureReason( IntPtr ISteamUtils, ulong hSteamAPICall ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetAPICallResult( IntPtr ISteamUtils, ulong hSteamAPICall, IntPtr /*void **/ pCallback, int /*int*/ cubCallback, int /*int*/ iCallbackExpected, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbFailed ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetIPCCallCount( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetWarningMessageHook( IntPtr ISteamUtils, IntPtr /*SteamAPIWarningMessageHook_t*/ pFunction ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsOverlayEnabled( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_BOverlayNeedsPresent( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUtils_CheckFileSignature( IntPtr ISteamUtils, string /*const char **/ szFileName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_ShowGamepadTextInput( IntPtr ISteamUtils, GamepadTextInputMode /*EGamepadTextInputMode*/ eInputMode, GamepadTextInputLineMode /*EGamepadTextInputLineMode*/ eLineInputMode, string /*const char **/ pchDescription, uint /*uint32*/ unCharMax, string /*const char **/ pchExistingText ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextLength( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_GetEnteredGamepadTextInput( IntPtr ISteamUtils, System.Text.StringBuilder /*char **/ pchText, uint /*uint32*/ cchText ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUtils_GetSteamUILanguage( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamRunningInVR( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetOverlayNotificationInset( IntPtr ISteamUtils, int /*int*/ nHorizontalInset, int /*int*/ nVerticalInset ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsSteamInBigPictureMode( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_StartVRDashboard( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUtils_IsVRHeadsetStreamingEnabled( IntPtr ISteamUtils ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUtils_SetVRHeadsetStreamingEnabled( IntPtr ISteamUtils, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - - // - // ISteamMatchmaking - // - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetFavoriteGameCount( IntPtr ISteamMatchmaking ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetFavoriteGame( IntPtr ISteamMatchmaking, int /*int*/ iGame, ref uint pnAppID, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnConnPort, out ushort /*uint16 **/ pnQueryPort, out uint /*uint32 **/ punFlags, out uint /*uint32 **/ pRTime32LastPlayedOnServer ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_AddFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags, uint /*uint32*/ rTime32LastPlayedOnServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RemoveFavoriteGame( IntPtr ISteamMatchmaking, uint nAppID, uint /*uint32*/ nIP, ushort /*uint16*/ nConnPort, ushort /*uint16*/ nQueryPort, uint /*uint32*/ unFlags ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_RequestLobbyList( IntPtr ISteamMatchmaking ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListStringFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, string /*const char **/ pchValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNumericalFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToMatch, LobbyComparison /*ELobbyComparison*/ eComparisonType ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListNearValueFilter( IntPtr ISteamMatchmaking, string /*const char **/ pchKeyToMatch, int /*int*/ nValueToBeCloseTo ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( IntPtr ISteamMatchmaking, int /*int*/ nSlotsAvailable ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListDistanceFilter( IntPtr ISteamMatchmaking, LobbyDistanceFilter /*ELobbyDistanceFilter*/ eLobbyDistanceFilter ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListResultCountFilter( IntPtr ISteamMatchmaking, int /*int*/ cMaxResults ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyByIndex( IntPtr ISteamMatchmaking, int /*int*/ iLobby ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_CreateLobby( IntPtr ISteamMatchmaking, LobbyType /*ELobbyType*/ eLobbyType, int /*int*/ cMaxMembers ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamMatchmaking_JoinLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_LeaveLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_InviteUserToLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDInvitee ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetNumLobbyMembers( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iMember ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyDataCount( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyDataByIndex( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iLobbyData, System.Text.StringBuilder /*char **/ pchKey, int /*int*/ cchKeyBufferSize, System.Text.StringBuilder /*char **/ pchValue, int /*int*/ cchValueBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_DeleteLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamMatchmaking_GetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDUser, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberData( IntPtr ISteamMatchmaking, ulong steamIDLobby, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SendLobbyChatMsg( IntPtr ISteamMatchmaking, ulong steamIDLobby, IntPtr /*const void **/ pvMsgBody, int /*int*/ cubMsgBody ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyChatEntry( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ iChatID, out ulong pSteamIDUser, IntPtr /*void **/ pvData, int /*int*/ cubData, out ChatEntryType /*EChatEntryType **/ peChatEntryType ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_RequestLobbyData( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmaking_SetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, uint /*uint32*/ unGameServerIP, ushort /*uint16*/ unGameServerPort, ulong steamIDGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_GetLobbyGameServer( IntPtr ISteamMatchmaking, ulong steamIDLobby, out uint /*uint32 **/ punGameServerIP, out ushort /*uint16 **/ punGameServerPort, out ulong psteamIDGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby, int /*int*/ cMaxMembers ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmaking_GetLobbyMemberLimit( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyType( IntPtr ISteamMatchmaking, ulong steamIDLobby, LobbyType /*ELobbyType*/ eLobbyType ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyJoinable( IntPtr ISteamMatchmaking, ulong steamIDLobby, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bLobbyJoinable ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamMatchmaking_GetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLobbyOwner( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDNewOwner ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmaking_SetLinkedLobby( IntPtr ISteamMatchmaking, ulong steamIDLobby, ulong steamIDLobbyDependent ); - - // - // ISteamMatchmakingServers - // - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestInternetServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestLANServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFriendsServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestFavoritesServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestHistoryServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerListRequest /*(HServerListRequest)*/ SteamAPI_ISteamMatchmakingServers_RequestSpectatorServerList( IntPtr ISteamMatchmakingServers, uint iApp, IntPtr /*struct MatchMakingKeyValuePair_t ***/ ppchFilters, uint /*uint32*/ nFilters, IntPtr /*class ISteamMatchmakingServerListResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_ReleaseRequest( IntPtr ISteamMatchmakingServers, IntPtr hServerListRequest ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*class gameserveritem_t **/ SteamAPI_ISteamMatchmakingServers_GetServerDetails( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshQuery( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMatchmakingServers_IsRefreshing( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamMatchmakingServers_GetServerCount( IntPtr ISteamMatchmakingServers, IntPtr hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_RefreshServer( IntPtr ISteamMatchmakingServers, IntPtr hRequest, int /*int*/ iServer ); - [DllImport( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PingServer( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPingResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_PlayerDetails( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingPlayersResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern HServerQuery /*(HServerQuery)*/ SteamAPI_ISteamMatchmakingServers_ServerRules( IntPtr ISteamMatchmakingServers, uint /*uint32*/ unIP, ushort /*uint16*/ usPort, IntPtr /*class ISteamMatchmakingRulesResponse **/ pRequestServersResponse ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMatchmakingServers_CancelServerQuery( IntPtr ISteamMatchmakingServers, int hServerQuery ); - - // - // ISteamRemoteStorage - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWrite( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_FileRead( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, IntPtr /*const void **/ pvData, uint /*uint32*/ cubData ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileReadAsync( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, uint /*uint32*/ nOffset, uint /*uint32*/ cubToRead ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileReadAsyncComplete( IntPtr ISteamRemoteStorage, ulong hReadCall, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cubToRead ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileForget( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileDelete( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_FileShare( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_SetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, RemoteStoragePlatform /*ERemoteStoragePlatform*/ eRemoteStoragePlatform ); - [DllImport( "steam_api64.dll" )] internal static extern UGCFileWriteStreamHandle_t /*(UGCFileWriteStreamHandle_t)*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamOpen( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamWriteChunk( IntPtr ISteamRemoteStorage, ulong writeHandle, IntPtr /*const void **/ pvData, int /*int32*/ cubData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamClose( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileWriteStreamCancel( IntPtr ISteamRemoteStorage, ulong writeHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FileExists( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_FilePersisted( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileSize( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern long /*int64*/ SteamAPI_ISteamRemoteStorage_GetFileTimestamp( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern RemoteStoragePlatform /*ERemoteStoragePlatform*/ SteamAPI_ISteamRemoteStorage_GetSyncPlatforms( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetFileCount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamRemoteStorage_GetFileNameAndSize( IntPtr ISteamRemoteStorage, int /*int*/ iFile, out int /*int32 **/ pnFileSizeInBytes ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetQuota( IntPtr ISteamRemoteStorage, out ulong /*uint64 **/ pnTotalBytes, out ulong /*uint64 **/ puAvailableBytes ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForAccount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_IsCloudEnabledForApp( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamRemoteStorage_SetCloudEnabledForApp( IntPtr ISteamRemoteStorage, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bEnabled ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownload( IntPtr ISteamRemoteStorage, ulong hContent, uint /*uint32*/ unPriority ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDownloadProgress( IntPtr ISteamRemoteStorage, ulong hContent, out int /*int32 **/ pnBytesDownloaded, out int /*int32 **/ pnBytesExpected ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_GetUGCDetails( IntPtr ISteamRemoteStorage, ulong hContent, ref uint pnAppID, System.Text.StringBuilder /*char ***/ ppchName, out int /*int32 **/ pnFileSizeInBytes, out ulong pSteamIDOwner ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_UGCRead( IntPtr ISteamRemoteStorage, ulong hContent, IntPtr /*void **/ pvData, int /*int32*/ cubDataToRead, uint /*uint32*/ cOffset, UGCReadAction /*EUGCReadAction*/ eAction ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCCount( IntPtr ISteamRemoteStorage ); - [DllImport( "steam_api64.dll" )] internal static extern UGCHandle_t /*(UGCHandle_t)*/ SteamAPI_ISteamRemoteStorage_GetCachedUGCHandle( IntPtr ISteamRemoteStorage, int /*int32*/ iCachedContent ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishWorkshopFile( IntPtr ISteamRemoteStorage, string /*const char **/ pchFile, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, WorkshopFileType /*EWorkshopFileType*/ eWorkshopFileType ); - [DllImport( "steam_api64.dll" )] internal static extern PublishedFileUpdateHandle_t /*(PublishedFileUpdateHandle_t)*/ SteamAPI_ISteamRemoteStorage_CreatePublishedFileUpdateRequest( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFilePreviewFile( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchPreviewFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTitle( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchTitle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchDescription ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileVisibility( IntPtr ISteamRemoteStorage, ulong updateHandle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileTags( IntPtr ISteamRemoteStorage, ulong updateHandle, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_CommitPublishedFileUpdate( IntPtr ISteamRemoteStorage, ulong updateHandle ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedFileDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, uint /*uint32*/ unMaxSecondsOld ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_DeletePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserPublishedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSubscribedFiles( IntPtr ISteamRemoteStorage, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UnsubscribePublishedFile( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( IntPtr ISteamRemoteStorage, ulong updateHandle, string /*const char **/ pchChangeDescription ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UpdateUserPublishedItemVote( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_GetUserPublishedItemVoteDetails( IntPtr ISteamRemoteStorage, ulong unPublishedFileId ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( IntPtr ISteamRemoteStorage, ulong steamId, uint /*uint32*/ unStartIndex, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pRequiredTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pExcludedTags ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_PublishVideo( IntPtr ISteamRemoteStorage, WorkshopVideoProvider /*EWorkshopVideoProvider*/ eVideoProvider, string /*const char **/ pchVideoAccount, string /*const char **/ pchVideoIdentifier, string /*const char **/ pchPreviewFile, uint nConsumerAppId, string /*const char **/ pchTitle, string /*const char **/ pchDescription, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_SetUserPublishedFileAction( IntPtr ISteamRemoteStorage, ulong unPublishedFileId, WorkshopFileAction /*EWorkshopFileAction*/ eAction ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( IntPtr ISteamRemoteStorage, WorkshopFileAction /*EWorkshopFileAction*/ eAction, uint /*uint32*/ unStartIndex ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( IntPtr ISteamRemoteStorage, WorkshopEnumerationType /*EWorkshopEnumerationType*/ eEnumerationType, uint /*uint32*/ unStartIndex, uint /*uint32*/ unCount, uint /*uint32*/ unDays, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pTags, ref SteamParamStringArray_t /*struct SteamParamStringArray_t **/ pUserTags ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamRemoteStorage_UGCDownloadToLocation( IntPtr ISteamRemoteStorage, ulong hContent, string /*const char **/ pchLocation, uint /*uint32*/ unPriority ); - - // - // ISteamUserStats - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_RequestCurrentStats( IntPtr ISteamUserStats ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat( IntPtr ISteamUserStats, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetStat0( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_UpdateAvgRateStat( IntPtr ISteamUserStats, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_SetAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ClearAchievement( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAndUnlockTime( IntPtr ISteamUserStats, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_StoreStats( IntPtr ISteamUserStats ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetAchievementIcon( IntPtr ISteamUserStats, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementDisplayAttribute( IntPtr ISteamUserStats, string /*const char **/ pchName, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_IndicateAchievementProgress( IntPtr ISteamUserStats, string /*const char **/ pchName, uint /*uint32*/ nCurProgress, uint /*uint32*/ nMaxProgress ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUserStats_GetNumAchievements( IntPtr ISteamUserStats ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetAchievementName( IntPtr ISteamUserStats, uint /*uint32*/ iAchievement ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestUserStats( IntPtr ISteamUserStats, ulong steamIDUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserStat0( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievement( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetUserAchievementAndUnlockTime( IntPtr ISteamUserStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved, out uint /*uint32 **/ punUnlockTime ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_ResetAllStats( IntPtr ISteamUserStats, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAchievementsToo ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindOrCreateLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName, LeaderboardSortMethod /*ELeaderboardSortMethod*/ eLeaderboardSortMethod, LeaderboardDisplayType /*ELeaderboardDisplayType*/ eLeaderboardDisplayType ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_FindLeaderboard( IntPtr ISteamUserStats, string /*const char **/ pchLeaderboardName ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamUserStats_GetLeaderboardName( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetLeaderboardEntryCount( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api64.dll" )] internal static extern LeaderboardSortMethod /*ELeaderboardSortMethod*/ SteamAPI_ISteamUserStats_GetLeaderboardSortMethod( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api64.dll" )] internal static extern LeaderboardDisplayType /*ELeaderboardDisplayType*/ SteamAPI_ISteamUserStats_GetLeaderboardDisplayType( IntPtr ISteamUserStats, ulong hSteamLeaderboard ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntries( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardDataRequest /*ELeaderboardDataRequest*/ eLeaderboardDataRequest, int /*int*/ nRangeStart, int /*int*/ nRangeEnd ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_DownloadLeaderboardEntriesForUsers( IntPtr ISteamUserStats, ulong hSteamLeaderboard, IntPtr /*class CSteamID **/ prgUsers, int /*int*/ cUsers ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetDownloadedLeaderboardEntry( IntPtr ISteamUserStats, ulong hSteamLeaderboardEntries, int /*int*/ index, ref LeaderboardEntry_t /*struct LeaderboardEntry_t **/ pLeaderboardEntry, IntPtr /*int32 **/ pDetails, int /*int*/ cDetailsMax ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_UploadLeaderboardScore( IntPtr ISteamUserStats, ulong hSteamLeaderboard, LeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/ eLeaderboardUploadScoreMethod, int /*int32*/ nScore, int[] /*const int32 **/ pScoreDetails, int /*int*/ cScoreDetailsCount ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_AttachLeaderboardUGC( IntPtr ISteamUserStats, ulong hSteamLeaderboard, ulong hUGC ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_GetNumberOfCurrentPlayers( IntPtr ISteamUserStats ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalAchievementPercentages( IntPtr ISteamUserStats ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetMostAchievedAchievementInfo( IntPtr ISteamUserStats, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamUserStats_GetNextMostAchievedAchievementInfo( IntPtr ISteamUserStats, int /*int*/ iIteratorPrevious, System.Text.StringBuilder /*char **/ pchName, uint /*uint32*/ unNameBufLen, out float /*float **/ pflPercent, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetAchievementAchievedPercent( IntPtr ISteamUserStats, string /*const char **/ pchName, out float /*float **/ pflPercent ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUserStats_RequestGlobalStats( IntPtr ISteamUserStats, int /*int*/ nHistoryDays ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUserStats_GetGlobalStat0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out long /*int64 **/ pData, uint /*uint32*/ cubData ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int32*/ SteamAPI_ISteamUserStats_GetGlobalStatHistory0( IntPtr ISteamUserStats, string /*const char **/ pchStatName, out double /*double **/ pData, uint /*uint32*/ cubData ); - - // - // ISteamApps - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribed( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsLowViolence( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsCybercafe( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsVACBanned( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetCurrentGameLanguage( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetAvailableGameLanguages( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedApp( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsDlcInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetEarliestPurchaseUnixTime( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsSubscribedFromFreeWeekend( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetDLCCount( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BGetDLCDataByIndex( IntPtr ISteamApps, int /*int*/ iDLC, ref uint pAppID, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAvailable, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_InstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_UninstallDLC( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAppProofOfPurchaseKey( IntPtr ISteamApps, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetCurrentBetaName( IntPtr ISteamApps, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_MarkContentCorrupt( IntPtr ISteamApps, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMissingFilesOnly ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetInstalledDepots( IntPtr ISteamApps, uint appID, IntPtr /*DepotId_t **/ pvecDepots, uint /*uint32*/ cMaxDepots ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamApps_GetAppInstallDir( IntPtr ISteamApps, uint appID, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_BIsAppInstalled( IntPtr ISteamApps, uint appID ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamApps_GetAppOwner( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamApps_GetLaunchQueryParam( IntPtr ISteamApps, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamApps_GetDlcDownloadProgress( IntPtr ISteamApps, uint nAppID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamApps_GetAppBuildId( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys( IntPtr ISteamApps ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamApps_GetFileDetails( IntPtr ISteamApps, string /*const char **/ pszFileName ); - - // - // ISteamNetworking - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendP2PPacket( IntPtr ISteamNetworking, ulong steamIDRemote, IntPtr /*const void **/ pubData, uint /*uint32*/ cubData, P2PSend /*EP2PSend*/ eP2PSendType, int /*int*/ nChannel ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsP2PPacketAvailable( IntPtr ISteamNetworking, out uint /*uint32 **/ pcubMsgSize, int /*int*/ nChannel ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_ReadP2PPacket( IntPtr ISteamNetworking, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, out ulong psteamIDRemote, int /*int*/ nChannel ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AcceptP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PSessionWithUser( IntPtr ISteamNetworking, ulong steamIDRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_CloseP2PChannelWithUser( IntPtr ISteamNetworking, ulong steamIDRemote, int /*int*/ nChannel ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetP2PSessionState( IntPtr ISteamNetworking, ulong steamIDRemote, ref P2PSessionState_t /*struct P2PSessionState_t **/ pConnectionState ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_AllowP2PPacketRelay( IntPtr ISteamNetworking, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllow ); - [DllImport( "steam_api64.dll" )] internal static extern SNetListenSocket_t /*(SNetListenSocket_t)*/ SteamAPI_ISteamNetworking_CreateListenSocket( IntPtr ISteamNetworking, int /*int*/ nVirtualP2PPort, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "steam_api64.dll" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateP2PConnectionSocket( IntPtr ISteamNetworking, ulong steamIDTarget, int /*int*/ nVirtualPort, int /*int*/ nTimeoutSec, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowUseOfPacketRelay ); - [DllImport( "steam_api64.dll" )] internal static extern SNetSocket_t /*(SNetSocket_t)*/ SteamAPI_ISteamNetworking_CreateConnectionSocket( IntPtr ISteamNetworking, uint /*uint32*/ nIP, ushort /*uint16*/ nPort, int /*int*/ nTimeoutSec ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroySocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_DestroyListenSocket( IntPtr ISteamNetworking, uint hSocket, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bNotifyRemoteEnd ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_SendDataOnSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubData, uint /*uint32*/ cubData, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReliable ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailableOnSocket( IntPtr ISteamNetworking, uint hSocket, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveDataFromSocket( IntPtr ISteamNetworking, uint hSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_IsDataAvailable( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_RetrieveData( IntPtr ISteamNetworking, uint hListenSocket, IntPtr /*void **/ pubDest, uint /*uint32*/ cubDest, out uint /*uint32 **/ pcubMsgSize, ref uint phSocket ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetSocketInfo( IntPtr ISteamNetworking, uint hSocket, out ulong pSteamIDRemote, IntPtr /*int **/ peSocketStatus, out uint /*uint32 **/ punIPRemote, out ushort /*uint16 **/ punPortRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamNetworking_GetListenSocketInfo( IntPtr ISteamNetworking, uint hListenSocket, out uint /*uint32 **/ pnIP, out ushort /*uint16 **/ pnPort ); - [DllImport( "steam_api64.dll" )] internal static extern SNetSocketConnectionType /*ESNetSocketConnectionType*/ SteamAPI_ISteamNetworking_GetSocketConnectionType( IntPtr ISteamNetworking, uint hSocket ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamNetworking_GetMaxPacketSize( IntPtr ISteamNetworking, uint hSocket ); - - // - // ISteamScreenshots - // - [DllImport( "steam_api64.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_WriteScreenshot( IntPtr ISteamScreenshots, IntPtr /*void **/ pubRGB, uint /*uint32*/ cubRGB, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "steam_api64.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddScreenshotToLibrary( IntPtr ISteamScreenshots, string /*const char **/ pchFilename, string /*const char **/ pchThumbnailFilename, int /*int*/ nWidth, int /*int*/ nHeight ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_TriggerScreenshot( IntPtr ISteamScreenshots ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamScreenshots_HookScreenshots( IntPtr ISteamScreenshots, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHook ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_SetLocation( IntPtr ISteamScreenshots, uint hScreenshot, string /*const char **/ pchLocation ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagUser( IntPtr ISteamScreenshots, uint hScreenshot, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_TagPublishedFile( IntPtr ISteamScreenshots, uint hScreenshot, ulong unPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamScreenshots_IsScreenshotsHooked( IntPtr ISteamScreenshots ); - [DllImport( "steam_api64.dll" )] internal static extern ScreenshotHandle /*(ScreenshotHandle)*/ SteamAPI_ISteamScreenshots_AddVRScreenshotToLibrary( IntPtr ISteamScreenshots, VRScreenshotType /*EVRScreenshotType*/ eType, string /*const char **/ pchFilename, string /*const char **/ pchVRFilename ); - - // - // ISteamMusic - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsEnabled( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusic_BIsPlaying( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern AudioPlayback_Status /*AudioPlayback_Status*/ SteamAPI_ISteamMusic_GetPlaybackStatus( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Play( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_Pause( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayPrevious( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_PlayNext( IntPtr ISteamMusic ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamMusic_SetVolume( IntPtr ISteamMusic, float /*float*/ flVolume ); - [DllImport( "steam_api64.dll" )] internal static extern float /*float*/ SteamAPI_ISteamMusic_GetVolume( IntPtr ISteamMusic ); - - // - // ISteamMusicRemote - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_RegisterSteamMusicRemote( IntPtr ISteamMusicRemote, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_DeregisterSteamMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BIsCurrentMusicRemote( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_BActivationSuccess( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetDisplayName( IntPtr ISteamMusicRemote, string /*const char **/ pchDisplayName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPNGIcon_64x64( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayPrevious( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlayNext( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnableQueue( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_EnablePlaylists( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdatePlaybackStatus( IntPtr ISteamMusicRemote, AudioPlayback_Status /*AudioPlayback_Status*/ nStatus ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateShuffled( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateLooped( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateVolume( IntPtr ISteamMusicRemote, float /*float*/ flValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryIsAvailable( IntPtr ISteamMusicRemote, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAvailable ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryText( IntPtr ISteamMusicRemote, string /*const char **/ pchText ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( IntPtr ISteamMusicRemote, int /*int*/ nValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_UpdateCurrentEntryCoverArt( IntPtr ISteamMusicRemote, IntPtr /*void **/ pvBuffer, uint /*uint32*/ cbBufferLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_CurrentEntryDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetQueueEntries( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentQueueEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_QueueDidChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistWillChange( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_ResetPlaylistEntries( IntPtr ISteamMusicRemote ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID, int /*int*/ nPosition, string /*const char **/ pchEntryText ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_SetCurrentPlaylistEntry( IntPtr ISteamMusicRemote, int /*int*/ nID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamMusicRemote_PlaylistDidChange( IntPtr ISteamMusicRemote ); - - // - // ISteamHTTP - // - [DllImport( "steam_api64.dll" )] internal static extern HTTPRequestHandle /*(HTTPRequestHandle)*/ SteamAPI_ISteamHTTP_CreateHTTPRequest( IntPtr ISteamHTTP, HTTPMethod /*EHTTPMethod*/ eHTTPRequestMethod, string /*const char **/ pchAbsoluteURL ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestContextValue( IntPtr ISteamHTTP, uint hRequest, ulong /*uint64*/ ulContextValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unTimeoutSeconds ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, string /*const char **/ pchHeaderValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestGetOrPostParameter( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchParamName, string /*const char **/ pchParamValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequest( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SendHTTPRequestAndStreamResponse( IntPtr ISteamHTTP, uint hRequest, ref ulong pCallHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_DeferHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_PrioritizeHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderSize( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out uint /*uint32 **/ unResponseHeaderSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseHeaderValue( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchHeaderName, out byte /*uint8 **/ pHeaderValueBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodySize( IntPtr ISteamHTTP, uint hRequest, out uint /*uint32 **/ unBodySize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPResponseBodyData( IntPtr ISteamHTTP, uint hRequest, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPStreamingResponseBodyData( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ cOffset, out byte /*uint8 **/ pBodyDataBuffer, uint /*uint32*/ unBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseHTTPRequest( IntPtr ISteamHTTP, uint hRequest ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPDownloadProgressPct( IntPtr ISteamHTTP, uint hRequest, out float /*float **/ pflPercentOut ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRawPostBody( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchContentType, out byte /*uint8 **/ pubBody, uint /*uint32*/ unBodyLen ); - [DllImport( "steam_api64.dll" )] internal static extern HTTPCookieContainerHandle /*(HTTPCookieContainerHandle)*/ SteamAPI_ISteamHTTP_CreateCookieContainer( IntPtr ISteamHTTP, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowResponsesToModify ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_ReleaseCookieContainer( IntPtr ISteamHTTP, uint hCookieContainer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetCookie( IntPtr ISteamHTTP, uint hCookieContainer, string /*const char **/ pchHost, string /*const char **/ pchUrl, string /*const char **/ pchCookie ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestCookieContainer( IntPtr ISteamHTTP, uint hRequest, uint hCookieContainer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo( IntPtr ISteamHTTP, uint hRequest, string /*const char **/ pchUserAgentInfo ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRequireVerifiedCertificate ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( IntPtr ISteamHTTP, uint hRequest, uint /*uint32*/ unMilliseconds ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut( IntPtr ISteamHTTP, uint hRequest, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbWasTimedOut ); - - // - // ISteamController - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Init( IntPtr ISteamController ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_Shutdown( IntPtr ISteamController ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_RunFrame( IntPtr ISteamController ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetConnectedControllers( IntPtr ISteamController, IntPtr /*ControllerHandle_t **/ handlesOut ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowBindingPanel( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetActionSetHandle( IntPtr ISteamController, string /*const char **/ pszActionSetName ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSet( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerActionSetHandle_t /*(ControllerActionSetHandle_t)*/ SteamAPI_ISteamController_GetCurrentActionSet( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_ActivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateActionSetLayer( IntPtr ISteamController, ulong controllerHandle, ulong actionSetLayerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_DeactivateAllActionSetLayers( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetActiveActionSetLayers( IntPtr ISteamController, ulong controllerHandle, IntPtr /*ControllerActionSetHandle_t **/ handlesOut ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerDigitalActionHandle_t /*(ControllerDigitalActionHandle_t)*/ SteamAPI_ISteamController_GetDigitalActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerDigitalActionData_t /*struct ControllerDigitalActionData_t*/ SteamAPI_ISteamController_GetDigitalActionData( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerAnalogActionHandle_t /*(ControllerAnalogActionHandle_t)*/ SteamAPI_ISteamController_GetAnalogActionHandle( IntPtr ISteamController, string /*const char **/ pszActionName ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerAnalogActionData_t /*struct ControllerAnalogActionData_t*/ SteamAPI_ISteamController_GetAnalogActionData( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, out ControllerActionOrigin /*EControllerActionOrigin **/ originsOut ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_StopAnalogActionMomentum( IntPtr ISteamController, ulong controllerHandle, ulong eAction ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerRepeatedHapticPulse( IntPtr ISteamController, ulong controllerHandle, SteamControllerPad /*ESteamControllerPad*/ eTargetPad, ushort /*unsigned short*/ usDurationMicroSec, ushort /*unsigned short*/ usOffMicroSec, ushort /*unsigned short*/ unRepeat, uint /*unsigned int*/ nFlags ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_TriggerVibration( IntPtr ISteamController, ulong controllerHandle, ushort /*unsigned short*/ usLeftSpeed, ushort /*unsigned short*/ usRightSpeed ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamController_SetLEDColor( IntPtr ISteamController, ulong controllerHandle, byte /*uint8*/ nColorR, byte /*uint8*/ nColorG, byte /*uint8*/ nColorB, uint /*unsigned int*/ nFlags ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamController_GetGamepadIndexForController( IntPtr ISteamController, ulong ulControllerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerHandle_t /*(ControllerHandle_t)*/ SteamAPI_ISteamController_GetControllerForGamepadIndex( IntPtr ISteamController, int /*int*/ nIndex ); - [DllImport( "steam_api64.dll" )] internal static extern ControllerMotionData_t /*struct ControllerMotionData_t*/ SteamAPI_ISteamController_GetMotionData( IntPtr ISteamController, ulong controllerHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowDigitalActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong digitalActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamController_ShowAnalogActionOrigins( IntPtr ISteamController, ulong controllerHandle, ulong analogActionHandle, float /*float*/ flScale, float /*float*/ flXPosition, float /*float*/ flYPosition ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin( IntPtr ISteamController, ControllerActionOrigin /*EControllerActionOrigin*/ eOrigin ); - [DllImport( "steam_api64.dll" )] internal static extern SteamInputType /*ESteamInputType*/ SteamAPI_ISteamController_GetInputTypeForHandle( IntPtr ISteamController, ulong controllerHandle ); - - // - // ISteamUGC - // - [DllImport( "steam_api64.dll" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUserUGCRequest( IntPtr ISteamUGC, uint unAccountID, UserUGCList /*EUserUGCList*/ eListType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingUGCType, UserUGCListSortOrder /*EUserUGCListSortOrder*/ eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "steam_api64.dll" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryAllUGCRequest( IntPtr ISteamUGC, UGCQuery /*EUGCQuery*/ eQueryType, UGCMatchingUGCType /*EUGCMatchingUGCType*/ eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint /*uint32*/ unPage ); - [DllImport( "steam_api64.dll" )] internal static extern UGCQueryHandle_t /*(UGCQueryHandle_t)*/ SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SendQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCResult( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ref SteamUGCDetails_t /*struct SteamUGCDetails_t **/ pDetails ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCPreviewURL( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchURL, uint /*uint32*/ cchURLSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCMetadata( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, System.Text.StringBuilder /*char **/ pchMetadata, uint /*uint32*/ cchMetadatasize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCChildren( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCStatistic( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, ItemStatistic /*EItemStatistic*/ eStatType, out ulong /*uint64 **/ pStatValue ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumAdditionalPreviews( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCAdditionalPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ previewIndex, System.Text.StringBuilder /*char **/ pchURLOrVideoID, uint /*uint32*/ cchURLSize, System.Text.StringBuilder /*char **/ pchOriginalFileName, uint /*uint32*/ cchOriginalFileNameSize, out ItemPreviewType /*EItemPreviewType **/ pPreviewType ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetQueryUGCNumKeyValueTags( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetQueryUGCKeyValueTag( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, uint /*uint32*/ keyValueTagIndex, System.Text.StringBuilder /*char **/ pchKey, uint /*uint32*/ cchKeySize, System.Text.StringBuilder /*char **/ pchValue, uint /*uint32*/ cchValueSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_ReleaseQueryUGCRequest( IntPtr ISteamUGC, ulong handle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddExcludedTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pTagName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnOnlyIDs( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnOnlyIDs ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnKeyValueTags( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnKeyValueTags ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnLongDescription( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnLongDescription ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnMetadata( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnMetadata ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnChildren( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnChildren ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnAdditionalPreviews( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnAdditionalPreviews ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnTotalOnly( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReturnTotalOnly ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetReturnPlaytimeStats( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetAllowCachedResponse( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetCloudFileNameFilter( IntPtr ISteamUGC, ulong handle, string /*const char **/ pMatchCloudFileName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetMatchAnyTag( IntPtr ISteamUGC, ulong handle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bMatchAnyTag ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetSearchText( IntPtr ISteamUGC, ulong handle, string /*const char **/ pSearchText ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetRankedByTrendDays( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ unDays ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddRequiredKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RequestUGCDetails( IntPtr ISteamUGC, ulong nPublishedFileID, uint /*uint32*/ unMaxAgeSeconds ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_CreateItem( IntPtr ISteamUGC, uint nConsumerAppId, WorkshopFileType /*EWorkshopFileType*/ eFileType ); - [DllImport( "steam_api64.dll" )] internal static extern UGCUpdateHandle_t /*(UGCUpdateHandle_t)*/ SteamAPI_ISteamUGC_StartItemUpdate( IntPtr ISteamUGC, uint nConsumerAppId, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTitle( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchTitle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemDescription( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchDescription ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemUpdateLanguage( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchLanguage ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemMetadata( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchMetaData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemVisibility( IntPtr ISteamUGC, ulong handle, RemoteStoragePublishedFileVisibility /*ERemoteStoragePublishedFileVisibility*/ eVisibility ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemTags( IntPtr ISteamUGC, ulong updateHandle, ref SteamParamStringArray_t /*const struct SteamParamStringArray_t **/ pTags ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemContent( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszContentFolder ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_SetItemPreview( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemKeyValueTags( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemKeyValueTag( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewFile( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszPreviewFile, ItemPreviewType /*EItemPreviewType*/ type ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_AddItemPreviewVideo( IntPtr ISteamUGC, ulong handle, string /*const char **/ pszVideoID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewFile( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszPreviewFile ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_UpdateItemPreviewVideo( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index, string /*const char **/ pszVideoID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_RemoveItemPreview( IntPtr ISteamUGC, ulong handle, uint /*uint32*/ index ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubmitItemUpdate( IntPtr ISteamUGC, ulong handle, string /*const char **/ pchChangeNote ); - [DllImport( "steam_api64.dll" )] internal static extern ItemUpdateStatus /*EItemUpdateStatus*/ SteamAPI_ISteamUGC_GetItemUpdateProgress( IntPtr ISteamUGC, ulong handle, out ulong /*uint64 **/ punBytesProcessed, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bVoteUp ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetUserItemVote( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddItemToFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveItemFromFavorites( IntPtr ISteamUGC, uint nAppId, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_SubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_UnsubscribeItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetNumSubscribedItems( IntPtr ISteamUGC ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetSubscribedItems( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ cMaxEntries ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamUGC_GetItemState( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemInstallInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punSizeOnDisk, System.Text.StringBuilder /*char **/ pchFolder, uint /*uint32*/ cchFolderSize, out uint /*uint32 **/ punTimeStamp ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_GetItemDownloadInfo( IntPtr ISteamUGC, ulong nPublishedFileID, out ulong /*uint64 **/ punBytesDownloaded, out ulong /*uint64 **/ punBytesTotal ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_DownloadItem( IntPtr ISteamUGC, ulong nPublishedFileID, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHighPriority ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamUGC_BInitWorkshopForGameServer( IntPtr ISteamUGC, uint unWorkshopDepotID, string /*const char **/ pszFolder ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamUGC_SuspendDownloads( IntPtr ISteamUGC, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSuspend ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StartPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTracking( IntPtr ISteamUGC, IntPtr /*PublishedFileId_t **/ pvecPublishedFileID, uint /*uint32*/ unNumPublishedFileIDs ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_StopPlaytimeTrackingForAllItems( IntPtr ISteamUGC ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveDependency( IntPtr ISteamUGC, ulong nParentPublishedFileID, ulong nChildPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_AddAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_RemoveAppDependency( IntPtr ISteamUGC, ulong nPublishedFileID, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_GetAppDependencies( IntPtr ISteamUGC, ulong nPublishedFileID ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamUGC_DeleteItem( IntPtr ISteamUGC, ulong nPublishedFileID ); - - // - // ISteamAppList - // - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetNumInstalledApps( IntPtr ISteamAppList ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamAppList_GetInstalledApps( IntPtr ISteamAppList, IntPtr /*AppId_t **/ pvecAppID, uint /*uint32*/ unMaxAppIDs ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppName( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchName, int /*int*/ cchNameMax ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppInstallDir( IntPtr ISteamAppList, uint nAppID, System.Text.StringBuilder /*char **/ pchDirectory, int /*int*/ cchNameMax ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamAppList_GetAppBuildId( IntPtr ISteamAppList, uint nAppID ); - - // - // ISteamHTMLSurface - // - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_DestructISteamHTMLSurface( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Init( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamHTMLSurface_Shutdown( IntPtr ISteamHTMLSurface ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamHTMLSurface_CreateBrowser( IntPtr ISteamHTMLSurface, string /*const char **/ pchUserAgent, string /*const char **/ pchUserCSS ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_RemoveBrowser( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_LoadURL( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchURL, string /*const char **/ pchPostData ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetSize( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ unWidth, uint /*uint32*/ unHeight ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopLoad( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Reload( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoBack( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GoForward( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AddHeader( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchKey, string /*const char **/ pchValue ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ExecuteJavascript( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchScript ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseDoubleClick( IntPtr ISteamHTMLSurface, uint unBrowserHandle, HTMLMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ eMouseButton ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseMove( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_MouseWheel( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int32*/ nDelta ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyDown( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyUp( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nNativeKeyCode, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_KeyChar( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ cUnicodeChar, HTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ eHTMLKeyModifiers ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetHorizontalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetVerticalScroll( IntPtr ISteamHTMLSurface, uint unBrowserHandle, uint /*uint32*/ nAbsolutePixelScroll ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetKeyFocus( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHasKeyFocus ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_ViewSource( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_CopyToClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_PasteFromClipboard( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_Find( IntPtr ISteamHTMLSurface, uint unBrowserHandle, string /*const char **/ pchSearchStr, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bCurrentlyInFind, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bReverse ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_StopFind( IntPtr ISteamHTMLSurface, uint unBrowserHandle ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_GetLinkAtPosition( IntPtr ISteamHTMLSurface, uint unBrowserHandle, int /*int*/ x, int /*int*/ y ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetCookie( IntPtr ISteamHTMLSurface, string /*const char **/ pchHostname, string /*const char **/ pchKey, string /*const char **/ pchValue, string /*const char **/ pchPath, uint nExpires, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bSecure, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bHTTPOnly ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetPageScaleFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flZoom, int /*int*/ nPointX, int /*int*/ nPointY ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetBackgroundMode( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bBackgroundMode ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor( IntPtr ISteamHTMLSurface, uint unBrowserHandle, float /*float*/ flDPIScaling ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_AllowStartRequest( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bAllowed ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamHTMLSurface_JSDialogResponse( IntPtr ISteamHTMLSurface, uint unBrowserHandle, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bResult ); - - // - // ISteamInventory - // - [DllImport( "steam_api64.dll" )] internal static extern Result /*EResult*/ SteamAPI_ISteamInventory_GetResultStatus( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItems( IntPtr ISteamInventory, int resultHandle, IntPtr /*struct SteamItemDetails_t **/ pOutItemsArray, out uint /*uint32 **/ punOutItemsArraySize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetResultItemProperty( IntPtr ISteamInventory, int resultHandle, uint /*uint32*/ unItemIndex, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetResultTimestamp( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_CheckResultSteamID( IntPtr ISteamInventory, int resultHandle, ulong steamIDExpected ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_DestroyResult( IntPtr ISteamInventory, int resultHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetAllItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsByID( IntPtr ISteamInventory, ref int pResultHandle, ulong[] pInstanceIDs, uint /*uint32*/ unCountInstanceIDs ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SerializeResult( IntPtr ISteamInventory, int resultHandle, IntPtr /*void **/ pOutBuffer, out uint /*uint32 **/ punOutBufferSize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_DeserializeResult( IntPtr ISteamInventory, ref int pOutResultHandle, IntPtr /*const void **/ pBuffer, uint /*uint32*/ unBufferSize, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bRESERVED_MUST_BE_FALSE ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GenerateItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GrantPromoItems( IntPtr ISteamInventory, ref int pResultHandle ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItem( IntPtr ISteamInventory, ref int pResultHandle, int itemDef ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_AddPromoItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayItemDefs, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ConsumeItem( IntPtr ISteamInventory, ref int pResultHandle, ulong itemConsume, uint /*uint32*/ unQuantity ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_ExchangeItems( IntPtr ISteamInventory, ref int pResultHandle, int[] pArrayGenerate, uint[] /*const uint32 **/ punArrayGenerateQuantity, uint /*uint32*/ unArrayGenerateLength, ulong[] pArrayDestroy, uint[] /*const uint32 **/ punArrayDestroyQuantity, uint /*uint32*/ unArrayDestroyLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TransferItemQuantity( IntPtr ISteamInventory, ref int pResultHandle, ulong itemIdSource, uint /*uint32*/ unQuantity, ulong itemIdDest ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamInventory_SendItemDropHeartbeat( IntPtr ISteamInventory ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TriggerItemDrop( IntPtr ISteamInventory, ref int pResultHandle, int dropListDefinition ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_TradeItems( IntPtr ISteamInventory, ref int pResultHandle, ulong steamIDTradePartner, ulong[] pArrayGive, uint[] /*const uint32 **/ pArrayGiveQuantity, uint /*uint32*/ nArrayGiveLength, ulong[] pArrayGet, uint[] /*const uint32 **/ pArrayGetQuantity, uint /*uint32*/ nArrayGetLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_LoadItemDefinitions( IntPtr ISteamInventory ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionIDs( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemDefinitionProperty( IntPtr ISteamInventory, int iDefinition, string /*const char **/ pchPropertyName, System.Text.StringBuilder /*char **/ pchValueBuffer, out uint /*uint32 **/ punValueBufferSizeOut ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( IntPtr ISteamInventory, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs( IntPtr ISteamInventory, ulong steamID, IntPtr /*SteamItemDef_t **/ pItemDefIDs, out uint /*uint32 **/ punItemDefIDsArraySize ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_StartPurchase( IntPtr ISteamInventory, int[] pArrayItemDefs, uint[] /*const uint32 **/ punArrayQuantity, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamInventory_RequestPrices( IntPtr ISteamInventory ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamInventory_GetNumItemsWithPrices( IntPtr ISteamInventory ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemsWithPrices( IntPtr ISteamInventory, IntPtr /*SteamItemDef_t **/ pArrayItemDefs, IntPtr /*uint64 **/ pPrices, uint /*uint32*/ unArrayLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_GetItemPrice( IntPtr ISteamInventory, int iDefinition, out ulong /*uint64 **/ pPrice ); - [DllImport( "steam_api64.dll" )] internal static extern SteamInventoryUpdateHandle_t /*(SteamInventoryUpdateHandle_t)*/ SteamAPI_ISteamInventory_StartUpdateProperties( IntPtr ISteamInventory ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_RemoveProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, string /*const char **/ pchPropertyValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, long /*int64*/ nValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SetProperty0( IntPtr ISteamInventory, ulong handle, ulong nItemID, string /*const char **/ pchPropertyName, float /*float*/ flValue ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamInventory_SubmitUpdateProperties( IntPtr ISteamInventory, ulong handle, ref int pResultHandle ); - - // - // ISteamVideo - // - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetVideoURL( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_IsBroadcasting( IntPtr ISteamVideo, IntPtr /*int **/ pnNumViewers ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamVideo_GetOPFSettings( IntPtr ISteamVideo, uint unVideoAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamVideo_GetOPFStringForApp( IntPtr ISteamVideo, uint unVideoAppID, System.Text.StringBuilder /*char **/ pchBuffer, out int /*int32 **/ pnBufferSize ); - - // - // ISteamParentalSettings - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockEnabled( IntPtr ISteamParentalSettings ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsParentalLockLocked( IntPtr ISteamParentalSettings ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppBlocked( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsAppInBlockList( IntPtr ISteamParentalSettings, uint nAppID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureBlocked( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamParentalSettings_BIsFeatureInBlockList( IntPtr ISteamParentalSettings, ParentalFeature /*EParentalFeature*/ eFeature ); - - // - // ISteamGameServer - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_InitGameServer( IntPtr ISteamGameServer, uint /*uint32*/ unIP, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, uint /*uint32*/ unFlags, uint nGameAppId, string /*const char **/ pchVersionString ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetProduct( IntPtr ISteamGameServer, string /*const char **/ pszProduct ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameDescription( IntPtr ISteamGameServer, string /*const char **/ pszGameDescription ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetModDir( IntPtr ISteamGameServer, string /*const char **/ pszModDir ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetDedicatedServer( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bDedicated ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOn( IntPtr ISteamGameServer, string /*const char **/ pszToken ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOnAnonymous( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_LogOff( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BLoggedOn( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BSecure( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_GetSteamID( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_WasRestartRequested( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMaxPlayerCount( IntPtr ISteamGameServer, int /*int*/ cPlayersMax ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetBotPlayerCount( IntPtr ISteamGameServer, int /*int*/ cBotplayers ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetServerName( IntPtr ISteamGameServer, string /*const char **/ pszServerName ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetMapName( IntPtr ISteamGameServer, string /*const char **/ pszMapName ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetPasswordProtected( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bPasswordProtected ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorPort( IntPtr ISteamGameServer, ushort /*uint16*/ unSpectatorPort ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetSpectatorServerName( IntPtr ISteamGameServer, string /*const char **/ pszSpectatorServerName ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ClearAllKeyValues( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetKeyValue( IntPtr ISteamGameServer, string /*const char **/ pKey, string /*const char **/ pValue ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameTags( IntPtr ISteamGameServer, string /*const char **/ pchGameTags ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetGameData( IntPtr ISteamGameServer, string /*const char **/ pchGameData ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetRegion( IntPtr ISteamGameServer, string /*const char **/ pszRegion ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_SendUserConnectAndAuthenticate( IntPtr ISteamGameServer, uint /*uint32*/ unIPClient, IntPtr /*const void **/ pvAuthBlob, uint /*uint32*/ cubAuthBlobSize, out ulong pSteamIDUser ); - [DllImport( "steam_api64.dll" )] internal static extern CSteamID /*(class CSteamID)*/ SteamAPI_ISteamGameServer_CreateUnauthenticatedUserConnection( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SendUserDisconnect( IntPtr ISteamGameServer, ulong steamIDUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_BUpdateUserData( IntPtr ISteamGameServer, ulong steamIDUser, string /*const char **/ pchPlayerName, uint /*uint32*/ uScore ); - [DllImport( "steam_api64.dll" )] internal static extern HAuthTicket /*(HAuthTicket)*/ SteamAPI_ISteamGameServer_GetAuthSessionTicket( IntPtr ISteamGameServer, IntPtr /*void **/ pTicket, int /*int*/ cbMaxTicket, out uint /*uint32 **/ pcbTicket ); - [DllImport( "steam_api64.dll" )] internal static extern BeginAuthSessionResult /*EBeginAuthSessionResult*/ SteamAPI_ISteamGameServer_BeginAuthSession( IntPtr ISteamGameServer, IntPtr /*const void **/ pAuthTicket, int /*int*/ cbAuthTicket, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EndAuthSession( IntPtr ISteamGameServer, ulong steamID ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_CancelAuthTicket( IntPtr ISteamGameServer, uint hAuthTicket ); - [DllImport( "steam_api64.dll" )] internal static extern UserHasLicenseForAppResult /*EUserHasLicenseForAppResult*/ SteamAPI_ISteamGameServer_UserHasLicenseForApp( IntPtr ISteamGameServer, ulong steamID, uint appID ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_RequestUserGroupStatus( IntPtr ISteamGameServer, ulong steamIDUser, ulong steamIDGroup ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_GetGameplayStats( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_GetServerReputation( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern uint /*uint32*/ SteamAPI_ISteamGameServer_GetPublicIP( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServer_HandleIncomingPacket( IntPtr ISteamGameServer, IntPtr /*const void **/ pData, int /*int*/ cbData, uint /*uint32*/ srcIP, ushort /*uint16*/ srcPort ); - [DllImport( "steam_api64.dll" )] internal static extern int /*int*/ SteamAPI_ISteamGameServer_GetNextOutgoingPacket( IntPtr ISteamGameServer, IntPtr /*void **/ pOut, int /*int*/ cbMaxOut, out uint /*uint32 **/ pNetAdr, out ushort /*uint16 **/ pPort ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_EnableHeartbeats( IntPtr ISteamGameServer, [MarshalAs(UnmanagedType.U1)] bool /*bool*/ bActive ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_SetHeartbeatInterval( IntPtr ISteamGameServer, int /*int*/ iHeartbeatInterval ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_ISteamGameServer_ForceHeartbeat( IntPtr ISteamGameServer ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_AssociateWithClan( IntPtr ISteamGameServer, ulong steamIDClan ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServer_ComputeNewPlayerCompatibility( IntPtr ISteamGameServer, ulong steamIDNewPlayer ); - - // - // ISteamGameServerStats - // - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_RequestUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out int /*int32 **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, out float /*float **/ pData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_GetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, [MarshalAs(UnmanagedType.U1)] ref bool /*bool **/ pbAchieved ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, int /*int32*/ nData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserStat0( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ fData ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_UpdateUserAvgRateStat( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName, float /*float*/ flCountThisSession, double /*double*/ dSessionLength ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_SetUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_ISteamGameServerStats_ClearUserAchievement( IntPtr ISteamGameServerStats, ulong steamIDUser, string /*const char **/ pchName ); - [DllImport( "steam_api64.dll" )] internal static extern SteamAPICall_t /*(SteamAPICall_t)*/ SteamAPI_ISteamGameServerStats_StoreUserStats( IntPtr ISteamGameServerStats, ulong steamIDUser ); - - // - // SteamApi - // - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_Init(); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RunCallbacks(); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamGameServer_RunCallbacks(); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallback( IntPtr /*void **/ pCallback, int /*int*/ callback ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallback( IntPtr /*void **/ pCallback ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_RegisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_UnregisterCallResult( IntPtr /*void **/ pCallback, ulong callback ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamInternal_GameServer_Init( uint /*uint32*/ unIP, ushort /*uint16*/ usPort, ushort /*uint16*/ usGamePort, ushort /*uint16*/ usQueryPort, int /*int*/ eServerMode, string /*const char **/ pchVersionString ); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamAPI_Shutdown(); - [DllImport( "steam_api64.dll" )] internal static extern void /*void*/ SteamGameServer_Shutdown(); - [DllImport( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamAPI_GetHSteamUser(); - [DllImport( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamAPI_GetHSteamPipe(); - [DllImport( "steam_api64.dll" )] internal static extern HSteamUser /*(HSteamUser)*/ SteamGameServer_GetHSteamUser(); - [DllImport( "steam_api64.dll" )] internal static extern HSteamPipe /*(HSteamPipe)*/ SteamGameServer_GetHSteamPipe(); - [DllImport( "steam_api64.dll" )] internal static extern IntPtr /*void **/ SteamInternal_CreateInterface( string /*const char **/ version ); - [DllImport( "steam_api64.dll" )] internal static extern bool /*bool*/ SteamAPI_RestartAppIfNecessary( uint /*uint32*/ unOwnAppID ); - - } - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs deleted file mode 100644 index 1d9fc7b..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Platform.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace Facepunch.Steamworks -{ - public enum OperatingSystem - { - Unset, - Windows, - Linux, - Osx, - } - - public enum Architecture - { - Unset, - x86, - x64 - } -} - -namespace SteamNative -{ - internal static partial class Platform - { - private static Facepunch.Steamworks.OperatingSystem _os; - private static Facepunch.Steamworks.Architecture _arch; - - internal static Facepunch.Steamworks.OperatingSystem Os - { - get - { - // - // Work out our platform - // - if ( _os == Facepunch.Steamworks.OperatingSystem.Unset ) - { - _os = Facepunch.Steamworks.OperatingSystem.Windows; - -#if !NET_CORE - // - // These checks aren't so accurate on older versions of mono - // - if ( Environment.OSVersion.Platform == PlatformID.MacOSX ) _os = Facepunch.Steamworks.OperatingSystem.Osx; - if ( Environment.OSVersion.Platform == PlatformID.Unix ) _os = Facepunch.Steamworks.OperatingSystem.Linux; - - // - // Edging our bets - // - if ( Environment.OSVersion.VersionString.ToLower().Contains( "unix" ) ) _os = Facepunch.Steamworks.OperatingSystem.Linux; - if ( Environment.OSVersion.VersionString.ToLower().Contains( "osx" ) ) _os = Facepunch.Steamworks.OperatingSystem.Osx; -#endif - } - - return _os; - } - - set - { - _os = value; - } - } - - internal static Facepunch.Steamworks.Architecture Arch - { - get - { - // - // Work out whether we're 64bit or 32bit - // - if ( _arch == Facepunch.Steamworks.Architecture.Unset ) - { - if ( IntPtr.Size == 8 ) - _arch = Facepunch.Steamworks.Architecture.x64; - else if ( IntPtr.Size == 4 ) - _arch = Facepunch.Steamworks.Architecture.x86; - else - throw new System.Exception( "Unsupported Architecture!" ); - } - - return _arch; - } - - set - { - _arch = value; - } - } - - public static bool IsWindows { get { return Os == Facepunch.Steamworks.OperatingSystem.Windows; } } - public static bool IsWindows64 { get { return Arch == Facepunch.Steamworks.Architecture.x64 && IsWindows; } } - public static bool IsWindows32 { get { return Arch == Facepunch.Steamworks.Architecture.x86 && IsWindows; } } - public static bool IsLinux64 { get { return Arch == Facepunch.Steamworks.Architecture.x64 && Os == Facepunch.Steamworks.OperatingSystem.Linux; } } - public static bool IsLinux32 { get { return Arch == Facepunch.Steamworks.Architecture.x86 && Os == Facepunch.Steamworks.OperatingSystem.Linux; } } - public static bool IsOsx { get { return Os == Facepunch.Steamworks.OperatingSystem.Osx; } } - - - /// - /// We're only Pack = 8 on Windows - /// - public static bool PackSmall { get { return Os != Facepunch.Steamworks.OperatingSystem.Windows; } } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamApi.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamApi.cs deleted file mode 100644 index 698de98..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamApi.cs +++ /dev/null @@ -1,141 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamApi : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamApi() - { - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( ((IntPtr)1) ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( ((IntPtr)1) ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( ((IntPtr)1) ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( ((IntPtr)1) ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( ((IntPtr)1) ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // HSteamPipe - public HSteamPipe SteamAPI_GetHSteamPipe() - { - return platform.SteamApi_SteamAPI_GetHSteamPipe(); - } - - // HSteamUser - public HSteamUser SteamAPI_GetHSteamUser() - { - return platform.SteamApi_SteamAPI_GetHSteamUser(); - } - - // bool - public bool SteamAPI_Init() - { - return platform.SteamApi_SteamAPI_Init(); - } - - // void - public void SteamAPI_RegisterCallback( IntPtr pCallback /*void **/, int callback /*int*/ ) - { - platform.SteamApi_SteamAPI_RegisterCallback( (IntPtr) pCallback, callback ); - } - - // void - public void SteamAPI_RegisterCallResult( IntPtr pCallback /*void **/, SteamAPICall_t callback /*SteamAPICall_t*/ ) - { - platform.SteamApi_SteamAPI_RegisterCallResult( (IntPtr) pCallback, callback.Value ); - } - - // bool - public bool SteamAPI_RestartAppIfNecessary( uint unOwnAppID /*uint32*/ ) - { - return platform.SteamApi_SteamAPI_RestartAppIfNecessary( unOwnAppID ); - } - - // void - public void SteamAPI_RunCallbacks() - { - platform.SteamApi_SteamAPI_RunCallbacks(); - } - - // void - public void SteamAPI_Shutdown() - { - platform.SteamApi_SteamAPI_Shutdown(); - } - - // void - public void SteamAPI_UnregisterCallback( IntPtr pCallback /*void **/ ) - { - platform.SteamApi_SteamAPI_UnregisterCallback( (IntPtr) pCallback ); - } - - // void - public void SteamAPI_UnregisterCallResult( IntPtr pCallback /*void **/, SteamAPICall_t callback /*SteamAPICall_t*/ ) - { - platform.SteamApi_SteamAPI_UnregisterCallResult( (IntPtr) pCallback, callback.Value ); - } - - // HSteamPipe - public HSteamPipe SteamGameServer_GetHSteamPipe() - { - return platform.SteamApi_SteamGameServer_GetHSteamPipe(); - } - - // HSteamUser - public HSteamUser SteamGameServer_GetHSteamUser() - { - return platform.SteamApi_SteamGameServer_GetHSteamUser(); - } - - // void - public void SteamGameServer_RunCallbacks() - { - platform.SteamApi_SteamGameServer_RunCallbacks(); - } - - // void - public void SteamGameServer_Shutdown() - { - platform.SteamApi_SteamGameServer_Shutdown(); - } - - // IntPtr - public IntPtr SteamInternal_CreateInterface( string version /*const char **/ ) - { - return platform.SteamApi_SteamInternal_CreateInterface( version ); - } - - // bool - public bool SteamInternal_GameServer_Init( uint unIP /*uint32*/, ushort usPort /*uint16*/, ushort usGamePort /*uint16*/, ushort usQueryPort /*uint16*/, int eServerMode /*int*/, string pchVersionString /*const char **/ ) - { - return platform.SteamApi_SteamInternal_GameServer_Init( unIP, usPort, usGamePort, usQueryPort, eServerMode, pchVersionString ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamAppList.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamAppList.cs deleted file mode 100644 index a5ea0c6..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamAppList.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamAppList : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamAppList( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // int - public int GetAppBuildId( AppId_t nAppID /*AppId_t*/ ) - { - return platform.ISteamAppList_GetAppBuildId( nAppID.Value ); - } - - // int - // with: Detect_StringFetch True - public string GetAppInstallDir( AppId_t nAppID /*AppId_t*/ ) - { - int bSuccess = default( int ); - System.Text.StringBuilder pchDirectory_sb = Helpers.TakeStringBuilder(); - int cchNameMax = 4096; - bSuccess = platform.ISteamAppList_GetAppInstallDir( nAppID.Value, pchDirectory_sb, cchNameMax ); - if ( bSuccess <= 0 ) return null; - return pchDirectory_sb.ToString(); - } - - // int - // with: Detect_StringFetch True - public string GetAppName( AppId_t nAppID /*AppId_t*/ ) - { - int bSuccess = default( int ); - System.Text.StringBuilder pchName_sb = Helpers.TakeStringBuilder(); - int cchNameMax = 4096; - bSuccess = platform.ISteamAppList_GetAppName( nAppID.Value, pchName_sb, cchNameMax ); - if ( bSuccess <= 0 ) return null; - return pchName_sb.ToString(); - } - - // with: Detect_VectorReturn - // uint - public uint GetInstalledApps( AppId_t[] pvecAppID /*AppId_t **/ ) - { - var unMaxAppIDs = (uint) pvecAppID.Length; - fixed ( AppId_t* pvecAppID_ptr = pvecAppID ) - { - return platform.ISteamAppList_GetInstalledApps( (IntPtr) pvecAppID_ptr, unMaxAppIDs ); - } - } - - // uint - public uint GetNumInstalledApps() - { - return platform.ISteamAppList_GetNumInstalledApps(); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamApps.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamApps.cs deleted file mode 100644 index 2f28d3c..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamApps.cs +++ /dev/null @@ -1,238 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamApps : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamApps( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - // with: Detect_StringFetch False - public bool BGetDLCDataByIndex( int iDLC /*int*/, ref AppId_t pAppID /*AppId_t **/, ref bool pbAvailable /*bool **/, out string pchName /*char **/ ) - { - bool bSuccess = default( bool ); - pchName = string.Empty; - System.Text.StringBuilder pchName_sb = Helpers.TakeStringBuilder(); - int cchNameBufferSize = 4096; - bSuccess = platform.ISteamApps_BGetDLCDataByIndex( iDLC, ref pAppID.Value, ref pbAvailable, pchName_sb, cchNameBufferSize ); - if ( !bSuccess ) return bSuccess; - pchName = pchName_sb.ToString(); - return bSuccess; - } - - // bool - public bool BIsAppInstalled( AppId_t appID /*AppId_t*/ ) - { - return platform.ISteamApps_BIsAppInstalled( appID.Value ); - } - - // bool - public bool BIsCybercafe() - { - return platform.ISteamApps_BIsCybercafe(); - } - - // bool - public bool BIsDlcInstalled( AppId_t appID /*AppId_t*/ ) - { - return platform.ISteamApps_BIsDlcInstalled( appID.Value ); - } - - // bool - public bool BIsLowViolence() - { - return platform.ISteamApps_BIsLowViolence(); - } - - // bool - public bool BIsSubscribed() - { - return platform.ISteamApps_BIsSubscribed(); - } - - // bool - public bool BIsSubscribedApp( AppId_t appID /*AppId_t*/ ) - { - return platform.ISteamApps_BIsSubscribedApp( appID.Value ); - } - - // bool - public bool BIsSubscribedFromFreeWeekend() - { - return platform.ISteamApps_BIsSubscribedFromFreeWeekend(); - } - - // bool - public bool BIsVACBanned() - { - return platform.ISteamApps_BIsVACBanned(); - } - - // int - public int GetAppBuildId() - { - return platform.ISteamApps_GetAppBuildId(); - } - - // uint - // with: Detect_StringFetch True - public string GetAppInstallDir( AppId_t appID /*AppId_t*/ ) - { - uint bSuccess = default( uint ); - System.Text.StringBuilder pchFolder_sb = Helpers.TakeStringBuilder(); - uint cchFolderBufferSize = 4096; - bSuccess = platform.ISteamApps_GetAppInstallDir( appID.Value, pchFolder_sb, cchFolderBufferSize ); - if ( bSuccess <= 0 ) return null; - return pchFolder_sb.ToString(); - } - - // ulong - public ulong GetAppOwner() - { - return platform.ISteamApps_GetAppOwner(); - } - - // string - // with: Detect_StringReturn - public string GetAvailableGameLanguages() - { - IntPtr string_pointer; - string_pointer = platform.ISteamApps_GetAvailableGameLanguages(); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // bool - // with: Detect_StringFetch True - public string GetCurrentBetaName() - { - bool bSuccess = default( bool ); - System.Text.StringBuilder pchName_sb = Helpers.TakeStringBuilder(); - int cchNameBufferSize = 4096; - bSuccess = platform.ISteamApps_GetCurrentBetaName( pchName_sb, cchNameBufferSize ); - if ( !bSuccess ) return null; - return pchName_sb.ToString(); - } - - // string - // with: Detect_StringReturn - public string GetCurrentGameLanguage() - { - IntPtr string_pointer; - string_pointer = platform.ISteamApps_GetCurrentGameLanguage(); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetDLCCount() - { - return platform.ISteamApps_GetDLCCount(); - } - - // bool - public bool GetDlcDownloadProgress( AppId_t nAppID /*AppId_t*/, out ulong punBytesDownloaded /*uint64 **/, out ulong punBytesTotal /*uint64 **/ ) - { - return platform.ISteamApps_GetDlcDownloadProgress( nAppID.Value, out punBytesDownloaded, out punBytesTotal ); - } - - // uint - public uint GetEarliestPurchaseUnixTime( AppId_t nAppID /*AppId_t*/ ) - { - return platform.ISteamApps_GetEarliestPurchaseUnixTime( nAppID.Value ); - } - - // SteamAPICall_t - public CallbackHandle GetFileDetails( string pszFileName /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamApps_GetFileDetails( pszFileName ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return FileDetailsResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // uint - public uint GetInstalledDepots( AppId_t appID /*AppId_t*/, IntPtr pvecDepots /*DepotId_t **/, uint cMaxDepots /*uint32*/ ) - { - return platform.ISteamApps_GetInstalledDepots( appID.Value, (IntPtr) pvecDepots, cMaxDepots ); - } - - // string - // with: Detect_StringReturn - public string GetLaunchQueryParam( string pchKey /*const char **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamApps_GetLaunchQueryParam( pchKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // void - public void InstallDLC( AppId_t nAppID /*AppId_t*/ ) - { - platform.ISteamApps_InstallDLC( nAppID.Value ); - } - - // bool - public bool MarkContentCorrupt( bool bMissingFilesOnly /*bool*/ ) - { - return platform.ISteamApps_MarkContentCorrupt( bMissingFilesOnly ); - } - - // void - public void RequestAllProofOfPurchaseKeys() - { - platform.ISteamApps_RequestAllProofOfPurchaseKeys(); - } - - // void - public void RequestAppProofOfPurchaseKey( AppId_t nAppID /*AppId_t*/ ) - { - platform.ISteamApps_RequestAppProofOfPurchaseKey( nAppID.Value ); - } - - // void - public void UninstallDLC( AppId_t nAppID /*AppId_t*/ ) - { - platform.ISteamApps_UninstallDLC( nAppID.Value ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamClient.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamClient.cs deleted file mode 100644 index b8f9234..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamClient.cs +++ /dev/null @@ -1,283 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamClient : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamClient( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool BReleaseSteamPipe( HSteamPipe hSteamPipe /*HSteamPipe*/ ) - { - return platform.ISteamClient_BReleaseSteamPipe( hSteamPipe.Value ); - } - - // bool - public bool BShutdownIfAllPipesClosed() - { - return platform.ISteamClient_BShutdownIfAllPipesClosed(); - } - - // HSteamUser - public HSteamUser ConnectToGlobalUser( HSteamPipe hSteamPipe /*HSteamPipe*/ ) - { - return platform.ISteamClient_ConnectToGlobalUser( hSteamPipe.Value ); - } - - // HSteamUser - public HSteamUser CreateLocalUser( out HSteamPipe phSteamPipe /*HSteamPipe **/, AccountType eAccountType /*EAccountType*/ ) - { - return platform.ISteamClient_CreateLocalUser( out phSteamPipe.Value, eAccountType ); - } - - // HSteamPipe - public HSteamPipe CreateSteamPipe() - { - return platform.ISteamClient_CreateSteamPipe(); - } - - // uint - public uint GetIPCCallCount() - { - return platform.ISteamClient_GetIPCCallCount(); - } - - // ISteamAppList * - public SteamAppList GetISteamAppList( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamAppList( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamAppList( steamworks, interface_pointer ); - } - - // ISteamApps * - public SteamApps GetISteamApps( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamApps( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamApps( steamworks, interface_pointer ); - } - - // ISteamController * - public SteamController GetISteamController( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamController( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamController( steamworks, interface_pointer ); - } - - // ISteamFriends * - public SteamFriends GetISteamFriends( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamFriends( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamFriends( steamworks, interface_pointer ); - } - - // ISteamGameServer * - public SteamGameServer GetISteamGameServer( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamGameServer( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamGameServer( steamworks, interface_pointer ); - } - - // ISteamGameServerStats * - public SteamGameServerStats GetISteamGameServerStats( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamGameServerStats( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamGameServerStats( steamworks, interface_pointer ); - } - - // IntPtr - public IntPtr GetISteamGenericInterface( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - return platform.ISteamClient_GetISteamGenericInterface( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - } - - // ISteamHTMLSurface * - public SteamHTMLSurface GetISteamHTMLSurface( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamHTMLSurface( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamHTMLSurface( steamworks, interface_pointer ); - } - - // ISteamHTTP * - public SteamHTTP GetISteamHTTP( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamHTTP( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamHTTP( steamworks, interface_pointer ); - } - - // ISteamInventory * - public SteamInventory GetISteamInventory( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamInventory( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamInventory( steamworks, interface_pointer ); - } - - // ISteamMatchmaking * - public SteamMatchmaking GetISteamMatchmaking( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamMatchmaking( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamMatchmaking( steamworks, interface_pointer ); - } - - // ISteamMatchmakingServers * - public SteamMatchmakingServers GetISteamMatchmakingServers( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamMatchmakingServers( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamMatchmakingServers( steamworks, interface_pointer ); - } - - // ISteamMusic * - public SteamMusic GetISteamMusic( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamMusic( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamMusic( steamworks, interface_pointer ); - } - - // ISteamMusicRemote * - public SteamMusicRemote GetISteamMusicRemote( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamMusicRemote( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamMusicRemote( steamworks, interface_pointer ); - } - - // ISteamNetworking * - public SteamNetworking GetISteamNetworking( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamNetworking( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamNetworking( steamworks, interface_pointer ); - } - - // ISteamParentalSettings * - public SteamParentalSettings GetISteamParentalSettings( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamParentalSettings( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamParentalSettings( steamworks, interface_pointer ); - } - - // ISteamRemoteStorage * - public SteamRemoteStorage GetISteamRemoteStorage( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamRemoteStorage( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamRemoteStorage( steamworks, interface_pointer ); - } - - // ISteamScreenshots * - public SteamScreenshots GetISteamScreenshots( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamScreenshots( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamScreenshots( steamworks, interface_pointer ); - } - - // ISteamUGC * - public SteamUGC GetISteamUGC( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamUGC( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamUGC( steamworks, interface_pointer ); - } - - // ISteamUser * - public SteamUser GetISteamUser( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamUser( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamUser( steamworks, interface_pointer ); - } - - // ISteamUserStats * - public SteamUserStats GetISteamUserStats( HSteamUser hSteamUser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamUserStats( hSteamUser.Value, hSteamPipe.Value, pchVersion ); - return new SteamUserStats( steamworks, interface_pointer ); - } - - // ISteamUtils * - public SteamUtils GetISteamUtils( HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamUtils( hSteamPipe.Value, pchVersion ); - return new SteamUtils( steamworks, interface_pointer ); - } - - // ISteamVideo * - public SteamVideo GetISteamVideo( HSteamUser hSteamuser /*HSteamUser*/, HSteamPipe hSteamPipe /*HSteamPipe*/, string pchVersion /*const char **/ ) - { - IntPtr interface_pointer; - interface_pointer = platform.ISteamClient_GetISteamVideo( hSteamuser.Value, hSteamPipe.Value, pchVersion ); - return new SteamVideo( steamworks, interface_pointer ); - } - - // void - public void ReleaseUser( HSteamPipe hSteamPipe /*HSteamPipe*/, HSteamUser hUser /*HSteamUser*/ ) - { - platform.ISteamClient_ReleaseUser( hSteamPipe.Value, hUser.Value ); - } - - // void - public void SetLocalIPBinding( uint unIP /*uint32*/, ushort usPort /*uint16*/ ) - { - platform.ISteamClient_SetLocalIPBinding( unIP, usPort ); - } - - // void - public void SetWarningMessageHook( IntPtr pFunction /*SteamAPIWarningMessageHook_t*/ ) - { - platform.ISteamClient_SetWarningMessageHook( (IntPtr) pFunction ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamController.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamController.cs deleted file mode 100644 index 44e083b..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamController.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamController : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamController( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void ActivateActionSet( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerActionSetHandle_t actionSetHandle /*ControllerActionSetHandle_t*/ ) - { - platform.ISteamController_ActivateActionSet( controllerHandle.Value, actionSetHandle.Value ); - } - - // void - public void ActivateActionSetLayer( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerActionSetHandle_t actionSetLayerHandle /*ControllerActionSetHandle_t*/ ) - { - platform.ISteamController_ActivateActionSetLayer( controllerHandle.Value, actionSetLayerHandle.Value ); - } - - // void - public void DeactivateActionSetLayer( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerActionSetHandle_t actionSetLayerHandle /*ControllerActionSetHandle_t*/ ) - { - platform.ISteamController_DeactivateActionSetLayer( controllerHandle.Value, actionSetLayerHandle.Value ); - } - - // void - public void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle /*ControllerHandle_t*/ ) - { - platform.ISteamController_DeactivateAllActionSetLayers( controllerHandle.Value ); - } - - // ControllerActionSetHandle_t - public ControllerActionSetHandle_t GetActionSetHandle( string pszActionSetName /*const char **/ ) - { - return platform.ISteamController_GetActionSetHandle( pszActionSetName ); - } - - // int - public int GetActiveActionSetLayers( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, IntPtr handlesOut /*ControllerActionSetHandle_t **/ ) - { - return platform.ISteamController_GetActiveActionSetLayers( controllerHandle.Value, (IntPtr) handlesOut ); - } - - // ControllerAnalogActionData_t - public ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerAnalogActionHandle_t analogActionHandle /*ControllerAnalogActionHandle_t*/ ) - { - return platform.ISteamController_GetAnalogActionData( controllerHandle.Value, analogActionHandle.Value ); - } - - // ControllerAnalogActionHandle_t - public ControllerAnalogActionHandle_t GetAnalogActionHandle( string pszActionName /*const char **/ ) - { - return platform.ISteamController_GetAnalogActionHandle( pszActionName ); - } - - // int - public int GetAnalogActionOrigins( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerActionSetHandle_t actionSetHandle /*ControllerActionSetHandle_t*/, ControllerAnalogActionHandle_t analogActionHandle /*ControllerAnalogActionHandle_t*/, out ControllerActionOrigin originsOut /*EControllerActionOrigin **/ ) - { - return platform.ISteamController_GetAnalogActionOrigins( controllerHandle.Value, actionSetHandle.Value, analogActionHandle.Value, out originsOut ); - } - - // int - public int GetConnectedControllers( IntPtr handlesOut /*ControllerHandle_t **/ ) - { - return platform.ISteamController_GetConnectedControllers( (IntPtr) handlesOut ); - } - - // ControllerHandle_t - public ControllerHandle_t GetControllerForGamepadIndex( int nIndex /*int*/ ) - { - return platform.ISteamController_GetControllerForGamepadIndex( nIndex ); - } - - // ControllerActionSetHandle_t - public ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle /*ControllerHandle_t*/ ) - { - return platform.ISteamController_GetCurrentActionSet( controllerHandle.Value ); - } - - // ControllerDigitalActionData_t - public ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerDigitalActionHandle_t digitalActionHandle /*ControllerDigitalActionHandle_t*/ ) - { - return platform.ISteamController_GetDigitalActionData( controllerHandle.Value, digitalActionHandle.Value ); - } - - // ControllerDigitalActionHandle_t - public ControllerDigitalActionHandle_t GetDigitalActionHandle( string pszActionName /*const char **/ ) - { - return platform.ISteamController_GetDigitalActionHandle( pszActionName ); - } - - // int - public int GetDigitalActionOrigins( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerActionSetHandle_t actionSetHandle /*ControllerActionSetHandle_t*/, ControllerDigitalActionHandle_t digitalActionHandle /*ControllerDigitalActionHandle_t*/, out ControllerActionOrigin originsOut /*EControllerActionOrigin **/ ) - { - return platform.ISteamController_GetDigitalActionOrigins( controllerHandle.Value, actionSetHandle.Value, digitalActionHandle.Value, out originsOut ); - } - - // int - public int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle /*ControllerHandle_t*/ ) - { - return platform.ISteamController_GetGamepadIndexForController( ulControllerHandle.Value ); - } - - // string - // with: Detect_StringReturn - public string GetGlyphForActionOrigin( ControllerActionOrigin eOrigin /*EControllerActionOrigin*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamController_GetGlyphForActionOrigin( eOrigin ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // SteamInputType - public SteamInputType GetInputTypeForHandle( ControllerHandle_t controllerHandle /*ControllerHandle_t*/ ) - { - return platform.ISteamController_GetInputTypeForHandle( controllerHandle.Value ); - } - - // ControllerMotionData_t - public ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle /*ControllerHandle_t*/ ) - { - return platform.ISteamController_GetMotionData( controllerHandle.Value ); - } - - // string - // with: Detect_StringReturn - public string GetStringForActionOrigin( ControllerActionOrigin eOrigin /*EControllerActionOrigin*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamController_GetStringForActionOrigin( eOrigin ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // bool - public bool Init() - { - return platform.ISteamController_Init(); - } - - // void - public void RunFrame() - { - platform.ISteamController_RunFrame(); - } - - // void - public void SetLEDColor( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, byte nColorR /*uint8*/, byte nColorG /*uint8*/, byte nColorB /*uint8*/, uint nFlags /*unsigned int*/ ) - { - platform.ISteamController_SetLEDColor( controllerHandle.Value, nColorR, nColorG, nColorB, nFlags ); - } - - // bool - public bool ShowAnalogActionOrigins( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerAnalogActionHandle_t analogActionHandle /*ControllerAnalogActionHandle_t*/, float flScale /*float*/, float flXPosition /*float*/, float flYPosition /*float*/ ) - { - return platform.ISteamController_ShowAnalogActionOrigins( controllerHandle.Value, analogActionHandle.Value, flScale, flXPosition, flYPosition ); - } - - // bool - public bool ShowBindingPanel( ControllerHandle_t controllerHandle /*ControllerHandle_t*/ ) - { - return platform.ISteamController_ShowBindingPanel( controllerHandle.Value ); - } - - // bool - public bool ShowDigitalActionOrigins( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerDigitalActionHandle_t digitalActionHandle /*ControllerDigitalActionHandle_t*/, float flScale /*float*/, float flXPosition /*float*/, float flYPosition /*float*/ ) - { - return platform.ISteamController_ShowDigitalActionOrigins( controllerHandle.Value, digitalActionHandle.Value, flScale, flXPosition, flYPosition ); - } - - // bool - public bool Shutdown() - { - return platform.ISteamController_Shutdown(); - } - - // void - public void StopAnalogActionMomentum( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ControllerAnalogActionHandle_t eAction /*ControllerAnalogActionHandle_t*/ ) - { - platform.ISteamController_StopAnalogActionMomentum( controllerHandle.Value, eAction.Value ); - } - - // void - public void TriggerHapticPulse( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, SteamControllerPad eTargetPad /*ESteamControllerPad*/, ushort usDurationMicroSec /*unsigned short*/ ) - { - platform.ISteamController_TriggerHapticPulse( controllerHandle.Value, eTargetPad, usDurationMicroSec ); - } - - // void - public void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, SteamControllerPad eTargetPad /*ESteamControllerPad*/, ushort usDurationMicroSec /*unsigned short*/, ushort usOffMicroSec /*unsigned short*/, ushort unRepeat /*unsigned short*/, uint nFlags /*unsigned int*/ ) - { - platform.ISteamController_TriggerRepeatedHapticPulse( controllerHandle.Value, eTargetPad, usDurationMicroSec, usOffMicroSec, unRepeat, nFlags ); - } - - // void - public void TriggerVibration( ControllerHandle_t controllerHandle /*ControllerHandle_t*/, ushort usLeftSpeed /*unsigned short*/, ushort usRightSpeed /*unsigned short*/ ) - { - platform.ISteamController_TriggerVibration( controllerHandle.Value, usLeftSpeed, usRightSpeed ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamFriends.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamFriends.cs deleted file mode 100644 index 6734548..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamFriends.cs +++ /dev/null @@ -1,542 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamFriends : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamFriends( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void ActivateGameOverlay( string pchDialog /*const char **/ ) - { - platform.ISteamFriends_ActivateGameOverlay( pchDialog ); - } - - // void - public void ActivateGameOverlayInviteDialog( CSteamID steamIDLobby /*class CSteamID*/ ) - { - platform.ISteamFriends_ActivateGameOverlayInviteDialog( steamIDLobby.Value ); - } - - // void - public void ActivateGameOverlayToStore( AppId_t nAppID /*AppId_t*/, OverlayToStoreFlag eFlag /*EOverlayToStoreFlag*/ ) - { - platform.ISteamFriends_ActivateGameOverlayToStore( nAppID.Value, eFlag ); - } - - // void - public void ActivateGameOverlayToUser( string pchDialog /*const char **/, CSteamID steamID /*class CSteamID*/ ) - { - platform.ISteamFriends_ActivateGameOverlayToUser( pchDialog, steamID.Value ); - } - - // void - public void ActivateGameOverlayToWebPage( string pchURL /*const char **/ ) - { - platform.ISteamFriends_ActivateGameOverlayToWebPage( pchURL ); - } - - // void - public void ClearRichPresence() - { - platform.ISteamFriends_ClearRichPresence(); - } - - // bool - public bool CloseClanChatWindowInSteam( CSteamID steamIDClanChat /*class CSteamID*/ ) - { - return platform.ISteamFriends_CloseClanChatWindowInSteam( steamIDClanChat.Value ); - } - - // SteamAPICall_t - public SteamAPICall_t DownloadClanActivityCounts( IntPtr psteamIDClans /*class CSteamID **/, int cClansToRequest /*int*/ ) - { - return platform.ISteamFriends_DownloadClanActivityCounts( (IntPtr) psteamIDClans, cClansToRequest ); - } - - // SteamAPICall_t - public CallbackHandle EnumerateFollowingList( uint unStartIndex /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_EnumerateFollowingList( unStartIndex ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return FriendsEnumerateFollowingList_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // ulong - public ulong GetChatMemberByIndex( CSteamID steamIDClan /*class CSteamID*/, int iUser /*int*/ ) - { - return platform.ISteamFriends_GetChatMemberByIndex( steamIDClan.Value, iUser ); - } - - // bool - public bool GetClanActivityCounts( CSteamID steamIDClan /*class CSteamID*/, out int pnOnline /*int **/, out int pnInGame /*int **/, out int pnChatting /*int **/ ) - { - return platform.ISteamFriends_GetClanActivityCounts( steamIDClan.Value, out pnOnline, out pnInGame, out pnChatting ); - } - - // ulong - public ulong GetClanByIndex( int iClan /*int*/ ) - { - return platform.ISteamFriends_GetClanByIndex( iClan ); - } - - // int - public int GetClanChatMemberCount( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetClanChatMemberCount( steamIDClan.Value ); - } - - // int - public int GetClanChatMessage( CSteamID steamIDClanChat /*class CSteamID*/, int iMessage /*int*/, IntPtr prgchText /*void **/, int cchTextMax /*int*/, out ChatEntryType peChatEntryType /*EChatEntryType **/, out CSteamID psteamidChatter /*class CSteamID **/ ) - { - return platform.ISteamFriends_GetClanChatMessage( steamIDClanChat.Value, iMessage, (IntPtr) prgchText, cchTextMax, out peChatEntryType, out psteamidChatter.Value ); - } - - // int - public int GetClanCount() - { - return platform.ISteamFriends_GetClanCount(); - } - - // string - // with: Detect_StringReturn - public string GetClanName( CSteamID steamIDClan /*class CSteamID*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetClanName( steamIDClan.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // ulong - public ulong GetClanOfficerByIndex( CSteamID steamIDClan /*class CSteamID*/, int iOfficer /*int*/ ) - { - return platform.ISteamFriends_GetClanOfficerByIndex( steamIDClan.Value, iOfficer ); - } - - // int - public int GetClanOfficerCount( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetClanOfficerCount( steamIDClan.Value ); - } - - // ulong - public ulong GetClanOwner( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetClanOwner( steamIDClan.Value ); - } - - // string - // with: Detect_StringReturn - public string GetClanTag( CSteamID steamIDClan /*class CSteamID*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetClanTag( steamIDClan.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // ulong - public ulong GetCoplayFriend( int iCoplayFriend /*int*/ ) - { - return platform.ISteamFriends_GetCoplayFriend( iCoplayFriend ); - } - - // int - public int GetCoplayFriendCount() - { - return platform.ISteamFriends_GetCoplayFriendCount(); - } - - // SteamAPICall_t - public CallbackHandle GetFollowerCount( CSteamID steamID /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_GetFollowerCount( steamID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return FriendsGetFollowerCount_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // ulong - public ulong GetFriendByIndex( int iFriend /*int*/, int iFriendFlags /*int*/ ) - { - return platform.ISteamFriends_GetFriendByIndex( iFriend, iFriendFlags ); - } - - // AppId_t - public AppId_t GetFriendCoplayGame( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendCoplayGame( steamIDFriend.Value ); - } - - // int - public int GetFriendCoplayTime( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendCoplayTime( steamIDFriend.Value ); - } - - // int - public int GetFriendCount( int iFriendFlags /*int*/ ) - { - return platform.ISteamFriends_GetFriendCount( iFriendFlags ); - } - - // int - public int GetFriendCountFromSource( CSteamID steamIDSource /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendCountFromSource( steamIDSource.Value ); - } - - // ulong - public ulong GetFriendFromSourceByIndex( CSteamID steamIDSource /*class CSteamID*/, int iFriend /*int*/ ) - { - return platform.ISteamFriends_GetFriendFromSourceByIndex( steamIDSource.Value, iFriend ); - } - - // bool - public bool GetFriendGamePlayed( CSteamID steamIDFriend /*class CSteamID*/, ref FriendGameInfo_t pFriendGameInfo /*struct FriendGameInfo_t **/ ) - { - return platform.ISteamFriends_GetFriendGamePlayed( steamIDFriend.Value, ref pFriendGameInfo ); - } - - // int - public int GetFriendMessage( CSteamID steamIDFriend /*class CSteamID*/, int iMessageID /*int*/, IntPtr pvData /*void **/, int cubData /*int*/, out ChatEntryType peChatEntryType /*EChatEntryType **/ ) - { - return platform.ISteamFriends_GetFriendMessage( steamIDFriend.Value, iMessageID, (IntPtr) pvData, cubData, out peChatEntryType ); - } - - // string - // with: Detect_StringReturn - public string GetFriendPersonaName( CSteamID steamIDFriend /*class CSteamID*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetFriendPersonaName( steamIDFriend.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // string - // with: Detect_StringReturn - public string GetFriendPersonaNameHistory( CSteamID steamIDFriend /*class CSteamID*/, int iPersonaName /*int*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetFriendPersonaNameHistory( steamIDFriend.Value, iPersonaName ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // PersonaState - public PersonaState GetFriendPersonaState( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendPersonaState( steamIDFriend.Value ); - } - - // FriendRelationship - public FriendRelationship GetFriendRelationship( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendRelationship( steamIDFriend.Value ); - } - - // string - // with: Detect_StringReturn - public string GetFriendRichPresence( CSteamID steamIDFriend /*class CSteamID*/, string pchKey /*const char **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetFriendRichPresence( steamIDFriend.Value, pchKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // string - // with: Detect_StringReturn - public string GetFriendRichPresenceKeyByIndex( CSteamID steamIDFriend /*class CSteamID*/, int iKey /*int*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetFriendRichPresenceKeyByIndex( steamIDFriend.Value, iKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetFriendRichPresenceKeyCount( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendRichPresenceKeyCount( steamIDFriend.Value ); - } - - // int - public int GetFriendsGroupCount() - { - return platform.ISteamFriends_GetFriendsGroupCount(); - } - - // FriendsGroupID_t - public FriendsGroupID_t GetFriendsGroupIDByIndex( int iFG /*int*/ ) - { - return platform.ISteamFriends_GetFriendsGroupIDByIndex( iFG ); - } - - // int - public int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID /*FriendsGroupID_t*/ ) - { - return platform.ISteamFriends_GetFriendsGroupMembersCount( friendsGroupID.Value ); - } - - // void - public void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID /*FriendsGroupID_t*/, IntPtr pOutSteamIDMembers /*class CSteamID **/, int nMembersCount /*int*/ ) - { - platform.ISteamFriends_GetFriendsGroupMembersList( friendsGroupID.Value, (IntPtr) pOutSteamIDMembers, nMembersCount ); - } - - // string - // with: Detect_StringReturn - public string GetFriendsGroupName( FriendsGroupID_t friendsGroupID /*FriendsGroupID_t*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetFriendsGroupName( friendsGroupID.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetFriendSteamLevel( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetFriendSteamLevel( steamIDFriend.Value ); - } - - // int - public int GetLargeFriendAvatar( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetLargeFriendAvatar( steamIDFriend.Value ); - } - - // int - public int GetMediumFriendAvatar( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetMediumFriendAvatar( steamIDFriend.Value ); - } - - // string - // with: Detect_StringReturn - public string GetPersonaName() - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetPersonaName(); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // PersonaState - public PersonaState GetPersonaState() - { - return platform.ISteamFriends_GetPersonaState(); - } - - // string - // with: Detect_StringReturn - public string GetPlayerNickname( CSteamID steamIDPlayer /*class CSteamID*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamFriends_GetPlayerNickname( steamIDPlayer.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetSmallFriendAvatar( CSteamID steamIDFriend /*class CSteamID*/ ) - { - return platform.ISteamFriends_GetSmallFriendAvatar( steamIDFriend.Value ); - } - - // uint - public uint GetUserRestrictions() - { - return platform.ISteamFriends_GetUserRestrictions(); - } - - // bool - public bool HasFriend( CSteamID steamIDFriend /*class CSteamID*/, int iFriendFlags /*int*/ ) - { - return platform.ISteamFriends_HasFriend( steamIDFriend.Value, iFriendFlags ); - } - - // bool - public bool InviteUserToGame( CSteamID steamIDFriend /*class CSteamID*/, string pchConnectString /*const char **/ ) - { - return platform.ISteamFriends_InviteUserToGame( steamIDFriend.Value, pchConnectString ); - } - - // bool - public bool IsClanChatAdmin( CSteamID steamIDClanChat /*class CSteamID*/, CSteamID steamIDUser /*class CSteamID*/ ) - { - return platform.ISteamFriends_IsClanChatAdmin( steamIDClanChat.Value, steamIDUser.Value ); - } - - // bool - public bool IsClanChatWindowOpenInSteam( CSteamID steamIDClanChat /*class CSteamID*/ ) - { - return platform.ISteamFriends_IsClanChatWindowOpenInSteam( steamIDClanChat.Value ); - } - - // bool - public bool IsClanOfficialGameGroup( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_IsClanOfficialGameGroup( steamIDClan.Value ); - } - - // bool - public bool IsClanPublic( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_IsClanPublic( steamIDClan.Value ); - } - - // SteamAPICall_t - public CallbackHandle IsFollowing( CSteamID steamID /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_IsFollowing( steamID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return FriendsIsFollowing_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool IsUserInSource( CSteamID steamIDUser /*class CSteamID*/, CSteamID steamIDSource /*class CSteamID*/ ) - { - return platform.ISteamFriends_IsUserInSource( steamIDUser.Value, steamIDSource.Value ); - } - - // SteamAPICall_t - public CallbackHandle JoinClanChatRoom( CSteamID steamIDClan /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_JoinClanChatRoom( steamIDClan.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return JoinClanChatRoomCompletionResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool LeaveClanChatRoom( CSteamID steamIDClan /*class CSteamID*/ ) - { - return platform.ISteamFriends_LeaveClanChatRoom( steamIDClan.Value ); - } - - // bool - public bool OpenClanChatWindowInSteam( CSteamID steamIDClanChat /*class CSteamID*/ ) - { - return platform.ISteamFriends_OpenClanChatWindowInSteam( steamIDClanChat.Value ); - } - - // bool - public bool ReplyToFriendMessage( CSteamID steamIDFriend /*class CSteamID*/, string pchMsgToSend /*const char **/ ) - { - return platform.ISteamFriends_ReplyToFriendMessage( steamIDFriend.Value, pchMsgToSend ); - } - - // SteamAPICall_t - public CallbackHandle RequestClanOfficerList( CSteamID steamIDClan /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_RequestClanOfficerList( steamIDClan.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return ClanOfficerListResponse_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void RequestFriendRichPresence( CSteamID steamIDFriend /*class CSteamID*/ ) - { - platform.ISteamFriends_RequestFriendRichPresence( steamIDFriend.Value ); - } - - // bool - public bool RequestUserInformation( CSteamID steamIDUser /*class CSteamID*/, bool bRequireNameOnly /*bool*/ ) - { - return platform.ISteamFriends_RequestUserInformation( steamIDUser.Value, bRequireNameOnly ); - } - - // bool - public bool SendClanChatMessage( CSteamID steamIDClanChat /*class CSteamID*/, string pchText /*const char **/ ) - { - return platform.ISteamFriends_SendClanChatMessage( steamIDClanChat.Value, pchText ); - } - - // void - public void SetInGameVoiceSpeaking( CSteamID steamIDUser /*class CSteamID*/, bool bSpeaking /*bool*/ ) - { - platform.ISteamFriends_SetInGameVoiceSpeaking( steamIDUser.Value, bSpeaking ); - } - - // bool - public bool SetListenForFriendsMessages( bool bInterceptEnabled /*bool*/ ) - { - return platform.ISteamFriends_SetListenForFriendsMessages( bInterceptEnabled ); - } - - // SteamAPICall_t - public CallbackHandle SetPersonaName( string pchPersonaName /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamFriends_SetPersonaName( pchPersonaName ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SetPersonaNameResponse_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void SetPlayedWith( CSteamID steamIDUserPlayedWith /*class CSteamID*/ ) - { - platform.ISteamFriends_SetPlayedWith( steamIDUserPlayedWith.Value ); - } - - // bool - public bool SetRichPresence( string pchKey /*const char **/, string pchValue /*const char **/ ) - { - return platform.ISteamFriends_SetRichPresence( pchKey, pchValue ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServer.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServer.cs deleted file mode 100644 index bc8d46a..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServer.cs +++ /dev/null @@ -1,329 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamGameServer : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamGameServer( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // SteamAPICall_t - public CallbackHandle AssociateWithClan( CSteamID steamIDClan /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamGameServer_AssociateWithClan( steamIDClan.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return AssociateWithClanResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // BeginAuthSessionResult - public BeginAuthSessionResult BeginAuthSession( IntPtr pAuthTicket /*const void **/, int cbAuthTicket /*int*/, CSteamID steamID /*class CSteamID*/ ) - { - return platform.ISteamGameServer_BeginAuthSession( (IntPtr) pAuthTicket, cbAuthTicket, steamID.Value ); - } - - // bool - public bool BLoggedOn() - { - return platform.ISteamGameServer_BLoggedOn(); - } - - // bool - public bool BSecure() - { - return platform.ISteamGameServer_BSecure(); - } - - // bool - public bool BUpdateUserData( CSteamID steamIDUser /*class CSteamID*/, string pchPlayerName /*const char **/, uint uScore /*uint32*/ ) - { - return platform.ISteamGameServer_BUpdateUserData( steamIDUser.Value, pchPlayerName, uScore ); - } - - // void - public void CancelAuthTicket( HAuthTicket hAuthTicket /*HAuthTicket*/ ) - { - platform.ISteamGameServer_CancelAuthTicket( hAuthTicket.Value ); - } - - // void - public void ClearAllKeyValues() - { - platform.ISteamGameServer_ClearAllKeyValues(); - } - - // SteamAPICall_t - public CallbackHandle ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamGameServer_ComputeNewPlayerCompatibility( steamIDNewPlayer.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return ComputeNewPlayerCompatibilityResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // ulong - public ulong CreateUnauthenticatedUserConnection() - { - return platform.ISteamGameServer_CreateUnauthenticatedUserConnection(); - } - - // void - public void EnableHeartbeats( bool bActive /*bool*/ ) - { - platform.ISteamGameServer_EnableHeartbeats( bActive ); - } - - // void - public void EndAuthSession( CSteamID steamID /*class CSteamID*/ ) - { - platform.ISteamGameServer_EndAuthSession( steamID.Value ); - } - - // void - public void ForceHeartbeat() - { - platform.ISteamGameServer_ForceHeartbeat(); - } - - // HAuthTicket - public HAuthTicket GetAuthSessionTicket( IntPtr pTicket /*void **/, int cbMaxTicket /*int*/, out uint pcbTicket /*uint32 **/ ) - { - return platform.ISteamGameServer_GetAuthSessionTicket( (IntPtr) pTicket, cbMaxTicket, out pcbTicket ); - } - - // void - public void GetGameplayStats() - { - platform.ISteamGameServer_GetGameplayStats(); - } - - // int - public int GetNextOutgoingPacket( IntPtr pOut /*void **/, int cbMaxOut /*int*/, out uint pNetAdr /*uint32 **/, out ushort pPort /*uint16 **/ ) - { - return platform.ISteamGameServer_GetNextOutgoingPacket( (IntPtr) pOut, cbMaxOut, out pNetAdr, out pPort ); - } - - // uint - public uint GetPublicIP() - { - return platform.ISteamGameServer_GetPublicIP(); - } - - // SteamAPICall_t - public CallbackHandle GetServerReputation( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamGameServer_GetServerReputation(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GSReputation_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // ulong - public ulong GetSteamID() - { - return platform.ISteamGameServer_GetSteamID(); - } - - // bool - public bool HandleIncomingPacket( IntPtr pData /*const void **/, int cbData /*int*/, uint srcIP /*uint32*/, ushort srcPort /*uint16*/ ) - { - return platform.ISteamGameServer_HandleIncomingPacket( (IntPtr) pData, cbData, srcIP, srcPort ); - } - - // bool - public bool InitGameServer( uint unIP /*uint32*/, ushort usGamePort /*uint16*/, ushort usQueryPort /*uint16*/, uint unFlags /*uint32*/, AppId_t nGameAppId /*AppId_t*/, string pchVersionString /*const char **/ ) - { - return platform.ISteamGameServer_InitGameServer( unIP, usGamePort, usQueryPort, unFlags, nGameAppId.Value, pchVersionString ); - } - - // void - public void LogOff() - { - platform.ISteamGameServer_LogOff(); - } - - // void - public void LogOn( string pszToken /*const char **/ ) - { - platform.ISteamGameServer_LogOn( pszToken ); - } - - // void - public void LogOnAnonymous() - { - platform.ISteamGameServer_LogOnAnonymous(); - } - - // bool - public bool RequestUserGroupStatus( CSteamID steamIDUser /*class CSteamID*/, CSteamID steamIDGroup /*class CSteamID*/ ) - { - return platform.ISteamGameServer_RequestUserGroupStatus( steamIDUser.Value, steamIDGroup.Value ); - } - - // bool - public bool SendUserConnectAndAuthenticate( uint unIPClient /*uint32*/, IntPtr pvAuthBlob /*const void **/, uint cubAuthBlobSize /*uint32*/, out CSteamID pSteamIDUser /*class CSteamID **/ ) - { - return platform.ISteamGameServer_SendUserConnectAndAuthenticate( unIPClient, (IntPtr) pvAuthBlob, cubAuthBlobSize, out pSteamIDUser.Value ); - } - - // void - public void SendUserDisconnect( CSteamID steamIDUser /*class CSteamID*/ ) - { - platform.ISteamGameServer_SendUserDisconnect( steamIDUser.Value ); - } - - // void - public void SetBotPlayerCount( int cBotplayers /*int*/ ) - { - platform.ISteamGameServer_SetBotPlayerCount( cBotplayers ); - } - - // void - public void SetDedicatedServer( bool bDedicated /*bool*/ ) - { - platform.ISteamGameServer_SetDedicatedServer( bDedicated ); - } - - // void - public void SetGameData( string pchGameData /*const char **/ ) - { - platform.ISteamGameServer_SetGameData( pchGameData ); - } - - // void - public void SetGameDescription( string pszGameDescription /*const char **/ ) - { - platform.ISteamGameServer_SetGameDescription( pszGameDescription ); - } - - // void - public void SetGameTags( string pchGameTags /*const char **/ ) - { - platform.ISteamGameServer_SetGameTags( pchGameTags ); - } - - // void - public void SetHeartbeatInterval( int iHeartbeatInterval /*int*/ ) - { - platform.ISteamGameServer_SetHeartbeatInterval( iHeartbeatInterval ); - } - - // void - public void SetKeyValue( string pKey /*const char **/, string pValue /*const char **/ ) - { - platform.ISteamGameServer_SetKeyValue( pKey, pValue ); - } - - // void - public void SetMapName( string pszMapName /*const char **/ ) - { - platform.ISteamGameServer_SetMapName( pszMapName ); - } - - // void - public void SetMaxPlayerCount( int cPlayersMax /*int*/ ) - { - platform.ISteamGameServer_SetMaxPlayerCount( cPlayersMax ); - } - - // void - public void SetModDir( string pszModDir /*const char **/ ) - { - platform.ISteamGameServer_SetModDir( pszModDir ); - } - - // void - public void SetPasswordProtected( bool bPasswordProtected /*bool*/ ) - { - platform.ISteamGameServer_SetPasswordProtected( bPasswordProtected ); - } - - // void - public void SetProduct( string pszProduct /*const char **/ ) - { - platform.ISteamGameServer_SetProduct( pszProduct ); - } - - // void - public void SetRegion( string pszRegion /*const char **/ ) - { - platform.ISteamGameServer_SetRegion( pszRegion ); - } - - // void - public void SetServerName( string pszServerName /*const char **/ ) - { - platform.ISteamGameServer_SetServerName( pszServerName ); - } - - // void - public void SetSpectatorPort( ushort unSpectatorPort /*uint16*/ ) - { - platform.ISteamGameServer_SetSpectatorPort( unSpectatorPort ); - } - - // void - public void SetSpectatorServerName( string pszSpectatorServerName /*const char **/ ) - { - platform.ISteamGameServer_SetSpectatorServerName( pszSpectatorServerName ); - } - - // UserHasLicenseForAppResult - public UserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID /*class CSteamID*/, AppId_t appID /*AppId_t*/ ) - { - return platform.ISteamGameServer_UserHasLicenseForApp( steamID.Value, appID.Value ); - } - - // bool - public bool WasRestartRequested() - { - return platform.ISteamGameServer_WasRestartRequested(); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServerStats.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServerStats.cs deleted file mode 100644 index 706408c..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamGameServerStats.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamGameServerStats : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamGameServerStats( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool ClearUserAchievement( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/ ) - { - return platform.ISteamGameServerStats_ClearUserAchievement( steamIDUser.Value, pchName ); - } - - // bool - public bool GetUserAchievement( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, ref bool pbAchieved /*bool **/ ) - { - return platform.ISteamGameServerStats_GetUserAchievement( steamIDUser.Value, pchName, ref pbAchieved ); - } - - // bool - public bool GetUserStat( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, out int pData /*int32 **/ ) - { - return platform.ISteamGameServerStats_GetUserStat( steamIDUser.Value, pchName, out pData ); - } - - // bool - public bool GetUserStat0( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, out float pData /*float **/ ) - { - return platform.ISteamGameServerStats_GetUserStat0( steamIDUser.Value, pchName, out pData ); - } - - // SteamAPICall_t - public CallbackHandle RequestUserStats( CSteamID steamIDUser /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamGameServerStats_RequestUserStats( steamIDUser.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GSStatsReceived_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool SetUserAchievement( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/ ) - { - return platform.ISteamGameServerStats_SetUserAchievement( steamIDUser.Value, pchName ); - } - - // bool - public bool SetUserStat( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, int nData /*int32*/ ) - { - return platform.ISteamGameServerStats_SetUserStat( steamIDUser.Value, pchName, nData ); - } - - // bool - public bool SetUserStat0( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, float fData /*float*/ ) - { - return platform.ISteamGameServerStats_SetUserStat0( steamIDUser.Value, pchName, fData ); - } - - // SteamAPICall_t - public CallbackHandle StoreUserStats( CSteamID steamIDUser /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamGameServerStats_StoreUserStats( steamIDUser.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GSStatsStored_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool UpdateUserAvgRateStat( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, float flCountThisSession /*float*/, double dSessionLength /*double*/ ) - { - return platform.ISteamGameServerStats_UpdateUserAvgRateStat( steamIDUser.Value, pchName, flCountThisSession, dSessionLength ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTMLSurface.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTMLSurface.cs deleted file mode 100644 index 3f434bb..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTMLSurface.cs +++ /dev/null @@ -1,269 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamHTMLSurface : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamHTMLSurface( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void AddHeader( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, string pchKey /*const char **/, string pchValue /*const char **/ ) - { - platform.ISteamHTMLSurface_AddHeader( unBrowserHandle.Value, pchKey, pchValue ); - } - - // void - public void AllowStartRequest( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, bool bAllowed /*bool*/ ) - { - platform.ISteamHTMLSurface_AllowStartRequest( unBrowserHandle.Value, bAllowed ); - } - - // void - public void CopyToClipboard( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_CopyToClipboard( unBrowserHandle.Value ); - } - - // SteamAPICall_t - public CallbackHandle CreateBrowser( string pchUserAgent /*const char **/, string pchUserCSS /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamHTMLSurface_CreateBrowser( pchUserAgent, pchUserCSS ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return HTML_BrowserReady_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void DestructISteamHTMLSurface() - { - platform.ISteamHTMLSurface_DestructISteamHTMLSurface(); - } - - // void - public void ExecuteJavascript( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, string pchScript /*const char **/ ) - { - platform.ISteamHTMLSurface_ExecuteJavascript( unBrowserHandle.Value, pchScript ); - } - - // void - public void Find( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, string pchSearchStr /*const char **/, bool bCurrentlyInFind /*bool*/, bool bReverse /*bool*/ ) - { - platform.ISteamHTMLSurface_Find( unBrowserHandle.Value, pchSearchStr, bCurrentlyInFind, bReverse ); - } - - // void - public void GetLinkAtPosition( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, int x /*int*/, int y /*int*/ ) - { - platform.ISteamHTMLSurface_GetLinkAtPosition( unBrowserHandle.Value, x, y ); - } - - // void - public void GoBack( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_GoBack( unBrowserHandle.Value ); - } - - // void - public void GoForward( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_GoForward( unBrowserHandle.Value ); - } - - // bool - public bool Init() - { - return platform.ISteamHTMLSurface_Init(); - } - - // void - public void JSDialogResponse( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, bool bResult /*bool*/ ) - { - platform.ISteamHTMLSurface_JSDialogResponse( unBrowserHandle.Value, bResult ); - } - - // void - public void KeyChar( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint cUnicodeChar /*uint32*/, HTMLKeyModifiers eHTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ ) - { - platform.ISteamHTMLSurface_KeyChar( unBrowserHandle.Value, cUnicodeChar, eHTMLKeyModifiers ); - } - - // void - public void KeyDown( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint nNativeKeyCode /*uint32*/, HTMLKeyModifiers eHTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ ) - { - platform.ISteamHTMLSurface_KeyDown( unBrowserHandle.Value, nNativeKeyCode, eHTMLKeyModifiers ); - } - - // void - public void KeyUp( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint nNativeKeyCode /*uint32*/, HTMLKeyModifiers eHTMLKeyModifiers /*ISteamHTMLSurface::EHTMLKeyModifiers*/ ) - { - platform.ISteamHTMLSurface_KeyUp( unBrowserHandle.Value, nNativeKeyCode, eHTMLKeyModifiers ); - } - - // void - public void LoadURL( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, string pchURL /*const char **/, string pchPostData /*const char **/ ) - { - platform.ISteamHTMLSurface_LoadURL( unBrowserHandle.Value, pchURL, pchPostData ); - } - - // void - public void MouseDoubleClick( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, HTMLMouseButton eMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ ) - { - platform.ISteamHTMLSurface_MouseDoubleClick( unBrowserHandle.Value, eMouseButton ); - } - - // void - public void MouseDown( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, HTMLMouseButton eMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ ) - { - platform.ISteamHTMLSurface_MouseDown( unBrowserHandle.Value, eMouseButton ); - } - - // void - public void MouseMove( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, int x /*int*/, int y /*int*/ ) - { - platform.ISteamHTMLSurface_MouseMove( unBrowserHandle.Value, x, y ); - } - - // void - public void MouseUp( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, HTMLMouseButton eMouseButton /*ISteamHTMLSurface::EHTMLMouseButton*/ ) - { - platform.ISteamHTMLSurface_MouseUp( unBrowserHandle.Value, eMouseButton ); - } - - // void - public void MouseWheel( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, int nDelta /*int32*/ ) - { - platform.ISteamHTMLSurface_MouseWheel( unBrowserHandle.Value, nDelta ); - } - - // void - public void PasteFromClipboard( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_PasteFromClipboard( unBrowserHandle.Value ); - } - - // void - public void Reload( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_Reload( unBrowserHandle.Value ); - } - - // void - public void RemoveBrowser( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_RemoveBrowser( unBrowserHandle.Value ); - } - - // void - public void SetBackgroundMode( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, bool bBackgroundMode /*bool*/ ) - { - platform.ISteamHTMLSurface_SetBackgroundMode( unBrowserHandle.Value, bBackgroundMode ); - } - - // void - public void SetCookie( string pchHostname /*const char **/, string pchKey /*const char **/, string pchValue /*const char **/, string pchPath /*const char **/, RTime32 nExpires /*RTime32*/, bool bSecure /*bool*/, bool bHTTPOnly /*bool*/ ) - { - platform.ISteamHTMLSurface_SetCookie( pchHostname, pchKey, pchValue, pchPath, nExpires.Value, bSecure, bHTTPOnly ); - } - - // void - public void SetDPIScalingFactor( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, float flDPIScaling /*float*/ ) - { - platform.ISteamHTMLSurface_SetDPIScalingFactor( unBrowserHandle.Value, flDPIScaling ); - } - - // void - public void SetHorizontalScroll( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint nAbsolutePixelScroll /*uint32*/ ) - { - platform.ISteamHTMLSurface_SetHorizontalScroll( unBrowserHandle.Value, nAbsolutePixelScroll ); - } - - // void - public void SetKeyFocus( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, bool bHasKeyFocus /*bool*/ ) - { - platform.ISteamHTMLSurface_SetKeyFocus( unBrowserHandle.Value, bHasKeyFocus ); - } - - // void - public void SetPageScaleFactor( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, float flZoom /*float*/, int nPointX /*int*/, int nPointY /*int*/ ) - { - platform.ISteamHTMLSurface_SetPageScaleFactor( unBrowserHandle.Value, flZoom, nPointX, nPointY ); - } - - // void - public void SetSize( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint unWidth /*uint32*/, uint unHeight /*uint32*/ ) - { - platform.ISteamHTMLSurface_SetSize( unBrowserHandle.Value, unWidth, unHeight ); - } - - // void - public void SetVerticalScroll( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/, uint nAbsolutePixelScroll /*uint32*/ ) - { - platform.ISteamHTMLSurface_SetVerticalScroll( unBrowserHandle.Value, nAbsolutePixelScroll ); - } - - // bool - public bool Shutdown() - { - return platform.ISteamHTMLSurface_Shutdown(); - } - - // void - public void StopFind( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_StopFind( unBrowserHandle.Value ); - } - - // void - public void StopLoad( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_StopLoad( unBrowserHandle.Value ); - } - - // void - public void ViewSource( HHTMLBrowser unBrowserHandle /*HHTMLBrowser*/ ) - { - platform.ISteamHTMLSurface_ViewSource( unBrowserHandle.Value ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTTP.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTTP.cs deleted file mode 100644 index e95e1f4..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamHTTP.cs +++ /dev/null @@ -1,197 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamHTTP : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamHTTP( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // HTTPCookieContainerHandle - public HTTPCookieContainerHandle CreateCookieContainer( bool bAllowResponsesToModify /*bool*/ ) - { - return platform.ISteamHTTP_CreateCookieContainer( bAllowResponsesToModify ); - } - - // HTTPRequestHandle - public HTTPRequestHandle CreateHTTPRequest( HTTPMethod eHTTPRequestMethod /*EHTTPMethod*/, string pchAbsoluteURL /*const char **/ ) - { - return platform.ISteamHTTP_CreateHTTPRequest( eHTTPRequestMethod, pchAbsoluteURL ); - } - - // bool - public bool DeferHTTPRequest( HTTPRequestHandle hRequest /*HTTPRequestHandle*/ ) - { - return platform.ISteamHTTP_DeferHTTPRequest( hRequest.Value ); - } - - // bool - public bool GetHTTPDownloadProgressPct( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, out float pflPercentOut /*float **/ ) - { - return platform.ISteamHTTP_GetHTTPDownloadProgressPct( hRequest.Value, out pflPercentOut ); - } - - // bool - public bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, ref bool pbWasTimedOut /*bool **/ ) - { - return platform.ISteamHTTP_GetHTTPRequestWasTimedOut( hRequest.Value, ref pbWasTimedOut ); - } - - // bool - public bool GetHTTPResponseBodyData( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, out byte pBodyDataBuffer /*uint8 **/, uint unBufferSize /*uint32*/ ) - { - return platform.ISteamHTTP_GetHTTPResponseBodyData( hRequest.Value, out pBodyDataBuffer, unBufferSize ); - } - - // bool - public bool GetHTTPResponseBodySize( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, out uint unBodySize /*uint32 **/ ) - { - return platform.ISteamHTTP_GetHTTPResponseBodySize( hRequest.Value, out unBodySize ); - } - - // bool - public bool GetHTTPResponseHeaderSize( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchHeaderName /*const char **/, out uint unResponseHeaderSize /*uint32 **/ ) - { - return platform.ISteamHTTP_GetHTTPResponseHeaderSize( hRequest.Value, pchHeaderName, out unResponseHeaderSize ); - } - - // bool - public bool GetHTTPResponseHeaderValue( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchHeaderName /*const char **/, out byte pHeaderValueBuffer /*uint8 **/, uint unBufferSize /*uint32*/ ) - { - return platform.ISteamHTTP_GetHTTPResponseHeaderValue( hRequest.Value, pchHeaderName, out pHeaderValueBuffer, unBufferSize ); - } - - // bool - public bool GetHTTPStreamingResponseBodyData( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, uint cOffset /*uint32*/, out byte pBodyDataBuffer /*uint8 **/, uint unBufferSize /*uint32*/ ) - { - return platform.ISteamHTTP_GetHTTPStreamingResponseBodyData( hRequest.Value, cOffset, out pBodyDataBuffer, unBufferSize ); - } - - // bool - public bool PrioritizeHTTPRequest( HTTPRequestHandle hRequest /*HTTPRequestHandle*/ ) - { - return platform.ISteamHTTP_PrioritizeHTTPRequest( hRequest.Value ); - } - - // bool - public bool ReleaseCookieContainer( HTTPCookieContainerHandle hCookieContainer /*HTTPCookieContainerHandle*/ ) - { - return platform.ISteamHTTP_ReleaseCookieContainer( hCookieContainer.Value ); - } - - // bool - public bool ReleaseHTTPRequest( HTTPRequestHandle hRequest /*HTTPRequestHandle*/ ) - { - return platform.ISteamHTTP_ReleaseHTTPRequest( hRequest.Value ); - } - - // bool - public bool SendHTTPRequest( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, ref SteamAPICall_t pCallHandle /*SteamAPICall_t **/ ) - { - return platform.ISteamHTTP_SendHTTPRequest( hRequest.Value, ref pCallHandle.Value ); - } - - // bool - public bool SendHTTPRequestAndStreamResponse( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, ref SteamAPICall_t pCallHandle /*SteamAPICall_t **/ ) - { - return platform.ISteamHTTP_SendHTTPRequestAndStreamResponse( hRequest.Value, ref pCallHandle.Value ); - } - - // bool - public bool SetCookie( HTTPCookieContainerHandle hCookieContainer /*HTTPCookieContainerHandle*/, string pchHost /*const char **/, string pchUrl /*const char **/, string pchCookie /*const char **/ ) - { - return platform.ISteamHTTP_SetCookie( hCookieContainer.Value, pchHost, pchUrl, pchCookie ); - } - - // bool - public bool SetHTTPRequestAbsoluteTimeoutMS( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, uint unMilliseconds /*uint32*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS( hRequest.Value, unMilliseconds ); - } - - // bool - public bool SetHTTPRequestContextValue( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, ulong ulContextValue /*uint64*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestContextValue( hRequest.Value, ulContextValue ); - } - - // bool - public bool SetHTTPRequestCookieContainer( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, HTTPCookieContainerHandle hCookieContainer /*HTTPCookieContainerHandle*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestCookieContainer( hRequest.Value, hCookieContainer.Value ); - } - - // bool - public bool SetHTTPRequestGetOrPostParameter( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchParamName /*const char **/, string pchParamValue /*const char **/ ) - { - return platform.ISteamHTTP_SetHTTPRequestGetOrPostParameter( hRequest.Value, pchParamName, pchParamValue ); - } - - // bool - public bool SetHTTPRequestHeaderValue( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchHeaderName /*const char **/, string pchHeaderValue /*const char **/ ) - { - return platform.ISteamHTTP_SetHTTPRequestHeaderValue( hRequest.Value, pchHeaderName, pchHeaderValue ); - } - - // bool - public bool SetHTTPRequestNetworkActivityTimeout( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, uint unTimeoutSeconds /*uint32*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestNetworkActivityTimeout( hRequest.Value, unTimeoutSeconds ); - } - - // bool - public bool SetHTTPRequestRawPostBody( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchContentType /*const char **/, out byte pubBody /*uint8 **/, uint unBodyLen /*uint32*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestRawPostBody( hRequest.Value, pchContentType, out pubBody, unBodyLen ); - } - - // bool - public bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, bool bRequireVerifiedCertificate /*bool*/ ) - { - return platform.ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate( hRequest.Value, bRequireVerifiedCertificate ); - } - - // bool - public bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest /*HTTPRequestHandle*/, string pchUserAgentInfo /*const char **/ ) - { - return platform.ISteamHTTP_SetHTTPRequestUserAgentInfo( hRequest.Value, pchUserAgentInfo ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamInventory.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamInventory.cs deleted file mode 100644 index e758ee0..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamInventory.cs +++ /dev/null @@ -1,342 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamInventory : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamInventory( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool AddPromoItem( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemDef_t itemDef /*SteamItemDef_t*/ ) - { - return platform.ISteamInventory_AddPromoItem( ref pResultHandle.Value, itemDef.Value ); - } - - // bool - public bool AddPromoItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemDef_t[] pArrayItemDefs /*const SteamItemDef_t **/, uint unArrayLength /*uint32*/ ) - { - return platform.ISteamInventory_AddPromoItems( ref pResultHandle.Value, pArrayItemDefs.Select( x => x.Value ).ToArray(), unArrayLength ); - } - - // bool - public bool CheckResultSteamID( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/, CSteamID steamIDExpected /*class CSteamID*/ ) - { - return platform.ISteamInventory_CheckResultSteamID( resultHandle.Value, steamIDExpected.Value ); - } - - // bool - public bool ConsumeItem( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemInstanceID_t itemConsume /*SteamItemInstanceID_t*/, uint unQuantity /*uint32*/ ) - { - return platform.ISteamInventory_ConsumeItem( ref pResultHandle.Value, itemConsume.Value, unQuantity ); - } - - // bool - public bool DeserializeResult( ref SteamInventoryResult_t pOutResultHandle /*SteamInventoryResult_t **/, IntPtr pBuffer /*const void **/, uint unBufferSize /*uint32*/, bool bRESERVED_MUST_BE_FALSE /*bool*/ ) - { - return platform.ISteamInventory_DeserializeResult( ref pOutResultHandle.Value, (IntPtr) pBuffer, unBufferSize, bRESERVED_MUST_BE_FALSE ); - } - - // void - public void DestroyResult( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/ ) - { - platform.ISteamInventory_DestroyResult( resultHandle.Value ); - } - - // bool - public bool ExchangeItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemDef_t[] pArrayGenerate /*const SteamItemDef_t **/, uint[] punArrayGenerateQuantity /*const uint32 **/, uint unArrayGenerateLength /*uint32*/, SteamItemInstanceID_t[] pArrayDestroy /*const SteamItemInstanceID_t **/, uint[] punArrayDestroyQuantity /*const uint32 **/, uint unArrayDestroyLength /*uint32*/ ) - { - return platform.ISteamInventory_ExchangeItems( ref pResultHandle.Value, pArrayGenerate.Select( x => x.Value ).ToArray(), punArrayGenerateQuantity, unArrayGenerateLength, pArrayDestroy.Select( x => x.Value ).ToArray(), punArrayDestroyQuantity, unArrayDestroyLength ); - } - - // bool - public bool GenerateItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemDef_t[] pArrayItemDefs /*const SteamItemDef_t **/, uint[] punArrayQuantity /*const uint32 **/, uint unArrayLength /*uint32*/ ) - { - return platform.ISteamInventory_GenerateItems( ref pResultHandle.Value, pArrayItemDefs.Select( x => x.Value ).ToArray(), punArrayQuantity, unArrayLength ); - } - - // bool - public bool GetAllItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/ ) - { - return platform.ISteamInventory_GetAllItems( ref pResultHandle.Value ); - } - - // bool - // using: Detect_MultiSizeArrayReturn - public SteamItemDef_t[] GetEligiblePromoItemDefinitionIDs( CSteamID steamID /*class CSteamID*/ ) - { - uint punItemDefIDsArraySize = 0; - - bool success = false; - success = platform.ISteamInventory_GetEligiblePromoItemDefinitionIDs( steamID.Value, IntPtr.Zero, out punItemDefIDsArraySize ); - if ( !success || punItemDefIDsArraySize == 0) return null; - - var pItemDefIDs = new SteamItemDef_t[punItemDefIDsArraySize]; - fixed ( void* pItemDefIDs_ptr = pItemDefIDs ) - { - success = platform.ISteamInventory_GetEligiblePromoItemDefinitionIDs( steamID.Value, (IntPtr) pItemDefIDs_ptr, out punItemDefIDsArraySize ); - if ( !success ) return null; - return pItemDefIDs; - } - } - - // bool - // using: Detect_MultiSizeArrayReturn - public SteamItemDef_t[] GetItemDefinitionIDs() - { - uint punItemDefIDsArraySize = 0; - - bool success = false; - success = platform.ISteamInventory_GetItemDefinitionIDs( IntPtr.Zero, out punItemDefIDsArraySize ); - if ( !success || punItemDefIDsArraySize == 0) return null; - - var pItemDefIDs = new SteamItemDef_t[punItemDefIDsArraySize]; - fixed ( void* pItemDefIDs_ptr = pItemDefIDs ) - { - success = platform.ISteamInventory_GetItemDefinitionIDs( (IntPtr) pItemDefIDs_ptr, out punItemDefIDsArraySize ); - if ( !success ) return null; - return pItemDefIDs; - } - } - - // bool - // with: Detect_StringFetch False - public bool GetItemDefinitionProperty( SteamItemDef_t iDefinition /*SteamItemDef_t*/, string pchPropertyName /*const char **/, out string pchValueBuffer /*char **/ ) - { - bool bSuccess = default( bool ); - pchValueBuffer = string.Empty; - System.Text.StringBuilder pchValueBuffer_sb = Helpers.TakeStringBuilder(); - uint punValueBufferSizeOut = 4096; - bSuccess = platform.ISteamInventory_GetItemDefinitionProperty( iDefinition.Value, pchPropertyName, pchValueBuffer_sb, out punValueBufferSizeOut ); - if ( !bSuccess ) return bSuccess; - pchValueBuffer = pchValueBuffer_sb.ToString(); - return bSuccess; - } - - // bool - public bool GetItemPrice( SteamItemDef_t iDefinition /*SteamItemDef_t*/, out ulong pPrice /*uint64 **/ ) - { - return platform.ISteamInventory_GetItemPrice( iDefinition.Value, out pPrice ); - } - - // bool - public bool GetItemsByID( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemInstanceID_t[] pInstanceIDs /*const SteamItemInstanceID_t **/, uint unCountInstanceIDs /*uint32*/ ) - { - return platform.ISteamInventory_GetItemsByID( ref pResultHandle.Value, pInstanceIDs.Select( x => x.Value ).ToArray(), unCountInstanceIDs ); - } - - // bool - public bool GetItemsWithPrices( IntPtr pArrayItemDefs /*SteamItemDef_t **/, IntPtr pPrices /*uint64 **/, uint unArrayLength /*uint32*/ ) - { - return platform.ISteamInventory_GetItemsWithPrices( (IntPtr) pArrayItemDefs, (IntPtr) pPrices, unArrayLength ); - } - - // uint - public uint GetNumItemsWithPrices() - { - return platform.ISteamInventory_GetNumItemsWithPrices(); - } - - // bool - // with: Detect_StringFetch False - public bool GetResultItemProperty( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/, uint unItemIndex /*uint32*/, string pchPropertyName /*const char **/, out string pchValueBuffer /*char **/ ) - { - bool bSuccess = default( bool ); - pchValueBuffer = string.Empty; - System.Text.StringBuilder pchValueBuffer_sb = Helpers.TakeStringBuilder(); - uint punValueBufferSizeOut = 4096; - bSuccess = platform.ISteamInventory_GetResultItemProperty( resultHandle.Value, unItemIndex, pchPropertyName, pchValueBuffer_sb, out punValueBufferSizeOut ); - if ( !bSuccess ) return bSuccess; - pchValueBuffer = pchValueBuffer_sb.ToString(); - return bSuccess; - } - - // bool - // using: Detect_MultiSizeArrayReturn - public SteamItemDetails_t[] GetResultItems( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/ ) - { - uint punOutItemsArraySize = 0; - - bool success = false; - success = platform.ISteamInventory_GetResultItems( resultHandle.Value, IntPtr.Zero, out punOutItemsArraySize ); - if ( !success || punOutItemsArraySize == 0) return null; - - var pOutItemsArray = new SteamItemDetails_t[punOutItemsArraySize]; - fixed ( void* pOutItemsArray_ptr = pOutItemsArray ) - { - success = platform.ISteamInventory_GetResultItems( resultHandle.Value, (IntPtr) pOutItemsArray_ptr, out punOutItemsArraySize ); - if ( !success ) return null; - return pOutItemsArray; - } - } - - // Result - public Result GetResultStatus( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/ ) - { - return platform.ISteamInventory_GetResultStatus( resultHandle.Value ); - } - - // uint - public uint GetResultTimestamp( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/ ) - { - return platform.ISteamInventory_GetResultTimestamp( resultHandle.Value ); - } - - // bool - public bool GrantPromoItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/ ) - { - return platform.ISteamInventory_GrantPromoItems( ref pResultHandle.Value ); - } - - // bool - public bool LoadItemDefinitions() - { - return platform.ISteamInventory_LoadItemDefinitions(); - } - - // bool - public bool RemoveProperty( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, SteamItemInstanceID_t nItemID /*SteamItemInstanceID_t*/, string pchPropertyName /*const char **/ ) - { - return platform.ISteamInventory_RemoveProperty( handle.Value, nItemID.Value, pchPropertyName ); - } - - // SteamAPICall_t - public CallbackHandle RequestEligiblePromoItemDefinitionsIDs( CSteamID steamID /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamInventory_RequestEligiblePromoItemDefinitionsIDs( steamID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SteamInventoryEligiblePromoItemDefIDs_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RequestPrices( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamInventory_RequestPrices(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SteamInventoryRequestPricesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void SendItemDropHeartbeat() - { - platform.ISteamInventory_SendItemDropHeartbeat(); - } - - // bool - public bool SerializeResult( SteamInventoryResult_t resultHandle /*SteamInventoryResult_t*/, IntPtr pOutBuffer /*void **/, out uint punOutBufferSize /*uint32 **/ ) - { - return platform.ISteamInventory_SerializeResult( resultHandle.Value, (IntPtr) pOutBuffer, out punOutBufferSize ); - } - - // bool - public bool SetProperty( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, SteamItemInstanceID_t nItemID /*SteamItemInstanceID_t*/, string pchPropertyName /*const char **/, string pchPropertyValue /*const char **/ ) - { - return platform.ISteamInventory_SetProperty( handle.Value, nItemID.Value, pchPropertyName, pchPropertyValue ); - } - - // bool - public bool SetProperty0( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, SteamItemInstanceID_t nItemID /*SteamItemInstanceID_t*/, string pchPropertyName /*const char **/, bool bValue /*bool*/ ) - { - return platform.ISteamInventory_SetProperty0( handle.Value, nItemID.Value, pchPropertyName, bValue ); - } - - // bool - public bool SetProperty1( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, SteamItemInstanceID_t nItemID /*SteamItemInstanceID_t*/, string pchPropertyName /*const char **/, long nValue /*int64*/ ) - { - return platform.ISteamInventory_SetProperty0( handle.Value, nItemID.Value, pchPropertyName, nValue ); - } - - // bool - public bool SetProperty2( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, SteamItemInstanceID_t nItemID /*SteamItemInstanceID_t*/, string pchPropertyName /*const char **/, float flValue /*float*/ ) - { - return platform.ISteamInventory_SetProperty0( handle.Value, nItemID.Value, pchPropertyName, flValue ); - } - - // SteamAPICall_t - public CallbackHandle StartPurchase( SteamItemDef_t[] pArrayItemDefs /*const SteamItemDef_t **/, uint[] punArrayQuantity /*const uint32 **/, uint unArrayLength /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamInventory_StartPurchase( pArrayItemDefs.Select( x => x.Value ).ToArray(), punArrayQuantity, unArrayLength ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SteamInventoryStartPurchaseResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamInventoryUpdateHandle_t - public SteamInventoryUpdateHandle_t StartUpdateProperties() - { - return platform.ISteamInventory_StartUpdateProperties(); - } - - // bool - public bool SubmitUpdateProperties( SteamInventoryUpdateHandle_t handle /*SteamInventoryUpdateHandle_t*/, ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/ ) - { - return platform.ISteamInventory_SubmitUpdateProperties( handle.Value, ref pResultHandle.Value ); - } - - // bool - public bool TradeItems( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, CSteamID steamIDTradePartner /*class CSteamID*/, SteamItemInstanceID_t[] pArrayGive /*const SteamItemInstanceID_t **/, uint[] pArrayGiveQuantity /*const uint32 **/, uint nArrayGiveLength /*uint32*/, SteamItemInstanceID_t[] pArrayGet /*const SteamItemInstanceID_t **/, uint[] pArrayGetQuantity /*const uint32 **/, uint nArrayGetLength /*uint32*/ ) - { - return platform.ISteamInventory_TradeItems( ref pResultHandle.Value, steamIDTradePartner.Value, pArrayGive.Select( x => x.Value ).ToArray(), pArrayGiveQuantity, nArrayGiveLength, pArrayGet.Select( x => x.Value ).ToArray(), pArrayGetQuantity, nArrayGetLength ); - } - - // bool - public bool TransferItemQuantity( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemInstanceID_t itemIdSource /*SteamItemInstanceID_t*/, uint unQuantity /*uint32*/, SteamItemInstanceID_t itemIdDest /*SteamItemInstanceID_t*/ ) - { - return platform.ISteamInventory_TransferItemQuantity( ref pResultHandle.Value, itemIdSource.Value, unQuantity, itemIdDest.Value ); - } - - // bool - public bool TriggerItemDrop( ref SteamInventoryResult_t pResultHandle /*SteamInventoryResult_t **/, SteamItemDef_t dropListDefinition /*SteamItemDef_t*/ ) - { - return platform.ISteamInventory_TriggerItemDrop( ref pResultHandle.Value, dropListDefinition.Value ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmaking.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmaking.cs deleted file mode 100644 index da740fe..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmaking.cs +++ /dev/null @@ -1,313 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamMatchmaking : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamMatchmaking( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // int - public int AddFavoriteGame( AppId_t nAppID /*AppId_t*/, uint nIP /*uint32*/, ushort nConnPort /*uint16*/, ushort nQueryPort /*uint16*/, uint unFlags /*uint32*/, uint rTime32LastPlayedOnServer /*uint32*/ ) - { - return platform.ISteamMatchmaking_AddFavoriteGame( nAppID.Value, nIP, nConnPort, nQueryPort, unFlags, rTime32LastPlayedOnServer ); - } - - // void - public void AddRequestLobbyListCompatibleMembersFilter( CSteamID steamIDLobby /*class CSteamID*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListCompatibleMembersFilter( steamIDLobby.Value ); - } - - // void - public void AddRequestLobbyListDistanceFilter( LobbyDistanceFilter eLobbyDistanceFilter /*ELobbyDistanceFilter*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListDistanceFilter( eLobbyDistanceFilter ); - } - - // void - public void AddRequestLobbyListFilterSlotsAvailable( int nSlotsAvailable /*int*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListFilterSlotsAvailable( nSlotsAvailable ); - } - - // void - public void AddRequestLobbyListNearValueFilter( string pchKeyToMatch /*const char **/, int nValueToBeCloseTo /*int*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListNearValueFilter( pchKeyToMatch, nValueToBeCloseTo ); - } - - // void - public void AddRequestLobbyListNumericalFilter( string pchKeyToMatch /*const char **/, int nValueToMatch /*int*/, LobbyComparison eComparisonType /*ELobbyComparison*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListNumericalFilter( pchKeyToMatch, nValueToMatch, eComparisonType ); - } - - // void - public void AddRequestLobbyListResultCountFilter( int cMaxResults /*int*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListResultCountFilter( cMaxResults ); - } - - // void - public void AddRequestLobbyListStringFilter( string pchKeyToMatch /*const char **/, string pchValueToMatch /*const char **/, LobbyComparison eComparisonType /*ELobbyComparison*/ ) - { - platform.ISteamMatchmaking_AddRequestLobbyListStringFilter( pchKeyToMatch, pchValueToMatch, eComparisonType ); - } - - // SteamAPICall_t - public CallbackHandle CreateLobby( LobbyType eLobbyType /*ELobbyType*/, int cMaxMembers /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamMatchmaking_CreateLobby( eLobbyType, cMaxMembers ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LobbyCreated_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool DeleteLobbyData( CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/ ) - { - return platform.ISteamMatchmaking_DeleteLobbyData( steamIDLobby.Value, pchKey ); - } - - // bool - public bool GetFavoriteGame( int iGame /*int*/, ref AppId_t pnAppID /*AppId_t **/, out uint pnIP /*uint32 **/, out ushort pnConnPort /*uint16 **/, out ushort pnQueryPort /*uint16 **/, out uint punFlags /*uint32 **/, out uint pRTime32LastPlayedOnServer /*uint32 **/ ) - { - return platform.ISteamMatchmaking_GetFavoriteGame( iGame, ref pnAppID.Value, out pnIP, out pnConnPort, out pnQueryPort, out punFlags, out pRTime32LastPlayedOnServer ); - } - - // int - public int GetFavoriteGameCount() - { - return platform.ISteamMatchmaking_GetFavoriteGameCount(); - } - - // ulong - public ulong GetLobbyByIndex( int iLobby /*int*/ ) - { - return platform.ISteamMatchmaking_GetLobbyByIndex( iLobby ); - } - - // int - public int GetLobbyChatEntry( CSteamID steamIDLobby /*class CSteamID*/, int iChatID /*int*/, out CSteamID pSteamIDUser /*class CSteamID **/, IntPtr pvData /*void **/, int cubData /*int*/, out ChatEntryType peChatEntryType /*EChatEntryType **/ ) - { - return platform.ISteamMatchmaking_GetLobbyChatEntry( steamIDLobby.Value, iChatID, out pSteamIDUser.Value, (IntPtr) pvData, cubData, out peChatEntryType ); - } - - // string - // with: Detect_StringReturn - public string GetLobbyData( CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamMatchmaking_GetLobbyData( steamIDLobby.Value, pchKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // bool - // with: Detect_StringFetch False - // with: Detect_StringFetch False - public bool GetLobbyDataByIndex( CSteamID steamIDLobby /*class CSteamID*/, int iLobbyData /*int*/, out string pchKey /*char **/, out string pchValue /*char **/ ) - { - bool bSuccess = default( bool ); - pchKey = string.Empty; - System.Text.StringBuilder pchKey_sb = Helpers.TakeStringBuilder(); - int cchKeyBufferSize = 4096; - pchValue = string.Empty; - System.Text.StringBuilder pchValue_sb = Helpers.TakeStringBuilder(); - int cchValueBufferSize = 4096; - bSuccess = platform.ISteamMatchmaking_GetLobbyDataByIndex( steamIDLobby.Value, iLobbyData, pchKey_sb, cchKeyBufferSize, pchValue_sb, cchValueBufferSize ); - if ( !bSuccess ) return bSuccess; - pchValue = pchValue_sb.ToString(); - if ( !bSuccess ) return bSuccess; - pchKey = pchKey_sb.ToString(); - return bSuccess; - } - - // int - public int GetLobbyDataCount( CSteamID steamIDLobby /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_GetLobbyDataCount( steamIDLobby.Value ); - } - - // bool - public bool GetLobbyGameServer( CSteamID steamIDLobby /*class CSteamID*/, out uint punGameServerIP /*uint32 **/, out ushort punGameServerPort /*uint16 **/, out CSteamID psteamIDGameServer /*class CSteamID **/ ) - { - return platform.ISteamMatchmaking_GetLobbyGameServer( steamIDLobby.Value, out punGameServerIP, out punGameServerPort, out psteamIDGameServer.Value ); - } - - // ulong - public ulong GetLobbyMemberByIndex( CSteamID steamIDLobby /*class CSteamID*/, int iMember /*int*/ ) - { - return platform.ISteamMatchmaking_GetLobbyMemberByIndex( steamIDLobby.Value, iMember ); - } - - // string - // with: Detect_StringReturn - public string GetLobbyMemberData( CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDUser /*class CSteamID*/, string pchKey /*const char **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamMatchmaking_GetLobbyMemberData( steamIDLobby.Value, steamIDUser.Value, pchKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetLobbyMemberLimit( CSteamID steamIDLobby /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_GetLobbyMemberLimit( steamIDLobby.Value ); - } - - // ulong - public ulong GetLobbyOwner( CSteamID steamIDLobby /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_GetLobbyOwner( steamIDLobby.Value ); - } - - // int - public int GetNumLobbyMembers( CSteamID steamIDLobby /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_GetNumLobbyMembers( steamIDLobby.Value ); - } - - // bool - public bool InviteUserToLobby( CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDInvitee /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_InviteUserToLobby( steamIDLobby.Value, steamIDInvitee.Value ); - } - - // SteamAPICall_t - public CallbackHandle JoinLobby( CSteamID steamIDLobby /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamMatchmaking_JoinLobby( steamIDLobby.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LobbyEnter_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void LeaveLobby( CSteamID steamIDLobby /*class CSteamID*/ ) - { - platform.ISteamMatchmaking_LeaveLobby( steamIDLobby.Value ); - } - - // bool - public bool RemoveFavoriteGame( AppId_t nAppID /*AppId_t*/, uint nIP /*uint32*/, ushort nConnPort /*uint16*/, ushort nQueryPort /*uint16*/, uint unFlags /*uint32*/ ) - { - return platform.ISteamMatchmaking_RemoveFavoriteGame( nAppID.Value, nIP, nConnPort, nQueryPort, unFlags ); - } - - // bool - public bool RequestLobbyData( CSteamID steamIDLobby /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_RequestLobbyData( steamIDLobby.Value ); - } - - // SteamAPICall_t - public CallbackHandle RequestLobbyList( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamMatchmaking_RequestLobbyList(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LobbyMatchList_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool SendLobbyChatMsg( CSteamID steamIDLobby /*class CSteamID*/, IntPtr pvMsgBody /*const void **/, int cubMsgBody /*int*/ ) - { - return platform.ISteamMatchmaking_SendLobbyChatMsg( steamIDLobby.Value, (IntPtr) pvMsgBody, cubMsgBody ); - } - - // bool - public bool SetLinkedLobby( CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDLobbyDependent /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_SetLinkedLobby( steamIDLobby.Value, steamIDLobbyDependent.Value ); - } - - // bool - public bool SetLobbyData( CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/, string pchValue /*const char **/ ) - { - return platform.ISteamMatchmaking_SetLobbyData( steamIDLobby.Value, pchKey, pchValue ); - } - - // void - public void SetLobbyGameServer( CSteamID steamIDLobby /*class CSteamID*/, uint unGameServerIP /*uint32*/, ushort unGameServerPort /*uint16*/, CSteamID steamIDGameServer /*class CSteamID*/ ) - { - platform.ISteamMatchmaking_SetLobbyGameServer( steamIDLobby.Value, unGameServerIP, unGameServerPort, steamIDGameServer.Value ); - } - - // bool - public bool SetLobbyJoinable( CSteamID steamIDLobby /*class CSteamID*/, bool bLobbyJoinable /*bool*/ ) - { - return platform.ISteamMatchmaking_SetLobbyJoinable( steamIDLobby.Value, bLobbyJoinable ); - } - - // void - public void SetLobbyMemberData( CSteamID steamIDLobby /*class CSteamID*/, string pchKey /*const char **/, string pchValue /*const char **/ ) - { - platform.ISteamMatchmaking_SetLobbyMemberData( steamIDLobby.Value, pchKey, pchValue ); - } - - // bool - public bool SetLobbyMemberLimit( CSteamID steamIDLobby /*class CSteamID*/, int cMaxMembers /*int*/ ) - { - return platform.ISteamMatchmaking_SetLobbyMemberLimit( steamIDLobby.Value, cMaxMembers ); - } - - // bool - public bool SetLobbyOwner( CSteamID steamIDLobby /*class CSteamID*/, CSteamID steamIDNewOwner /*class CSteamID*/ ) - { - return platform.ISteamMatchmaking_SetLobbyOwner( steamIDLobby.Value, steamIDNewOwner.Value ); - } - - // bool - public bool SetLobbyType( CSteamID steamIDLobby /*class CSteamID*/, LobbyType eLobbyType /*ELobbyType*/ ) - { - return platform.ISteamMatchmaking_SetLobbyType( steamIDLobby.Value, eLobbyType ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmakingServers.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmakingServers.cs deleted file mode 100644 index 8ae6603..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMatchmakingServers.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamMatchmakingServers : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamMatchmakingServers( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void CancelQuery( HServerListRequest hRequest /*HServerListRequest*/ ) - { - platform.ISteamMatchmakingServers_CancelQuery( hRequest.Value ); - } - - // void - public void CancelServerQuery( HServerQuery hServerQuery /*HServerQuery*/ ) - { - platform.ISteamMatchmakingServers_CancelServerQuery( hServerQuery.Value ); - } - - // int - public int GetServerCount( HServerListRequest hRequest /*HServerListRequest*/ ) - { - return platform.ISteamMatchmakingServers_GetServerCount( hRequest.Value ); - } - - // gameserveritem_t * - // with: Detect_ReturningStruct - public gameserveritem_t GetServerDetails( HServerListRequest hRequest /*HServerListRequest*/, int iServer /*int*/ ) - { - IntPtr struct_pointer; - struct_pointer = platform.ISteamMatchmakingServers_GetServerDetails( hRequest.Value, iServer ); - if ( struct_pointer == IntPtr.Zero ) return default(gameserveritem_t); - return gameserveritem_t.FromPointer( struct_pointer ); - } - - // bool - public bool IsRefreshing( HServerListRequest hRequest /*HServerListRequest*/ ) - { - return platform.ISteamMatchmakingServers_IsRefreshing( hRequest.Value ); - } - - // HServerQuery - public HServerQuery PingServer( uint unIP /*uint32*/, ushort usPort /*uint16*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingPingResponse **/ ) - { - return platform.ISteamMatchmakingServers_PingServer( unIP, usPort, (IntPtr) pRequestServersResponse ); - } - - // HServerQuery - public HServerQuery PlayerDetails( uint unIP /*uint32*/, ushort usPort /*uint16*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingPlayersResponse **/ ) - { - return platform.ISteamMatchmakingServers_PlayerDetails( unIP, usPort, (IntPtr) pRequestServersResponse ); - } - - // void - public void RefreshQuery( HServerListRequest hRequest /*HServerListRequest*/ ) - { - platform.ISteamMatchmakingServers_RefreshQuery( hRequest.Value ); - } - - // void - public void RefreshServer( HServerListRequest hRequest /*HServerListRequest*/, int iServer /*int*/ ) - { - platform.ISteamMatchmakingServers_RefreshServer( hRequest.Value, iServer ); - } - - // void - public void ReleaseRequest( HServerListRequest hServerListRequest /*HServerListRequest*/ ) - { - platform.ISteamMatchmakingServers_ReleaseRequest( hServerListRequest.Value ); - } - - // HServerListRequest - // with: Detect_MatchmakingFilters - public HServerListRequest RequestFavoritesServerList( AppId_t iApp /*AppId_t*/, IntPtr ppchFilters /*struct MatchMakingKeyValuePair_t ***/, uint nFilters /*uint32*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestFavoritesServerList( iApp.Value, (IntPtr) ppchFilters, nFilters, (IntPtr) pRequestServersResponse ); - } - - // HServerListRequest - // with: Detect_MatchmakingFilters - public HServerListRequest RequestFriendsServerList( AppId_t iApp /*AppId_t*/, IntPtr ppchFilters /*struct MatchMakingKeyValuePair_t ***/, uint nFilters /*uint32*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestFriendsServerList( iApp.Value, (IntPtr) ppchFilters, nFilters, (IntPtr) pRequestServersResponse ); - } - - // HServerListRequest - // with: Detect_MatchmakingFilters - public HServerListRequest RequestHistoryServerList( AppId_t iApp /*AppId_t*/, IntPtr ppchFilters /*struct MatchMakingKeyValuePair_t ***/, uint nFilters /*uint32*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestHistoryServerList( iApp.Value, (IntPtr) ppchFilters, nFilters, (IntPtr) pRequestServersResponse ); - } - - // HServerListRequest - // with: Detect_MatchmakingFilters - public HServerListRequest RequestInternetServerList( AppId_t iApp /*AppId_t*/, IntPtr ppchFilters /*struct MatchMakingKeyValuePair_t ***/, uint nFilters /*uint32*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestInternetServerList( iApp.Value, (IntPtr) ppchFilters, nFilters, (IntPtr) pRequestServersResponse ); - } - - // HServerListRequest - public HServerListRequest RequestLANServerList( AppId_t iApp /*AppId_t*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestLANServerList( iApp.Value, (IntPtr) pRequestServersResponse ); - } - - // HServerListRequest - // with: Detect_MatchmakingFilters - public HServerListRequest RequestSpectatorServerList( AppId_t iApp /*AppId_t*/, IntPtr ppchFilters /*struct MatchMakingKeyValuePair_t ***/, uint nFilters /*uint32*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingServerListResponse **/ ) - { - return platform.ISteamMatchmakingServers_RequestSpectatorServerList( iApp.Value, (IntPtr) ppchFilters, nFilters, (IntPtr) pRequestServersResponse ); - } - - // HServerQuery - public HServerQuery ServerRules( uint unIP /*uint32*/, ushort usPort /*uint16*/, IntPtr pRequestServersResponse /*class ISteamMatchmakingRulesResponse **/ ) - { - return platform.ISteamMatchmakingServers_ServerRules( unIP, usPort, (IntPtr) pRequestServersResponse ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusic.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusic.cs deleted file mode 100644 index 6c8fd26..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusic.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamMusic : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamMusic( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool BIsEnabled() - { - return platform.ISteamMusic_BIsEnabled(); - } - - // bool - public bool BIsPlaying() - { - return platform.ISteamMusic_BIsPlaying(); - } - - // AudioPlayback_Status - public AudioPlayback_Status GetPlaybackStatus() - { - return platform.ISteamMusic_GetPlaybackStatus(); - } - - // float - public float GetVolume() - { - return platform.ISteamMusic_GetVolume(); - } - - // void - public void Pause() - { - platform.ISteamMusic_Pause(); - } - - // void - public void Play() - { - platform.ISteamMusic_Play(); - } - - // void - public void PlayNext() - { - platform.ISteamMusic_PlayNext(); - } - - // void - public void PlayPrevious() - { - platform.ISteamMusic_PlayPrevious(); - } - - // void - public void SetVolume( float flVolume /*float*/ ) - { - platform.ISteamMusic_SetVolume( flVolume ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusicRemote.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusicRemote.cs deleted file mode 100644 index 2bd0b11..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamMusicRemote.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamMusicRemote : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamMusicRemote( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool BActivationSuccess( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_BActivationSuccess( bValue ); - } - - // bool - public bool BIsCurrentMusicRemote() - { - return platform.ISteamMusicRemote_BIsCurrentMusicRemote(); - } - - // bool - public bool CurrentEntryDidChange() - { - return platform.ISteamMusicRemote_CurrentEntryDidChange(); - } - - // bool - public bool CurrentEntryIsAvailable( bool bAvailable /*bool*/ ) - { - return platform.ISteamMusicRemote_CurrentEntryIsAvailable( bAvailable ); - } - - // bool - public bool CurrentEntryWillChange() - { - return platform.ISteamMusicRemote_CurrentEntryWillChange(); - } - - // bool - public bool DeregisterSteamMusicRemote() - { - return platform.ISteamMusicRemote_DeregisterSteamMusicRemote(); - } - - // bool - public bool EnableLooped( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnableLooped( bValue ); - } - - // bool - public bool EnablePlaylists( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnablePlaylists( bValue ); - } - - // bool - public bool EnablePlayNext( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnablePlayNext( bValue ); - } - - // bool - public bool EnablePlayPrevious( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnablePlayPrevious( bValue ); - } - - // bool - public bool EnableQueue( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnableQueue( bValue ); - } - - // bool - public bool EnableShuffled( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_EnableShuffled( bValue ); - } - - // bool - public bool PlaylistDidChange() - { - return platform.ISteamMusicRemote_PlaylistDidChange(); - } - - // bool - public bool PlaylistWillChange() - { - return platform.ISteamMusicRemote_PlaylistWillChange(); - } - - // bool - public bool QueueDidChange() - { - return platform.ISteamMusicRemote_QueueDidChange(); - } - - // bool - public bool QueueWillChange() - { - return platform.ISteamMusicRemote_QueueWillChange(); - } - - // bool - public bool RegisterSteamMusicRemote( string pchName /*const char **/ ) - { - return platform.ISteamMusicRemote_RegisterSteamMusicRemote( pchName ); - } - - // bool - public bool ResetPlaylistEntries() - { - return platform.ISteamMusicRemote_ResetPlaylistEntries(); - } - - // bool - public bool ResetQueueEntries() - { - return platform.ISteamMusicRemote_ResetQueueEntries(); - } - - // bool - public bool SetCurrentPlaylistEntry( int nID /*int*/ ) - { - return platform.ISteamMusicRemote_SetCurrentPlaylistEntry( nID ); - } - - // bool - public bool SetCurrentQueueEntry( int nID /*int*/ ) - { - return platform.ISteamMusicRemote_SetCurrentQueueEntry( nID ); - } - - // bool - public bool SetDisplayName( string pchDisplayName /*const char **/ ) - { - return platform.ISteamMusicRemote_SetDisplayName( pchDisplayName ); - } - - // bool - public bool SetPlaylistEntry( int nID /*int*/, int nPosition /*int*/, string pchEntryText /*const char **/ ) - { - return platform.ISteamMusicRemote_SetPlaylistEntry( nID, nPosition, pchEntryText ); - } - - // bool - public bool SetPNGIcon_64x64( IntPtr pvBuffer /*void **/, uint cbBufferLength /*uint32*/ ) - { - return platform.ISteamMusicRemote_SetPNGIcon_64x64( (IntPtr) pvBuffer, cbBufferLength ); - } - - // bool - public bool SetQueueEntry( int nID /*int*/, int nPosition /*int*/, string pchEntryText /*const char **/ ) - { - return platform.ISteamMusicRemote_SetQueueEntry( nID, nPosition, pchEntryText ); - } - - // bool - public bool UpdateCurrentEntryCoverArt( IntPtr pvBuffer /*void **/, uint cbBufferLength /*uint32*/ ) - { - return platform.ISteamMusicRemote_UpdateCurrentEntryCoverArt( (IntPtr) pvBuffer, cbBufferLength ); - } - - // bool - public bool UpdateCurrentEntryElapsedSeconds( int nValue /*int*/ ) - { - return platform.ISteamMusicRemote_UpdateCurrentEntryElapsedSeconds( nValue ); - } - - // bool - public bool UpdateCurrentEntryText( string pchText /*const char **/ ) - { - return platform.ISteamMusicRemote_UpdateCurrentEntryText( pchText ); - } - - // bool - public bool UpdateLooped( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_UpdateLooped( bValue ); - } - - // bool - public bool UpdatePlaybackStatus( AudioPlayback_Status nStatus /*AudioPlayback_Status*/ ) - { - return platform.ISteamMusicRemote_UpdatePlaybackStatus( nStatus ); - } - - // bool - public bool UpdateShuffled( bool bValue /*bool*/ ) - { - return platform.ISteamMusicRemote_UpdateShuffled( bValue ); - } - - // bool - public bool UpdateVolume( float flValue /*float*/ ) - { - return platform.ISteamMusicRemote_UpdateVolume( flValue ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamNetworking.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamNetworking.cs deleted file mode 100644 index 981a16a..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamNetworking.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamNetworking : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamNetworking( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool AcceptP2PSessionWithUser( CSteamID steamIDRemote /*class CSteamID*/ ) - { - return platform.ISteamNetworking_AcceptP2PSessionWithUser( steamIDRemote.Value ); - } - - // bool - public bool AllowP2PPacketRelay( bool bAllow /*bool*/ ) - { - return platform.ISteamNetworking_AllowP2PPacketRelay( bAllow ); - } - - // bool - public bool CloseP2PChannelWithUser( CSteamID steamIDRemote /*class CSteamID*/, int nChannel /*int*/ ) - { - return platform.ISteamNetworking_CloseP2PChannelWithUser( steamIDRemote.Value, nChannel ); - } - - // bool - public bool CloseP2PSessionWithUser( CSteamID steamIDRemote /*class CSteamID*/ ) - { - return platform.ISteamNetworking_CloseP2PSessionWithUser( steamIDRemote.Value ); - } - - // SNetSocket_t - public SNetSocket_t CreateConnectionSocket( uint nIP /*uint32*/, ushort nPort /*uint16*/, int nTimeoutSec /*int*/ ) - { - return platform.ISteamNetworking_CreateConnectionSocket( nIP, nPort, nTimeoutSec ); - } - - // SNetListenSocket_t - public SNetListenSocket_t CreateListenSocket( int nVirtualP2PPort /*int*/, uint nIP /*uint32*/, ushort nPort /*uint16*/, bool bAllowUseOfPacketRelay /*bool*/ ) - { - return platform.ISteamNetworking_CreateListenSocket( nVirtualP2PPort, nIP, nPort, bAllowUseOfPacketRelay ); - } - - // SNetSocket_t - public SNetSocket_t CreateP2PConnectionSocket( CSteamID steamIDTarget /*class CSteamID*/, int nVirtualPort /*int*/, int nTimeoutSec /*int*/, bool bAllowUseOfPacketRelay /*bool*/ ) - { - return platform.ISteamNetworking_CreateP2PConnectionSocket( steamIDTarget.Value, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay ); - } - - // bool - public bool DestroyListenSocket( SNetListenSocket_t hSocket /*SNetListenSocket_t*/, bool bNotifyRemoteEnd /*bool*/ ) - { - return platform.ISteamNetworking_DestroyListenSocket( hSocket.Value, bNotifyRemoteEnd ); - } - - // bool - public bool DestroySocket( SNetSocket_t hSocket /*SNetSocket_t*/, bool bNotifyRemoteEnd /*bool*/ ) - { - return platform.ISteamNetworking_DestroySocket( hSocket.Value, bNotifyRemoteEnd ); - } - - // bool - public bool GetListenSocketInfo( SNetListenSocket_t hListenSocket /*SNetListenSocket_t*/, out uint pnIP /*uint32 **/, out ushort pnPort /*uint16 **/ ) - { - return platform.ISteamNetworking_GetListenSocketInfo( hListenSocket.Value, out pnIP, out pnPort ); - } - - // int - public int GetMaxPacketSize( SNetSocket_t hSocket /*SNetSocket_t*/ ) - { - return platform.ISteamNetworking_GetMaxPacketSize( hSocket.Value ); - } - - // bool - public bool GetP2PSessionState( CSteamID steamIDRemote /*class CSteamID*/, ref P2PSessionState_t pConnectionState /*struct P2PSessionState_t **/ ) - { - return platform.ISteamNetworking_GetP2PSessionState( steamIDRemote.Value, ref pConnectionState ); - } - - // SNetSocketConnectionType - public SNetSocketConnectionType GetSocketConnectionType( SNetSocket_t hSocket /*SNetSocket_t*/ ) - { - return platform.ISteamNetworking_GetSocketConnectionType( hSocket.Value ); - } - - // bool - public bool GetSocketInfo( SNetSocket_t hSocket /*SNetSocket_t*/, out CSteamID pSteamIDRemote /*class CSteamID **/, IntPtr peSocketStatus /*int **/, out uint punIPRemote /*uint32 **/, out ushort punPortRemote /*uint16 **/ ) - { - return platform.ISteamNetworking_GetSocketInfo( hSocket.Value, out pSteamIDRemote.Value, (IntPtr) peSocketStatus, out punIPRemote, out punPortRemote ); - } - - // bool - public bool IsDataAvailable( SNetListenSocket_t hListenSocket /*SNetListenSocket_t*/, out uint pcubMsgSize /*uint32 **/, ref SNetSocket_t phSocket /*SNetSocket_t **/ ) - { - return platform.ISteamNetworking_IsDataAvailable( hListenSocket.Value, out pcubMsgSize, ref phSocket.Value ); - } - - // bool - public bool IsDataAvailableOnSocket( SNetSocket_t hSocket /*SNetSocket_t*/, out uint pcubMsgSize /*uint32 **/ ) - { - return platform.ISteamNetworking_IsDataAvailableOnSocket( hSocket.Value, out pcubMsgSize ); - } - - // bool - public bool IsP2PPacketAvailable( out uint pcubMsgSize /*uint32 **/, int nChannel /*int*/ ) - { - return platform.ISteamNetworking_IsP2PPacketAvailable( out pcubMsgSize, nChannel ); - } - - // bool - public bool ReadP2PPacket( IntPtr pubDest /*void **/, uint cubDest /*uint32*/, out uint pcubMsgSize /*uint32 **/, out CSteamID psteamIDRemote /*class CSteamID **/, int nChannel /*int*/ ) - { - return platform.ISteamNetworking_ReadP2PPacket( (IntPtr) pubDest, cubDest, out pcubMsgSize, out psteamIDRemote.Value, nChannel ); - } - - // bool - public bool RetrieveData( SNetListenSocket_t hListenSocket /*SNetListenSocket_t*/, IntPtr pubDest /*void **/, uint cubDest /*uint32*/, out uint pcubMsgSize /*uint32 **/, ref SNetSocket_t phSocket /*SNetSocket_t **/ ) - { - return platform.ISteamNetworking_RetrieveData( hListenSocket.Value, (IntPtr) pubDest, cubDest, out pcubMsgSize, ref phSocket.Value ); - } - - // bool - public bool RetrieveDataFromSocket( SNetSocket_t hSocket /*SNetSocket_t*/, IntPtr pubDest /*void **/, uint cubDest /*uint32*/, out uint pcubMsgSize /*uint32 **/ ) - { - return platform.ISteamNetworking_RetrieveDataFromSocket( hSocket.Value, (IntPtr) pubDest, cubDest, out pcubMsgSize ); - } - - // bool - public bool SendDataOnSocket( SNetSocket_t hSocket /*SNetSocket_t*/, IntPtr pubData /*void **/, uint cubData /*uint32*/, bool bReliable /*bool*/ ) - { - return platform.ISteamNetworking_SendDataOnSocket( hSocket.Value, (IntPtr) pubData, cubData, bReliable ); - } - - // bool - public bool SendP2PPacket( CSteamID steamIDRemote /*class CSteamID*/, IntPtr pubData /*const void **/, uint cubData /*uint32*/, P2PSend eP2PSendType /*EP2PSend*/, int nChannel /*int*/ ) - { - return platform.ISteamNetworking_SendP2PPacket( steamIDRemote.Value, (IntPtr) pubData, cubData, eP2PSendType, nChannel ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamParentalSettings.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamParentalSettings.cs deleted file mode 100644 index f79d5c6..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamParentalSettings.cs +++ /dev/null @@ -1,83 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamParentalSettings : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamParentalSettings( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool BIsAppBlocked( AppId_t nAppID /*AppId_t*/ ) - { - return platform.ISteamParentalSettings_BIsAppBlocked( nAppID.Value ); - } - - // bool - public bool BIsAppInBlockList( AppId_t nAppID /*AppId_t*/ ) - { - return platform.ISteamParentalSettings_BIsAppInBlockList( nAppID.Value ); - } - - // bool - public bool BIsFeatureBlocked( ParentalFeature eFeature /*EParentalFeature*/ ) - { - return platform.ISteamParentalSettings_BIsFeatureBlocked( eFeature ); - } - - // bool - public bool BIsFeatureInBlockList( ParentalFeature eFeature /*EParentalFeature*/ ) - { - return platform.ISteamParentalSettings_BIsFeatureInBlockList( eFeature ); - } - - // bool - public bool BIsParentalLockEnabled() - { - return platform.ISteamParentalSettings_BIsParentalLockEnabled(); - } - - // bool - public bool BIsParentalLockLocked() - { - return platform.ISteamParentalSettings_BIsParentalLockLocked(); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs deleted file mode 100644 index 22de4be..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamRemoteStorage.cs +++ /dev/null @@ -1,644 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamRemoteStorage : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamRemoteStorage( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // SteamAPICall_t - public CallbackHandle CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_CommitPublishedFileUpdate( updateHandle.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageUpdatePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // PublishedFileUpdateHandle_t - public PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/ ) - { - return platform.ISteamRemoteStorage_CreatePublishedFileUpdateRequest( unPublishedFileId.Value ); - } - - // SteamAPICall_t - public CallbackHandle DeletePublishedFile( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_DeletePublishedFile( unPublishedFileId.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageDeletePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle EnumeratePublishedFilesByUserAction( WorkshopFileAction eAction /*EWorkshopFileAction*/, uint unStartIndex /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_EnumeratePublishedFilesByUserAction( eAction, unStartIndex ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageEnumeratePublishedFilesByUserActionResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - // using: Detect_StringArray - public CallbackHandle EnumeratePublishedWorkshopFiles( WorkshopEnumerationType eEnumerationType /*EWorkshopEnumerationType*/, uint unStartIndex /*uint32*/, uint unCount /*uint32*/, uint unDays /*uint32*/, string[] pTags /*struct SteamParamStringArray_t **/, ref SteamParamStringArray_t pUserTags /*struct SteamParamStringArray_t **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - // Create strings - var nativeStrings = new IntPtr[pTags.Length]; - for ( int i = 0; i < pTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pTags.Length; - callback = platform.ISteamRemoteStorage_EnumeratePublishedWorkshopFiles( eEnumerationType, unStartIndex, unCount, unDays, ref tags, ref pUserTags ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageEnumerateWorkshopFilesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle EnumerateUserPublishedFiles( uint unStartIndex /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_EnumerateUserPublishedFiles( unStartIndex ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageEnumerateUserPublishedFilesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - // using: Detect_StringArray - public CallbackHandle EnumerateUserSharedWorkshopFiles( CSteamID steamId /*class CSteamID*/, uint unStartIndex /*uint32*/, string[] pRequiredTags /*struct SteamParamStringArray_t **/, ref SteamParamStringArray_t pExcludedTags /*struct SteamParamStringArray_t **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - // Create strings - var nativeStrings = new IntPtr[pRequiredTags.Length]; - for ( int i = 0; i < pRequiredTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pRequiredTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pRequiredTags.Length; - callback = platform.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles( steamId.Value, unStartIndex, ref tags, ref pExcludedTags ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageEnumerateUserPublishedFilesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle EnumerateUserSubscribedFiles( uint unStartIndex /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_EnumerateUserSubscribedFiles( unStartIndex ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageEnumerateUserSubscribedFilesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool FileDelete( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_FileDelete( pchFile ); - } - - // bool - public bool FileExists( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_FileExists( pchFile ); - } - - // bool - public bool FileForget( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_FileForget( pchFile ); - } - - // bool - public bool FilePersisted( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_FilePersisted( pchFile ); - } - - // int - public int FileRead( string pchFile /*const char **/, IntPtr pvData /*void **/, int cubDataToRead /*int32*/ ) - { - return platform.ISteamRemoteStorage_FileRead( pchFile, (IntPtr) pvData, cubDataToRead ); - } - - // SteamAPICall_t - public CallbackHandle FileReadAsync( string pchFile /*const char **/, uint nOffset /*uint32*/, uint cubToRead /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_FileReadAsync( pchFile, nOffset, cubToRead ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageFileReadAsyncComplete_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool FileReadAsyncComplete( SteamAPICall_t hReadCall /*SteamAPICall_t*/, IntPtr pvBuffer /*void **/, uint cubToRead /*uint32*/ ) - { - return platform.ISteamRemoteStorage_FileReadAsyncComplete( hReadCall.Value, (IntPtr) pvBuffer, cubToRead ); - } - - // SteamAPICall_t - public CallbackHandle FileShare( string pchFile /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_FileShare( pchFile ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageFileShareResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool FileWrite( string pchFile /*const char **/, IntPtr pvData /*const void **/, int cubData /*int32*/ ) - { - return platform.ISteamRemoteStorage_FileWrite( pchFile, (IntPtr) pvData, cubData ); - } - - // SteamAPICall_t - public CallbackHandle FileWriteAsync( string pchFile /*const char **/, IntPtr pvData /*const void **/, uint cubData /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_FileWriteAsync( pchFile, (IntPtr) pvData, cubData ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageFileWriteAsyncComplete_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool FileWriteStreamCancel( UGCFileWriteStreamHandle_t writeHandle /*UGCFileWriteStreamHandle_t*/ ) - { - return platform.ISteamRemoteStorage_FileWriteStreamCancel( writeHandle.Value ); - } - - // bool - public bool FileWriteStreamClose( UGCFileWriteStreamHandle_t writeHandle /*UGCFileWriteStreamHandle_t*/ ) - { - return platform.ISteamRemoteStorage_FileWriteStreamClose( writeHandle.Value ); - } - - // UGCFileWriteStreamHandle_t - public UGCFileWriteStreamHandle_t FileWriteStreamOpen( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_FileWriteStreamOpen( pchFile ); - } - - // bool - public bool FileWriteStreamWriteChunk( UGCFileWriteStreamHandle_t writeHandle /*UGCFileWriteStreamHandle_t*/, IntPtr pvData /*const void **/, int cubData /*int32*/ ) - { - return platform.ISteamRemoteStorage_FileWriteStreamWriteChunk( writeHandle.Value, (IntPtr) pvData, cubData ); - } - - // int - public int GetCachedUGCCount() - { - return platform.ISteamRemoteStorage_GetCachedUGCCount(); - } - - // UGCHandle_t - public UGCHandle_t GetCachedUGCHandle( int iCachedContent /*int32*/ ) - { - return platform.ISteamRemoteStorage_GetCachedUGCHandle( iCachedContent ); - } - - // int - public int GetFileCount() - { - return platform.ISteamRemoteStorage_GetFileCount(); - } - - // string - // with: Detect_StringReturn - public string GetFileNameAndSize( int iFile /*int*/, out int pnFileSizeInBytes /*int32 **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamRemoteStorage_GetFileNameAndSize( iFile, out pnFileSizeInBytes ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetFileSize( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_GetFileSize( pchFile ); - } - - // long - public long GetFileTimestamp( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_GetFileTimestamp( pchFile ); - } - - // SteamAPICall_t - public CallbackHandle GetPublishedFileDetails( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, uint unMaxSecondsOld /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_GetPublishedFileDetails( unPublishedFileId.Value, unMaxSecondsOld ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageGetPublishedFileDetailsResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_GetPublishedItemVoteDetails( unPublishedFileId.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageGetPublishedItemVoteDetailsResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool GetQuota( out ulong pnTotalBytes /*uint64 **/, out ulong puAvailableBytes /*uint64 **/ ) - { - return platform.ISteamRemoteStorage_GetQuota( out pnTotalBytes, out puAvailableBytes ); - } - - // RemoteStoragePlatform - public RemoteStoragePlatform GetSyncPlatforms( string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_GetSyncPlatforms( pchFile ); - } - - // bool - // with: Detect_StringFetch False - public bool GetUGCDetails( UGCHandle_t hContent /*UGCHandle_t*/, ref AppId_t pnAppID /*AppId_t **/, out string ppchName /*char ***/, out CSteamID pSteamIDOwner /*class CSteamID **/ ) - { - bool bSuccess = default( bool ); - ppchName = string.Empty; - System.Text.StringBuilder ppchName_sb = Helpers.TakeStringBuilder(); - int pnFileSizeInBytes = 4096; - bSuccess = platform.ISteamRemoteStorage_GetUGCDetails( hContent.Value, ref pnAppID.Value, ppchName_sb, out pnFileSizeInBytes, out pSteamIDOwner.Value ); - if ( !bSuccess ) return bSuccess; - ppchName = ppchName_sb.ToString(); - return bSuccess; - } - - // bool - public bool GetUGCDownloadProgress( UGCHandle_t hContent /*UGCHandle_t*/, out int pnBytesDownloaded /*int32 **/, out int pnBytesExpected /*int32 **/ ) - { - return platform.ISteamRemoteStorage_GetUGCDownloadProgress( hContent.Value, out pnBytesDownloaded, out pnBytesExpected ); - } - - // SteamAPICall_t - public CallbackHandle GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_GetUserPublishedItemVoteDetails( unPublishedFileId.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageGetPublishedItemVoteDetailsResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool IsCloudEnabledForAccount() - { - return platform.ISteamRemoteStorage_IsCloudEnabledForAccount(); - } - - // bool - public bool IsCloudEnabledForApp() - { - return platform.ISteamRemoteStorage_IsCloudEnabledForApp(); - } - - // SteamAPICall_t - // using: Detect_StringArray - public CallbackHandle PublishVideo( WorkshopVideoProvider eVideoProvider /*EWorkshopVideoProvider*/, string pchVideoAccount /*const char **/, string pchVideoIdentifier /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, string[] pTags /*struct SteamParamStringArray_t **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - // Create strings - var nativeStrings = new IntPtr[pTags.Length]; - for ( int i = 0; i < pTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pTags.Length; - callback = platform.ISteamRemoteStorage_PublishVideo( eVideoProvider, pchVideoAccount, pchVideoIdentifier, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, ref tags ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStoragePublishFileProgress_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - // using: Detect_StringArray - public CallbackHandle PublishWorkshopFile( string pchFile /*const char **/, string pchPreviewFile /*const char **/, AppId_t nConsumerAppId /*AppId_t*/, string pchTitle /*const char **/, string pchDescription /*const char **/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/, string[] pTags /*struct SteamParamStringArray_t **/, WorkshopFileType eWorkshopFileType /*EWorkshopFileType*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - // Create strings - var nativeStrings = new IntPtr[pTags.Length]; - for ( int i = 0; i < pTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pTags.Length; - callback = platform.ISteamRemoteStorage_PublishWorkshopFile( pchFile, pchPreviewFile, nConsumerAppId.Value, pchTitle, pchDescription, eVisibility, ref tags, eWorkshopFileType ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStoragePublishFileProgress_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void SetCloudEnabledForApp( bool bEnabled /*bool*/ ) - { - platform.ISteamRemoteStorage_SetCloudEnabledForApp( bEnabled ); - } - - // bool - public bool SetSyncPlatforms( string pchFile /*const char **/, RemoteStoragePlatform eRemoteStoragePlatform /*ERemoteStoragePlatform*/ ) - { - return platform.ISteamRemoteStorage_SetSyncPlatforms( pchFile, eRemoteStoragePlatform ); - } - - // SteamAPICall_t - public CallbackHandle SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, WorkshopFileAction eAction /*EWorkshopFileAction*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_SetUserPublishedFileAction( unPublishedFileId.Value, eAction ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageSetUserPublishedFileActionResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle SubscribePublishedFile( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_SubscribePublishedFile( unPublishedFileId.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageSubscribePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle UGCDownload( UGCHandle_t hContent /*UGCHandle_t*/, uint unPriority /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_UGCDownload( hContent.Value, unPriority ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageDownloadUGCResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle UGCDownloadToLocation( UGCHandle_t hContent /*UGCHandle_t*/, string pchLocation /*const char **/, uint unPriority /*uint32*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_UGCDownloadToLocation( hContent.Value, pchLocation, unPriority ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageDownloadUGCResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // int - public int UGCRead( UGCHandle_t hContent /*UGCHandle_t*/, IntPtr pvData /*void **/, int cubDataToRead /*int32*/, uint cOffset /*uint32*/, UGCReadAction eAction /*EUGCReadAction*/ ) - { - return platform.ISteamRemoteStorage_UGCRead( hContent.Value, (IntPtr) pvData, cubDataToRead, cOffset, eAction ); - } - - // SteamAPICall_t - public CallbackHandle UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_UnsubscribePublishedFile( unPublishedFileId.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageUnsubscribePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string pchDescription /*const char **/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFileDescription( updateHandle.Value, pchDescription ); - } - - // bool - public bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string pchFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFileFile( updateHandle.Value, pchFile ); - } - - // bool - public bool UpdatePublishedFilePreviewFile( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string pchPreviewFile /*const char **/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFilePreviewFile( updateHandle.Value, pchPreviewFile ); - } - - // bool - public bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string pchChangeDescription /*const char **/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFileSetChangeDescription( updateHandle.Value, pchChangeDescription ); - } - - // bool - // using: Detect_StringArray - public bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string[] pTags /*struct SteamParamStringArray_t **/ ) - { - // Create strings - var nativeStrings = new IntPtr[pTags.Length]; - for ( int i = 0; i < pTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pTags.Length; - return platform.ISteamRemoteStorage_UpdatePublishedFileTags( updateHandle.Value, ref tags ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - } - - // bool - public bool UpdatePublishedFileTitle( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, string pchTitle /*const char **/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFileTitle( updateHandle.Value, pchTitle ); - } - - // bool - public bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle /*PublishedFileUpdateHandle_t*/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/ ) - { - return platform.ISteamRemoteStorage_UpdatePublishedFileVisibility( updateHandle.Value, eVisibility ); - } - - // SteamAPICall_t - public CallbackHandle UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId /*PublishedFileId_t*/, bool bVoteUp /*bool*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamRemoteStorage_UpdateUserPublishedItemVote( unPublishedFileId.Value, bVoteUp ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageUpdateUserPublishedItemVoteResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamScreenshots.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamScreenshots.cs deleted file mode 100644 index c8de7b2..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamScreenshots.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamScreenshots : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamScreenshots( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // ScreenshotHandle - public ScreenshotHandle AddScreenshotToLibrary( string pchFilename /*const char **/, string pchThumbnailFilename /*const char **/, int nWidth /*int*/, int nHeight /*int*/ ) - { - return platform.ISteamScreenshots_AddScreenshotToLibrary( pchFilename, pchThumbnailFilename, nWidth, nHeight ); - } - - // ScreenshotHandle - public ScreenshotHandle AddVRScreenshotToLibrary( VRScreenshotType eType /*EVRScreenshotType*/, string pchFilename /*const char **/, string pchVRFilename /*const char **/ ) - { - return platform.ISteamScreenshots_AddVRScreenshotToLibrary( eType, pchFilename, pchVRFilename ); - } - - // void - public void HookScreenshots( bool bHook /*bool*/ ) - { - platform.ISteamScreenshots_HookScreenshots( bHook ); - } - - // bool - public bool IsScreenshotsHooked() - { - return platform.ISteamScreenshots_IsScreenshotsHooked(); - } - - // bool - public bool SetLocation( ScreenshotHandle hScreenshot /*ScreenshotHandle*/, string pchLocation /*const char **/ ) - { - return platform.ISteamScreenshots_SetLocation( hScreenshot.Value, pchLocation ); - } - - // bool - public bool TagPublishedFile( ScreenshotHandle hScreenshot /*ScreenshotHandle*/, PublishedFileId_t unPublishedFileID /*PublishedFileId_t*/ ) - { - return platform.ISteamScreenshots_TagPublishedFile( hScreenshot.Value, unPublishedFileID.Value ); - } - - // bool - public bool TagUser( ScreenshotHandle hScreenshot /*ScreenshotHandle*/, CSteamID steamID /*class CSteamID*/ ) - { - return platform.ISteamScreenshots_TagUser( hScreenshot.Value, steamID.Value ); - } - - // void - public void TriggerScreenshot() - { - platform.ISteamScreenshots_TriggerScreenshot(); - } - - // ScreenshotHandle - public ScreenshotHandle WriteScreenshot( IntPtr pubRGB /*void **/, uint cubRGB /*uint32*/, int nWidth /*int*/, int nHeight /*int*/ ) - { - return platform.ISteamScreenshots_WriteScreenshot( (IntPtr) pubRGB, cubRGB, nWidth, nHeight ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs deleted file mode 100644 index eb9dad7..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUGC.cs +++ /dev/null @@ -1,692 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamUGC : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamUGC( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // SteamAPICall_t - public CallbackHandle AddAppDependency( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, AppId_t nAppID /*AppId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_AddAppDependency( nPublishedFileID.Value, nAppID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return AddAppDependencyResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle AddDependency( PublishedFileId_t nParentPublishedFileID /*PublishedFileId_t*/, PublishedFileId_t nChildPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_AddDependency( nParentPublishedFileID.Value, nChildPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return AddUGCDependencyResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool AddExcludedTag( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pTagName /*const char **/ ) - { - return platform.ISteamUGC_AddExcludedTag( handle.Value, pTagName ); - } - - // bool - public bool AddItemKeyValueTag( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/, string pchValue /*const char **/ ) - { - return platform.ISteamUGC_AddItemKeyValueTag( handle.Value, pchKey, pchValue ); - } - - // bool - public bool AddItemPreviewFile( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/, ItemPreviewType type /*EItemPreviewType*/ ) - { - return platform.ISteamUGC_AddItemPreviewFile( handle.Value, pszPreviewFile, type ); - } - - // bool - public bool AddItemPreviewVideo( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszVideoID /*const char **/ ) - { - return platform.ISteamUGC_AddItemPreviewVideo( handle.Value, pszVideoID ); - } - - // SteamAPICall_t - public CallbackHandle AddItemToFavorites( AppId_t nAppId /*AppId_t*/, PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_AddItemToFavorites( nAppId.Value, nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return UserFavoriteItemsListChanged_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool AddRequiredKeyValueTag( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pKey /*const char **/, string pValue /*const char **/ ) - { - return platform.ISteamUGC_AddRequiredKeyValueTag( handle.Value, pKey, pValue ); - } - - // bool - public bool AddRequiredTag( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pTagName /*const char **/ ) - { - return platform.ISteamUGC_AddRequiredTag( handle.Value, pTagName ); - } - - // bool - public bool BInitWorkshopForGameServer( DepotId_t unWorkshopDepotID /*DepotId_t*/, string pszFolder /*const char **/ ) - { - return platform.ISteamUGC_BInitWorkshopForGameServer( unWorkshopDepotID.Value, pszFolder ); - } - - // SteamAPICall_t - public CallbackHandle CreateItem( AppId_t nConsumerAppId /*AppId_t*/, WorkshopFileType eFileType /*EWorkshopFileType*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_CreateItem( nConsumerAppId.Value, eFileType ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return CreateItemResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // UGCQueryHandle_t - public UGCQueryHandle_t CreateQueryAllUGCRequest( UGCQuery eQueryType /*EUGCQuery*/, UGCMatchingUGCType eMatchingeMatchingUGCTypeFileType /*EUGCMatchingUGCType*/, AppId_t nCreatorAppID /*AppId_t*/, AppId_t nConsumerAppID /*AppId_t*/, uint unPage /*uint32*/ ) - { - return platform.ISteamUGC_CreateQueryAllUGCRequest( eQueryType, eMatchingeMatchingUGCTypeFileType, nCreatorAppID.Value, nConsumerAppID.Value, unPage ); - } - - // with: Detect_VectorReturn - // UGCQueryHandle_t - public UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t[] pvecPublishedFileID /*PublishedFileId_t **/ ) - { - var unNumPublishedFileIDs = (uint) pvecPublishedFileID.Length; - fixed ( PublishedFileId_t* pvecPublishedFileID_ptr = pvecPublishedFileID ) - { - return platform.ISteamUGC_CreateQueryUGCDetailsRequest( (IntPtr) pvecPublishedFileID_ptr, unNumPublishedFileIDs ); - } - } - - // UGCQueryHandle_t - public UGCQueryHandle_t CreateQueryUserUGCRequest( AccountID_t unAccountID /*AccountID_t*/, UserUGCList eListType /*EUserUGCList*/, UGCMatchingUGCType eMatchingUGCType /*EUGCMatchingUGCType*/, UserUGCListSortOrder eSortOrder /*EUserUGCListSortOrder*/, AppId_t nCreatorAppID /*AppId_t*/, AppId_t nConsumerAppID /*AppId_t*/, uint unPage /*uint32*/ ) - { - return platform.ISteamUGC_CreateQueryUserUGCRequest( unAccountID.Value, eListType, eMatchingUGCType, eSortOrder, nCreatorAppID.Value, nConsumerAppID.Value, unPage ); - } - - // SteamAPICall_t - public CallbackHandle DeleteItem( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_DeleteItem( nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return DeleteItemResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool DownloadItem( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, bool bHighPriority /*bool*/ ) - { - return platform.ISteamUGC_DownloadItem( nPublishedFileID.Value, bHighPriority ); - } - - // SteamAPICall_t - public CallbackHandle GetAppDependencies( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_GetAppDependencies( nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GetAppDependenciesResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, out ulong punBytesDownloaded /*uint64 **/, out ulong punBytesTotal /*uint64 **/ ) - { - return platform.ISteamUGC_GetItemDownloadInfo( nPublishedFileID.Value, out punBytesDownloaded, out punBytesTotal ); - } - - // bool - // with: Detect_StringFetch False - public bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, out ulong punSizeOnDisk /*uint64 **/, out string pchFolder /*char **/, out uint punTimeStamp /*uint32 **/ ) - { - bool bSuccess = default( bool ); - pchFolder = string.Empty; - System.Text.StringBuilder pchFolder_sb = Helpers.TakeStringBuilder(); - uint cchFolderSize = 4096; - bSuccess = platform.ISteamUGC_GetItemInstallInfo( nPublishedFileID.Value, out punSizeOnDisk, pchFolder_sb, cchFolderSize, out punTimeStamp ); - if ( !bSuccess ) return bSuccess; - pchFolder = pchFolder_sb.ToString(); - return bSuccess; - } - - // uint - public uint GetItemState( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/ ) - { - return platform.ISteamUGC_GetItemState( nPublishedFileID.Value ); - } - - // ItemUpdateStatus - public ItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, out ulong punBytesProcessed /*uint64 **/, out ulong punBytesTotal /*uint64 **/ ) - { - return platform.ISteamUGC_GetItemUpdateProgress( handle.Value, out punBytesProcessed, out punBytesTotal ); - } - - // uint - public uint GetNumSubscribedItems() - { - return platform.ISteamUGC_GetNumSubscribedItems(); - } - - // bool - // with: Detect_StringFetch False - // with: Detect_StringFetch False - public bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, uint previewIndex /*uint32*/, out string pchURLOrVideoID /*char **/, out string pchOriginalFileName /*char **/, out ItemPreviewType pPreviewType /*EItemPreviewType **/ ) - { - bool bSuccess = default( bool ); - pchURLOrVideoID = string.Empty; - System.Text.StringBuilder pchURLOrVideoID_sb = Helpers.TakeStringBuilder(); - uint cchURLSize = 4096; - pchOriginalFileName = string.Empty; - System.Text.StringBuilder pchOriginalFileName_sb = Helpers.TakeStringBuilder(); - uint cchOriginalFileNameSize = 4096; - bSuccess = platform.ISteamUGC_GetQueryUGCAdditionalPreview( handle.Value, index, previewIndex, pchURLOrVideoID_sb, cchURLSize, pchOriginalFileName_sb, cchOriginalFileNameSize, out pPreviewType ); - if ( !bSuccess ) return bSuccess; - pchOriginalFileName = pchOriginalFileName_sb.ToString(); - if ( !bSuccess ) return bSuccess; - pchURLOrVideoID = pchURLOrVideoID_sb.ToString(); - return bSuccess; - } - - // bool - public bool GetQueryUGCChildren( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, PublishedFileId_t* pvecPublishedFileID /*PublishedFileId_t **/, uint cMaxEntries /*uint32*/ ) - { - return platform.ISteamUGC_GetQueryUGCChildren( handle.Value, index, (IntPtr) pvecPublishedFileID, cMaxEntries ); - } - - // bool - // with: Detect_StringFetch False - // with: Detect_StringFetch False - public bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, uint keyValueTagIndex /*uint32*/, out string pchKey /*char **/, out string pchValue /*char **/ ) - { - bool bSuccess = default( bool ); - pchKey = string.Empty; - System.Text.StringBuilder pchKey_sb = Helpers.TakeStringBuilder(); - uint cchKeySize = 4096; - pchValue = string.Empty; - System.Text.StringBuilder pchValue_sb = Helpers.TakeStringBuilder(); - uint cchValueSize = 4096; - bSuccess = platform.ISteamUGC_GetQueryUGCKeyValueTag( handle.Value, index, keyValueTagIndex, pchKey_sb, cchKeySize, pchValue_sb, cchValueSize ); - if ( !bSuccess ) return bSuccess; - pchValue = pchValue_sb.ToString(); - if ( !bSuccess ) return bSuccess; - pchKey = pchKey_sb.ToString(); - return bSuccess; - } - - // bool - // with: Detect_StringFetch False - public bool GetQueryUGCMetadata( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, out string pchMetadata /*char **/ ) - { - bool bSuccess = default( bool ); - pchMetadata = string.Empty; - System.Text.StringBuilder pchMetadata_sb = Helpers.TakeStringBuilder(); - uint cchMetadatasize = 4096; - bSuccess = platform.ISteamUGC_GetQueryUGCMetadata( handle.Value, index, pchMetadata_sb, cchMetadatasize ); - if ( !bSuccess ) return bSuccess; - pchMetadata = pchMetadata_sb.ToString(); - return bSuccess; - } - - // uint - public uint GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/ ) - { - return platform.ISteamUGC_GetQueryUGCNumAdditionalPreviews( handle.Value, index ); - } - - // uint - public uint GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/ ) - { - return platform.ISteamUGC_GetQueryUGCNumKeyValueTags( handle.Value, index ); - } - - // bool - // with: Detect_StringFetch False - public bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, out string pchURL /*char **/ ) - { - bool bSuccess = default( bool ); - pchURL = string.Empty; - System.Text.StringBuilder pchURL_sb = Helpers.TakeStringBuilder(); - uint cchURLSize = 4096; - bSuccess = platform.ISteamUGC_GetQueryUGCPreviewURL( handle.Value, index, pchURL_sb, cchURLSize ); - if ( !bSuccess ) return bSuccess; - pchURL = pchURL_sb.ToString(); - return bSuccess; - } - - // bool - public bool GetQueryUGCResult( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, ref SteamUGCDetails_t pDetails /*struct SteamUGCDetails_t **/ ) - { - return platform.ISteamUGC_GetQueryUGCResult( handle.Value, index, ref pDetails ); - } - - // bool - public bool GetQueryUGCStatistic( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint index /*uint32*/, ItemStatistic eStatType /*EItemStatistic*/, out ulong pStatValue /*uint64 **/ ) - { - return platform.ISteamUGC_GetQueryUGCStatistic( handle.Value, index, eStatType, out pStatValue ); - } - - // uint - public uint GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID /*PublishedFileId_t **/, uint cMaxEntries /*uint32*/ ) - { - return platform.ISteamUGC_GetSubscribedItems( (IntPtr) pvecPublishedFileID, cMaxEntries ); - } - - // SteamAPICall_t - public CallbackHandle GetUserItemVote( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_GetUserItemVote( nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GetUserItemVoteResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle /*UGCQueryHandle_t*/ ) - { - return platform.ISteamUGC_ReleaseQueryUGCRequest( handle.Value ); - } - - // SteamAPICall_t - public CallbackHandle RemoveAppDependency( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, AppId_t nAppID /*AppId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_RemoveAppDependency( nPublishedFileID.Value, nAppID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoveAppDependencyResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RemoveDependency( PublishedFileId_t nParentPublishedFileID /*PublishedFileId_t*/, PublishedFileId_t nChildPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_RemoveDependency( nParentPublishedFileID.Value, nChildPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoveUGCDependencyResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RemoveItemFromFavorites( AppId_t nAppId /*AppId_t*/, PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_RemoveItemFromFavorites( nAppId.Value, nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return UserFavoriteItemsListChanged_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchKey /*const char **/ ) - { - return platform.ISteamUGC_RemoveItemKeyValueTags( handle.Value, pchKey ); - } - - // bool - public bool RemoveItemPreview( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/ ) - { - return platform.ISteamUGC_RemoveItemPreview( handle.Value, index ); - } - - // SteamAPICall_t - public SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, uint unMaxAgeSeconds /*uint32*/ ) - { - return platform.ISteamUGC_RequestUGCDetails( nPublishedFileID.Value, unMaxAgeSeconds ); - } - - // SteamAPICall_t - public CallbackHandle SendQueryUGCRequest( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_SendQueryUGCRequest( handle.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SteamUGCQueryCompleted_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool SetAllowCachedResponse( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint unMaxAgeSeconds /*uint32*/ ) - { - return platform.ISteamUGC_SetAllowCachedResponse( handle.Value, unMaxAgeSeconds ); - } - - // bool - public bool SetCloudFileNameFilter( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pMatchCloudFileName /*const char **/ ) - { - return platform.ISteamUGC_SetCloudFileNameFilter( handle.Value, pMatchCloudFileName ); - } - - // bool - public bool SetItemContent( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszContentFolder /*const char **/ ) - { - return platform.ISteamUGC_SetItemContent( handle.Value, pszContentFolder ); - } - - // bool - public bool SetItemDescription( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchDescription /*const char **/ ) - { - return platform.ISteamUGC_SetItemDescription( handle.Value, pchDescription ); - } - - // bool - public bool SetItemMetadata( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchMetaData /*const char **/ ) - { - return platform.ISteamUGC_SetItemMetadata( handle.Value, pchMetaData ); - } - - // bool - public bool SetItemPreview( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pszPreviewFile /*const char **/ ) - { - return platform.ISteamUGC_SetItemPreview( handle.Value, pszPreviewFile ); - } - - // bool - // using: Detect_StringArray - public bool SetItemTags( UGCUpdateHandle_t updateHandle /*UGCUpdateHandle_t*/, string[] pTags /*const struct SteamParamStringArray_t **/ ) - { - // Create strings - var nativeStrings = new IntPtr[pTags.Length]; - for ( int i = 0; i < pTags.Length; i++ ) - { - nativeStrings[i] = Marshal.StringToHGlobalAnsi( pTags[i] ); - } - try - { - - // Create string array - var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length; - var nativeArray = Marshal.AllocHGlobal( size ); - Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length ); - - // Create SteamParamStringArray_t - var tags = new SteamParamStringArray_t(); - tags.Strings = nativeArray; - tags.NumStrings = pTags.Length; - return platform.ISteamUGC_SetItemTags( updateHandle.Value, ref tags ); - } - finally - { - foreach ( var x in nativeStrings ) - Marshal.FreeHGlobal( x ); - - } - } - - // bool - public bool SetItemTitle( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchTitle /*const char **/ ) - { - return platform.ISteamUGC_SetItemTitle( handle.Value, pchTitle ); - } - - // bool - public bool SetItemUpdateLanguage( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchLanguage /*const char **/ ) - { - return platform.ISteamUGC_SetItemUpdateLanguage( handle.Value, pchLanguage ); - } - - // bool - public bool SetItemVisibility( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, RemoteStoragePublishedFileVisibility eVisibility /*ERemoteStoragePublishedFileVisibility*/ ) - { - return platform.ISteamUGC_SetItemVisibility( handle.Value, eVisibility ); - } - - // bool - public bool SetLanguage( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pchLanguage /*const char **/ ) - { - return platform.ISteamUGC_SetLanguage( handle.Value, pchLanguage ); - } - - // bool - public bool SetMatchAnyTag( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bMatchAnyTag /*bool*/ ) - { - return platform.ISteamUGC_SetMatchAnyTag( handle.Value, bMatchAnyTag ); - } - - // bool - public bool SetRankedByTrendDays( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint unDays /*uint32*/ ) - { - return platform.ISteamUGC_SetRankedByTrendDays( handle.Value, unDays ); - } - - // bool - public bool SetReturnAdditionalPreviews( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnAdditionalPreviews /*bool*/ ) - { - return platform.ISteamUGC_SetReturnAdditionalPreviews( handle.Value, bReturnAdditionalPreviews ); - } - - // bool - public bool SetReturnChildren( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnChildren /*bool*/ ) - { - return platform.ISteamUGC_SetReturnChildren( handle.Value, bReturnChildren ); - } - - // bool - public bool SetReturnKeyValueTags( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnKeyValueTags /*bool*/ ) - { - return platform.ISteamUGC_SetReturnKeyValueTags( handle.Value, bReturnKeyValueTags ); - } - - // bool - public bool SetReturnLongDescription( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnLongDescription /*bool*/ ) - { - return platform.ISteamUGC_SetReturnLongDescription( handle.Value, bReturnLongDescription ); - } - - // bool - public bool SetReturnMetadata( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnMetadata /*bool*/ ) - { - return platform.ISteamUGC_SetReturnMetadata( handle.Value, bReturnMetadata ); - } - - // bool - public bool SetReturnOnlyIDs( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnOnlyIDs /*bool*/ ) - { - return platform.ISteamUGC_SetReturnOnlyIDs( handle.Value, bReturnOnlyIDs ); - } - - // bool - public bool SetReturnPlaytimeStats( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, uint unDays /*uint32*/ ) - { - return platform.ISteamUGC_SetReturnPlaytimeStats( handle.Value, unDays ); - } - - // bool - public bool SetReturnTotalOnly( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, bool bReturnTotalOnly /*bool*/ ) - { - return platform.ISteamUGC_SetReturnTotalOnly( handle.Value, bReturnTotalOnly ); - } - - // bool - public bool SetSearchText( UGCQueryHandle_t handle /*UGCQueryHandle_t*/, string pSearchText /*const char **/ ) - { - return platform.ISteamUGC_SetSearchText( handle.Value, pSearchText ); - } - - // SteamAPICall_t - public CallbackHandle SetUserItemVote( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, bool bVoteUp /*bool*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_SetUserItemVote( nPublishedFileID.Value, bVoteUp ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SetUserItemVoteResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // UGCUpdateHandle_t - public UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId /*AppId_t*/, PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/ ) - { - return platform.ISteamUGC_StartItemUpdate( nConsumerAppId.Value, nPublishedFileID.Value ); - } - - // with: Detect_VectorReturn - // SteamAPICall_t - public CallbackHandle StartPlaytimeTracking( PublishedFileId_t[] pvecPublishedFileID /*PublishedFileId_t **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - var unNumPublishedFileIDs = (uint) pvecPublishedFileID.Length; - fixed ( PublishedFileId_t* pvecPublishedFileID_ptr = pvecPublishedFileID ) - { - callback = platform.ISteamUGC_StartPlaytimeTracking( (IntPtr) pvecPublishedFileID_ptr, unNumPublishedFileIDs ); - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return StartPlaytimeTrackingResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // with: Detect_VectorReturn - // SteamAPICall_t - public CallbackHandle StopPlaytimeTracking( PublishedFileId_t[] pvecPublishedFileID /*PublishedFileId_t **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - var unNumPublishedFileIDs = (uint) pvecPublishedFileID.Length; - fixed ( PublishedFileId_t* pvecPublishedFileID_ptr = pvecPublishedFileID ) - { - callback = platform.ISteamUGC_StopPlaytimeTracking( (IntPtr) pvecPublishedFileID_ptr, unNumPublishedFileIDs ); - } - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return StopPlaytimeTrackingResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle StopPlaytimeTrackingForAllItems( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_StopPlaytimeTrackingForAllItems(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return StopPlaytimeTrackingResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle SubmitItemUpdate( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, string pchChangeNote /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_SubmitItemUpdate( handle.Value, pchChangeNote ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return SubmitItemUpdateResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle SubscribeItem( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_SubscribeItem( nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageSubscribePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void SuspendDownloads( bool bSuspend /*bool*/ ) - { - platform.ISteamUGC_SuspendDownloads( bSuspend ); - } - - // SteamAPICall_t - public CallbackHandle UnsubscribeItem( PublishedFileId_t nPublishedFileID /*PublishedFileId_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUGC_UnsubscribeItem( nPublishedFileID.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return RemoteStorageUnsubscribePublishedFileResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool UpdateItemPreviewFile( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszPreviewFile /*const char **/ ) - { - return platform.ISteamUGC_UpdateItemPreviewFile( handle.Value, index, pszPreviewFile ); - } - - // bool - public bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle /*UGCUpdateHandle_t*/, uint index /*uint32*/, string pszVideoID /*const char **/ ) - { - return platform.ISteamUGC_UpdateItemPreviewVideo( handle.Value, index, pszVideoID ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUser.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUser.cs deleted file mode 100644 index 443cee6..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUser.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamUser : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamUser( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void AdvertiseGame( CSteamID steamIDGameServer /*class CSteamID*/, uint unIPServer /*uint32*/, ushort usPortServer /*uint16*/ ) - { - platform.ISteamUser_AdvertiseGame( steamIDGameServer.Value, unIPServer, usPortServer ); - } - - // BeginAuthSessionResult - public BeginAuthSessionResult BeginAuthSession( IntPtr pAuthTicket /*const void **/, int cbAuthTicket /*int*/, CSteamID steamID /*class CSteamID*/ ) - { - return platform.ISteamUser_BeginAuthSession( (IntPtr) pAuthTicket, cbAuthTicket, steamID.Value ); - } - - // bool - public bool BIsBehindNAT() - { - return platform.ISteamUser_BIsBehindNAT(); - } - - // bool - public bool BIsPhoneIdentifying() - { - return platform.ISteamUser_BIsPhoneIdentifying(); - } - - // bool - public bool BIsPhoneRequiringVerification() - { - return platform.ISteamUser_BIsPhoneRequiringVerification(); - } - - // bool - public bool BIsPhoneVerified() - { - return platform.ISteamUser_BIsPhoneVerified(); - } - - // bool - public bool BIsTwoFactorEnabled() - { - return platform.ISteamUser_BIsTwoFactorEnabled(); - } - - // bool - public bool BLoggedOn() - { - return platform.ISteamUser_BLoggedOn(); - } - - // void - public void CancelAuthTicket( HAuthTicket hAuthTicket /*HAuthTicket*/ ) - { - platform.ISteamUser_CancelAuthTicket( hAuthTicket.Value ); - } - - // VoiceResult - public VoiceResult DecompressVoice( IntPtr pCompressed /*const void **/, uint cbCompressed /*uint32*/, IntPtr pDestBuffer /*void **/, uint cbDestBufferSize /*uint32*/, out uint nBytesWritten /*uint32 **/, uint nDesiredSampleRate /*uint32*/ ) - { - return platform.ISteamUser_DecompressVoice( (IntPtr) pCompressed, cbCompressed, (IntPtr) pDestBuffer, cbDestBufferSize, out nBytesWritten, nDesiredSampleRate ); - } - - // void - public void EndAuthSession( CSteamID steamID /*class CSteamID*/ ) - { - platform.ISteamUser_EndAuthSession( steamID.Value ); - } - - // HAuthTicket - public HAuthTicket GetAuthSessionTicket( IntPtr pTicket /*void **/, int cbMaxTicket /*int*/, out uint pcbTicket /*uint32 **/ ) - { - return platform.ISteamUser_GetAuthSessionTicket( (IntPtr) pTicket, cbMaxTicket, out pcbTicket ); - } - - // VoiceResult - public VoiceResult GetAvailableVoice( out uint pcbCompressed /*uint32 **/, out uint pcbUncompressed_Deprecated /*uint32 **/, uint nUncompressedVoiceDesiredSampleRate_Deprecated /*uint32*/ ) - { - return platform.ISteamUser_GetAvailableVoice( out pcbCompressed, out pcbUncompressed_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); - } - - // bool - public bool GetEncryptedAppTicket( IntPtr pTicket /*void **/, int cbMaxTicket /*int*/, out uint pcbTicket /*uint32 **/ ) - { - return platform.ISteamUser_GetEncryptedAppTicket( (IntPtr) pTicket, cbMaxTicket, out pcbTicket ); - } - - // int - public int GetGameBadgeLevel( int nSeries /*int*/, bool bFoil /*bool*/ ) - { - return platform.ISteamUser_GetGameBadgeLevel( nSeries, bFoil ); - } - - // HSteamUser - public HSteamUser GetHSteamUser() - { - return platform.ISteamUser_GetHSteamUser(); - } - - // int - public int GetPlayerSteamLevel() - { - return platform.ISteamUser_GetPlayerSteamLevel(); - } - - // ulong - public ulong GetSteamID() - { - return platform.ISteamUser_GetSteamID(); - } - - // bool - // with: Detect_StringFetch True - public string GetUserDataFolder() - { - bool bSuccess = default( bool ); - System.Text.StringBuilder pchBuffer_sb = Helpers.TakeStringBuilder(); - int cubBuffer = 4096; - bSuccess = platform.ISteamUser_GetUserDataFolder( pchBuffer_sb, cubBuffer ); - if ( !bSuccess ) return null; - return pchBuffer_sb.ToString(); - } - - // VoiceResult - public VoiceResult GetVoice( bool bWantCompressed /*bool*/, IntPtr pDestBuffer /*void **/, uint cbDestBufferSize /*uint32*/, out uint nBytesWritten /*uint32 **/, bool bWantUncompressed_Deprecated /*bool*/, IntPtr pUncompressedDestBuffer_Deprecated /*void **/, uint cbUncompressedDestBufferSize_Deprecated /*uint32*/, out uint nUncompressBytesWritten_Deprecated /*uint32 **/, uint nUncompressedVoiceDesiredSampleRate_Deprecated /*uint32*/ ) - { - return platform.ISteamUser_GetVoice( bWantCompressed, (IntPtr) pDestBuffer, cbDestBufferSize, out nBytesWritten, bWantUncompressed_Deprecated, (IntPtr) pUncompressedDestBuffer_Deprecated, cbUncompressedDestBufferSize_Deprecated, out nUncompressBytesWritten_Deprecated, nUncompressedVoiceDesiredSampleRate_Deprecated ); - } - - // uint - public uint GetVoiceOptimalSampleRate() - { - return platform.ISteamUser_GetVoiceOptimalSampleRate(); - } - - // int - public int InitiateGameConnection( IntPtr pAuthBlob /*void **/, int cbMaxAuthBlob /*int*/, CSteamID steamIDGameServer /*class CSteamID*/, uint unIPServer /*uint32*/, ushort usPortServer /*uint16*/, bool bSecure /*bool*/ ) - { - return platform.ISteamUser_InitiateGameConnection( (IntPtr) pAuthBlob, cbMaxAuthBlob, steamIDGameServer.Value, unIPServer, usPortServer, bSecure ); - } - - // SteamAPICall_t - public CallbackHandle RequestEncryptedAppTicket( IntPtr pDataToInclude /*void **/, int cbDataToInclude /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUser_RequestEncryptedAppTicket( (IntPtr) pDataToInclude, cbDataToInclude ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return EncryptedAppTicketResponse_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RequestStoreAuthURL( string pchRedirectURL /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUser_RequestStoreAuthURL( pchRedirectURL ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return StoreAuthURLResponse_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // void - public void StartVoiceRecording() - { - platform.ISteamUser_StartVoiceRecording(); - } - - // void - public void StopVoiceRecording() - { - platform.ISteamUser_StopVoiceRecording(); - } - - // void - public void TerminateGameConnection( uint unIPServer /*uint32*/, ushort usPortServer /*uint16*/ ) - { - platform.ISteamUser_TerminateGameConnection( unIPServer, usPortServer ); - } - - // void - public void TrackAppUsageEvent( CGameID gameID /*class CGameID*/, int eAppUsageEvent /*int*/, string pchExtraInfo /*const char **/ ) - { - platform.ISteamUser_TrackAppUsageEvent( gameID.Value, eAppUsageEvent, pchExtraInfo ); - } - - // UserHasLicenseForAppResult - public UserHasLicenseForAppResult UserHasLicenseForApp( CSteamID steamID /*class CSteamID*/, AppId_t appID /*AppId_t*/ ) - { - return platform.ISteamUser_UserHasLicenseForApp( steamID.Value, appID.Value ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUserStats.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUserStats.cs deleted file mode 100644 index c7c3e16..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUserStats.cs +++ /dev/null @@ -1,390 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamUserStats : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamUserStats( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // SteamAPICall_t - public CallbackHandle AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/, UGCHandle_t hUGC /*UGCHandle_t*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_AttachLeaderboardUGC( hSteamLeaderboard.Value, hUGC.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardUGCSet_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool ClearAchievement( string pchName /*const char **/ ) - { - return platform.ISteamUserStats_ClearAchievement( pchName ); - } - - // SteamAPICall_t - public CallbackHandle DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/, LeaderboardDataRequest eLeaderboardDataRequest /*ELeaderboardDataRequest*/, int nRangeStart /*int*/, int nRangeEnd /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_DownloadLeaderboardEntries( hSteamLeaderboard.Value, eLeaderboardDataRequest, nRangeStart, nRangeEnd ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardScoresDownloaded_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/, IntPtr prgUsers /*class CSteamID **/, int cUsers /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_DownloadLeaderboardEntriesForUsers( hSteamLeaderboard.Value, (IntPtr) prgUsers, cUsers ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardScoresDownloaded_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle FindLeaderboard( string pchLeaderboardName /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_FindLeaderboard( pchLeaderboardName ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardFindResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle FindOrCreateLeaderboard( string pchLeaderboardName /*const char **/, LeaderboardSortMethod eLeaderboardSortMethod /*ELeaderboardSortMethod*/, LeaderboardDisplayType eLeaderboardDisplayType /*ELeaderboardDisplayType*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_FindOrCreateLeaderboard( pchLeaderboardName, eLeaderboardSortMethod, eLeaderboardDisplayType ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardFindResult_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool GetAchievement( string pchName /*const char **/, ref bool pbAchieved /*bool **/ ) - { - return platform.ISteamUserStats_GetAchievement( pchName, ref pbAchieved ); - } - - // bool - public bool GetAchievementAchievedPercent( string pchName /*const char **/, out float pflPercent /*float **/ ) - { - return platform.ISteamUserStats_GetAchievementAchievedPercent( pchName, out pflPercent ); - } - - // bool - public bool GetAchievementAndUnlockTime( string pchName /*const char **/, ref bool pbAchieved /*bool **/, out uint punUnlockTime /*uint32 **/ ) - { - return platform.ISteamUserStats_GetAchievementAndUnlockTime( pchName, ref pbAchieved, out punUnlockTime ); - } - - // string - // with: Detect_StringReturn - public string GetAchievementDisplayAttribute( string pchName /*const char **/, string pchKey /*const char **/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamUserStats_GetAchievementDisplayAttribute( pchName, pchKey ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // int - public int GetAchievementIcon( string pchName /*const char **/ ) - { - return platform.ISteamUserStats_GetAchievementIcon( pchName ); - } - - // string - // with: Detect_StringReturn - public string GetAchievementName( uint iAchievement /*uint32*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamUserStats_GetAchievementName( iAchievement ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // bool - public bool GetDownloadedLeaderboardEntry( SteamLeaderboardEntries_t hSteamLeaderboardEntries /*SteamLeaderboardEntries_t*/, int index /*int*/, ref LeaderboardEntry_t pLeaderboardEntry /*struct LeaderboardEntry_t **/, IntPtr pDetails /*int32 **/, int cDetailsMax /*int*/ ) - { - return platform.ISteamUserStats_GetDownloadedLeaderboardEntry( hSteamLeaderboardEntries.Value, index, ref pLeaderboardEntry, (IntPtr) pDetails, cDetailsMax ); - } - - // bool - public bool GetGlobalStat( string pchStatName /*const char **/, out long pData /*int64 **/ ) - { - return platform.ISteamUserStats_GetGlobalStat( pchStatName, out pData ); - } - - // bool - public bool GetGlobalStat0( string pchStatName /*const char **/, out double pData /*double **/ ) - { - return platform.ISteamUserStats_GetGlobalStat0( pchStatName, out pData ); - } - - // int - public int GetGlobalStatHistory( string pchStatName /*const char **/, out long pData /*int64 **/, uint cubData /*uint32*/ ) - { - return platform.ISteamUserStats_GetGlobalStatHistory( pchStatName, out pData, cubData ); - } - - // int - public int GetGlobalStatHistory0( string pchStatName /*const char **/, out double pData /*double **/, uint cubData /*uint32*/ ) - { - return platform.ISteamUserStats_GetGlobalStatHistory0( pchStatName, out pData, cubData ); - } - - // LeaderboardDisplayType - public LeaderboardDisplayType GetLeaderboardDisplayType( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/ ) - { - return platform.ISteamUserStats_GetLeaderboardDisplayType( hSteamLeaderboard.Value ); - } - - // int - public int GetLeaderboardEntryCount( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/ ) - { - return platform.ISteamUserStats_GetLeaderboardEntryCount( hSteamLeaderboard.Value ); - } - - // string - // with: Detect_StringReturn - public string GetLeaderboardName( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/ ) - { - IntPtr string_pointer; - string_pointer = platform.ISteamUserStats_GetLeaderboardName( hSteamLeaderboard.Value ); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // LeaderboardSortMethod - public LeaderboardSortMethod GetLeaderboardSortMethod( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/ ) - { - return platform.ISteamUserStats_GetLeaderboardSortMethod( hSteamLeaderboard.Value ); - } - - // int - // with: Detect_StringFetch False - public int GetMostAchievedAchievementInfo( out string pchName /*char **/, out float pflPercent /*float **/, ref bool pbAchieved /*bool **/ ) - { - int bSuccess = default( int ); - pchName = string.Empty; - System.Text.StringBuilder pchName_sb = Helpers.TakeStringBuilder(); - uint unNameBufLen = 4096; - bSuccess = platform.ISteamUserStats_GetMostAchievedAchievementInfo( pchName_sb, unNameBufLen, out pflPercent, ref pbAchieved ); - if ( bSuccess <= 0 ) return bSuccess; - pchName = pchName_sb.ToString(); - return bSuccess; - } - - // int - // with: Detect_StringFetch False - public int GetNextMostAchievedAchievementInfo( int iIteratorPrevious /*int*/, out string pchName /*char **/, out float pflPercent /*float **/, ref bool pbAchieved /*bool **/ ) - { - int bSuccess = default( int ); - pchName = string.Empty; - System.Text.StringBuilder pchName_sb = Helpers.TakeStringBuilder(); - uint unNameBufLen = 4096; - bSuccess = platform.ISteamUserStats_GetNextMostAchievedAchievementInfo( iIteratorPrevious, pchName_sb, unNameBufLen, out pflPercent, ref pbAchieved ); - if ( bSuccess <= 0 ) return bSuccess; - pchName = pchName_sb.ToString(); - return bSuccess; - } - - // uint - public uint GetNumAchievements() - { - return platform.ISteamUserStats_GetNumAchievements(); - } - - // SteamAPICall_t - public CallbackHandle GetNumberOfCurrentPlayers( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_GetNumberOfCurrentPlayers(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return NumberOfCurrentPlayers_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool GetStat( string pchName /*const char **/, out int pData /*int32 **/ ) - { - return platform.ISteamUserStats_GetStat( pchName, out pData ); - } - - // bool - public bool GetStat0( string pchName /*const char **/, out float pData /*float **/ ) - { - return platform.ISteamUserStats_GetStat0( pchName, out pData ); - } - - // bool - public bool GetUserAchievement( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, ref bool pbAchieved /*bool **/ ) - { - return platform.ISteamUserStats_GetUserAchievement( steamIDUser.Value, pchName, ref pbAchieved ); - } - - // bool - public bool GetUserAchievementAndUnlockTime( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, ref bool pbAchieved /*bool **/, out uint punUnlockTime /*uint32 **/ ) - { - return platform.ISteamUserStats_GetUserAchievementAndUnlockTime( steamIDUser.Value, pchName, ref pbAchieved, out punUnlockTime ); - } - - // bool - public bool GetUserStat( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, out int pData /*int32 **/ ) - { - return platform.ISteamUserStats_GetUserStat( steamIDUser.Value, pchName, out pData ); - } - - // bool - public bool GetUserStat0( CSteamID steamIDUser /*class CSteamID*/, string pchName /*const char **/, out float pData /*float **/ ) - { - return platform.ISteamUserStats_GetUserStat0( steamIDUser.Value, pchName, out pData ); - } - - // bool - public bool IndicateAchievementProgress( string pchName /*const char **/, uint nCurProgress /*uint32*/, uint nMaxProgress /*uint32*/ ) - { - return platform.ISteamUserStats_IndicateAchievementProgress( pchName, nCurProgress, nMaxProgress ); - } - - // bool - public bool RequestCurrentStats() - { - return platform.ISteamUserStats_RequestCurrentStats(); - } - - // SteamAPICall_t - public CallbackHandle RequestGlobalAchievementPercentages( Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_RequestGlobalAchievementPercentages(); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GlobalAchievementPercentagesReady_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RequestGlobalStats( int nHistoryDays /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_RequestGlobalStats( nHistoryDays ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return GlobalStatsReceived_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICall_t - public CallbackHandle RequestUserStats( CSteamID steamIDUser /*class CSteamID*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_RequestUserStats( steamIDUser.Value ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return UserStatsReceived_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // bool - public bool ResetAllStats( bool bAchievementsToo /*bool*/ ) - { - return platform.ISteamUserStats_ResetAllStats( bAchievementsToo ); - } - - // bool - public bool SetAchievement( string pchName /*const char **/ ) - { - return platform.ISteamUserStats_SetAchievement( pchName ); - } - - // bool - public bool SetStat( string pchName /*const char **/, int nData /*int32*/ ) - { - return platform.ISteamUserStats_SetStat( pchName, nData ); - } - - // bool - public bool SetStat0( string pchName /*const char **/, float fData /*float*/ ) - { - return platform.ISteamUserStats_SetStat0( pchName, fData ); - } - - // bool - public bool StoreStats() - { - return platform.ISteamUserStats_StoreStats(); - } - - // bool - public bool UpdateAvgRateStat( string pchName /*const char **/, float flCountThisSession /*float*/, double dSessionLength /*double*/ ) - { - return platform.ISteamUserStats_UpdateAvgRateStat( pchName, flCountThisSession, dSessionLength ); - } - - // SteamAPICall_t - public CallbackHandle UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard /*SteamLeaderboard_t*/, LeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod /*ELeaderboardUploadScoreMethod*/, int nScore /*int32*/, int[] pScoreDetails /*const int32 **/, int cScoreDetailsCount /*int*/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUserStats_UploadLeaderboardScore( hSteamLeaderboard.Value, eLeaderboardUploadScoreMethod, nScore, pScoreDetails, cScoreDetailsCount ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return LeaderboardScoreUploaded_t.CallResult( steamworks, callback, CallbackFunction ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUtils.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamUtils.cs deleted file mode 100644 index dec7642..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamUtils.cs +++ /dev/null @@ -1,239 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamUtils : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamUtils( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // bool - public bool BOverlayNeedsPresent() - { - return platform.ISteamUtils_BOverlayNeedsPresent(); - } - - // SteamAPICall_t - public CallbackHandle CheckFileSignature( string szFileName /*const char **/, Action CallbackFunction = null /*Action*/ ) - { - SteamAPICall_t callback = 0; - callback = platform.ISteamUtils_CheckFileSignature( szFileName ); - - if ( CallbackFunction == null ) return null; - if ( callback == 0 ) return null; - - return CheckFileSignature_t.CallResult( steamworks, callback, CallbackFunction ); - } - - // SteamAPICallFailure - public SteamAPICallFailure GetAPICallFailureReason( SteamAPICall_t hSteamAPICall /*SteamAPICall_t*/ ) - { - return platform.ISteamUtils_GetAPICallFailureReason( hSteamAPICall.Value ); - } - - // bool - public bool GetAPICallResult( SteamAPICall_t hSteamAPICall /*SteamAPICall_t*/, IntPtr pCallback /*void **/, int cubCallback /*int*/, int iCallbackExpected /*int*/, ref bool pbFailed /*bool **/ ) - { - return platform.ISteamUtils_GetAPICallResult( hSteamAPICall.Value, (IntPtr) pCallback, cubCallback, iCallbackExpected, ref pbFailed ); - } - - // uint - public uint GetAppID() - { - return platform.ISteamUtils_GetAppID(); - } - - // Universe - public Universe GetConnectedUniverse() - { - return platform.ISteamUtils_GetConnectedUniverse(); - } - - // bool - public bool GetCSERIPPort( out uint unIP /*uint32 **/, out ushort usPort /*uint16 **/ ) - { - return platform.ISteamUtils_GetCSERIPPort( out unIP, out usPort ); - } - - // byte - public byte GetCurrentBatteryPower() - { - return platform.ISteamUtils_GetCurrentBatteryPower(); - } - - // bool - // with: Detect_StringFetch True - public string GetEnteredGamepadTextInput() - { - bool bSuccess = default( bool ); - System.Text.StringBuilder pchText_sb = Helpers.TakeStringBuilder(); - uint cchText = 4096; - bSuccess = platform.ISteamUtils_GetEnteredGamepadTextInput( pchText_sb, cchText ); - if ( !bSuccess ) return null; - return pchText_sb.ToString(); - } - - // uint - public uint GetEnteredGamepadTextLength() - { - return platform.ISteamUtils_GetEnteredGamepadTextLength(); - } - - // bool - public bool GetImageRGBA( int iImage /*int*/, IntPtr pubDest /*uint8 **/, int nDestBufferSize /*int*/ ) - { - return platform.ISteamUtils_GetImageRGBA( iImage, (IntPtr) pubDest, nDestBufferSize ); - } - - // bool - public bool GetImageSize( int iImage /*int*/, out uint pnWidth /*uint32 **/, out uint pnHeight /*uint32 **/ ) - { - return platform.ISteamUtils_GetImageSize( iImage, out pnWidth, out pnHeight ); - } - - // uint - public uint GetIPCCallCount() - { - return platform.ISteamUtils_GetIPCCallCount(); - } - - // string - // with: Detect_StringReturn - public string GetIPCountry() - { - IntPtr string_pointer; - string_pointer = platform.ISteamUtils_GetIPCountry(); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // uint - public uint GetSecondsSinceAppActive() - { - return platform.ISteamUtils_GetSecondsSinceAppActive(); - } - - // uint - public uint GetSecondsSinceComputerActive() - { - return platform.ISteamUtils_GetSecondsSinceComputerActive(); - } - - // uint - public uint GetServerRealTime() - { - return platform.ISteamUtils_GetServerRealTime(); - } - - // string - // with: Detect_StringReturn - public string GetSteamUILanguage() - { - IntPtr string_pointer; - string_pointer = platform.ISteamUtils_GetSteamUILanguage(); - return Marshal.PtrToStringAnsi( string_pointer ); - } - - // bool - public bool IsAPICallCompleted( SteamAPICall_t hSteamAPICall /*SteamAPICall_t*/, ref bool pbFailed /*bool **/ ) - { - return platform.ISteamUtils_IsAPICallCompleted( hSteamAPICall.Value, ref pbFailed ); - } - - // bool - public bool IsOverlayEnabled() - { - return platform.ISteamUtils_IsOverlayEnabled(); - } - - // bool - public bool IsSteamInBigPictureMode() - { - return platform.ISteamUtils_IsSteamInBigPictureMode(); - } - - // bool - public bool IsSteamRunningInVR() - { - return platform.ISteamUtils_IsSteamRunningInVR(); - } - - // bool - public bool IsVRHeadsetStreamingEnabled() - { - return platform.ISteamUtils_IsVRHeadsetStreamingEnabled(); - } - - // void - public void SetOverlayNotificationInset( int nHorizontalInset /*int*/, int nVerticalInset /*int*/ ) - { - platform.ISteamUtils_SetOverlayNotificationInset( nHorizontalInset, nVerticalInset ); - } - - // void - public void SetOverlayNotificationPosition( NotificationPosition eNotificationPosition /*ENotificationPosition*/ ) - { - platform.ISteamUtils_SetOverlayNotificationPosition( eNotificationPosition ); - } - - // void - public void SetVRHeadsetStreamingEnabled( bool bEnabled /*bool*/ ) - { - platform.ISteamUtils_SetVRHeadsetStreamingEnabled( bEnabled ); - } - - // void - public void SetWarningMessageHook( IntPtr pFunction /*SteamAPIWarningMessageHook_t*/ ) - { - platform.ISteamUtils_SetWarningMessageHook( (IntPtr) pFunction ); - } - - // bool - public bool ShowGamepadTextInput( GamepadTextInputMode eInputMode /*EGamepadTextInputMode*/, GamepadTextInputLineMode eLineInputMode /*EGamepadTextInputLineMode*/, string pchDescription /*const char **/, uint unCharMax /*uint32*/, string pchExistingText /*const char **/ ) - { - return platform.ISteamUtils_ShowGamepadTextInput( eInputMode, eLineInputMode, pchDescription, unCharMax, pchExistingText ); - } - - // void - public void StartVRDashboard() - { - platform.ISteamUtils_StartVRDashboard(); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.SteamVideo.cs b/Facepunch.Steamworks/SteamNative/SteamNative.SteamVideo.cs deleted file mode 100644 index a0e1852..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.SteamVideo.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal unsafe class SteamVideo : IDisposable - { - // - // Holds a platform specific implentation - // - internal Platform.Interface platform; - internal Facepunch.Steamworks.BaseSteamworks steamworks; - - // - // Constructor decides which implementation to use based on current platform - // - internal SteamVideo( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer ) - { - this.steamworks = steamworks; - - if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer ); - else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer ); - else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer ); - else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer ); - else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer ); - } - - // - // Class is invalid if we don't have a valid implementation - // - public bool IsValid{ get{ return platform != null && platform.IsValid; } } - - // - // When shutting down clear all the internals to avoid accidental use - // - public virtual void Dispose() - { - if ( platform != null ) - { - platform.Dispose(); - platform = null; - } - } - - // void - public void GetOPFSettings( AppId_t unVideoAppID /*AppId_t*/ ) - { - platform.ISteamVideo_GetOPFSettings( unVideoAppID.Value ); - } - - // bool - // with: Detect_StringFetch True - public string GetOPFStringForApp( AppId_t unVideoAppID /*AppId_t*/ ) - { - bool bSuccess = default( bool ); - System.Text.StringBuilder pchBuffer_sb = Helpers.TakeStringBuilder(); - int pnBufferSize = 4096; - bSuccess = platform.ISteamVideo_GetOPFStringForApp( unVideoAppID.Value, pchBuffer_sb, out pnBufferSize ); - if ( !bSuccess ) return null; - return pchBuffer_sb.ToString(); - } - - // void - public void GetVideoURL( AppId_t unVideoAppID /*AppId_t*/ ) - { - platform.ISteamVideo_GetVideoURL( unVideoAppID.Value ); - } - - // bool - public bool IsBroadcasting( IntPtr pnNumViewers /*int **/ ) - { - return platform.ISteamVideo_IsBroadcasting( (IntPtr) pnNumViewers ); - } - - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs deleted file mode 100644 index a37a3c1..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Structs.cs +++ /dev/null @@ -1,31620 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct CallbackMsg_t - { - internal int SteamUser; // m_hSteamUser HSteamUser - internal int Callback; // m_iCallback int - internal IntPtr ParamPtr; // m_pubParam uint8 * - internal int ParamCount; // m_cubParam int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static CallbackMsg_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (CallbackMsg_t) Marshal.PtrToStructure( p, typeof(CallbackMsg_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(CallbackMsg_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int SteamUser; // m_hSteamUser HSteamUser - internal int Callback; // m_iCallback int - internal IntPtr ParamPtr; // m_pubParam uint8 * - internal int ParamCount; // m_cubParam int - - // - // Easily convert from PackSmall to CallbackMsg_t - // - public static implicit operator CallbackMsg_t ( CallbackMsg_t.PackSmall d ) - { - return new CallbackMsg_t() - { - SteamUser = d.SteamUser, - Callback = d.Callback, - ParamPtr = d.ParamPtr, - ParamCount = d.ParamCount, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamServerConnectFailure_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 2; - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool StillRetrying; // m_bStillRetrying _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamServerConnectFailure_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamServerConnectFailure_t) Marshal.PtrToStructure( p, typeof(SteamServerConnectFailure_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServerConnectFailure_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool StillRetrying; // m_bStillRetrying _Bool - - // - // Easily convert from PackSmall to SteamServerConnectFailure_t - // - public static implicit operator SteamServerConnectFailure_t ( SteamServerConnectFailure_t.PackSmall d ) - { - return new SteamServerConnectFailure_t() - { - Result = d.Result, - StillRetrying = d.StillRetrying, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamServersDisconnected_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 3; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamServersDisconnected_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamServersDisconnected_t) Marshal.PtrToStructure( p, typeof(SteamServersDisconnected_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersDisconnected_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to SteamServersDisconnected_t - // - public static implicit operator SteamServersDisconnected_t ( SteamServersDisconnected_t.PackSmall d ) - { - return new SteamServersDisconnected_t() - { - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ClientGameServerDeny_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 13; - internal uint AppID; // m_uAppID uint32 - internal uint GameServerIP; // m_unGameServerIP uint32 - internal ushort GameServerPort; // m_usGameServerPort uint16 - internal ushort Secure; // m_bSecure uint16 - internal uint Reason; // m_uReason uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ClientGameServerDeny_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ClientGameServerDeny_t) Marshal.PtrToStructure( p, typeof(ClientGameServerDeny_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClientGameServerDeny_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_uAppID uint32 - internal uint GameServerIP; // m_unGameServerIP uint32 - internal ushort GameServerPort; // m_usGameServerPort uint16 - internal ushort Secure; // m_bSecure uint16 - internal uint Reason; // m_uReason uint32 - - // - // Easily convert from PackSmall to ClientGameServerDeny_t - // - public static implicit operator ClientGameServerDeny_t ( ClientGameServerDeny_t.PackSmall d ) - { - return new ClientGameServerDeny_t() - { - AppID = d.AppID, - GameServerIP = d.GameServerIP, - GameServerPort = d.GameServerPort, - Secure = d.Secure, - Reason = d.Reason, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct ValidateAuthTicketResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 43; - internal ulong SteamID; // m_SteamID class CSteamID - internal AuthSessionResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse - internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ValidateAuthTicketResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ValidateAuthTicketResponse_t) Marshal.PtrToStructure( p, typeof(ValidateAuthTicketResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ValidateAuthTicketResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_SteamID class CSteamID - internal AuthSessionResponse AuthSessionResponse; // m_eAuthSessionResponse enum EAuthSessionResponse - internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID - - // - // Easily convert from PackSmall to ValidateAuthTicketResponse_t - // - public static implicit operator ValidateAuthTicketResponse_t ( ValidateAuthTicketResponse_t.PackSmall d ) - { - return new ValidateAuthTicketResponse_t() - { - SteamID = d.SteamID, - AuthSessionResponse = d.AuthSessionResponse, - OwnerSteamID = d.OwnerSteamID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MicroTxnAuthorizationResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 52; - internal uint AppID; // m_unAppID uint32 - internal ulong OrderID; // m_ulOrderID uint64 - internal byte Authorized; // m_bAuthorized uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MicroTxnAuthorizationResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MicroTxnAuthorizationResponse_t) Marshal.PtrToStructure( p, typeof(MicroTxnAuthorizationResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MicroTxnAuthorizationResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_unAppID uint32 - internal ulong OrderID; // m_ulOrderID uint64 - internal byte Authorized; // m_bAuthorized uint8 - - // - // Easily convert from PackSmall to MicroTxnAuthorizationResponse_t - // - public static implicit operator MicroTxnAuthorizationResponse_t ( MicroTxnAuthorizationResponse_t.PackSmall d ) - { - return new MicroTxnAuthorizationResponse_t() - { - AppID = d.AppID, - OrderID = d.OrderID, - Authorized = d.Authorized, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct EncryptedAppTicketResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 54; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static EncryptedAppTicketResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (EncryptedAppTicketResponse_t) Marshal.PtrToStructure( p, typeof(EncryptedAppTicketResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(EncryptedAppTicketResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to EncryptedAppTicketResponse_t - // - public static implicit operator EncryptedAppTicketResponse_t ( EncryptedAppTicketResponse_t.PackSmall d ) - { - return new EncryptedAppTicketResponse_t() - { - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GetAuthSessionTicketResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 63; - internal uint AuthTicket; // m_hAuthTicket HAuthTicket - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GetAuthSessionTicketResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GetAuthSessionTicketResponse_t) Marshal.PtrToStructure( p, typeof(GetAuthSessionTicketResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAuthSessionTicketResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AuthTicket; // m_hAuthTicket HAuthTicket - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to GetAuthSessionTicketResponse_t - // - public static implicit operator GetAuthSessionTicketResponse_t ( GetAuthSessionTicketResponse_t.PackSmall d ) - { - return new GetAuthSessionTicketResponse_t() - { - AuthTicket = d.AuthTicket, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GameWebCallback_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 64; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_szURL char [256] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameWebCallback_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameWebCallback_t) Marshal.PtrToStructure( p, typeof(GameWebCallback_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameWebCallback_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_szURL char [256] - - // - // Easily convert from PackSmall to GameWebCallback_t - // - public static implicit operator GameWebCallback_t ( GameWebCallback_t.PackSmall d ) - { - return new GameWebCallback_t() - { - URL = d.URL, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct StoreAuthURLResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 65; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] - internal string URL; // m_szURL char [512] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static StoreAuthURLResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (StoreAuthURLResponse_t) Marshal.PtrToStructure( p, typeof(StoreAuthURLResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(StoreAuthURLResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] - internal string URL; // m_szURL char [512] - - // - // Easily convert from PackSmall to StoreAuthURLResponse_t - // - public static implicit operator StoreAuthURLResponse_t ( StoreAuthURLResponse_t.PackSmall d ) - { - return new StoreAuthURLResponse_t() - { - URL = d.URL, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct FriendGameInfo_t - { - internal ulong GameID; // m_gameID class CGameID - internal uint GameIP; // m_unGameIP uint32 - internal ushort GamePort; // m_usGamePort uint16 - internal ushort QueryPort; // m_usQueryPort uint16 - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendGameInfo_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendGameInfo_t) Marshal.PtrToStructure( p, typeof(FriendGameInfo_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendGameInfo_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_gameID class CGameID - internal uint GameIP; // m_unGameIP uint32 - internal ushort GamePort; // m_usGamePort uint16 - internal ushort QueryPort; // m_usQueryPort uint16 - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - - // - // Easily convert from PackSmall to FriendGameInfo_t - // - public static implicit operator FriendGameInfo_t ( FriendGameInfo_t.PackSmall d ) - { - return new FriendGameInfo_t() - { - GameID = d.GameID, - GameIP = d.GameIP, - GamePort = d.GamePort, - QueryPort = d.QueryPort, - SteamIDLobby = d.SteamIDLobby, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct FriendSessionStateInfo_t - { - internal uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 - internal byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendSessionStateInfo_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendSessionStateInfo_t) Marshal.PtrToStructure( p, typeof(FriendSessionStateInfo_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendSessionStateInfo_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint IOnlineSessionInstances; // m_uiOnlineSessionInstances uint32 - internal byte IPublishedToFriendsSessionInstance; // m_uiPublishedToFriendsSessionInstance uint8 - - // - // Easily convert from PackSmall to FriendSessionStateInfo_t - // - public static implicit operator FriendSessionStateInfo_t ( FriendSessionStateInfo_t.PackSmall d ) - { - return new FriendSessionStateInfo_t() - { - IOnlineSessionInstances = d.IOnlineSessionInstances, - IPublishedToFriendsSessionInstance = d.IPublishedToFriendsSessionInstance, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct PersonaStateChange_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 4; - internal ulong SteamID; // m_ulSteamID uint64 - internal int ChangeFlags; // m_nChangeFlags int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static PersonaStateChange_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (PersonaStateChange_t) Marshal.PtrToStructure( p, typeof(PersonaStateChange_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PersonaStateChange_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_ulSteamID uint64 - internal int ChangeFlags; // m_nChangeFlags int - - // - // Easily convert from PackSmall to PersonaStateChange_t - // - public static implicit operator PersonaStateChange_t ( PersonaStateChange_t.PackSmall d ) - { - return new PersonaStateChange_t() - { - SteamID = d.SteamID, - ChangeFlags = d.ChangeFlags, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GameOverlayActivated_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 31; - internal byte Active; // m_bActive uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameOverlayActivated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameOverlayActivated_t) Marshal.PtrToStructure( p, typeof(GameOverlayActivated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameOverlayActivated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte Active; // m_bActive uint8 - - // - // Easily convert from PackSmall to GameOverlayActivated_t - // - public static implicit operator GameOverlayActivated_t ( GameOverlayActivated_t.PackSmall d ) - { - return new GameOverlayActivated_t() - { - Active = d.Active, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GameServerChangeRequested_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 32; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string Server; // m_rgchServer char [64] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string Password; // m_rgchPassword char [64] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameServerChangeRequested_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameServerChangeRequested_t) Marshal.PtrToStructure( p, typeof(GameServerChangeRequested_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameServerChangeRequested_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string Server; // m_rgchServer char [64] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string Password; // m_rgchPassword char [64] - - // - // Easily convert from PackSmall to GameServerChangeRequested_t - // - public static implicit operator GameServerChangeRequested_t ( GameServerChangeRequested_t.PackSmall d ) - { - return new GameServerChangeRequested_t() - { - Server = d.Server, - Password = d.Password, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameLobbyJoinRequested_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 33; - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameLobbyJoinRequested_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameLobbyJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameLobbyJoinRequested_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameLobbyJoinRequested_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - - // - // Easily convert from PackSmall to GameLobbyJoinRequested_t - // - public static implicit operator GameLobbyJoinRequested_t ( GameLobbyJoinRequested_t.PackSmall d ) - { - return new GameLobbyJoinRequested_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDFriend = d.SteamIDFriend, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct AvatarImageLoaded_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 34; - internal ulong SteamID; // m_steamID class CSteamID - internal int Image; // m_iImage int - internal int Wide; // m_iWide int - internal int Tall; // m_iTall int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static AvatarImageLoaded_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (AvatarImageLoaded_t) Marshal.PtrToStructure( p, typeof(AvatarImageLoaded_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(AvatarImageLoaded_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_steamID class CSteamID - internal int Image; // m_iImage int - internal int Wide; // m_iWide int - internal int Tall; // m_iTall int - - // - // Easily convert from PackSmall to AvatarImageLoaded_t - // - public static implicit operator AvatarImageLoaded_t ( AvatarImageLoaded_t.PackSmall d ) - { - return new AvatarImageLoaded_t() - { - SteamID = d.SteamID, - Image = d.Image, - Wide = d.Wide, - Tall = d.Tall, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct ClanOfficerListResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 35; - internal ulong SteamIDClan; // m_steamIDClan class CSteamID - internal int COfficers; // m_cOfficers int - internal byte Success; // m_bSuccess uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ClanOfficerListResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ClanOfficerListResponse_t) Marshal.PtrToStructure( p, typeof(ClanOfficerListResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ClanOfficerListResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDClan; // m_steamIDClan class CSteamID - internal int COfficers; // m_cOfficers int - internal byte Success; // m_bSuccess uint8 - - // - // Easily convert from PackSmall to ClanOfficerListResponse_t - // - public static implicit operator ClanOfficerListResponse_t ( ClanOfficerListResponse_t.PackSmall d ) - { - return new ClanOfficerListResponse_t() - { - SteamIDClan = d.SteamIDClan, - COfficers = d.COfficers, - Success = d.Success, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct FriendRichPresenceUpdate_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 36; - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendRichPresenceUpdate_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendRichPresenceUpdate_t) Marshal.PtrToStructure( p, typeof(FriendRichPresenceUpdate_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendRichPresenceUpdate_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to FriendRichPresenceUpdate_t - // - public static implicit operator FriendRichPresenceUpdate_t ( FriendRichPresenceUpdate_t.PackSmall d ) - { - return new FriendRichPresenceUpdate_t() - { - SteamIDFriend = d.SteamIDFriend, - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameRichPresenceJoinRequested_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 37; - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Connect; // m_rgchConnect char [256] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameRichPresenceJoinRequested_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameRichPresenceJoinRequested_t) Marshal.PtrToStructure( p, typeof(GameRichPresenceJoinRequested_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameRichPresenceJoinRequested_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDFriend; // m_steamIDFriend class CSteamID - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Connect; // m_rgchConnect char [256] - - // - // Easily convert from PackSmall to GameRichPresenceJoinRequested_t - // - public static implicit operator GameRichPresenceJoinRequested_t ( GameRichPresenceJoinRequested_t.PackSmall d ) - { - return new GameRichPresenceJoinRequested_t() - { - SteamIDFriend = d.SteamIDFriend, - Connect = d.Connect, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameConnectedClanChatMsg_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 38; - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int MessageID; // m_iMessageID int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameConnectedClanChatMsg_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameConnectedClanChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedClanChatMsg_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedClanChatMsg_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int MessageID; // m_iMessageID int - - // - // Easily convert from PackSmall to GameConnectedClanChatMsg_t - // - public static implicit operator GameConnectedClanChatMsg_t ( GameConnectedClanChatMsg_t.PackSmall d ) - { - return new GameConnectedClanChatMsg_t() - { - SteamIDClanChat = d.SteamIDClanChat, - SteamIDUser = d.SteamIDUser, - MessageID = d.MessageID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameConnectedChatJoin_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 39; - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameConnectedChatJoin_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameConnectedChatJoin_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatJoin_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatJoin_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to GameConnectedChatJoin_t - // - public static implicit operator GameConnectedChatJoin_t ( GameConnectedChatJoin_t.PackSmall d ) - { - return new GameConnectedChatJoin_t() - { - SteamIDClanChat = d.SteamIDClanChat, - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameConnectedChatLeave_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 40; - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool Kicked; // m_bKicked _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Dropped; // m_bDropped _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameConnectedChatLeave_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameConnectedChatLeave_t) Marshal.PtrToStructure( p, typeof(GameConnectedChatLeave_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedChatLeave_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool Kicked; // m_bKicked _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Dropped; // m_bDropped _Bool - - // - // Easily convert from PackSmall to GameConnectedChatLeave_t - // - public static implicit operator GameConnectedChatLeave_t ( GameConnectedChatLeave_t.PackSmall d ) - { - return new GameConnectedChatLeave_t() - { - SteamIDClanChat = d.SteamIDClanChat, - SteamIDUser = d.SteamIDUser, - Kicked = d.Kicked, - Dropped = d.Dropped, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct DownloadClanActivityCountsResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 41; - [MarshalAs(UnmanagedType.I1)] - internal bool Success; // m_bSuccess _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static DownloadClanActivityCountsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (DownloadClanActivityCountsResult_t) Marshal.PtrToStructure( p, typeof(DownloadClanActivityCountsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadClanActivityCountsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool Success; // m_bSuccess _Bool - - // - // Easily convert from PackSmall to DownloadClanActivityCountsResult_t - // - public static implicit operator DownloadClanActivityCountsResult_t ( DownloadClanActivityCountsResult_t.PackSmall d ) - { - return new DownloadClanActivityCountsResult_t() - { - Success = d.Success, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct JoinClanChatRoomCompletionResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 42; - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ChatRoomEnterResponse ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static JoinClanChatRoomCompletionResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (JoinClanChatRoomCompletionResult_t) Marshal.PtrToStructure( p, typeof(JoinClanChatRoomCompletionResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(JoinClanChatRoomCompletionResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDClanChat; // m_steamIDClanChat class CSteamID - internal ChatRoomEnterResponse ChatRoomEnterResponse; // m_eChatRoomEnterResponse enum EChatRoomEnterResponse - - // - // Easily convert from PackSmall to JoinClanChatRoomCompletionResult_t - // - public static implicit operator JoinClanChatRoomCompletionResult_t ( JoinClanChatRoomCompletionResult_t.PackSmall d ) - { - return new JoinClanChatRoomCompletionResult_t() - { - SteamIDClanChat = d.SteamIDClanChat, - ChatRoomEnterResponse = d.ChatRoomEnterResponse, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GameConnectedFriendChatMsg_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 43; - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int MessageID; // m_iMessageID int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GameConnectedFriendChatMsg_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GameConnectedFriendChatMsg_t) Marshal.PtrToStructure( p, typeof(GameConnectedFriendChatMsg_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GameConnectedFriendChatMsg_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int MessageID; // m_iMessageID int - - // - // Easily convert from PackSmall to GameConnectedFriendChatMsg_t - // - public static implicit operator GameConnectedFriendChatMsg_t ( GameConnectedFriendChatMsg_t.PackSmall d ) - { - return new GameConnectedFriendChatMsg_t() - { - SteamIDUser = d.SteamIDUser, - MessageID = d.MessageID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct FriendsGetFollowerCount_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 44; - internal Result Result; // m_eResult enum EResult - internal ulong SteamID; // m_steamID class CSteamID - internal int Count; // m_nCount int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendsGetFollowerCount_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendsGetFollowerCount_t) Marshal.PtrToStructure( p, typeof(FriendsGetFollowerCount_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsGetFollowerCount_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamID; // m_steamID class CSteamID - internal int Count; // m_nCount int - - // - // Easily convert from PackSmall to FriendsGetFollowerCount_t - // - public static implicit operator FriendsGetFollowerCount_t ( FriendsGetFollowerCount_t.PackSmall d ) - { - return new FriendsGetFollowerCount_t() - { - Result = d.Result, - SteamID = d.SteamID, - Count = d.Count, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct FriendsIsFollowing_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 45; - internal Result Result; // m_eResult enum EResult - internal ulong SteamID; // m_steamID class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool IsFollowing; // m_bIsFollowing _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendsIsFollowing_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendsIsFollowing_t) Marshal.PtrToStructure( p, typeof(FriendsIsFollowing_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsIsFollowing_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamID; // m_steamID class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool IsFollowing; // m_bIsFollowing _Bool - - // - // Easily convert from PackSmall to FriendsIsFollowing_t - // - public static implicit operator FriendsIsFollowing_t ( FriendsIsFollowing_t.PackSmall d ) - { - return new FriendsIsFollowing_t() - { - Result = d.Result, - SteamID = d.SteamID, - IsFollowing = d.IsFollowing, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct FriendsEnumerateFollowingList_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 46; - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GSteamID; // m_rgSteamID class CSteamID [50] - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FriendsEnumerateFollowingList_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FriendsEnumerateFollowingList_t) Marshal.PtrToStructure( p, typeof(FriendsEnumerateFollowingList_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FriendsEnumerateFollowingList_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GSteamID; // m_rgSteamID class CSteamID [50] - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - - // - // Easily convert from PackSmall to FriendsEnumerateFollowingList_t - // - public static implicit operator FriendsEnumerateFollowingList_t ( FriendsEnumerateFollowingList_t.PackSmall d ) - { - return new FriendsEnumerateFollowingList_t() - { - Result = d.Result, - GSteamID = d.GSteamID, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SetPersonaNameResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamFriends + 47; - [MarshalAs(UnmanagedType.I1)] - internal bool Success; // m_bSuccess _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool LocalSuccess; // m_bLocalSuccess _Bool - internal Result Result; // m_result enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SetPersonaNameResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SetPersonaNameResponse_t) Marshal.PtrToStructure( p, typeof(SetPersonaNameResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetPersonaNameResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool Success; // m_bSuccess _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool LocalSuccess; // m_bLocalSuccess _Bool - internal Result Result; // m_result enum EResult - - // - // Easily convert from PackSmall to SetPersonaNameResponse_t - // - public static implicit operator SetPersonaNameResponse_t ( SetPersonaNameResponse_t.PackSmall d ) - { - return new SetPersonaNameResponse_t() - { - Success = d.Success, - LocalSuccess = d.LocalSuccess, - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LowBatteryPower_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 2; - internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LowBatteryPower_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LowBatteryPower_t) Marshal.PtrToStructure( p, typeof(LowBatteryPower_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LowBatteryPower_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte MinutesBatteryLeft; // m_nMinutesBatteryLeft uint8 - - // - // Easily convert from PackSmall to LowBatteryPower_t - // - public static implicit operator LowBatteryPower_t ( LowBatteryPower_t.PackSmall d ) - { - return new LowBatteryPower_t() - { - MinutesBatteryLeft = d.MinutesBatteryLeft, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamAPICallCompleted_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 3; - internal ulong AsyncCall; // m_hAsyncCall SteamAPICall_t - internal int Callback; // m_iCallback int - internal uint ParamCount; // m_cubParam uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamAPICallCompleted_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamAPICallCompleted_t) Marshal.PtrToStructure( p, typeof(SteamAPICallCompleted_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAPICallCompleted_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong AsyncCall; // m_hAsyncCall SteamAPICall_t - internal int Callback; // m_iCallback int - internal uint ParamCount; // m_cubParam uint32 - - // - // Easily convert from PackSmall to SteamAPICallCompleted_t - // - public static implicit operator SteamAPICallCompleted_t ( SteamAPICallCompleted_t.PackSmall d ) - { - return new SteamAPICallCompleted_t() - { - AsyncCall = d.AsyncCall, - Callback = d.Callback, - ParamCount = d.ParamCount, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct CheckFileSignature_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 5; - internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static CheckFileSignature_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (CheckFileSignature_t) Marshal.PtrToStructure( p, typeof(CheckFileSignature_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(CheckFileSignature_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal CheckFileSignature CheckFileSignature; // m_eCheckFileSignature enum ECheckFileSignature - - // - // Easily convert from PackSmall to CheckFileSignature_t - // - public static implicit operator CheckFileSignature_t ( CheckFileSignature_t.PackSmall d ) - { - return new CheckFileSignature_t() - { - CheckFileSignature = d.CheckFileSignature, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GamepadTextInputDismissed_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 14; - [MarshalAs(UnmanagedType.I1)] - internal bool Submitted; // m_bSubmitted _Bool - internal uint SubmittedText; // m_unSubmittedText uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GamepadTextInputDismissed_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GamepadTextInputDismissed_t) Marshal.PtrToStructure( p, typeof(GamepadTextInputDismissed_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GamepadTextInputDismissed_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool Submitted; // m_bSubmitted _Bool - internal uint SubmittedText; // m_unSubmittedText uint32 - - // - // Easily convert from PackSmall to GamepadTextInputDismissed_t - // - public static implicit operator GamepadTextInputDismissed_t ( GamepadTextInputDismissed_t.PackSmall d ) - { - return new GamepadTextInputDismissed_t() - { - Submitted = d.Submitted, - SubmittedText = d.SubmittedText, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MatchMakingKeyValuePair_t - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Key; // m_szKey char [256] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Value; // m_szValue char [256] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MatchMakingKeyValuePair_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MatchMakingKeyValuePair_t) Marshal.PtrToStructure( p, typeof(MatchMakingKeyValuePair_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MatchMakingKeyValuePair_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Key; // m_szKey char [256] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Value; // m_szValue char [256] - - // - // Easily convert from PackSmall to MatchMakingKeyValuePair_t - // - public static implicit operator MatchMakingKeyValuePair_t ( MatchMakingKeyValuePair_t.PackSmall d ) - { - return new MatchMakingKeyValuePair_t() - { - Key = d.Key, - Value = d.Value, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct servernetadr_t - { - internal ushort ConnectionPort; // m_usConnectionPort uint16 - internal ushort QueryPort; // m_usQueryPort uint16 - internal uint IP; // m_unIP uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static servernetadr_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (servernetadr_t) Marshal.PtrToStructure( p, typeof(servernetadr_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(servernetadr_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ushort ConnectionPort; // m_usConnectionPort uint16 - internal ushort QueryPort; // m_usQueryPort uint16 - internal uint IP; // m_unIP uint32 - - // - // Easily convert from PackSmall to servernetadr_t - // - public static implicit operator servernetadr_t ( servernetadr_t.PackSmall d ) - { - return new servernetadr_t() - { - ConnectionPort = d.ConnectionPort, - QueryPort = d.QueryPort, - IP = d.IP, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct gameserveritem_t - { - internal servernetadr_t NetAdr; // m_NetAdr class servernetadr_t - internal int Ping; // m_nPing int - [MarshalAs(UnmanagedType.I1)] - internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool DoNotRefresh; // m_bDoNotRefresh _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - internal string GameDir; // m_szGameDir char [32] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - internal string Map; // m_szMap char [32] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string GameDescription; // m_szGameDescription char [64] - internal uint AppID; // m_nAppID uint32 - internal int Players; // m_nPlayers int - internal int MaxPlayers; // m_nMaxPlayers int - internal int BotPlayers; // m_nBotPlayers int - [MarshalAs(UnmanagedType.I1)] - internal bool Password; // m_bPassword _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Secure; // m_bSecure _Bool - internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 - internal int ServerVersion; // m_nServerVersion int - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string ServerName; // m_szServerName char [64] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string GameTags; // m_szGameTags char [128] - internal ulong SteamID; // m_steamID class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static gameserveritem_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (gameserveritem_t) Marshal.PtrToStructure( p, typeof(gameserveritem_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(gameserveritem_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal servernetadr_t NetAdr; // m_NetAdr class servernetadr_t - internal int Ping; // m_nPing int - [MarshalAs(UnmanagedType.I1)] - internal bool HadSuccessfulResponse; // m_bHadSuccessfulResponse _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool DoNotRefresh; // m_bDoNotRefresh _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - internal string GameDir; // m_szGameDir char [32] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)] - internal string Map; // m_szMap char [32] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string GameDescription; // m_szGameDescription char [64] - internal uint AppID; // m_nAppID uint32 - internal int Players; // m_nPlayers int - internal int MaxPlayers; // m_nMaxPlayers int - internal int BotPlayers; // m_nBotPlayers int - [MarshalAs(UnmanagedType.I1)] - internal bool Password; // m_bPassword _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Secure; // m_bSecure _Bool - internal uint TimeLastPlayed; // m_ulTimeLastPlayed uint32 - internal int ServerVersion; // m_nServerVersion int - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string ServerName; // m_szServerName char [64] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string GameTags; // m_szGameTags char [128] - internal ulong SteamID; // m_steamID class CSteamID - - // - // Easily convert from PackSmall to gameserveritem_t - // - public static implicit operator gameserveritem_t ( gameserveritem_t.PackSmall d ) - { - return new gameserveritem_t() - { - NetAdr = d.NetAdr, - Ping = d.Ping, - HadSuccessfulResponse = d.HadSuccessfulResponse, - DoNotRefresh = d.DoNotRefresh, - GameDir = d.GameDir, - Map = d.Map, - GameDescription = d.GameDescription, - AppID = d.AppID, - Players = d.Players, - MaxPlayers = d.MaxPlayers, - BotPlayers = d.BotPlayers, - Password = d.Password, - Secure = d.Secure, - TimeLastPlayed = d.TimeLastPlayed, - ServerVersion = d.ServerVersion, - ServerName = d.ServerName, - GameTags = d.GameTags, - SteamID = d.SteamID, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct FavoritesListChanged_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 2; - internal uint IP; // m_nIP uint32 - internal uint QueryPort; // m_nQueryPort uint32 - internal uint ConnPort; // m_nConnPort uint32 - internal uint AppID; // m_nAppID uint32 - internal uint Flags; // m_nFlags uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Add; // m_bAdd _Bool - internal uint AccountId; // m_unAccountId AccountID_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FavoritesListChanged_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FavoritesListChanged_t) Marshal.PtrToStructure( p, typeof(FavoritesListChanged_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListChanged_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint IP; // m_nIP uint32 - internal uint QueryPort; // m_nQueryPort uint32 - internal uint ConnPort; // m_nConnPort uint32 - internal uint AppID; // m_nAppID uint32 - internal uint Flags; // m_nFlags uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Add; // m_bAdd _Bool - internal uint AccountId; // m_unAccountId AccountID_t - - // - // Easily convert from PackSmall to FavoritesListChanged_t - // - public static implicit operator FavoritesListChanged_t ( FavoritesListChanged_t.PackSmall d ) - { - return new FavoritesListChanged_t() - { - IP = d.IP, - QueryPort = d.QueryPort, - ConnPort = d.ConnPort, - AppID = d.AppID, - Flags = d.Flags, - Add = d.Add, - AccountId = d.AccountId, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyInvite_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 3; - internal ulong SteamIDUser; // m_ulSteamIDUser uint64 - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong GameID; // m_ulGameID uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyInvite_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyInvite_t) Marshal.PtrToStructure( p, typeof(LobbyInvite_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyInvite_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_ulSteamIDUser uint64 - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong GameID; // m_ulGameID uint64 - - // - // Easily convert from PackSmall to LobbyInvite_t - // - public static implicit operator LobbyInvite_t ( LobbyInvite_t.PackSmall d ) - { - return new LobbyInvite_t() - { - SteamIDUser = d.SteamIDUser, - SteamIDLobby = d.SteamIDLobby, - GameID = d.GameID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyEnter_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 4; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal uint GfChatPermissions; // m_rgfChatPermissions uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Locked; // m_bLocked _Bool - internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyEnter_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyEnter_t) Marshal.PtrToStructure( p, typeof(LobbyEnter_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyEnter_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal uint GfChatPermissions; // m_rgfChatPermissions uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Locked; // m_bLocked _Bool - internal uint EChatRoomEnterResponse; // m_EChatRoomEnterResponse uint32 - - // - // Easily convert from PackSmall to LobbyEnter_t - // - public static implicit operator LobbyEnter_t ( LobbyEnter_t.PackSmall d ) - { - return new LobbyEnter_t() - { - SteamIDLobby = d.SteamIDLobby, - GfChatPermissions = d.GfChatPermissions, - Locked = d.Locked, - EChatRoomEnterResponse = d.EChatRoomEnterResponse, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyDataUpdate_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 5; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDMember; // m_ulSteamIDMember uint64 - internal byte Success; // m_bSuccess uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyDataUpdate_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyDataUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyDataUpdate_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyDataUpdate_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDMember; // m_ulSteamIDMember uint64 - internal byte Success; // m_bSuccess uint8 - - // - // Easily convert from PackSmall to LobbyDataUpdate_t - // - public static implicit operator LobbyDataUpdate_t ( LobbyDataUpdate_t.PackSmall d ) - { - return new LobbyDataUpdate_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDMember = d.SteamIDMember, - Success = d.Success, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyChatUpdate_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 6; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 - internal ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 - internal uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyChatUpdate_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyChatUpdate_t) Marshal.PtrToStructure( p, typeof(LobbyChatUpdate_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatUpdate_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDUserChanged; // m_ulSteamIDUserChanged uint64 - internal ulong SteamIDMakingChange; // m_ulSteamIDMakingChange uint64 - internal uint GfChatMemberStateChange; // m_rgfChatMemberStateChange uint32 - - // - // Easily convert from PackSmall to LobbyChatUpdate_t - // - public static implicit operator LobbyChatUpdate_t ( LobbyChatUpdate_t.PackSmall d ) - { - return new LobbyChatUpdate_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDUserChanged = d.SteamIDUserChanged, - SteamIDMakingChange = d.SteamIDMakingChange, - GfChatMemberStateChange = d.GfChatMemberStateChange, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyChatMsg_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 7; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDUser; // m_ulSteamIDUser uint64 - internal byte ChatEntryType; // m_eChatEntryType uint8 - internal uint ChatID; // m_iChatID uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyChatMsg_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyChatMsg_t) Marshal.PtrToStructure( p, typeof(LobbyChatMsg_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyChatMsg_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDUser; // m_ulSteamIDUser uint64 - internal byte ChatEntryType; // m_eChatEntryType uint8 - internal uint ChatID; // m_iChatID uint32 - - // - // Easily convert from PackSmall to LobbyChatMsg_t - // - public static implicit operator LobbyChatMsg_t ( LobbyChatMsg_t.PackSmall d ) - { - return new LobbyChatMsg_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDUser = d.SteamIDUser, - ChatEntryType = d.ChatEntryType, - ChatID = d.ChatID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyGameCreated_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 9; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 - internal uint IP; // m_unIP uint32 - internal ushort Port; // m_usPort uint16 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyGameCreated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyGameCreated_t) Marshal.PtrToStructure( p, typeof(LobbyGameCreated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyGameCreated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDGameServer; // m_ulSteamIDGameServer uint64 - internal uint IP; // m_unIP uint32 - internal ushort Port; // m_usPort uint16 - - // - // Easily convert from PackSmall to LobbyGameCreated_t - // - public static implicit operator LobbyGameCreated_t ( LobbyGameCreated_t.PackSmall d ) - { - return new LobbyGameCreated_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDGameServer = d.SteamIDGameServer, - IP = d.IP, - Port = d.Port, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyMatchList_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 10; - internal uint LobbiesMatching; // m_nLobbiesMatching uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyMatchList_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyMatchList_t) Marshal.PtrToStructure( p, typeof(LobbyMatchList_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyMatchList_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint LobbiesMatching; // m_nLobbiesMatching uint32 - - // - // Easily convert from PackSmall to LobbyMatchList_t - // - public static implicit operator LobbyMatchList_t ( LobbyMatchList_t.PackSmall d ) - { - return new LobbyMatchList_t() - { - LobbiesMatching = d.LobbiesMatching, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyKicked_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 12; - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 - internal byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyKicked_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyKicked_t) Marshal.PtrToStructure( p, typeof(LobbyKicked_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyKicked_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - internal ulong SteamIDAdmin; // m_ulSteamIDAdmin uint64 - internal byte KickedDueToDisconnect; // m_bKickedDueToDisconnect uint8 - - // - // Easily convert from PackSmall to LobbyKicked_t - // - public static implicit operator LobbyKicked_t ( LobbyKicked_t.PackSmall d ) - { - return new LobbyKicked_t() - { - SteamIDLobby = d.SteamIDLobby, - SteamIDAdmin = d.SteamIDAdmin, - KickedDueToDisconnect = d.KickedDueToDisconnect, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LobbyCreated_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 13; - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LobbyCreated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LobbyCreated_t) Marshal.PtrToStructure( p, typeof(LobbyCreated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LobbyCreated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDLobby; // m_ulSteamIDLobby uint64 - - // - // Easily convert from PackSmall to LobbyCreated_t - // - public static implicit operator LobbyCreated_t ( LobbyCreated_t.PackSmall d ) - { - return new LobbyCreated_t() - { - Result = d.Result, - SteamIDLobby = d.SteamIDLobby, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PSNGameBootInviteResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 15; - [MarshalAs(UnmanagedType.I1)] - internal bool GameBootInviteExists; // m_bGameBootInviteExists _Bool - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static PSNGameBootInviteResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (PSNGameBootInviteResult_t) Marshal.PtrToStructure( p, typeof(PSNGameBootInviteResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PSNGameBootInviteResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool GameBootInviteExists; // m_bGameBootInviteExists _Bool - internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID - - // - // Easily convert from PackSmall to PSNGameBootInviteResult_t - // - public static implicit operator PSNGameBootInviteResult_t ( PSNGameBootInviteResult_t.PackSmall d ) - { - return new PSNGameBootInviteResult_t() - { - GameBootInviteExists = d.GameBootInviteExists, - SteamIDLobby = d.SteamIDLobby, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct FavoritesListAccountsUpdated_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMatchmaking + 16; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FavoritesListAccountsUpdated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FavoritesListAccountsUpdated_t) Marshal.PtrToStructure( p, typeof(FavoritesListAccountsUpdated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FavoritesListAccountsUpdated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to FavoritesListAccountsUpdated_t - // - public static implicit operator FavoritesListAccountsUpdated_t ( FavoritesListAccountsUpdated_t.PackSmall d ) - { - return new FavoritesListAccountsUpdated_t() - { - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamParamStringArray_t - { - internal IntPtr Strings; // m_ppStrings const char ** - internal int NumStrings; // m_nNumStrings int32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamParamStringArray_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamParamStringArray_t) Marshal.PtrToStructure( p, typeof(SteamParamStringArray_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParamStringArray_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal IntPtr Strings; // m_ppStrings const char ** - internal int NumStrings; // m_nNumStrings int32 - - // - // Easily convert from PackSmall to SteamParamStringArray_t - // - public static implicit operator SteamParamStringArray_t ( SteamParamStringArray_t.PackSmall d ) - { - return new SteamParamStringArray_t() - { - Strings = d.Strings, - NumStrings = d.NumStrings, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageAppSyncedClient_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 1; - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - internal int NumDownloads; // m_unNumDownloads int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageAppSyncedClient_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageAppSyncedClient_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedClient_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedClient_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - internal int NumDownloads; // m_unNumDownloads int - - // - // Easily convert from PackSmall to RemoteStorageAppSyncedClient_t - // - public static implicit operator RemoteStorageAppSyncedClient_t ( RemoteStorageAppSyncedClient_t.PackSmall d ) - { - return new RemoteStorageAppSyncedClient_t() - { - AppID = d.AppID, - Result = d.Result, - NumDownloads = d.NumDownloads, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageAppSyncedServer_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 2; - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - internal int NumUploads; // m_unNumUploads int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageAppSyncedServer_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageAppSyncedServer_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncedServer_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncedServer_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - internal int NumUploads; // m_unNumUploads int - - // - // Easily convert from PackSmall to RemoteStorageAppSyncedServer_t - // - public static implicit operator RemoteStorageAppSyncedServer_t ( RemoteStorageAppSyncedServer_t.PackSmall d ) - { - return new RemoteStorageAppSyncedServer_t() - { - AppID = d.AppID, - Result = d.Result, - NumUploads = d.NumUploads, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageAppSyncProgress_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 3; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string CurrentFile; // m_rgchCurrentFile char [260] - internal uint AppID; // m_nAppID AppId_t - internal uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 - internal double DAppPercentComplete; // m_dAppPercentComplete double - [MarshalAs(UnmanagedType.I1)] - internal bool Uploading; // m_bUploading _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageAppSyncProgress_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageAppSyncProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncProgress_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncProgress_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string CurrentFile; // m_rgchCurrentFile char [260] - internal uint AppID; // m_nAppID AppId_t - internal uint BytesTransferredThisChunk; // m_uBytesTransferredThisChunk uint32 - internal double DAppPercentComplete; // m_dAppPercentComplete double - [MarshalAs(UnmanagedType.I1)] - internal bool Uploading; // m_bUploading _Bool - - // - // Easily convert from PackSmall to RemoteStorageAppSyncProgress_t - // - public static implicit operator RemoteStorageAppSyncProgress_t ( RemoteStorageAppSyncProgress_t.PackSmall d ) - { - return new RemoteStorageAppSyncProgress_t() - { - CurrentFile = d.CurrentFile, - AppID = d.AppID, - BytesTransferredThisChunk = d.BytesTransferredThisChunk, - DAppPercentComplete = d.DAppPercentComplete, - Uploading = d.Uploading, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageAppSyncStatusCheck_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 5; - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageAppSyncStatusCheck_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageAppSyncStatusCheck_t) Marshal.PtrToStructure( p, typeof(RemoteStorageAppSyncStatusCheck_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageAppSyncStatusCheck_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to RemoteStorageAppSyncStatusCheck_t - // - public static implicit operator RemoteStorageAppSyncStatusCheck_t ( RemoteStorageAppSyncStatusCheck_t.PackSmall d ) - { - return new RemoteStorageAppSyncStatusCheck_t() - { - AppID = d.AppID, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageFileShareResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 7; - internal Result Result; // m_eResult enum EResult - internal ulong File; // m_hFile UGCHandle_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string Filename; // m_rgchFilename char [260] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageFileShareResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageFileShareResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileShareResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileShareResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong File; // m_hFile UGCHandle_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string Filename; // m_rgchFilename char [260] - - // - // Easily convert from PackSmall to RemoteStorageFileShareResult_t - // - public static implicit operator RemoteStorageFileShareResult_t ( RemoteStorageFileShareResult_t.PackSmall d ) - { - return new RemoteStorageFileShareResult_t() - { - Result = d.Result, - File = d.File, - Filename = d.Filename, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishFileResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 9; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishFileResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Easily convert from PackSmall to RemoteStoragePublishFileResult_t - // - public static implicit operator RemoteStoragePublishFileResult_t ( RemoteStoragePublishFileResult_t.PackSmall d ) - { - return new RemoteStoragePublishFileResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - UserNeedsToAcceptWorkshopLegalAgreement = d.UserNeedsToAcceptWorkshopLegalAgreement, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageDeletePublishedFileResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 11; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageDeletePublishedFileResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageDeletePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDeletePublishedFileResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDeletePublishedFileResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to RemoteStorageDeletePublishedFileResult_t - // - public static implicit operator RemoteStorageDeletePublishedFileResult_t ( RemoteStorageDeletePublishedFileResult_t.PackSmall d ) - { - return new RemoteStorageDeletePublishedFileResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageEnumerateUserPublishedFilesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 12; - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageEnumerateUserPublishedFilesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageEnumerateUserPublishedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserPublishedFilesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - - // - // Easily convert from PackSmall to RemoteStorageEnumerateUserPublishedFilesResult_t - // - public static implicit operator RemoteStorageEnumerateUserPublishedFilesResult_t ( RemoteStorageEnumerateUserPublishedFilesResult_t.PackSmall d ) - { - return new RemoteStorageEnumerateUserPublishedFilesResult_t() - { - Result = d.Result, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - GPublishedFileId = d.GPublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageSubscribePublishedFileResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 13; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageSubscribePublishedFileResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageSubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSubscribePublishedFileResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSubscribePublishedFileResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to RemoteStorageSubscribePublishedFileResult_t - // - public static implicit operator RemoteStorageSubscribePublishedFileResult_t ( RemoteStorageSubscribePublishedFileResult_t.PackSmall d ) - { - return new RemoteStorageSubscribePublishedFileResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageEnumerateUserSubscribedFilesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 14; - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageEnumerateUserSubscribedFilesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageEnumerateUserSubscribedFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSubscribedFilesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - internal uint[] GRTimeSubscribed; // m_rgRTimeSubscribed uint32 [50] - - // - // Easily convert from PackSmall to RemoteStorageEnumerateUserSubscribedFilesResult_t - // - public static implicit operator RemoteStorageEnumerateUserSubscribedFilesResult_t ( RemoteStorageEnumerateUserSubscribedFilesResult_t.PackSmall d ) - { - return new RemoteStorageEnumerateUserSubscribedFilesResult_t() - { - Result = d.Result, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - GPublishedFileId = d.GPublishedFileId, - GRTimeSubscribed = d.GRTimeSubscribed, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageUnsubscribePublishedFileResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 15; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageUnsubscribePublishedFileResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageUnsubscribePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUnsubscribePublishedFileResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to RemoteStorageUnsubscribePublishedFileResult_t - // - public static implicit operator RemoteStorageUnsubscribePublishedFileResult_t ( RemoteStorageUnsubscribePublishedFileResult_t.PackSmall d ) - { - return new RemoteStorageUnsubscribePublishedFileResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageUpdatePublishedFileResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 16; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageUpdatePublishedFileResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageUpdatePublishedFileResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdatePublishedFileResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdatePublishedFileResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Easily convert from PackSmall to RemoteStorageUpdatePublishedFileResult_t - // - public static implicit operator RemoteStorageUpdatePublishedFileResult_t ( RemoteStorageUpdatePublishedFileResult_t.PackSmall d ) - { - return new RemoteStorageUpdatePublishedFileResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - UserNeedsToAcceptWorkshopLegalAgreement = d.UserNeedsToAcceptWorkshopLegalAgreement, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageDownloadUGCResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 17; - internal Result Result; // m_eResult enum EResult - internal ulong File; // m_hFile UGCHandle_t - internal uint AppID; // m_nAppID AppId_t - internal int SizeInBytes; // m_nSizeInBytes int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageDownloadUGCResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageDownloadUGCResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageDownloadUGCResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageDownloadUGCResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong File; // m_hFile UGCHandle_t - internal uint AppID; // m_nAppID AppId_t - internal int SizeInBytes; // m_nSizeInBytes int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - - // - // Easily convert from PackSmall to RemoteStorageDownloadUGCResult_t - // - public static implicit operator RemoteStorageDownloadUGCResult_t ( RemoteStorageDownloadUGCResult_t.PackSmall d ) - { - return new RemoteStorageDownloadUGCResult_t() - { - Result = d.Result, - File = d.File, - AppID = d.AppID, - SizeInBytes = d.SizeInBytes, - PchFileName = d.PchFileName, - SteamIDOwner = d.SteamIDOwner, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageGetPublishedFileDetailsResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 18; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint CreatorAppID; // m_nCreatorAppID AppId_t - internal uint ConsumerAppID; // m_nConsumerAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] - internal string Title; // m_rgchTitle char [129] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - internal string Description; // m_rgchDescription char [8000] - internal ulong File; // m_hFile UGCHandle_t - internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - internal uint TimeCreated; // m_rtimeCreated uint32 - internal uint TimeUpdated; // m_rtimeUpdated uint32 - internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - internal string Tags; // m_rgchTags char [1025] - [MarshalAs(UnmanagedType.I1)] - internal bool TagsTruncated; // m_bTagsTruncated _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal int FileSize; // m_nFileSize int32 - internal int PreviewFileSize; // m_nPreviewFileSize int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - [MarshalAs(UnmanagedType.I1)] - internal bool AcceptedForUse; // m_bAcceptedForUse _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageGetPublishedFileDetailsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageGetPublishedFileDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedFileDetailsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint CreatorAppID; // m_nCreatorAppID AppId_t - internal uint ConsumerAppID; // m_nConsumerAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] - internal string Title; // m_rgchTitle char [129] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - internal string Description; // m_rgchDescription char [8000] - internal ulong File; // m_hFile UGCHandle_t - internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - internal uint TimeCreated; // m_rtimeCreated uint32 - internal uint TimeUpdated; // m_rtimeUpdated uint32 - internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - internal string Tags; // m_rgchTags char [1025] - [MarshalAs(UnmanagedType.I1)] - internal bool TagsTruncated; // m_bTagsTruncated _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal int FileSize; // m_nFileSize int32 - internal int PreviewFileSize; // m_nPreviewFileSize int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - [MarshalAs(UnmanagedType.I1)] - internal bool AcceptedForUse; // m_bAcceptedForUse _Bool - - // - // Easily convert from PackSmall to RemoteStorageGetPublishedFileDetailsResult_t - // - public static implicit operator RemoteStorageGetPublishedFileDetailsResult_t ( RemoteStorageGetPublishedFileDetailsResult_t.PackSmall d ) - { - return new RemoteStorageGetPublishedFileDetailsResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - CreatorAppID = d.CreatorAppID, - ConsumerAppID = d.ConsumerAppID, - Title = d.Title, - Description = d.Description, - File = d.File, - PreviewFile = d.PreviewFile, - SteamIDOwner = d.SteamIDOwner, - TimeCreated = d.TimeCreated, - TimeUpdated = d.TimeUpdated, - Visibility = d.Visibility, - Banned = d.Banned, - Tags = d.Tags, - TagsTruncated = d.TagsTruncated, - PchFileName = d.PchFileName, - FileSize = d.FileSize, - PreviewFileSize = d.PreviewFileSize, - URL = d.URL, - FileType = d.FileType, - AcceptedForUse = d.AcceptedForUse, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageEnumerateWorkshopFilesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 19; - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] - internal float[] GScore; // m_rgScore float [50] - internal uint AppId; // m_nAppId AppId_t - internal uint StartIndex; // m_unStartIndex uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageEnumerateWorkshopFilesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageEnumerateWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateWorkshopFilesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.R4)] - internal float[] GScore; // m_rgScore float [50] - internal uint AppId; // m_nAppId AppId_t - internal uint StartIndex; // m_unStartIndex uint32 - - // - // Easily convert from PackSmall to RemoteStorageEnumerateWorkshopFilesResult_t - // - public static implicit operator RemoteStorageEnumerateWorkshopFilesResult_t ( RemoteStorageEnumerateWorkshopFilesResult_t.PackSmall d ) - { - return new RemoteStorageEnumerateWorkshopFilesResult_t() - { - Result = d.Result, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - GPublishedFileId = d.GPublishedFileId, - GScore = d.GScore, - AppId = d.AppId, - StartIndex = d.StartIndex, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageGetPublishedItemVoteDetailsResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 20; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_unPublishedFileId PublishedFileId_t - internal int VotesFor; // m_nVotesFor int32 - internal int VotesAgainst; // m_nVotesAgainst int32 - internal int Reports; // m_nReports int32 - internal float FScore; // m_fScore float - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageGetPublishedItemVoteDetailsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageGetPublishedItemVoteDetailsResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageGetPublishedItemVoteDetailsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_unPublishedFileId PublishedFileId_t - internal int VotesFor; // m_nVotesFor int32 - internal int VotesAgainst; // m_nVotesAgainst int32 - internal int Reports; // m_nReports int32 - internal float FScore; // m_fScore float - - // - // Easily convert from PackSmall to RemoteStorageGetPublishedItemVoteDetailsResult_t - // - public static implicit operator RemoteStorageGetPublishedItemVoteDetailsResult_t ( RemoteStorageGetPublishedItemVoteDetailsResult_t.PackSmall d ) - { - return new RemoteStorageGetPublishedItemVoteDetailsResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - VotesFor = d.VotesFor, - VotesAgainst = d.VotesAgainst, - Reports = d.Reports, - FScore = d.FScore, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishedFileSubscribed_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 21; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishedFileSubscribed_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishedFileSubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileSubscribed_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileSubscribed_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to RemoteStoragePublishedFileSubscribed_t - // - public static implicit operator RemoteStoragePublishedFileSubscribed_t ( RemoteStoragePublishedFileSubscribed_t.PackSmall d ) - { - return new RemoteStoragePublishedFileSubscribed_t() - { - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishedFileUnsubscribed_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 22; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishedFileUnsubscribed_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishedFileUnsubscribed_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUnsubscribed_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUnsubscribed_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to RemoteStoragePublishedFileUnsubscribed_t - // - public static implicit operator RemoteStoragePublishedFileUnsubscribed_t ( RemoteStoragePublishedFileUnsubscribed_t.PackSmall d ) - { - return new RemoteStoragePublishedFileUnsubscribed_t() - { - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishedFileDeleted_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 23; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishedFileDeleted_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishedFileDeleted_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileDeleted_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileDeleted_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to RemoteStoragePublishedFileDeleted_t - // - public static implicit operator RemoteStoragePublishedFileDeleted_t ( RemoteStoragePublishedFileDeleted_t.PackSmall d ) - { - return new RemoteStoragePublishedFileDeleted_t() - { - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageUpdateUserPublishedItemVoteResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 24; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageUpdateUserPublishedItemVoteResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageUpdateUserPublishedItemVoteResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUpdateUserPublishedItemVoteResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to RemoteStorageUpdateUserPublishedItemVoteResult_t - // - public static implicit operator RemoteStorageUpdateUserPublishedItemVoteResult_t ( RemoteStorageUpdateUserPublishedItemVoteResult_t.PackSmall d ) - { - return new RemoteStorageUpdateUserPublishedItemVoteResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageUserVoteDetails_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 25; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal WorkshopVote Vote; // m_eVote enum EWorkshopVote - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageUserVoteDetails_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageUserVoteDetails_t) Marshal.PtrToStructure( p, typeof(RemoteStorageUserVoteDetails_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageUserVoteDetails_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal WorkshopVote Vote; // m_eVote enum EWorkshopVote - - // - // Easily convert from PackSmall to RemoteStorageUserVoteDetails_t - // - public static implicit operator RemoteStorageUserVoteDetails_t ( RemoteStorageUserVoteDetails_t.PackSmall d ) - { - return new RemoteStorageUserVoteDetails_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - Vote = d.Vote, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageEnumerateUserSharedWorkshopFilesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 26; - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageEnumerateUserSharedWorkshopFilesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumerateUserSharedWorkshopFilesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - - // - // Easily convert from PackSmall to RemoteStorageEnumerateUserSharedWorkshopFilesResult_t - // - public static implicit operator RemoteStorageEnumerateUserSharedWorkshopFilesResult_t ( RemoteStorageEnumerateUserSharedWorkshopFilesResult_t.PackSmall d ) - { - return new RemoteStorageEnumerateUserSharedWorkshopFilesResult_t() - { - Result = d.Result, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - GPublishedFileId = d.GPublishedFileId, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageSetUserPublishedFileActionResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 27; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageSetUserPublishedFileActionResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageSetUserPublishedFileActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageSetUserPublishedFileActionResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - - // - // Easily convert from PackSmall to RemoteStorageSetUserPublishedFileActionResult_t - // - public static implicit operator RemoteStorageSetUserPublishedFileActionResult_t ( RemoteStorageSetUserPublishedFileActionResult_t.PackSmall d ) - { - return new RemoteStorageSetUserPublishedFileActionResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - Action = d.Action, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageEnumeratePublishedFilesByUserActionResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 28; - internal Result Result; // m_eResult enum EResult - internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageEnumeratePublishedFilesByUserActionResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageEnumeratePublishedFilesByUserActionResult_t) Marshal.PtrToStructure( p, typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageEnumeratePublishedFilesByUserActionResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal WorkshopFileAction Action; // m_eAction enum EWorkshopFileAction - internal int ResultsReturned; // m_nResultsReturned int32 - internal int TotalResultCount; // m_nTotalResultCount int32 - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U8)] - internal ulong[] GPublishedFileId; // m_rgPublishedFileId PublishedFileId_t [50] - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.U4)] - internal uint[] GRTimeUpdated; // m_rgRTimeUpdated uint32 [50] - - // - // Easily convert from PackSmall to RemoteStorageEnumeratePublishedFilesByUserActionResult_t - // - public static implicit operator RemoteStorageEnumeratePublishedFilesByUserActionResult_t ( RemoteStorageEnumeratePublishedFilesByUserActionResult_t.PackSmall d ) - { - return new RemoteStorageEnumeratePublishedFilesByUserActionResult_t() - { - Result = d.Result, - Action = d.Action, - ResultsReturned = d.ResultsReturned, - TotalResultCount = d.TotalResultCount, - GPublishedFileId = d.GPublishedFileId, - GRTimeUpdated = d.GRTimeUpdated, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishFileProgress_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 29; - internal double DPercentFile; // m_dPercentFile double - [MarshalAs(UnmanagedType.I1)] - internal bool Preview; // m_bPreview _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishFileProgress_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishFileProgress_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishFileProgress_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishFileProgress_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal double DPercentFile; // m_dPercentFile double - [MarshalAs(UnmanagedType.I1)] - internal bool Preview; // m_bPreview _Bool - - // - // Easily convert from PackSmall to RemoteStoragePublishFileProgress_t - // - public static implicit operator RemoteStoragePublishFileProgress_t ( RemoteStoragePublishFileProgress_t.PackSmall d ) - { - return new RemoteStoragePublishFileProgress_t() - { - DPercentFile = d.DPercentFile, - Preview = d.Preview, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStoragePublishedFileUpdated_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 30; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - internal ulong Unused; // m_ulUnused uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStoragePublishedFileUpdated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStoragePublishedFileUpdated_t) Marshal.PtrToStructure( p, typeof(RemoteStoragePublishedFileUpdated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStoragePublishedFileUpdated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - internal ulong Unused; // m_ulUnused uint64 - - // - // Easily convert from PackSmall to RemoteStoragePublishedFileUpdated_t - // - public static implicit operator RemoteStoragePublishedFileUpdated_t ( RemoteStoragePublishedFileUpdated_t.PackSmall d ) - { - return new RemoteStoragePublishedFileUpdated_t() - { - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - Unused = d.Unused, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageFileWriteAsyncComplete_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 31; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageFileWriteAsyncComplete_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageFileWriteAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileWriteAsyncComplete_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileWriteAsyncComplete_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to RemoteStorageFileWriteAsyncComplete_t - // - public static implicit operator RemoteStorageFileWriteAsyncComplete_t ( RemoteStorageFileWriteAsyncComplete_t.PackSmall d ) - { - return new RemoteStorageFileWriteAsyncComplete_t() - { - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoteStorageFileReadAsyncComplete_t - { - internal const int CallbackId = CallbackIdentifiers.ClientRemoteStorage + 32; - internal ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t - internal Result Result; // m_eResult enum EResult - internal uint Offset; // m_nOffset uint32 - internal uint Read; // m_cubRead uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoteStorageFileReadAsyncComplete_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoteStorageFileReadAsyncComplete_t) Marshal.PtrToStructure( p, typeof(RemoteStorageFileReadAsyncComplete_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoteStorageFileReadAsyncComplete_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong FileReadAsync; // m_hFileReadAsync SteamAPICall_t - internal Result Result; // m_eResult enum EResult - internal uint Offset; // m_nOffset uint32 - internal uint Read; // m_cubRead uint32 - - // - // Easily convert from PackSmall to RemoteStorageFileReadAsyncComplete_t - // - public static implicit operator RemoteStorageFileReadAsyncComplete_t ( RemoteStorageFileReadAsyncComplete_t.PackSmall d ) - { - return new RemoteStorageFileReadAsyncComplete_t() - { - FileReadAsync = d.FileReadAsync, - Result = d.Result, - Offset = d.Offset, - Read = d.Read, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LeaderboardEntry_t - { - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int GlobalRank; // m_nGlobalRank int32 - internal int Score; // m_nScore int32 - internal int CDetails; // m_cDetails int32 - internal ulong UGC; // m_hUGC UGCHandle_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LeaderboardEntry_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LeaderboardEntry_t) Marshal.PtrToStructure( p, typeof(LeaderboardEntry_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardEntry_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - internal int GlobalRank; // m_nGlobalRank int32 - internal int Score; // m_nScore int32 - internal int CDetails; // m_cDetails int32 - internal ulong UGC; // m_hUGC UGCHandle_t - - // - // Easily convert from PackSmall to LeaderboardEntry_t - // - public static implicit operator LeaderboardEntry_t ( LeaderboardEntry_t.PackSmall d ) - { - return new LeaderboardEntry_t() - { - SteamIDUser = d.SteamIDUser, - GlobalRank = d.GlobalRank, - Score = d.Score, - CDetails = d.CDetails, - UGC = d.UGC, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct UserStatsReceived_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 1; - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserStatsReceived_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserStatsReceived_t) Marshal.PtrToStructure( p, typeof(UserStatsReceived_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsReceived_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to UserStatsReceived_t - // - public static implicit operator UserStatsReceived_t ( UserStatsReceived_t.PackSmall d ) - { - return new UserStatsReceived_t() - { - GameID = d.GameID, - Result = d.Result, - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct UserStatsStored_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 2; - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserStatsStored_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserStatsStored_t) Marshal.PtrToStructure( p, typeof(UserStatsStored_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsStored_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to UserStatsStored_t - // - public static implicit operator UserStatsStored_t ( UserStatsStored_t.PackSmall d ) - { - return new UserStatsStored_t() - { - GameID = d.GameID, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct UserAchievementStored_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 3; - internal ulong GameID; // m_nGameID uint64 - [MarshalAs(UnmanagedType.I1)] - internal bool GroupAchievement; // m_bGroupAchievement _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string AchievementName; // m_rgchAchievementName char [128] - internal uint CurProgress; // m_nCurProgress uint32 - internal uint MaxProgress; // m_nMaxProgress uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserAchievementStored_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserAchievementStored_t) Marshal.PtrToStructure( p, typeof(UserAchievementStored_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementStored_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - [MarshalAs(UnmanagedType.I1)] - internal bool GroupAchievement; // m_bGroupAchievement _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string AchievementName; // m_rgchAchievementName char [128] - internal uint CurProgress; // m_nCurProgress uint32 - internal uint MaxProgress; // m_nMaxProgress uint32 - - // - // Easily convert from PackSmall to UserAchievementStored_t - // - public static implicit operator UserAchievementStored_t ( UserAchievementStored_t.PackSmall d ) - { - return new UserAchievementStored_t() - { - GameID = d.GameID, - GroupAchievement = d.GroupAchievement, - AchievementName = d.AchievementName, - CurProgress = d.CurProgress, - MaxProgress = d.MaxProgress, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LeaderboardFindResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 4; - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal byte LeaderboardFound; // m_bLeaderboardFound uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LeaderboardFindResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LeaderboardFindResult_t) Marshal.PtrToStructure( p, typeof(LeaderboardFindResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardFindResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal byte LeaderboardFound; // m_bLeaderboardFound uint8 - - // - // Easily convert from PackSmall to LeaderboardFindResult_t - // - public static implicit operator LeaderboardFindResult_t ( LeaderboardFindResult_t.PackSmall d ) - { - return new LeaderboardFindResult_t() - { - SteamLeaderboard = d.SteamLeaderboard, - LeaderboardFound = d.LeaderboardFound, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LeaderboardScoresDownloaded_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 5; - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t - internal int CEntryCount; // m_cEntryCount int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LeaderboardScoresDownloaded_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LeaderboardScoresDownloaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoresDownloaded_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoresDownloaded_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal ulong SteamLeaderboardEntries; // m_hSteamLeaderboardEntries SteamLeaderboardEntries_t - internal int CEntryCount; // m_cEntryCount int - - // - // Easily convert from PackSmall to LeaderboardScoresDownloaded_t - // - public static implicit operator LeaderboardScoresDownloaded_t ( LeaderboardScoresDownloaded_t.PackSmall d ) - { - return new LeaderboardScoresDownloaded_t() - { - SteamLeaderboard = d.SteamLeaderboard, - SteamLeaderboardEntries = d.SteamLeaderboardEntries, - CEntryCount = d.CEntryCount, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LeaderboardScoreUploaded_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 6; - internal byte Success; // m_bSuccess uint8 - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal int Score; // m_nScore int32 - internal byte ScoreChanged; // m_bScoreChanged uint8 - internal int GlobalRankNew; // m_nGlobalRankNew int - internal int GlobalRankPrevious; // m_nGlobalRankPrevious int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LeaderboardScoreUploaded_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LeaderboardScoreUploaded_t) Marshal.PtrToStructure( p, typeof(LeaderboardScoreUploaded_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardScoreUploaded_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte Success; // m_bSuccess uint8 - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - internal int Score; // m_nScore int32 - internal byte ScoreChanged; // m_bScoreChanged uint8 - internal int GlobalRankNew; // m_nGlobalRankNew int - internal int GlobalRankPrevious; // m_nGlobalRankPrevious int - - // - // Easily convert from PackSmall to LeaderboardScoreUploaded_t - // - public static implicit operator LeaderboardScoreUploaded_t ( LeaderboardScoreUploaded_t.PackSmall d ) - { - return new LeaderboardScoreUploaded_t() - { - Success = d.Success, - SteamLeaderboard = d.SteamLeaderboard, - Score = d.Score, - ScoreChanged = d.ScoreChanged, - GlobalRankNew = d.GlobalRankNew, - GlobalRankPrevious = d.GlobalRankPrevious, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct NumberOfCurrentPlayers_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 7; - internal byte Success; // m_bSuccess uint8 - internal int CPlayers; // m_cPlayers int32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static NumberOfCurrentPlayers_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (NumberOfCurrentPlayers_t) Marshal.PtrToStructure( p, typeof(NumberOfCurrentPlayers_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(NumberOfCurrentPlayers_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte Success; // m_bSuccess uint8 - internal int CPlayers; // m_cPlayers int32 - - // - // Easily convert from PackSmall to NumberOfCurrentPlayers_t - // - public static implicit operator NumberOfCurrentPlayers_t ( NumberOfCurrentPlayers_t.PackSmall d ) - { - return new NumberOfCurrentPlayers_t() - { - Success = d.Success, - CPlayers = d.CPlayers, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct UserStatsUnloaded_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 8; - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserStatsUnloaded_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(UserStatsUnloaded_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserStatsUnloaded_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to UserStatsUnloaded_t - // - public static implicit operator UserStatsUnloaded_t ( UserStatsUnloaded_t.PackSmall d ) - { - return new UserStatsUnloaded_t() - { - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct UserAchievementIconFetched_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 9; - internal ulong GameID; // m_nGameID class CGameID - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string AchievementName; // m_rgchAchievementName char [128] - [MarshalAs(UnmanagedType.I1)] - internal bool Achieved; // m_bAchieved _Bool - internal int IconHandle; // m_nIconHandle int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserAchievementIconFetched_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserAchievementIconFetched_t) Marshal.PtrToStructure( p, typeof(UserAchievementIconFetched_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserAchievementIconFetched_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID class CGameID - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string AchievementName; // m_rgchAchievementName char [128] - [MarshalAs(UnmanagedType.I1)] - internal bool Achieved; // m_bAchieved _Bool - internal int IconHandle; // m_nIconHandle int - - // - // Easily convert from PackSmall to UserAchievementIconFetched_t - // - public static implicit operator UserAchievementIconFetched_t ( UserAchievementIconFetched_t.PackSmall d ) - { - return new UserAchievementIconFetched_t() - { - GameID = d.GameID, - AchievementName = d.AchievementName, - Achieved = d.Achieved, - IconHandle = d.IconHandle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GlobalAchievementPercentagesReady_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 10; - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GlobalAchievementPercentagesReady_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GlobalAchievementPercentagesReady_t) Marshal.PtrToStructure( p, typeof(GlobalAchievementPercentagesReady_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalAchievementPercentagesReady_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to GlobalAchievementPercentagesReady_t - // - public static implicit operator GlobalAchievementPercentagesReady_t ( GlobalAchievementPercentagesReady_t.PackSmall d ) - { - return new GlobalAchievementPercentagesReady_t() - { - GameID = d.GameID, - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LeaderboardUGCSet_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 11; - internal Result Result; // m_eResult enum EResult - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LeaderboardUGCSet_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LeaderboardUGCSet_t) Marshal.PtrToStructure( p, typeof(LeaderboardUGCSet_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LeaderboardUGCSet_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamLeaderboard; // m_hSteamLeaderboard SteamLeaderboard_t - - // - // Easily convert from PackSmall to LeaderboardUGCSet_t - // - public static implicit operator LeaderboardUGCSet_t ( LeaderboardUGCSet_t.PackSmall d ) - { - return new LeaderboardUGCSet_t() - { - Result = d.Result, - SteamLeaderboard = d.SteamLeaderboard, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct PS3TrophiesInstalled_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 12; - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - internal ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static PS3TrophiesInstalled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (PS3TrophiesInstalled_t) Marshal.PtrToStructure( p, typeof(PS3TrophiesInstalled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PS3TrophiesInstalled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - internal ulong RequiredDiskSpace; // m_ulRequiredDiskSpace uint64 - - // - // Easily convert from PackSmall to PS3TrophiesInstalled_t - // - public static implicit operator PS3TrophiesInstalled_t ( PS3TrophiesInstalled_t.PackSmall d ) - { - return new PS3TrophiesInstalled_t() - { - GameID = d.GameID, - Result = d.Result, - RequiredDiskSpace = d.RequiredDiskSpace, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GlobalStatsReceived_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 12; - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GlobalStatsReceived_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GlobalStatsReceived_t) Marshal.PtrToStructure( p, typeof(GlobalStatsReceived_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GlobalStatsReceived_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong GameID; // m_nGameID uint64 - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to GlobalStatsReceived_t - // - public static implicit operator GlobalStatsReceived_t ( GlobalStatsReceived_t.PackSmall d ) - { - return new GlobalStatsReceived_t() - { - GameID = d.GameID, - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct DlcInstalled_t - { - internal const int CallbackId = CallbackIdentifiers.SteamApps + 5; - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static DlcInstalled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (DlcInstalled_t) Marshal.PtrToStructure( p, typeof(DlcInstalled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(DlcInstalled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to DlcInstalled_t - // - public static implicit operator DlcInstalled_t ( DlcInstalled_t.PackSmall d ) - { - return new DlcInstalled_t() - { - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RegisterActivationCodeResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamApps + 8; - internal RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult - internal uint PackageRegistered; // m_unPackageRegistered uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RegisterActivationCodeResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RegisterActivationCodeResponse_t) Marshal.PtrToStructure( p, typeof(RegisterActivationCodeResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RegisterActivationCodeResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal RegisterActivationCodeResult Result; // m_eResult enum ERegisterActivationCodeResult - internal uint PackageRegistered; // m_unPackageRegistered uint32 - - // - // Easily convert from PackSmall to RegisterActivationCodeResponse_t - // - public static implicit operator RegisterActivationCodeResponse_t ( RegisterActivationCodeResponse_t.PackSmall d ) - { - return new RegisterActivationCodeResponse_t() - { - Result = d.Result, - PackageRegistered = d.PackageRegistered, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct AppProofOfPurchaseKeyResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamApps + 21; - internal Result Result; // m_eResult enum EResult - internal uint AppID; // m_nAppID uint32 - internal uint CchKeyLength; // m_cchKeyLength uint32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 240)] - internal string Key; // m_rgchKey char [240] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static AppProofOfPurchaseKeyResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (AppProofOfPurchaseKeyResponse_t) Marshal.PtrToStructure( p, typeof(AppProofOfPurchaseKeyResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(AppProofOfPurchaseKeyResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal uint AppID; // m_nAppID uint32 - internal uint CchKeyLength; // m_cchKeyLength uint32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 240)] - internal string Key; // m_rgchKey char [240] - - // - // Easily convert from PackSmall to AppProofOfPurchaseKeyResponse_t - // - public static implicit operator AppProofOfPurchaseKeyResponse_t ( AppProofOfPurchaseKeyResponse_t.PackSmall d ) - { - return new AppProofOfPurchaseKeyResponse_t() - { - Result = d.Result, - AppID = d.AppID, - CchKeyLength = d.CchKeyLength, - Key = d.Key, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct FileDetailsResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamApps + 23; - internal Result Result; // m_eResult enum EResult - internal ulong FileSize; // m_ulFileSize uint64 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] - internal char FileSHA; // m_FileSHA uint8 [20] - internal uint Flags; // m_unFlags uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static FileDetailsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (FileDetailsResult_t) Marshal.PtrToStructure( p, typeof(FileDetailsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(FileDetailsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong FileSize; // m_ulFileSize uint64 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] - internal char FileSHA; // m_FileSHA uint8 [20] - internal uint Flags; // m_unFlags uint32 - - // - // Easily convert from PackSmall to FileDetailsResult_t - // - public static implicit operator FileDetailsResult_t ( FileDetailsResult_t.PackSmall d ) - { - return new FileDetailsResult_t() - { - Result = d.Result, - FileSize = d.FileSize, - FileSHA = d.FileSHA, - Flags = d.Flags, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct P2PSessionState_t - { - internal byte ConnectionActive; // m_bConnectionActive uint8 - internal byte Connecting; // m_bConnecting uint8 - internal byte P2PSessionError; // m_eP2PSessionError uint8 - internal byte UsingRelay; // m_bUsingRelay uint8 - internal int BytesQueuedForSend; // m_nBytesQueuedForSend int32 - internal int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 - internal uint RemoteIP; // m_nRemoteIP uint32 - internal ushort RemotePort; // m_nRemotePort uint16 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static P2PSessionState_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (P2PSessionState_t) Marshal.PtrToStructure( p, typeof(P2PSessionState_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionState_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte ConnectionActive; // m_bConnectionActive uint8 - internal byte Connecting; // m_bConnecting uint8 - internal byte P2PSessionError; // m_eP2PSessionError uint8 - internal byte UsingRelay; // m_bUsingRelay uint8 - internal int BytesQueuedForSend; // m_nBytesQueuedForSend int32 - internal int PacketsQueuedForSend; // m_nPacketsQueuedForSend int32 - internal uint RemoteIP; // m_nRemoteIP uint32 - internal ushort RemotePort; // m_nRemotePort uint16 - - // - // Easily convert from PackSmall to P2PSessionState_t - // - public static implicit operator P2PSessionState_t ( P2PSessionState_t.PackSmall d ) - { - return new P2PSessionState_t() - { - ConnectionActive = d.ConnectionActive, - Connecting = d.Connecting, - P2PSessionError = d.P2PSessionError, - UsingRelay = d.UsingRelay, - BytesQueuedForSend = d.BytesQueuedForSend, - PacketsQueuedForSend = d.PacketsQueuedForSend, - RemoteIP = d.RemoteIP, - RemotePort = d.RemotePort, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct P2PSessionRequest_t - { - internal const int CallbackId = CallbackIdentifiers.SteamNetworking + 2; - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static P2PSessionRequest_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (P2PSessionRequest_t) Marshal.PtrToStructure( p, typeof(P2PSessionRequest_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionRequest_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - - // - // Easily convert from PackSmall to P2PSessionRequest_t - // - public static implicit operator P2PSessionRequest_t ( P2PSessionRequest_t.PackSmall d ) - { - return new P2PSessionRequest_t() - { - SteamIDRemote = d.SteamIDRemote, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct P2PSessionConnectFail_t - { - internal const int CallbackId = CallbackIdentifiers.SteamNetworking + 3; - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - internal byte P2PSessionError; // m_eP2PSessionError uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static P2PSessionConnectFail_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (P2PSessionConnectFail_t) Marshal.PtrToStructure( p, typeof(P2PSessionConnectFail_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(P2PSessionConnectFail_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - internal byte P2PSessionError; // m_eP2PSessionError uint8 - - // - // Easily convert from PackSmall to P2PSessionConnectFail_t - // - public static implicit operator P2PSessionConnectFail_t ( P2PSessionConnectFail_t.PackSmall d ) - { - return new P2PSessionConnectFail_t() - { - SteamIDRemote = d.SteamIDRemote, - P2PSessionError = d.P2PSessionError, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct SocketStatusCallback_t - { - internal const int CallbackId = CallbackIdentifiers.SteamNetworking + 1; - internal uint Socket; // m_hSocket SNetSocket_t - internal uint ListenSocket; // m_hListenSocket SNetListenSocket_t - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - internal int SNetSocketState; // m_eSNetSocketState int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SocketStatusCallback_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SocketStatusCallback_t) Marshal.PtrToStructure( p, typeof(SocketStatusCallback_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SocketStatusCallback_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint Socket; // m_hSocket SNetSocket_t - internal uint ListenSocket; // m_hListenSocket SNetListenSocket_t - internal ulong SteamIDRemote; // m_steamIDRemote class CSteamID - internal int SNetSocketState; // m_eSNetSocketState int - - // - // Easily convert from PackSmall to SocketStatusCallback_t - // - public static implicit operator SocketStatusCallback_t ( SocketStatusCallback_t.PackSmall d ) - { - return new SocketStatusCallback_t() - { - Socket = d.Socket, - ListenSocket = d.ListenSocket, - SteamIDRemote = d.SteamIDRemote, - SNetSocketState = d.SNetSocketState, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ScreenshotReady_t - { - internal const int CallbackId = CallbackIdentifiers.SteamScreenshots + 1; - internal uint Local; // m_hLocal ScreenshotHandle - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ScreenshotReady_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ScreenshotReady_t) Marshal.PtrToStructure( p, typeof(ScreenshotReady_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotReady_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint Local; // m_hLocal ScreenshotHandle - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to ScreenshotReady_t - // - public static implicit operator ScreenshotReady_t ( ScreenshotReady_t.PackSmall d ) - { - return new ScreenshotReady_t() - { - Local = d.Local, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct VolumeHasChanged_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusic + 2; - internal float NewVolume; // m_flNewVolume float - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static VolumeHasChanged_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (VolumeHasChanged_t) Marshal.PtrToStructure( p, typeof(VolumeHasChanged_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(VolumeHasChanged_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal float NewVolume; // m_flNewVolume float - - // - // Easily convert from PackSmall to VolumeHasChanged_t - // - public static implicit operator VolumeHasChanged_t ( VolumeHasChanged_t.PackSmall d ) - { - return new VolumeHasChanged_t() - { - NewVolume = d.NewVolume, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerWantsShuffled_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 9; - [MarshalAs(UnmanagedType.I1)] - internal bool Shuffled; // m_bShuffled _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerWantsShuffled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerWantsShuffled_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsShuffled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsShuffled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool Shuffled; // m_bShuffled _Bool - - // - // Easily convert from PackSmall to MusicPlayerWantsShuffled_t - // - public static implicit operator MusicPlayerWantsShuffled_t ( MusicPlayerWantsShuffled_t.PackSmall d ) - { - return new MusicPlayerWantsShuffled_t() - { - Shuffled = d.Shuffled, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerWantsLooped_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 10; - [MarshalAs(UnmanagedType.I1)] - internal bool Looped; // m_bLooped _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerWantsLooped_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerWantsLooped_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsLooped_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsLooped_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool Looped; // m_bLooped _Bool - - // - // Easily convert from PackSmall to MusicPlayerWantsLooped_t - // - public static implicit operator MusicPlayerWantsLooped_t ( MusicPlayerWantsLooped_t.PackSmall d ) - { - return new MusicPlayerWantsLooped_t() - { - Looped = d.Looped, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerWantsVolume_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusic + 11; - internal float NewVolume; // m_flNewVolume float - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerWantsVolume_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerWantsVolume_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsVolume_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsVolume_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal float NewVolume; // m_flNewVolume float - - // - // Easily convert from PackSmall to MusicPlayerWantsVolume_t - // - public static implicit operator MusicPlayerWantsVolume_t ( MusicPlayerWantsVolume_t.PackSmall d ) - { - return new MusicPlayerWantsVolume_t() - { - NewVolume = d.NewVolume, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerSelectsQueueEntry_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusic + 12; - internal int NID; // nID int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerSelectsQueueEntry_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerSelectsQueueEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsQueueEntry_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsQueueEntry_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int NID; // nID int - - // - // Easily convert from PackSmall to MusicPlayerSelectsQueueEntry_t - // - public static implicit operator MusicPlayerSelectsQueueEntry_t ( MusicPlayerSelectsQueueEntry_t.PackSmall d ) - { - return new MusicPlayerSelectsQueueEntry_t() - { - NID = d.NID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerSelectsPlaylistEntry_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusic + 13; - internal int NID; // nID int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerSelectsPlaylistEntry_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerSelectsPlaylistEntry_t) Marshal.PtrToStructure( p, typeof(MusicPlayerSelectsPlaylistEntry_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerSelectsPlaylistEntry_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int NID; // nID int - - // - // Easily convert from PackSmall to MusicPlayerSelectsPlaylistEntry_t - // - public static implicit operator MusicPlayerSelectsPlaylistEntry_t ( MusicPlayerSelectsPlaylistEntry_t.PackSmall d ) - { - return new MusicPlayerSelectsPlaylistEntry_t() - { - NID = d.NID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct MusicPlayerWantsPlayingRepeatStatus_t - { - internal const int CallbackId = CallbackIdentifiers.SteamMusicRemote + 14; - internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static MusicPlayerWantsPlayingRepeatStatus_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (MusicPlayerWantsPlayingRepeatStatus_t) Marshal.PtrToStructure( p, typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(MusicPlayerWantsPlayingRepeatStatus_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int PlayingRepeatStatus; // m_nPlayingRepeatStatus int - - // - // Easily convert from PackSmall to MusicPlayerWantsPlayingRepeatStatus_t - // - public static implicit operator MusicPlayerWantsPlayingRepeatStatus_t ( MusicPlayerWantsPlayingRepeatStatus_t.PackSmall d ) - { - return new MusicPlayerWantsPlayingRepeatStatus_t() - { - PlayingRepeatStatus = d.PlayingRepeatStatus, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTTPRequestCompleted_t - { - internal const int CallbackId = CallbackIdentifiers.ClientHTTP + 1; - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - [MarshalAs(UnmanagedType.I1)] - internal bool RequestSuccessful; // m_bRequestSuccessful _Bool - internal HTTPStatusCode StatusCode; // m_eStatusCode enum EHTTPStatusCode - internal uint BodySize; // m_unBodySize uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTTPRequestCompleted_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTTPRequestCompleted_t) Marshal.PtrToStructure( p, typeof(HTTPRequestCompleted_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestCompleted_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - [MarshalAs(UnmanagedType.I1)] - internal bool RequestSuccessful; // m_bRequestSuccessful _Bool - internal HTTPStatusCode StatusCode; // m_eStatusCode enum EHTTPStatusCode - internal uint BodySize; // m_unBodySize uint32 - - // - // Easily convert from PackSmall to HTTPRequestCompleted_t - // - public static implicit operator HTTPRequestCompleted_t ( HTTPRequestCompleted_t.PackSmall d ) - { - return new HTTPRequestCompleted_t() - { - Request = d.Request, - ContextValue = d.ContextValue, - RequestSuccessful = d.RequestSuccessful, - StatusCode = d.StatusCode, - BodySize = d.BodySize, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTTPRequestHeadersReceived_t - { - internal const int CallbackId = CallbackIdentifiers.ClientHTTP + 2; - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTTPRequestHeadersReceived_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTTPRequestHeadersReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestHeadersReceived_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestHeadersReceived_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - - // - // Easily convert from PackSmall to HTTPRequestHeadersReceived_t - // - public static implicit operator HTTPRequestHeadersReceived_t ( HTTPRequestHeadersReceived_t.PackSmall d ) - { - return new HTTPRequestHeadersReceived_t() - { - Request = d.Request, - ContextValue = d.ContextValue, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTTPRequestDataReceived_t - { - internal const int CallbackId = CallbackIdentifiers.ClientHTTP + 3; - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - internal uint COffset; // m_cOffset uint32 - internal uint CBytesReceived; // m_cBytesReceived uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTTPRequestDataReceived_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTTPRequestDataReceived_t) Marshal.PtrToStructure( p, typeof(HTTPRequestDataReceived_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTTPRequestDataReceived_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint Request; // m_hRequest HTTPRequestHandle - internal ulong ContextValue; // m_ulContextValue uint64 - internal uint COffset; // m_cOffset uint32 - internal uint CBytesReceived; // m_cBytesReceived uint32 - - // - // Easily convert from PackSmall to HTTPRequestDataReceived_t - // - public static implicit operator HTTPRequestDataReceived_t ( HTTPRequestDataReceived_t.PackSmall d ) - { - return new HTTPRequestDataReceived_t() - { - Request = d.Request, - ContextValue = d.ContextValue, - COffset = d.COffset, - CBytesReceived = d.CBytesReceived, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ControllerAnalogActionData_t - { - internal ControllerSourceMode EMode; // eMode enum EControllerSourceMode - internal float X; // x float - internal float Y; // y float - [MarshalAs(UnmanagedType.I1)] - internal bool BActive; // bActive _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ControllerAnalogActionData_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ControllerAnalogActionData_t) Marshal.PtrToStructure( p, typeof(ControllerAnalogActionData_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ControllerAnalogActionData_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ControllerSourceMode EMode; // eMode enum EControllerSourceMode - internal float X; // x float - internal float Y; // y float - [MarshalAs(UnmanagedType.I1)] - internal bool BActive; // bActive _Bool - - // - // Easily convert from PackSmall to ControllerAnalogActionData_t - // - public static implicit operator ControllerAnalogActionData_t ( ControllerAnalogActionData_t.PackSmall d ) - { - return new ControllerAnalogActionData_t() - { - EMode = d.EMode, - X = d.X, - Y = d.Y, - BActive = d.BActive, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ControllerDigitalActionData_t - { - [MarshalAs(UnmanagedType.I1)] - internal bool BState; // bState _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BActive; // bActive _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ControllerDigitalActionData_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ControllerDigitalActionData_t) Marshal.PtrToStructure( p, typeof(ControllerDigitalActionData_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ControllerDigitalActionData_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - [MarshalAs(UnmanagedType.I1)] - internal bool BState; // bState _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BActive; // bActive _Bool - - // - // Easily convert from PackSmall to ControllerDigitalActionData_t - // - public static implicit operator ControllerDigitalActionData_t ( ControllerDigitalActionData_t.PackSmall d ) - { - return new ControllerDigitalActionData_t() - { - BState = d.BState, - BActive = d.BActive, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ControllerMotionData_t - { - internal float RotQuatX; // rotQuatX float - internal float RotQuatY; // rotQuatY float - internal float RotQuatZ; // rotQuatZ float - internal float RotQuatW; // rotQuatW float - internal float PosAccelX; // posAccelX float - internal float PosAccelY; // posAccelY float - internal float PosAccelZ; // posAccelZ float - internal float RotVelX; // rotVelX float - internal float RotVelY; // rotVelY float - internal float RotVelZ; // rotVelZ float - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ControllerMotionData_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ControllerMotionData_t) Marshal.PtrToStructure( p, typeof(ControllerMotionData_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ControllerMotionData_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal float RotQuatX; // rotQuatX float - internal float RotQuatY; // rotQuatY float - internal float RotQuatZ; // rotQuatZ float - internal float RotQuatW; // rotQuatW float - internal float PosAccelX; // posAccelX float - internal float PosAccelY; // posAccelY float - internal float PosAccelZ; // posAccelZ float - internal float RotVelX; // rotVelX float - internal float RotVelY; // rotVelY float - internal float RotVelZ; // rotVelZ float - - // - // Easily convert from PackSmall to ControllerMotionData_t - // - public static implicit operator ControllerMotionData_t ( ControllerMotionData_t.PackSmall d ) - { - return new ControllerMotionData_t() - { - RotQuatX = d.RotQuatX, - RotQuatY = d.RotQuatY, - RotQuatZ = d.RotQuatZ, - RotQuatW = d.RotQuatW, - PosAccelX = d.PosAccelX, - PosAccelY = d.PosAccelY, - PosAccelZ = d.PosAccelZ, - RotVelX = d.RotVelX, - RotVelY = d.RotVelY, - RotVelZ = d.RotVelZ, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamUGCDetails_t - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - internal uint CreatorAppID; // m_nCreatorAppID AppId_t - internal uint ConsumerAppID; // m_nConsumerAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] - internal string Title; // m_rgchTitle char [129] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - internal string Description; // m_rgchDescription char [8000] - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - internal uint TimeCreated; // m_rtimeCreated uint32 - internal uint TimeUpdated; // m_rtimeUpdated uint32 - internal uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 - internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool AcceptedForUse; // m_bAcceptedForUse _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool TagsTruncated; // m_bTagsTruncated _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - internal string Tags; // m_rgchTags char [1025] - internal ulong File; // m_hFile UGCHandle_t - internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal int FileSize; // m_nFileSize int32 - internal int PreviewFileSize; // m_nPreviewFileSize int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - internal uint VotesUp; // m_unVotesUp uint32 - internal uint VotesDown; // m_unVotesDown uint32 - internal float Score; // m_flScore float - internal uint NumChildren; // m_unNumChildren uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamUGCDetails_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamUGCDetails_t) Marshal.PtrToStructure( p, typeof(SteamUGCDetails_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCDetails_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - internal WorkshopFileType FileType; // m_eFileType enum EWorkshopFileType - internal uint CreatorAppID; // m_nCreatorAppID AppId_t - internal uint ConsumerAppID; // m_nConsumerAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 129)] - internal string Title; // m_rgchTitle char [129] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8000)] - internal string Description; // m_rgchDescription char [8000] - internal ulong SteamIDOwner; // m_ulSteamIDOwner uint64 - internal uint TimeCreated; // m_rtimeCreated uint32 - internal uint TimeUpdated; // m_rtimeUpdated uint32 - internal uint TimeAddedToUserList; // m_rtimeAddedToUserList uint32 - internal RemoteStoragePublishedFileVisibility Visibility; // m_eVisibility enum ERemoteStoragePublishedFileVisibility - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool AcceptedForUse; // m_bAcceptedForUse _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool TagsTruncated; // m_bTagsTruncated _Bool - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1025)] - internal string Tags; // m_rgchTags char [1025] - internal ulong File; // m_hFile UGCHandle_t - internal ulong PreviewFile; // m_hPreviewFile UGCHandle_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string PchFileName; // m_pchFileName char [260] - internal int FileSize; // m_nFileSize int32 - internal int PreviewFileSize; // m_nPreviewFileSize int32 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - internal uint VotesUp; // m_unVotesUp uint32 - internal uint VotesDown; // m_unVotesDown uint32 - internal float Score; // m_flScore float - internal uint NumChildren; // m_unNumChildren uint32 - - // - // Easily convert from PackSmall to SteamUGCDetails_t - // - public static implicit operator SteamUGCDetails_t ( SteamUGCDetails_t.PackSmall d ) - { - return new SteamUGCDetails_t() - { - PublishedFileId = d.PublishedFileId, - Result = d.Result, - FileType = d.FileType, - CreatorAppID = d.CreatorAppID, - ConsumerAppID = d.ConsumerAppID, - Title = d.Title, - Description = d.Description, - SteamIDOwner = d.SteamIDOwner, - TimeCreated = d.TimeCreated, - TimeUpdated = d.TimeUpdated, - TimeAddedToUserList = d.TimeAddedToUserList, - Visibility = d.Visibility, - Banned = d.Banned, - AcceptedForUse = d.AcceptedForUse, - TagsTruncated = d.TagsTruncated, - Tags = d.Tags, - File = d.File, - PreviewFile = d.PreviewFile, - PchFileName = d.PchFileName, - FileSize = d.FileSize, - PreviewFileSize = d.PreviewFileSize, - URL = d.URL, - VotesUp = d.VotesUp, - VotesDown = d.VotesDown, - Score = d.Score, - NumChildren = d.NumChildren, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamUGCQueryCompleted_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 1; - internal ulong Handle; // m_handle UGCQueryHandle_t - internal Result Result; // m_eResult enum EResult - internal uint NumResultsReturned; // m_unNumResultsReturned uint32 - internal uint TotalMatchingResults; // m_unTotalMatchingResults uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamUGCQueryCompleted_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamUGCQueryCompleted_t) Marshal.PtrToStructure( p, typeof(SteamUGCQueryCompleted_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCQueryCompleted_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong Handle; // m_handle UGCQueryHandle_t - internal Result Result; // m_eResult enum EResult - internal uint NumResultsReturned; // m_unNumResultsReturned uint32 - internal uint TotalMatchingResults; // m_unTotalMatchingResults uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Easily convert from PackSmall to SteamUGCQueryCompleted_t - // - public static implicit operator SteamUGCQueryCompleted_t ( SteamUGCQueryCompleted_t.PackSmall d ) - { - return new SteamUGCQueryCompleted_t() - { - Handle = d.Handle, - Result = d.Result, - NumResultsReturned = d.NumResultsReturned, - TotalMatchingResults = d.TotalMatchingResults, - CachedData = d.CachedData, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamUGCRequestUGCDetailsResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 2; - internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamUGCRequestUGCDetailsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamUGCRequestUGCDetailsResult_t) Marshal.PtrToStructure( p, typeof(SteamUGCRequestUGCDetailsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamUGCRequestUGCDetailsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal SteamUGCDetails_t Details; // m_details struct SteamUGCDetails_t - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Easily convert from PackSmall to SteamUGCRequestUGCDetailsResult_t - // - public static implicit operator SteamUGCRequestUGCDetailsResult_t ( SteamUGCRequestUGCDetailsResult_t.PackSmall d ) - { - return new SteamUGCRequestUGCDetailsResult_t() - { - Details = d.Details, - CachedData = d.CachedData, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct CreateItemResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 3; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static CreateItemResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (CreateItemResult_t) Marshal.PtrToStructure( p, typeof(CreateItemResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(CreateItemResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - - // - // Easily convert from PackSmall to CreateItemResult_t - // - public static implicit operator CreateItemResult_t ( CreateItemResult_t.PackSmall d ) - { - return new CreateItemResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - UserNeedsToAcceptWorkshopLegalAgreement = d.UserNeedsToAcceptWorkshopLegalAgreement, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SubmitItemUpdateResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 4; - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SubmitItemUpdateResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SubmitItemUpdateResult_t) Marshal.PtrToStructure( p, typeof(SubmitItemUpdateResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SubmitItemUpdateResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool UserNeedsToAcceptWorkshopLegalAgreement; // m_bUserNeedsToAcceptWorkshopLegalAgreement _Bool - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to SubmitItemUpdateResult_t - // - public static implicit operator SubmitItemUpdateResult_t ( SubmitItemUpdateResult_t.PackSmall d ) - { - return new SubmitItemUpdateResult_t() - { - Result = d.Result, - UserNeedsToAcceptWorkshopLegalAgreement = d.UserNeedsToAcceptWorkshopLegalAgreement, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct DownloadItemResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 6; - internal uint AppID; // m_unAppID AppId_t - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static DownloadItemResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (DownloadItemResult_t) Marshal.PtrToStructure( p, typeof(DownloadItemResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(DownloadItemResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_unAppID AppId_t - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to DownloadItemResult_t - // - public static implicit operator DownloadItemResult_t ( DownloadItemResult_t.PackSmall d ) - { - return new DownloadItemResult_t() - { - AppID = d.AppID, - PublishedFileId = d.PublishedFileId, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct UserFavoriteItemsListChanged_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 7; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool WasAddRequest; // m_bWasAddRequest _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static UserFavoriteItemsListChanged_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (UserFavoriteItemsListChanged_t) Marshal.PtrToStructure( p, typeof(UserFavoriteItemsListChanged_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(UserFavoriteItemsListChanged_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool WasAddRequest; // m_bWasAddRequest _Bool - - // - // Easily convert from PackSmall to UserFavoriteItemsListChanged_t - // - public static implicit operator UserFavoriteItemsListChanged_t ( UserFavoriteItemsListChanged_t.PackSmall d ) - { - return new UserFavoriteItemsListChanged_t() - { - PublishedFileId = d.PublishedFileId, - Result = d.Result, - WasAddRequest = d.WasAddRequest, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SetUserItemVoteResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 8; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool VoteUp; // m_bVoteUp _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SetUserItemVoteResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(SetUserItemVoteResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SetUserItemVoteResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool VoteUp; // m_bVoteUp _Bool - - // - // Easily convert from PackSmall to SetUserItemVoteResult_t - // - public static implicit operator SetUserItemVoteResult_t ( SetUserItemVoteResult_t.PackSmall d ) - { - return new SetUserItemVoteResult_t() - { - PublishedFileId = d.PublishedFileId, - Result = d.Result, - VoteUp = d.VoteUp, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GetUserItemVoteResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 9; - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool VotedUp; // m_bVotedUp _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool VotedDown; // m_bVotedDown _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool VoteSkipped; // m_bVoteSkipped _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GetUserItemVoteResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GetUserItemVoteResult_t) Marshal.PtrToStructure( p, typeof(GetUserItemVoteResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetUserItemVoteResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal Result Result; // m_eResult enum EResult - [MarshalAs(UnmanagedType.I1)] - internal bool VotedUp; // m_bVotedUp _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool VotedDown; // m_bVotedDown _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool VoteSkipped; // m_bVoteSkipped _Bool - - // - // Easily convert from PackSmall to GetUserItemVoteResult_t - // - public static implicit operator GetUserItemVoteResult_t ( GetUserItemVoteResult_t.PackSmall d ) - { - return new GetUserItemVoteResult_t() - { - PublishedFileId = d.PublishedFileId, - Result = d.Result, - VotedUp = d.VotedUp, - VotedDown = d.VotedDown, - VoteSkipped = d.VoteSkipped, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct StartPlaytimeTrackingResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 10; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static StartPlaytimeTrackingResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (StartPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StartPlaytimeTrackingResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(StartPlaytimeTrackingResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to StartPlaytimeTrackingResult_t - // - public static implicit operator StartPlaytimeTrackingResult_t ( StartPlaytimeTrackingResult_t.PackSmall d ) - { - return new StartPlaytimeTrackingResult_t() - { - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct StopPlaytimeTrackingResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 11; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static StopPlaytimeTrackingResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (StopPlaytimeTrackingResult_t) Marshal.PtrToStructure( p, typeof(StopPlaytimeTrackingResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(StopPlaytimeTrackingResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to StopPlaytimeTrackingResult_t - // - public static implicit operator StopPlaytimeTrackingResult_t ( StopPlaytimeTrackingResult_t.PackSmall d ) - { - return new StopPlaytimeTrackingResult_t() - { - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct AddUGCDependencyResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 12; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static AddUGCDependencyResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (AddUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddUGCDependencyResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddUGCDependencyResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to AddUGCDependencyResult_t - // - public static implicit operator AddUGCDependencyResult_t ( AddUGCDependencyResult_t.PackSmall d ) - { - return new AddUGCDependencyResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - ChildPublishedFileId = d.ChildPublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoveUGCDependencyResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 13; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoveUGCDependencyResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoveUGCDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveUGCDependencyResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveUGCDependencyResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal ulong ChildPublishedFileId; // m_nChildPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to RemoveUGCDependencyResult_t - // - public static implicit operator RemoveUGCDependencyResult_t ( RemoveUGCDependencyResult_t.PackSmall d ) - { - return new RemoveUGCDependencyResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - ChildPublishedFileId = d.ChildPublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct AddAppDependencyResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 14; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static AddAppDependencyResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (AddAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(AddAppDependencyResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(AddAppDependencyResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to AddAppDependencyResult_t - // - public static implicit operator AddAppDependencyResult_t ( AddAppDependencyResult_t.PackSmall d ) - { - return new AddAppDependencyResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct RemoveAppDependencyResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 15; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static RemoveAppDependencyResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (RemoveAppDependencyResult_t) Marshal.PtrToStructure( p, typeof(RemoveAppDependencyResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(RemoveAppDependencyResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to RemoveAppDependencyResult_t - // - public static implicit operator RemoveAppDependencyResult_t ( RemoveAppDependencyResult_t.PackSmall d ) - { - return new RemoveAppDependencyResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - AppID = d.AppID, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GetAppDependenciesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 16; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)] - internal AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32] - internal uint NumAppDependencies; // m_nNumAppDependencies uint32 - internal uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GetAppDependenciesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GetAppDependenciesResult_t) Marshal.PtrToStructure( p, typeof(GetAppDependenciesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetAppDependenciesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 32, ArraySubType = UnmanagedType.U4)] - internal AppId_t[] GAppIDs; // m_rgAppIDs AppId_t [32] - internal uint NumAppDependencies; // m_nNumAppDependencies uint32 - internal uint TotalNumAppDependencies; // m_nTotalNumAppDependencies uint32 - - // - // Easily convert from PackSmall to GetAppDependenciesResult_t - // - public static implicit operator GetAppDependenciesResult_t ( GetAppDependenciesResult_t.PackSmall d ) - { - return new GetAppDependenciesResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - GAppIDs = d.GAppIDs, - NumAppDependencies = d.NumAppDependencies, - TotalNumAppDependencies = d.TotalNumAppDependencies, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct DeleteItemResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 17; - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static DeleteItemResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (DeleteItemResult_t) Marshal.PtrToStructure( p, typeof(DeleteItemResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(DeleteItemResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to DeleteItemResult_t - // - public static implicit operator DeleteItemResult_t ( DeleteItemResult_t.PackSmall d ) - { - return new DeleteItemResult_t() - { - Result = d.Result, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamAppInstalled_t - { - internal const int CallbackId = CallbackIdentifiers.SteamAppList + 1; - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamAppInstalled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamAppInstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppInstalled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppInstalled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to SteamAppInstalled_t - // - public static implicit operator SteamAppInstalled_t ( SteamAppInstalled_t.PackSmall d ) - { - return new SteamAppInstalled_t() - { - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamAppUninstalled_t - { - internal const int CallbackId = CallbackIdentifiers.SteamAppList + 2; - internal uint AppID; // m_nAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamAppUninstalled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamAppUninstalled_t) Marshal.PtrToStructure( p, typeof(SteamAppUninstalled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamAppUninstalled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_nAppID AppId_t - - // - // Easily convert from PackSmall to SteamAppUninstalled_t - // - public static implicit operator SteamAppUninstalled_t ( SteamAppUninstalled_t.PackSmall d ) - { - return new SteamAppUninstalled_t() - { - AppID = d.AppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_BrowserReady_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 1; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_BrowserReady_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_BrowserReady_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserReady_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserReady_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Easily convert from PackSmall to HTML_BrowserReady_t - // - public static implicit operator HTML_BrowserReady_t ( HTML_BrowserReady_t.PackSmall d ) - { - return new HTML_BrowserReady_t() - { - UnBrowserHandle = d.UnBrowserHandle, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_NeedsPaint_t - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PBGRA; // pBGRA const char * - internal uint UnWide; // unWide uint32 - internal uint UnTall; // unTall uint32 - internal uint UnUpdateX; // unUpdateX uint32 - internal uint UnUpdateY; // unUpdateY uint32 - internal uint UnUpdateWide; // unUpdateWide uint32 - internal uint UnUpdateTall; // unUpdateTall uint32 - internal uint UnScrollX; // unScrollX uint32 - internal uint UnScrollY; // unScrollY uint32 - internal float FlPageScale; // flPageScale float - internal uint UnPageSerial; // unPageSerial uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_NeedsPaint_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_NeedsPaint_t) Marshal.PtrToStructure( p, typeof(HTML_NeedsPaint_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NeedsPaint_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PBGRA; // pBGRA const char * - internal uint UnWide; // unWide uint32 - internal uint UnTall; // unTall uint32 - internal uint UnUpdateX; // unUpdateX uint32 - internal uint UnUpdateY; // unUpdateY uint32 - internal uint UnUpdateWide; // unUpdateWide uint32 - internal uint UnUpdateTall; // unUpdateTall uint32 - internal uint UnScrollX; // unScrollX uint32 - internal uint UnScrollY; // unScrollY uint32 - internal float FlPageScale; // flPageScale float - internal uint UnPageSerial; // unPageSerial uint32 - - // - // Easily convert from PackSmall to HTML_NeedsPaint_t - // - public static implicit operator HTML_NeedsPaint_t ( HTML_NeedsPaint_t.PackSmall d ) - { - return new HTML_NeedsPaint_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PBGRA = d.PBGRA, - UnWide = d.UnWide, - UnTall = d.UnTall, - UnUpdateX = d.UnUpdateX, - UnUpdateY = d.UnUpdateY, - UnUpdateWide = d.UnUpdateWide, - UnUpdateTall = d.UnUpdateTall, - UnScrollX = d.UnScrollX, - UnScrollY = d.UnScrollY, - FlPageScale = d.FlPageScale, - UnPageSerial = d.UnPageSerial, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_StartRequest_t - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchTarget; // pchTarget const char * - internal string PchPostData; // pchPostData const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BIsRedirect; // bIsRedirect _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_StartRequest_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_StartRequest_t) Marshal.PtrToStructure( p, typeof(HTML_StartRequest_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StartRequest_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchTarget; // pchTarget const char * - internal string PchPostData; // pchPostData const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BIsRedirect; // bIsRedirect _Bool - - // - // Easily convert from PackSmall to HTML_StartRequest_t - // - public static implicit operator HTML_StartRequest_t ( HTML_StartRequest_t.PackSmall d ) - { - return new HTML_StartRequest_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchURL = d.PchURL, - PchTarget = d.PchTarget, - PchPostData = d.PchPostData, - BIsRedirect = d.BIsRedirect, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_CloseBrowser_t - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_CloseBrowser_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_CloseBrowser_t) Marshal.PtrToStructure( p, typeof(HTML_CloseBrowser_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CloseBrowser_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Easily convert from PackSmall to HTML_CloseBrowser_t - // - public static implicit operator HTML_CloseBrowser_t ( HTML_CloseBrowser_t.PackSmall d ) - { - return new HTML_CloseBrowser_t() - { - UnBrowserHandle = d.UnBrowserHandle, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_URLChanged_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 5; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchPostData; // pchPostData const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BIsRedirect; // bIsRedirect _Bool - internal string PchPageTitle; // pchPageTitle const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BNewNavigation; // bNewNavigation _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_URLChanged_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_URLChanged_t) Marshal.PtrToStructure( p, typeof(HTML_URLChanged_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_URLChanged_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchPostData; // pchPostData const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BIsRedirect; // bIsRedirect _Bool - internal string PchPageTitle; // pchPageTitle const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BNewNavigation; // bNewNavigation _Bool - - // - // Easily convert from PackSmall to HTML_URLChanged_t - // - public static implicit operator HTML_URLChanged_t ( HTML_URLChanged_t.PackSmall d ) - { - return new HTML_URLChanged_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchURL = d.PchURL, - PchPostData = d.PchPostData, - BIsRedirect = d.BIsRedirect, - PchPageTitle = d.PchPageTitle, - BNewNavigation = d.BNewNavigation, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_FinishedRequest_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 6; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchPageTitle; // pchPageTitle const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_FinishedRequest_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_FinishedRequest_t) Marshal.PtrToStructure( p, typeof(HTML_FinishedRequest_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FinishedRequest_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal string PchPageTitle; // pchPageTitle const char * - - // - // Easily convert from PackSmall to HTML_FinishedRequest_t - // - public static implicit operator HTML_FinishedRequest_t ( HTML_FinishedRequest_t.PackSmall d ) - { - return new HTML_FinishedRequest_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchURL = d.PchURL, - PchPageTitle = d.PchPageTitle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_OpenLinkInNewTab_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 7; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_OpenLinkInNewTab_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_OpenLinkInNewTab_t) Marshal.PtrToStructure( p, typeof(HTML_OpenLinkInNewTab_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_OpenLinkInNewTab_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - - // - // Easily convert from PackSmall to HTML_OpenLinkInNewTab_t - // - public static implicit operator HTML_OpenLinkInNewTab_t ( HTML_OpenLinkInNewTab_t.PackSmall d ) - { - return new HTML_OpenLinkInNewTab_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchURL = d.PchURL, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_ChangedTitle_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 8; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchTitle; // pchTitle const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_ChangedTitle_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_ChangedTitle_t) Marshal.PtrToStructure( p, typeof(HTML_ChangedTitle_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ChangedTitle_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchTitle; // pchTitle const char * - - // - // Easily convert from PackSmall to HTML_ChangedTitle_t - // - public static implicit operator HTML_ChangedTitle_t ( HTML_ChangedTitle_t.PackSmall d ) - { - return new HTML_ChangedTitle_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchTitle = d.PchTitle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_SearchResults_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 9; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnResults; // unResults uint32 - internal uint UnCurrentMatch; // unCurrentMatch uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_SearchResults_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_SearchResults_t) Marshal.PtrToStructure( p, typeof(HTML_SearchResults_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SearchResults_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnResults; // unResults uint32 - internal uint UnCurrentMatch; // unCurrentMatch uint32 - - // - // Easily convert from PackSmall to HTML_SearchResults_t - // - public static implicit operator HTML_SearchResults_t ( HTML_SearchResults_t.PackSmall d ) - { - return new HTML_SearchResults_t() - { - UnBrowserHandle = d.UnBrowserHandle, - UnResults = d.UnResults, - UnCurrentMatch = d.UnCurrentMatch, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_CanGoBackAndForward_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 10; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - [MarshalAs(UnmanagedType.I1)] - internal bool BCanGoBack; // bCanGoBack _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BCanGoForward; // bCanGoForward _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_CanGoBackAndForward_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_CanGoBackAndForward_t) Marshal.PtrToStructure( p, typeof(HTML_CanGoBackAndForward_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_CanGoBackAndForward_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - [MarshalAs(UnmanagedType.I1)] - internal bool BCanGoBack; // bCanGoBack _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BCanGoForward; // bCanGoForward _Bool - - // - // Easily convert from PackSmall to HTML_CanGoBackAndForward_t - // - public static implicit operator HTML_CanGoBackAndForward_t ( HTML_CanGoBackAndForward_t.PackSmall d ) - { - return new HTML_CanGoBackAndForward_t() - { - UnBrowserHandle = d.UnBrowserHandle, - BCanGoBack = d.BCanGoBack, - BCanGoForward = d.BCanGoForward, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_HorizontalScroll_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 11; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnScrollMax; // unScrollMax uint32 - internal uint UnScrollCurrent; // unScrollCurrent uint32 - internal float FlPageScale; // flPageScale float - [MarshalAs(UnmanagedType.I1)] - internal bool BVisible; // bVisible _Bool - internal uint UnPageSize; // unPageSize uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_HorizontalScroll_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_HorizontalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_HorizontalScroll_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HorizontalScroll_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnScrollMax; // unScrollMax uint32 - internal uint UnScrollCurrent; // unScrollCurrent uint32 - internal float FlPageScale; // flPageScale float - [MarshalAs(UnmanagedType.I1)] - internal bool BVisible; // bVisible _Bool - internal uint UnPageSize; // unPageSize uint32 - - // - // Easily convert from PackSmall to HTML_HorizontalScroll_t - // - public static implicit operator HTML_HorizontalScroll_t ( HTML_HorizontalScroll_t.PackSmall d ) - { - return new HTML_HorizontalScroll_t() - { - UnBrowserHandle = d.UnBrowserHandle, - UnScrollMax = d.UnScrollMax, - UnScrollCurrent = d.UnScrollCurrent, - FlPageScale = d.FlPageScale, - BVisible = d.BVisible, - UnPageSize = d.UnPageSize, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_VerticalScroll_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 12; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnScrollMax; // unScrollMax uint32 - internal uint UnScrollCurrent; // unScrollCurrent uint32 - internal float FlPageScale; // flPageScale float - [MarshalAs(UnmanagedType.I1)] - internal bool BVisible; // bVisible _Bool - internal uint UnPageSize; // unPageSize uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_VerticalScroll_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_VerticalScroll_t) Marshal.PtrToStructure( p, typeof(HTML_VerticalScroll_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_VerticalScroll_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnScrollMax; // unScrollMax uint32 - internal uint UnScrollCurrent; // unScrollCurrent uint32 - internal float FlPageScale; // flPageScale float - [MarshalAs(UnmanagedType.I1)] - internal bool BVisible; // bVisible _Bool - internal uint UnPageSize; // unPageSize uint32 - - // - // Easily convert from PackSmall to HTML_VerticalScroll_t - // - public static implicit operator HTML_VerticalScroll_t ( HTML_VerticalScroll_t.PackSmall d ) - { - return new HTML_VerticalScroll_t() - { - UnBrowserHandle = d.UnBrowserHandle, - UnScrollMax = d.UnScrollMax, - UnScrollCurrent = d.UnScrollCurrent, - FlPageScale = d.FlPageScale, - BVisible = d.BVisible, - UnPageSize = d.UnPageSize, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_LinkAtPosition_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 13; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint X; // x uint32 - internal uint Y; // y uint32 - internal string PchURL; // pchURL const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BInput; // bInput _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BLiveLink; // bLiveLink _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_LinkAtPosition_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_LinkAtPosition_t) Marshal.PtrToStructure( p, typeof(HTML_LinkAtPosition_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_LinkAtPosition_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint X; // x uint32 - internal uint Y; // y uint32 - internal string PchURL; // pchURL const char * - [MarshalAs(UnmanagedType.I1)] - internal bool BInput; // bInput _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool BLiveLink; // bLiveLink _Bool - - // - // Easily convert from PackSmall to HTML_LinkAtPosition_t - // - public static implicit operator HTML_LinkAtPosition_t ( HTML_LinkAtPosition_t.PackSmall d ) - { - return new HTML_LinkAtPosition_t() - { - UnBrowserHandle = d.UnBrowserHandle, - X = d.X, - Y = d.Y, - PchURL = d.PchURL, - BInput = d.BInput, - BLiveLink = d.BLiveLink, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_JSAlert_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 14; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMessage; // pchMessage const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_JSAlert_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_JSAlert_t) Marshal.PtrToStructure( p, typeof(HTML_JSAlert_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSAlert_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMessage; // pchMessage const char * - - // - // Easily convert from PackSmall to HTML_JSAlert_t - // - public static implicit operator HTML_JSAlert_t ( HTML_JSAlert_t.PackSmall d ) - { - return new HTML_JSAlert_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchMessage = d.PchMessage, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_JSConfirm_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 15; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMessage; // pchMessage const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_JSConfirm_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_JSConfirm_t) Marshal.PtrToStructure( p, typeof(HTML_JSConfirm_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_JSConfirm_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMessage; // pchMessage const char * - - // - // Easily convert from PackSmall to HTML_JSConfirm_t - // - public static implicit operator HTML_JSConfirm_t ( HTML_JSConfirm_t.PackSmall d ) - { - return new HTML_JSConfirm_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchMessage = d.PchMessage, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_FileOpenDialog_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 16; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchTitle; // pchTitle const char * - internal string PchInitialFile; // pchInitialFile const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_FileOpenDialog_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_FileOpenDialog_t) Marshal.PtrToStructure( p, typeof(HTML_FileOpenDialog_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_FileOpenDialog_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchTitle; // pchTitle const char * - internal string PchInitialFile; // pchInitialFile const char * - - // - // Easily convert from PackSmall to HTML_FileOpenDialog_t - // - public static implicit operator HTML_FileOpenDialog_t ( HTML_FileOpenDialog_t.PackSmall d ) - { - return new HTML_FileOpenDialog_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchTitle = d.PchTitle, - PchInitialFile = d.PchInitialFile, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_NewWindow_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 21; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal uint UnX; // unX uint32 - internal uint UnY; // unY uint32 - internal uint UnWide; // unWide uint32 - internal uint UnTall; // unTall uint32 - internal uint UnNewWindow_BrowserHandle; // unNewWindow_BrowserHandle HHTMLBrowser - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_NewWindow_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_NewWindow_t) Marshal.PtrToStructure( p, typeof(HTML_NewWindow_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_NewWindow_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchURL; // pchURL const char * - internal uint UnX; // unX uint32 - internal uint UnY; // unY uint32 - internal uint UnWide; // unWide uint32 - internal uint UnTall; // unTall uint32 - internal uint UnNewWindow_BrowserHandle; // unNewWindow_BrowserHandle HHTMLBrowser - - // - // Easily convert from PackSmall to HTML_NewWindow_t - // - public static implicit operator HTML_NewWindow_t ( HTML_NewWindow_t.PackSmall d ) - { - return new HTML_NewWindow_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchURL = d.PchURL, - UnX = d.UnX, - UnY = d.UnY, - UnWide = d.UnWide, - UnTall = d.UnTall, - UnNewWindow_BrowserHandle = d.UnNewWindow_BrowserHandle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_SetCursor_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 22; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint EMouseCursor; // eMouseCursor uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_SetCursor_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_SetCursor_t) Marshal.PtrToStructure( p, typeof(HTML_SetCursor_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_SetCursor_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint EMouseCursor; // eMouseCursor uint32 - - // - // Easily convert from PackSmall to HTML_SetCursor_t - // - public static implicit operator HTML_SetCursor_t ( HTML_SetCursor_t.PackSmall d ) - { - return new HTML_SetCursor_t() - { - UnBrowserHandle = d.UnBrowserHandle, - EMouseCursor = d.EMouseCursor, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_StatusText_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 23; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_StatusText_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_StatusText_t) Marshal.PtrToStructure( p, typeof(HTML_StatusText_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_StatusText_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Easily convert from PackSmall to HTML_StatusText_t - // - public static implicit operator HTML_StatusText_t ( HTML_StatusText_t.PackSmall d ) - { - return new HTML_StatusText_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchMsg = d.PchMsg, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_ShowToolTip_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 24; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_ShowToolTip_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_ShowToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_ShowToolTip_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_ShowToolTip_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Easily convert from PackSmall to HTML_ShowToolTip_t - // - public static implicit operator HTML_ShowToolTip_t ( HTML_ShowToolTip_t.PackSmall d ) - { - return new HTML_ShowToolTip_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchMsg = d.PchMsg, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_UpdateToolTip_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 25; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_UpdateToolTip_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_UpdateToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_UpdateToolTip_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_UpdateToolTip_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal string PchMsg; // pchMsg const char * - - // - // Easily convert from PackSmall to HTML_UpdateToolTip_t - // - public static implicit operator HTML_UpdateToolTip_t ( HTML_UpdateToolTip_t.PackSmall d ) - { - return new HTML_UpdateToolTip_t() - { - UnBrowserHandle = d.UnBrowserHandle, - PchMsg = d.PchMsg, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_HideToolTip_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 26; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_HideToolTip_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_HideToolTip_t) Marshal.PtrToStructure( p, typeof(HTML_HideToolTip_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_HideToolTip_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - - // - // Easily convert from PackSmall to HTML_HideToolTip_t - // - public static implicit operator HTML_HideToolTip_t ( HTML_HideToolTip_t.PackSmall d ) - { - return new HTML_HideToolTip_t() - { - UnBrowserHandle = d.UnBrowserHandle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct HTML_BrowserRestarted_t - { - internal const int CallbackId = CallbackIdentifiers.SteamHTMLSurface + 27; - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static HTML_BrowserRestarted_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (HTML_BrowserRestarted_t) Marshal.PtrToStructure( p, typeof(HTML_BrowserRestarted_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(HTML_BrowserRestarted_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint UnBrowserHandle; // unBrowserHandle HHTMLBrowser - internal uint UnOldBrowserHandle; // unOldBrowserHandle HHTMLBrowser - - // - // Easily convert from PackSmall to HTML_BrowserRestarted_t - // - public static implicit operator HTML_BrowserRestarted_t ( HTML_BrowserRestarted_t.PackSmall d ) - { - return new HTML_BrowserRestarted_t() - { - UnBrowserHandle = d.UnBrowserHandle, - UnOldBrowserHandle = d.UnOldBrowserHandle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamItemDetails_t - { - internal ulong ItemId; // m_itemId SteamItemInstanceID_t - internal int Definition; // m_iDefinition SteamItemDef_t - internal ushort Quantity; // m_unQuantity uint16 - internal ushort Flags; // m_unFlags uint16 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamItemDetails_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamItemDetails_t) Marshal.PtrToStructure( p, typeof(SteamItemDetails_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamItemDetails_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong ItemId; // m_itemId SteamItemInstanceID_t - internal int Definition; // m_iDefinition SteamItemDef_t - internal ushort Quantity; // m_unQuantity uint16 - internal ushort Flags; // m_unFlags uint16 - - // - // Easily convert from PackSmall to SteamItemDetails_t - // - public static implicit operator SteamItemDetails_t ( SteamItemDetails_t.PackSmall d ) - { - return new SteamItemDetails_t() - { - ItemId = d.ItemId, - Definition = d.Definition, - Quantity = d.Quantity, - Flags = d.Flags, - }; - } - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamInventoryResultReady_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 0; - internal int Handle; // m_handle SteamInventoryResult_t - internal Result Result; // m_result enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryResultReady_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryResultReady_t) Marshal.PtrToStructure( p, typeof(SteamInventoryResultReady_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryResultReady_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int Handle; // m_handle SteamInventoryResult_t - internal Result Result; // m_result enum EResult - - // - // Easily convert from PackSmall to SteamInventoryResultReady_t - // - public static implicit operator SteamInventoryResultReady_t ( SteamInventoryResultReady_t.PackSmall d ) - { - return new SteamInventoryResultReady_t() - { - Handle = d.Handle, - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamInventoryFullUpdate_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 1; - internal int Handle; // m_handle SteamInventoryResult_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryFullUpdate_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryFullUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryFullUpdate_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryFullUpdate_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal int Handle; // m_handle SteamInventoryResult_t - - // - // Easily convert from PackSmall to SteamInventoryFullUpdate_t - // - public static implicit operator SteamInventoryFullUpdate_t ( SteamInventoryFullUpdate_t.PackSmall d ) - { - return new SteamInventoryFullUpdate_t() - { - Handle = d.Handle, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct SteamInventoryEligiblePromoItemDefIDs_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 3; - internal Result Result; // m_result enum EResult - internal ulong SteamID; // m_steamID class CSteamID - internal int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryEligiblePromoItemDefIDs_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryEligiblePromoItemDefIDs_t) Marshal.PtrToStructure( p, typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryEligiblePromoItemDefIDs_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_result enum EResult - internal ulong SteamID; // m_steamID class CSteamID - internal int UmEligiblePromoItemDefs; // m_numEligiblePromoItemDefs int - [MarshalAs(UnmanagedType.I1)] - internal bool CachedData; // m_bCachedData _Bool - - // - // Easily convert from PackSmall to SteamInventoryEligiblePromoItemDefIDs_t - // - public static implicit operator SteamInventoryEligiblePromoItemDefIDs_t ( SteamInventoryEligiblePromoItemDefIDs_t.PackSmall d ) - { - return new SteamInventoryEligiblePromoItemDefIDs_t() - { - Result = d.Result, - SteamID = d.SteamID, - UmEligiblePromoItemDefs = d.UmEligiblePromoItemDefs, - CachedData = d.CachedData, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamInventoryStartPurchaseResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 4; - internal Result Result; // m_result enum EResult - internal ulong OrderID; // m_ulOrderID uint64 - internal ulong TransID; // m_ulTransID uint64 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryStartPurchaseResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryStartPurchaseResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryStartPurchaseResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryStartPurchaseResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_result enum EResult - internal ulong OrderID; // m_ulOrderID uint64 - internal ulong TransID; // m_ulTransID uint64 - - // - // Easily convert from PackSmall to SteamInventoryStartPurchaseResult_t - // - public static implicit operator SteamInventoryStartPurchaseResult_t ( SteamInventoryStartPurchaseResult_t.PackSmall d ) - { - return new SteamInventoryStartPurchaseResult_t() - { - Result = d.Result, - OrderID = d.OrderID, - TransID = d.TransID, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamInventoryRequestPricesResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 5; - internal Result Result; // m_result enum EResult - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - internal string Currency; // m_rgchCurrency char [4] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryRequestPricesResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryRequestPricesResult_t) Marshal.PtrToStructure( p, typeof(SteamInventoryRequestPricesResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryRequestPricesResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_result enum EResult - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - internal string Currency; // m_rgchCurrency char [4] - - // - // Easily convert from PackSmall to SteamInventoryRequestPricesResult_t - // - public static implicit operator SteamInventoryRequestPricesResult_t ( SteamInventoryRequestPricesResult_t.PackSmall d ) - { - return new SteamInventoryRequestPricesResult_t() - { - Result = d.Result, - Currency = d.Currency, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct BroadcastUploadStop_t - { - internal const int CallbackId = CallbackIdentifiers.ClientVideo + 5; - internal BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static BroadcastUploadStop_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (BroadcastUploadStop_t) Marshal.PtrToStructure( p, typeof(BroadcastUploadStop_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(BroadcastUploadStop_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal BroadcastUploadResult Result; // m_eResult enum EBroadcastUploadResult - - // - // Easily convert from PackSmall to BroadcastUploadStop_t - // - public static implicit operator BroadcastUploadStop_t ( BroadcastUploadStop_t.PackSmall d ) - { - return new BroadcastUploadStop_t() - { - Result = d.Result, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GetVideoURLResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientVideo + 11; - internal Result Result; // m_eResult enum EResult - internal uint VideoAppID; // m_unVideoAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GetVideoURLResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GetVideoURLResult_t) Marshal.PtrToStructure( p, typeof(GetVideoURLResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetVideoURLResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal uint VideoAppID; // m_unVideoAppID AppId_t - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string URL; // m_rgchURL char [256] - - // - // Easily convert from PackSmall to GetVideoURLResult_t - // - public static implicit operator GetVideoURLResult_t ( GetVideoURLResult_t.PackSmall d ) - { - return new GetVideoURLResult_t() - { - Result = d.Result, - VideoAppID = d.VideoAppID, - URL = d.URL, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GetOPFSettingsResult_t - { - internal const int CallbackId = CallbackIdentifiers.ClientVideo + 24; - internal Result Result; // m_eResult enum EResult - internal uint VideoAppID; // m_unVideoAppID AppId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GetOPFSettingsResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GetOPFSettingsResult_t) Marshal.PtrToStructure( p, typeof(GetOPFSettingsResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GetOPFSettingsResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal uint VideoAppID; // m_unVideoAppID AppId_t - - // - // Easily convert from PackSmall to GetOPFSettingsResult_t - // - public static implicit operator GetOPFSettingsResult_t ( GetOPFSettingsResult_t.PackSmall d ) - { - return new GetOPFSettingsResult_t() - { - Result = d.Result, - VideoAppID = d.VideoAppID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSClientApprove_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 1; - internal ulong SteamID; // m_SteamID class CSteamID - internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSClientApprove_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSClientApprove_t) Marshal.PtrToStructure( p, typeof(GSClientApprove_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientApprove_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_SteamID class CSteamID - internal ulong OwnerSteamID; // m_OwnerSteamID class CSteamID - - // - // Easily convert from PackSmall to GSClientApprove_t - // - public static implicit operator GSClientApprove_t ( GSClientApprove_t.PackSmall d ) - { - return new GSClientApprove_t() - { - SteamID = d.SteamID, - OwnerSteamID = d.OwnerSteamID, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSClientDeny_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 2; - internal ulong SteamID; // m_SteamID class CSteamID - internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string OptionalText; // m_rgchOptionalText char [128] - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSClientDeny_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSClientDeny_t) Marshal.PtrToStructure( p, typeof(GSClientDeny_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientDeny_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_SteamID class CSteamID - internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string OptionalText; // m_rgchOptionalText char [128] - - // - // Easily convert from PackSmall to GSClientDeny_t - // - public static implicit operator GSClientDeny_t ( GSClientDeny_t.PackSmall d ) - { - return new GSClientDeny_t() - { - SteamID = d.SteamID, - DenyReason = d.DenyReason, - OptionalText = d.OptionalText, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSClientKick_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 3; - internal ulong SteamID; // m_SteamID class CSteamID - internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSClientKick_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSClientKick_t) Marshal.PtrToStructure( p, typeof(GSClientKick_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientKick_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_SteamID class CSteamID - internal DenyReason DenyReason; // m_eDenyReason enum EDenyReason - - // - // Easily convert from PackSmall to GSClientKick_t - // - public static implicit operator GSClientKick_t ( GSClientKick_t.PackSmall d ) - { - return new GSClientKick_t() - { - SteamID = d.SteamID, - DenyReason = d.DenyReason, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GSClientAchievementStatus_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 6; - internal ulong SteamID; // m_SteamID uint64 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string PchAchievement; // m_pchAchievement char [128] - [MarshalAs(UnmanagedType.I1)] - internal bool Unlocked; // m_bUnlocked _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSClientAchievementStatus_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSClientAchievementStatus_t) Marshal.PtrToStructure( p, typeof(GSClientAchievementStatus_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientAchievementStatus_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamID; // m_SteamID uint64 - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string PchAchievement; // m_pchAchievement char [128] - [MarshalAs(UnmanagedType.I1)] - internal bool Unlocked; // m_bUnlocked _Bool - - // - // Easily convert from PackSmall to GSClientAchievementStatus_t - // - public static implicit operator GSClientAchievementStatus_t ( GSClientAchievementStatus_t.PackSmall d ) - { - return new GSClientAchievementStatus_t() - { - SteamID = d.SteamID, - PchAchievement = d.PchAchievement, - Unlocked = d.Unlocked, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GSPolicyResponse_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 15; - internal byte Secure; // m_bSecure uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSPolicyResponse_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSPolicyResponse_t) Marshal.PtrToStructure( p, typeof(GSPolicyResponse_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSPolicyResponse_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte Secure; // m_bSecure uint8 - - // - // Easily convert from PackSmall to GSPolicyResponse_t - // - public static implicit operator GSPolicyResponse_t ( GSPolicyResponse_t.PackSmall d ) - { - return new GSPolicyResponse_t() - { - Secure = d.Secure, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GSGameplayStats_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 7; - internal Result Result; // m_eResult enum EResult - internal int Rank; // m_nRank int32 - internal uint TotalConnects; // m_unTotalConnects uint32 - internal uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSGameplayStats_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSGameplayStats_t) Marshal.PtrToStructure( p, typeof(GSGameplayStats_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSGameplayStats_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int Rank; // m_nRank int32 - internal uint TotalConnects; // m_unTotalConnects uint32 - internal uint TotalMinutesPlayed; // m_unTotalMinutesPlayed uint32 - - // - // Easily convert from PackSmall to GSGameplayStats_t - // - public static implicit operator GSGameplayStats_t ( GSGameplayStats_t.PackSmall d ) - { - return new GSGameplayStats_t() - { - Result = d.Result, - Rank = d.Rank, - TotalConnects = d.TotalConnects, - TotalMinutesPlayed = d.TotalMinutesPlayed, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSClientGroupStatus_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 8; - internal ulong SteamIDUser; // m_SteamIDUser class CSteamID - internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool Member; // m_bMember _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Officer; // m_bOfficer _Bool - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSClientGroupStatus_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSClientGroupStatus_t) Marshal.PtrToStructure( p, typeof(GSClientGroupStatus_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSClientGroupStatus_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_SteamIDUser class CSteamID - internal ulong SteamIDGroup; // m_SteamIDGroup class CSteamID - [MarshalAs(UnmanagedType.I1)] - internal bool Member; // m_bMember _Bool - [MarshalAs(UnmanagedType.I1)] - internal bool Officer; // m_bOfficer _Bool - - // - // Easily convert from PackSmall to GSClientGroupStatus_t - // - public static implicit operator GSClientGroupStatus_t ( GSClientGroupStatus_t.PackSmall d ) - { - return new GSClientGroupStatus_t() - { - SteamIDUser = d.SteamIDUser, - SteamIDGroup = d.SteamIDGroup, - Member = d.Member, - Officer = d.Officer, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GSReputation_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 9; - internal Result Result; // m_eResult enum EResult - internal uint ReputationScore; // m_unReputationScore uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - internal uint BannedIP; // m_unBannedIP uint32 - internal ushort BannedPort; // m_usBannedPort uint16 - internal ulong BannedGameID; // m_ulBannedGameID uint64 - internal uint BanExpires; // m_unBanExpires uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSReputation_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSReputation_t) Marshal.PtrToStructure( p, typeof(GSReputation_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSReputation_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal uint ReputationScore; // m_unReputationScore uint32 - [MarshalAs(UnmanagedType.I1)] - internal bool Banned; // m_bBanned _Bool - internal uint BannedIP; // m_unBannedIP uint32 - internal ushort BannedPort; // m_usBannedPort uint16 - internal ulong BannedGameID; // m_ulBannedGameID uint64 - internal uint BanExpires; // m_unBanExpires uint32 - - // - // Easily convert from PackSmall to GSReputation_t - // - public static implicit operator GSReputation_t ( GSReputation_t.PackSmall d ) - { - return new GSReputation_t() - { - Result = d.Result, - ReputationScore = d.ReputationScore, - Banned = d.Banned, - BannedIP = d.BannedIP, - BannedPort = d.BannedPort, - BannedGameID = d.BannedGameID, - BanExpires = d.BanExpires, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct AssociateWithClanResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 10; - internal Result Result; // m_eResult enum EResult - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static AssociateWithClanResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (AssociateWithClanResult_t) Marshal.PtrToStructure( p, typeof(AssociateWithClanResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(AssociateWithClanResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - - // - // Easily convert from PackSmall to AssociateWithClanResult_t - // - public static implicit operator AssociateWithClanResult_t ( AssociateWithClanResult_t.PackSmall d ) - { - return new AssociateWithClanResult_t() - { - Result = d.Result, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct ComputeNewPlayerCompatibilityResult_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServer + 11; - internal Result Result; // m_eResult enum EResult - internal int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int - internal int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int - internal int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int - internal ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ComputeNewPlayerCompatibilityResult_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ComputeNewPlayerCompatibilityResult_t) Marshal.PtrToStructure( p, typeof(ComputeNewPlayerCompatibilityResult_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ComputeNewPlayerCompatibilityResult_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal int CPlayersThatDontLikeCandidate; // m_cPlayersThatDontLikeCandidate int - internal int CPlayersThatCandidateDoesntLike; // m_cPlayersThatCandidateDoesntLike int - internal int CClanPlayersThatDontLikeCandidate; // m_cClanPlayersThatDontLikeCandidate int - internal ulong SteamIDCandidate; // m_SteamIDCandidate class CSteamID - - // - // Easily convert from PackSmall to ComputeNewPlayerCompatibilityResult_t - // - public static implicit operator ComputeNewPlayerCompatibilityResult_t ( ComputeNewPlayerCompatibilityResult_t.PackSmall d ) - { - return new ComputeNewPlayerCompatibilityResult_t() - { - Result = d.Result, - CPlayersThatDontLikeCandidate = d.CPlayersThatDontLikeCandidate, - CPlayersThatCandidateDoesntLike = d.CPlayersThatCandidateDoesntLike, - CClanPlayersThatDontLikeCandidate = d.CClanPlayersThatDontLikeCandidate, - SteamIDCandidate = d.SteamIDCandidate, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSStatsReceived_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServerStats + 0; - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSStatsReceived_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSStatsReceived_t) Marshal.PtrToStructure( p, typeof(GSStatsReceived_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsReceived_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to GSStatsReceived_t - // - public static implicit operator GSStatsReceived_t ( GSStatsReceived_t.PackSmall d ) - { - return new GSStatsReceived_t() - { - Result = d.Result, - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSStatsStored_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameServerStats + 1; - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSStatsStored_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSStatsStored_t) Marshal.PtrToStructure( p, typeof(GSStatsStored_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsStored_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal Result Result; // m_eResult enum EResult - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to GSStatsStored_t - // - public static implicit operator GSStatsStored_t ( GSStatsStored_t.PackSmall d ) - { - return new GSStatsStored_t() - { - Result = d.Result, - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static CallResult CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action CallbackFunction ) - { - return new CallResult( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId ); - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct GSStatsUnloaded_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUserStats + 8; - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GSStatsUnloaded_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GSStatsUnloaded_t) Marshal.PtrToStructure( p, typeof(GSStatsUnloaded_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GSStatsUnloaded_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal ulong SteamIDUser; // m_steamIDUser class CSteamID - - // - // Easily convert from PackSmall to GSStatsUnloaded_t - // - public static implicit operator GSStatsUnloaded_t ( GSStatsUnloaded_t.PackSmall d ) - { - return new GSStatsUnloaded_t() - { - SteamIDUser = d.SteamIDUser, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ItemInstalled_t - { - internal const int CallbackId = CallbackIdentifiers.ClientUGC + 5; - internal uint AppID; // m_unAppID AppId_t - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ItemInstalled_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ItemInstalled_t) Marshal.PtrToStructure( p, typeof(ItemInstalled_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ItemInstalled_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint AppID; // m_unAppID AppId_t - internal ulong PublishedFileId; // m_nPublishedFileId PublishedFileId_t - - // - // Easily convert from PackSmall to ItemInstalled_t - // - public static implicit operator ItemInstalled_t ( ItemInstalled_t.PackSmall d ) - { - return new ItemInstalled_t() - { - AppID = d.AppID, - PublishedFileId = d.PublishedFileId, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamInventoryDefinitionUpdate_t - { - internal const int CallbackId = CallbackIdentifiers.ClientInventory + 2; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamInventoryDefinitionUpdate_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamInventoryDefinitionUpdate_t) Marshal.PtrToStructure( p, typeof(SteamInventoryDefinitionUpdate_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamInventoryDefinitionUpdate_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to SteamInventoryDefinitionUpdate_t - // - public static implicit operator SteamInventoryDefinitionUpdate_t ( SteamInventoryDefinitionUpdate_t.PackSmall d ) - { - return new SteamInventoryDefinitionUpdate_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamParentalSettingsChanged_t - { - internal const int CallbackId = CallbackIdentifiers.SteamParentalSettings + 1; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamParentalSettingsChanged_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamParentalSettingsChanged_t) Marshal.PtrToStructure( p, typeof(SteamParentalSettingsChanged_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamParentalSettingsChanged_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to SteamParentalSettingsChanged_t - // - public static implicit operator SteamParentalSettingsChanged_t ( SteamParentalSettingsChanged_t.PackSmall d ) - { - return new SteamParentalSettingsChanged_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamServersConnected_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 1; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamServersConnected_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamServersConnected_t) Marshal.PtrToStructure( p, typeof(SteamServersConnected_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamServersConnected_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to SteamServersConnected_t - // - public static implicit operator SteamServersConnected_t ( SteamServersConnected_t.PackSmall d ) - { - return new SteamServersConnected_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct NewLaunchQueryParameters_t - { - internal const int CallbackId = CallbackIdentifiers.SteamApps + 14; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static NewLaunchQueryParameters_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (NewLaunchQueryParameters_t) Marshal.PtrToStructure( p, typeof(NewLaunchQueryParameters_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(NewLaunchQueryParameters_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to NewLaunchQueryParameters_t - // - public static implicit operator NewLaunchQueryParameters_t ( NewLaunchQueryParameters_t.PackSmall d ) - { - return new NewLaunchQueryParameters_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GCMessageAvailable_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameCoordinator + 1; - internal uint MessageSize; // m_nMessageSize uint32 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GCMessageAvailable_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GCMessageAvailable_t) Marshal.PtrToStructure( p, typeof(GCMessageAvailable_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageAvailable_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal uint MessageSize; // m_nMessageSize uint32 - - // - // Easily convert from PackSmall to GCMessageAvailable_t - // - public static implicit operator GCMessageAvailable_t ( GCMessageAvailable_t.PackSmall d ) - { - return new GCMessageAvailable_t() - { - MessageSize = d.MessageSize, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct GCMessageFailed_t - { - internal const int CallbackId = CallbackIdentifiers.SteamGameCoordinator + 2; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static GCMessageFailed_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (GCMessageFailed_t) Marshal.PtrToStructure( p, typeof(GCMessageFailed_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(GCMessageFailed_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to GCMessageFailed_t - // - public static implicit operator GCMessageFailed_t ( GCMessageFailed_t.PackSmall d ) - { - return new GCMessageFailed_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct ScreenshotRequested_t - { - internal const int CallbackId = CallbackIdentifiers.SteamScreenshots + 2; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static ScreenshotRequested_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (ScreenshotRequested_t) Marshal.PtrToStructure( p, typeof(ScreenshotRequested_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(ScreenshotRequested_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to ScreenshotRequested_t - // - public static implicit operator ScreenshotRequested_t ( ScreenshotRequested_t.PackSmall d ) - { - return new ScreenshotRequested_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct LicensesUpdated_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 25; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static LicensesUpdated_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (LicensesUpdated_t) Marshal.PtrToStructure( p, typeof(LicensesUpdated_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(LicensesUpdated_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to LicensesUpdated_t - // - public static implicit operator LicensesUpdated_t ( LicensesUpdated_t.PackSmall d ) - { - return new LicensesUpdated_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct SteamShutdown_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 4; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static SteamShutdown_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (SteamShutdown_t) Marshal.PtrToStructure( p, typeof(SteamShutdown_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(SteamShutdown_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to SteamShutdown_t - // - public static implicit operator SteamShutdown_t ( SteamShutdown_t.PackSmall d ) - { - return new SteamShutdown_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct IPCountry_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUtils + 1; - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static IPCountry_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (IPCountry_t) Marshal.PtrToStructure( p, typeof(IPCountry_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCountry_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - - // - // Easily convert from PackSmall to IPCountry_t - // - public static implicit operator IPCountry_t ( IPCountry_t.PackSmall d ) - { - return new IPCountry_t() - { - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - [StructLayout( LayoutKind.Sequential, Pack = 8 )] - internal struct IPCFailure_t - { - internal const int CallbackId = CallbackIdentifiers.SteamUser + 17; - internal byte FailureType; // m_eFailureType uint8 - - // - // Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff. - // - internal static IPCFailure_t FromPointer( IntPtr p ) - { - if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) ); - return (IPCFailure_t) Marshal.PtrToStructure( p, typeof(IPCFailure_t) ); - } - - // - // Get the size of the structure we're going to be using. - // - internal static int StructSize() - { - if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) ); - return System.Runtime.InteropServices.Marshal.SizeOf( typeof(IPCFailure_t) ); - } - - [StructLayout( LayoutKind.Sequential, Pack = 4 )] - internal struct PackSmall - { - internal byte FailureType; // m_eFailureType uint8 - - // - // Easily convert from PackSmall to IPCFailure_t - // - public static implicit operator IPCFailure_t ( IPCFailure_t.PackSmall d ) - { - return new IPCFailure_t() - { - FailureType = d.FailureType, - }; - } - } - - internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - var handle = new CallbackHandle( steamworks ); - - // - // Create the functions we need for the vtable - // - if ( Facepunch.Steamworks.Config.UseThisCall ) - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWinThis ) ) ); - var vTable = new Callback.VTableWinThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableThis ) ) ); - var vTable = new Callback.VTableThis - { - ResultA = OnResultThis, - ResultB = OnResultWithInfoThis, - GetSize = OnGetSizeThis, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - else - { - // - // Create the VTable by manually allocating the memory and copying across - // - if ( Platform.IsWindows ) - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin ) ) ); - var vTable = new Callback.VTableWin - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - else - { - handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable ) ) ); - var vTable = new Callback.VTable - { - ResultA = OnResult, - ResultB = OnResultWithInfo, - GetSize = OnGetSize, - }; - handle.FuncA = GCHandle.Alloc( vTable.ResultA ); - handle.FuncB = GCHandle.Alloc( vTable.ResultB ); - handle.FuncC = GCHandle.Alloc( vTable.GetSize ); - Marshal.StructureToPtr( vTable, handle.vTablePtr, false ); - } - } - - // - // Create the callback object - // - var cb = new Callback(); - cb.vTablePtr = handle.vTablePtr; - cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0; - cb.CallbackId = CallbackId; - - // - // Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native - // - handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned ); - - // - // Register the callback with Steam - // - steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId ); - - steamworks.RegisterCallbackHandle( handle ); - } - - [MonoPInvokeCallback] - internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); } - [MonoPInvokeCallback] - internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); } - [MonoPInvokeCallback] - internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); } - [MonoPInvokeCallback] - internal static int OnGetSize(){ return StructSize(); } - - [MonoPInvokeCallback] - internal static void OnResult( IntPtr param ) - { - OnResultWithInfo( param, false, 0 ); - } - - [MonoPInvokeCallback] - internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call ) - { - if ( failure ) return; - - var value = FromPointer( param ); - - if ( Facepunch.Steamworks.Client.Instance != null ) - Facepunch.Steamworks.Client.Instance.OnCallback( value ); - - if ( Facepunch.Steamworks.Server.Instance != null ) - Facepunch.Steamworks.Server.Instance.OnCallback( value ); - } - } - - internal static class Callbacks - { - internal static void RegisterCallbacks( Facepunch.Steamworks.BaseSteamworks steamworks ) - { - SteamServerConnectFailure_t.Register( steamworks ); - SteamServersDisconnected_t.Register( steamworks ); - ClientGameServerDeny_t.Register( steamworks ); - ValidateAuthTicketResponse_t.Register( steamworks ); - MicroTxnAuthorizationResponse_t.Register( steamworks ); - EncryptedAppTicketResponse_t.Register( steamworks ); - GetAuthSessionTicketResponse_t.Register( steamworks ); - GameWebCallback_t.Register( steamworks ); - StoreAuthURLResponse_t.Register( steamworks ); - PersonaStateChange_t.Register( steamworks ); - GameOverlayActivated_t.Register( steamworks ); - GameServerChangeRequested_t.Register( steamworks ); - GameLobbyJoinRequested_t.Register( steamworks ); - AvatarImageLoaded_t.Register( steamworks ); - ClanOfficerListResponse_t.Register( steamworks ); - FriendRichPresenceUpdate_t.Register( steamworks ); - GameRichPresenceJoinRequested_t.Register( steamworks ); - GameConnectedClanChatMsg_t.Register( steamworks ); - GameConnectedChatJoin_t.Register( steamworks ); - GameConnectedChatLeave_t.Register( steamworks ); - DownloadClanActivityCountsResult_t.Register( steamworks ); - JoinClanChatRoomCompletionResult_t.Register( steamworks ); - GameConnectedFriendChatMsg_t.Register( steamworks ); - FriendsGetFollowerCount_t.Register( steamworks ); - FriendsIsFollowing_t.Register( steamworks ); - FriendsEnumerateFollowingList_t.Register( steamworks ); - SetPersonaNameResponse_t.Register( steamworks ); - LowBatteryPower_t.Register( steamworks ); - SteamAPICallCompleted_t.Register( steamworks ); - CheckFileSignature_t.Register( steamworks ); - GamepadTextInputDismissed_t.Register( steamworks ); - FavoritesListChanged_t.Register( steamworks ); - LobbyInvite_t.Register( steamworks ); - LobbyEnter_t.Register( steamworks ); - LobbyDataUpdate_t.Register( steamworks ); - LobbyChatUpdate_t.Register( steamworks ); - LobbyChatMsg_t.Register( steamworks ); - LobbyGameCreated_t.Register( steamworks ); - LobbyMatchList_t.Register( steamworks ); - LobbyKicked_t.Register( steamworks ); - LobbyCreated_t.Register( steamworks ); - PSNGameBootInviteResult_t.Register( steamworks ); - FavoritesListAccountsUpdated_t.Register( steamworks ); - RemoteStorageAppSyncedClient_t.Register( steamworks ); - RemoteStorageAppSyncedServer_t.Register( steamworks ); - RemoteStorageAppSyncProgress_t.Register( steamworks ); - RemoteStorageAppSyncStatusCheck_t.Register( steamworks ); - RemoteStorageFileShareResult_t.Register( steamworks ); - RemoteStoragePublishFileResult_t.Register( steamworks ); - RemoteStorageDeletePublishedFileResult_t.Register( steamworks ); - RemoteStorageEnumerateUserPublishedFilesResult_t.Register( steamworks ); - RemoteStorageSubscribePublishedFileResult_t.Register( steamworks ); - RemoteStorageEnumerateUserSubscribedFilesResult_t.Register( steamworks ); - RemoteStorageUnsubscribePublishedFileResult_t.Register( steamworks ); - RemoteStorageUpdatePublishedFileResult_t.Register( steamworks ); - RemoteStorageDownloadUGCResult_t.Register( steamworks ); - RemoteStorageGetPublishedFileDetailsResult_t.Register( steamworks ); - RemoteStorageEnumerateWorkshopFilesResult_t.Register( steamworks ); - RemoteStorageGetPublishedItemVoteDetailsResult_t.Register( steamworks ); - RemoteStoragePublishedFileSubscribed_t.Register( steamworks ); - RemoteStoragePublishedFileUnsubscribed_t.Register( steamworks ); - RemoteStoragePublishedFileDeleted_t.Register( steamworks ); - RemoteStorageUpdateUserPublishedItemVoteResult_t.Register( steamworks ); - RemoteStorageUserVoteDetails_t.Register( steamworks ); - RemoteStorageEnumerateUserSharedWorkshopFilesResult_t.Register( steamworks ); - RemoteStorageSetUserPublishedFileActionResult_t.Register( steamworks ); - RemoteStorageEnumeratePublishedFilesByUserActionResult_t.Register( steamworks ); - RemoteStoragePublishFileProgress_t.Register( steamworks ); - RemoteStoragePublishedFileUpdated_t.Register( steamworks ); - RemoteStorageFileWriteAsyncComplete_t.Register( steamworks ); - RemoteStorageFileReadAsyncComplete_t.Register( steamworks ); - UserStatsReceived_t.Register( steamworks ); - UserStatsStored_t.Register( steamworks ); - UserAchievementStored_t.Register( steamworks ); - LeaderboardFindResult_t.Register( steamworks ); - LeaderboardScoresDownloaded_t.Register( steamworks ); - LeaderboardScoreUploaded_t.Register( steamworks ); - NumberOfCurrentPlayers_t.Register( steamworks ); - UserStatsUnloaded_t.Register( steamworks ); - UserAchievementIconFetched_t.Register( steamworks ); - GlobalAchievementPercentagesReady_t.Register( steamworks ); - LeaderboardUGCSet_t.Register( steamworks ); - PS3TrophiesInstalled_t.Register( steamworks ); - GlobalStatsReceived_t.Register( steamworks ); - DlcInstalled_t.Register( steamworks ); - RegisterActivationCodeResponse_t.Register( steamworks ); - AppProofOfPurchaseKeyResponse_t.Register( steamworks ); - FileDetailsResult_t.Register( steamworks ); - P2PSessionRequest_t.Register( steamworks ); - P2PSessionConnectFail_t.Register( steamworks ); - SocketStatusCallback_t.Register( steamworks ); - ScreenshotReady_t.Register( steamworks ); - VolumeHasChanged_t.Register( steamworks ); - MusicPlayerWantsShuffled_t.Register( steamworks ); - MusicPlayerWantsLooped_t.Register( steamworks ); - MusicPlayerWantsVolume_t.Register( steamworks ); - MusicPlayerSelectsQueueEntry_t.Register( steamworks ); - MusicPlayerSelectsPlaylistEntry_t.Register( steamworks ); - MusicPlayerWantsPlayingRepeatStatus_t.Register( steamworks ); - HTTPRequestCompleted_t.Register( steamworks ); - HTTPRequestHeadersReceived_t.Register( steamworks ); - HTTPRequestDataReceived_t.Register( steamworks ); - SteamUGCQueryCompleted_t.Register( steamworks ); - SteamUGCRequestUGCDetailsResult_t.Register( steamworks ); - CreateItemResult_t.Register( steamworks ); - SubmitItemUpdateResult_t.Register( steamworks ); - DownloadItemResult_t.Register( steamworks ); - UserFavoriteItemsListChanged_t.Register( steamworks ); - SetUserItemVoteResult_t.Register( steamworks ); - GetUserItemVoteResult_t.Register( steamworks ); - StartPlaytimeTrackingResult_t.Register( steamworks ); - StopPlaytimeTrackingResult_t.Register( steamworks ); - AddUGCDependencyResult_t.Register( steamworks ); - RemoveUGCDependencyResult_t.Register( steamworks ); - AddAppDependencyResult_t.Register( steamworks ); - RemoveAppDependencyResult_t.Register( steamworks ); - GetAppDependenciesResult_t.Register( steamworks ); - DeleteItemResult_t.Register( steamworks ); - SteamAppInstalled_t.Register( steamworks ); - SteamAppUninstalled_t.Register( steamworks ); - HTML_BrowserReady_t.Register( steamworks ); - HTML_URLChanged_t.Register( steamworks ); - HTML_FinishedRequest_t.Register( steamworks ); - HTML_OpenLinkInNewTab_t.Register( steamworks ); - HTML_ChangedTitle_t.Register( steamworks ); - HTML_SearchResults_t.Register( steamworks ); - HTML_CanGoBackAndForward_t.Register( steamworks ); - HTML_HorizontalScroll_t.Register( steamworks ); - HTML_VerticalScroll_t.Register( steamworks ); - HTML_LinkAtPosition_t.Register( steamworks ); - HTML_JSAlert_t.Register( steamworks ); - HTML_JSConfirm_t.Register( steamworks ); - HTML_FileOpenDialog_t.Register( steamworks ); - HTML_NewWindow_t.Register( steamworks ); - HTML_SetCursor_t.Register( steamworks ); - HTML_StatusText_t.Register( steamworks ); - HTML_ShowToolTip_t.Register( steamworks ); - HTML_UpdateToolTip_t.Register( steamworks ); - HTML_HideToolTip_t.Register( steamworks ); - HTML_BrowserRestarted_t.Register( steamworks ); - SteamInventoryResultReady_t.Register( steamworks ); - SteamInventoryFullUpdate_t.Register( steamworks ); - SteamInventoryEligiblePromoItemDefIDs_t.Register( steamworks ); - SteamInventoryStartPurchaseResult_t.Register( steamworks ); - SteamInventoryRequestPricesResult_t.Register( steamworks ); - BroadcastUploadStop_t.Register( steamworks ); - GetVideoURLResult_t.Register( steamworks ); - GetOPFSettingsResult_t.Register( steamworks ); - GSClientApprove_t.Register( steamworks ); - GSClientDeny_t.Register( steamworks ); - GSClientKick_t.Register( steamworks ); - GSClientAchievementStatus_t.Register( steamworks ); - GSPolicyResponse_t.Register( steamworks ); - GSGameplayStats_t.Register( steamworks ); - GSClientGroupStatus_t.Register( steamworks ); - GSReputation_t.Register( steamworks ); - AssociateWithClanResult_t.Register( steamworks ); - ComputeNewPlayerCompatibilityResult_t.Register( steamworks ); - GSStatsReceived_t.Register( steamworks ); - GSStatsStored_t.Register( steamworks ); - GSStatsUnloaded_t.Register( steamworks ); - ItemInstalled_t.Register( steamworks ); - SteamInventoryDefinitionUpdate_t.Register( steamworks ); - SteamParentalSettingsChanged_t.Register( steamworks ); - SteamServersConnected_t.Register( steamworks ); - NewLaunchQueryParameters_t.Register( steamworks ); - GCMessageAvailable_t.Register( steamworks ); - GCMessageFailed_t.Register( steamworks ); - ScreenshotRequested_t.Register( steamworks ); - LicensesUpdated_t.Register( steamworks ); - SteamShutdown_t.Register( steamworks ); - IPCountry_t.Register( steamworks ); - IPCFailure_t.Register( steamworks ); - } - } -} diff --git a/Facepunch.Steamworks/SteamNative/SteamNative.Types.cs b/Facepunch.Steamworks/SteamNative/SteamNative.Types.cs deleted file mode 100644 index 4cbb9d3..0000000 --- a/Facepunch.Steamworks/SteamNative/SteamNative.Types.cs +++ /dev/null @@ -1,712 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Linq; - -namespace SteamNative -{ - internal struct GID_t - { - public ulong Value; - - public static implicit operator GID_t( ulong value ) - { - return new GID_t(){ Value = value }; - } - - public static implicit operator ulong( GID_t value ) - { - return value.Value; - } - } - - internal struct JobID_t - { - public ulong Value; - - public static implicit operator JobID_t( ulong value ) - { - return new JobID_t(){ Value = value }; - } - - public static implicit operator ulong( JobID_t value ) - { - return value.Value; - } - } - - internal struct TxnID_t - { - public GID_t Value; - - public static implicit operator TxnID_t( GID_t value ) - { - return new TxnID_t(){ Value = value }; - } - - public static implicit operator GID_t( TxnID_t value ) - { - return value.Value; - } - } - - internal struct PackageId_t - { - public uint Value; - - public static implicit operator PackageId_t( uint value ) - { - return new PackageId_t(){ Value = value }; - } - - public static implicit operator uint( PackageId_t value ) - { - return value.Value; - } - } - - internal struct BundleId_t - { - public uint Value; - - public static implicit operator BundleId_t( uint value ) - { - return new BundleId_t(){ Value = value }; - } - - public static implicit operator uint( BundleId_t value ) - { - return value.Value; - } - } - - internal struct AppId_t - { - public uint Value; - - public static implicit operator AppId_t( uint value ) - { - return new AppId_t(){ Value = value }; - } - - public static implicit operator uint( AppId_t value ) - { - return value.Value; - } - } - - internal struct AssetClassId_t - { - public ulong Value; - - public static implicit operator AssetClassId_t( ulong value ) - { - return new AssetClassId_t(){ Value = value }; - } - - public static implicit operator ulong( AssetClassId_t value ) - { - return value.Value; - } - } - - internal struct PhysicalItemId_t - { - public uint Value; - - public static implicit operator PhysicalItemId_t( uint value ) - { - return new PhysicalItemId_t(){ Value = value }; - } - - public static implicit operator uint( PhysicalItemId_t value ) - { - return value.Value; - } - } - - internal struct DepotId_t - { - public uint Value; - - public static implicit operator DepotId_t( uint value ) - { - return new DepotId_t(){ Value = value }; - } - - public static implicit operator uint( DepotId_t value ) - { - return value.Value; - } - } - - internal struct RTime32 - { - public uint Value; - - public static implicit operator RTime32( uint value ) - { - return new RTime32(){ Value = value }; - } - - public static implicit operator uint( RTime32 value ) - { - return value.Value; - } - } - - internal struct CellID_t - { - public uint Value; - - public static implicit operator CellID_t( uint value ) - { - return new CellID_t(){ Value = value }; - } - - public static implicit operator uint( CellID_t value ) - { - return value.Value; - } - } - - internal struct SteamAPICall_t - { - public ulong Value; - - public static implicit operator SteamAPICall_t( ulong value ) - { - return new SteamAPICall_t(){ Value = value }; - } - - public static implicit operator ulong( SteamAPICall_t value ) - { - return value.Value; - } - } - - internal struct AccountID_t - { - public uint Value; - - public static implicit operator AccountID_t( uint value ) - { - return new AccountID_t(){ Value = value }; - } - - public static implicit operator uint( AccountID_t value ) - { - return value.Value; - } - } - - internal struct PartnerId_t - { - public uint Value; - - public static implicit operator PartnerId_t( uint value ) - { - return new PartnerId_t(){ Value = value }; - } - - public static implicit operator uint( PartnerId_t value ) - { - return value.Value; - } - } - - internal struct ManifestId_t - { - public ulong Value; - - public static implicit operator ManifestId_t( ulong value ) - { - return new ManifestId_t(){ Value = value }; - } - - public static implicit operator ulong( ManifestId_t value ) - { - return value.Value; - } - } - - internal struct SiteId_t - { - public ulong Value; - - public static implicit operator SiteId_t( ulong value ) - { - return new SiteId_t(){ Value = value }; - } - - public static implicit operator ulong( SiteId_t value ) - { - return value.Value; - } - } - - internal struct HAuthTicket - { - public uint Value; - - public static implicit operator HAuthTicket( uint value ) - { - return new HAuthTicket(){ Value = value }; - } - - public static implicit operator uint( HAuthTicket value ) - { - return value.Value; - } - } - - internal struct BREAKPAD_HANDLE - { - public IntPtr Value; - - public static implicit operator BREAKPAD_HANDLE( IntPtr value ) - { - return new BREAKPAD_HANDLE(){ Value = value }; - } - - public static implicit operator IntPtr( BREAKPAD_HANDLE value ) - { - return value.Value; - } - } - - internal struct HSteamPipe - { - public int Value; - - public static implicit operator HSteamPipe( int value ) - { - return new HSteamPipe(){ Value = value }; - } - - public static implicit operator int( HSteamPipe value ) - { - return value.Value; - } - } - - internal struct HSteamUser - { - public int Value; - - public static implicit operator HSteamUser( int value ) - { - return new HSteamUser(){ Value = value }; - } - - public static implicit operator int( HSteamUser value ) - { - return value.Value; - } - } - - internal struct FriendsGroupID_t - { - public short Value; - - public static implicit operator FriendsGroupID_t( short value ) - { - return new FriendsGroupID_t(){ Value = value }; - } - - public static implicit operator short( FriendsGroupID_t value ) - { - return value.Value; - } - } - - internal struct HServerListRequest - { - public IntPtr Value; - - public static implicit operator HServerListRequest( IntPtr value ) - { - return new HServerListRequest(){ Value = value }; - } - - public static implicit operator IntPtr( HServerListRequest value ) - { - return value.Value; - } - } - - internal struct HServerQuery - { - public int Value; - - public static implicit operator HServerQuery( int value ) - { - return new HServerQuery(){ Value = value }; - } - - public static implicit operator int( HServerQuery value ) - { - return value.Value; - } - } - - internal struct UGCHandle_t - { - public ulong Value; - - public static implicit operator UGCHandle_t( ulong value ) - { - return new UGCHandle_t(){ Value = value }; - } - - public static implicit operator ulong( UGCHandle_t value ) - { - return value.Value; - } - } - - internal struct PublishedFileUpdateHandle_t - { - public ulong Value; - - public static implicit operator PublishedFileUpdateHandle_t( ulong value ) - { - return new PublishedFileUpdateHandle_t(){ Value = value }; - } - - public static implicit operator ulong( PublishedFileUpdateHandle_t value ) - { - return value.Value; - } - } - - internal struct PublishedFileId_t - { - public ulong Value; - - public static implicit operator PublishedFileId_t( ulong value ) - { - return new PublishedFileId_t(){ Value = value }; - } - - public static implicit operator ulong( PublishedFileId_t value ) - { - return value.Value; - } - } - - internal struct UGCFileWriteStreamHandle_t - { - public ulong Value; - - public static implicit operator UGCFileWriteStreamHandle_t( ulong value ) - { - return new UGCFileWriteStreamHandle_t(){ Value = value }; - } - - public static implicit operator ulong( UGCFileWriteStreamHandle_t value ) - { - return value.Value; - } - } - - internal struct SteamLeaderboard_t - { - public ulong Value; - - public static implicit operator SteamLeaderboard_t( ulong value ) - { - return new SteamLeaderboard_t(){ Value = value }; - } - - public static implicit operator ulong( SteamLeaderboard_t value ) - { - return value.Value; - } - } - - internal struct SteamLeaderboardEntries_t - { - public ulong Value; - - public static implicit operator SteamLeaderboardEntries_t( ulong value ) - { - return new SteamLeaderboardEntries_t(){ Value = value }; - } - - public static implicit operator ulong( SteamLeaderboardEntries_t value ) - { - return value.Value; - } - } - - internal struct SNetSocket_t - { - public uint Value; - - public static implicit operator SNetSocket_t( uint value ) - { - return new SNetSocket_t(){ Value = value }; - } - - public static implicit operator uint( SNetSocket_t value ) - { - return value.Value; - } - } - - internal struct SNetListenSocket_t - { - public uint Value; - - public static implicit operator SNetListenSocket_t( uint value ) - { - return new SNetListenSocket_t(){ Value = value }; - } - - public static implicit operator uint( SNetListenSocket_t value ) - { - return value.Value; - } - } - - internal struct ScreenshotHandle - { - public uint Value; - - public static implicit operator ScreenshotHandle( uint value ) - { - return new ScreenshotHandle(){ Value = value }; - } - - public static implicit operator uint( ScreenshotHandle value ) - { - return value.Value; - } - } - - internal struct HTTPRequestHandle - { - public uint Value; - - public static implicit operator HTTPRequestHandle( uint value ) - { - return new HTTPRequestHandle(){ Value = value }; - } - - public static implicit operator uint( HTTPRequestHandle value ) - { - return value.Value; - } - } - - internal struct HTTPCookieContainerHandle - { - public uint Value; - - public static implicit operator HTTPCookieContainerHandle( uint value ) - { - return new HTTPCookieContainerHandle(){ Value = value }; - } - - public static implicit operator uint( HTTPCookieContainerHandle value ) - { - return value.Value; - } - } - - internal struct ControllerHandle_t - { - public ulong Value; - - public static implicit operator ControllerHandle_t( ulong value ) - { - return new ControllerHandle_t(){ Value = value }; - } - - public static implicit operator ulong( ControllerHandle_t value ) - { - return value.Value; - } - } - - internal struct ControllerActionSetHandle_t - { - public ulong Value; - - public static implicit operator ControllerActionSetHandle_t( ulong value ) - { - return new ControllerActionSetHandle_t(){ Value = value }; - } - - public static implicit operator ulong( ControllerActionSetHandle_t value ) - { - return value.Value; - } - } - - internal struct ControllerDigitalActionHandle_t - { - public ulong Value; - - public static implicit operator ControllerDigitalActionHandle_t( ulong value ) - { - return new ControllerDigitalActionHandle_t(){ Value = value }; - } - - public static implicit operator ulong( ControllerDigitalActionHandle_t value ) - { - return value.Value; - } - } - - internal struct ControllerAnalogActionHandle_t - { - public ulong Value; - - public static implicit operator ControllerAnalogActionHandle_t( ulong value ) - { - return new ControllerAnalogActionHandle_t(){ Value = value }; - } - - public static implicit operator ulong( ControllerAnalogActionHandle_t value ) - { - return value.Value; - } - } - - internal struct UGCQueryHandle_t - { - public ulong Value; - - public static implicit operator UGCQueryHandle_t( ulong value ) - { - return new UGCQueryHandle_t(){ Value = value }; - } - - public static implicit operator ulong( UGCQueryHandle_t value ) - { - return value.Value; - } - } - - internal struct UGCUpdateHandle_t - { - public ulong Value; - - public static implicit operator UGCUpdateHandle_t( ulong value ) - { - return new UGCUpdateHandle_t(){ Value = value }; - } - - public static implicit operator ulong( UGCUpdateHandle_t value ) - { - return value.Value; - } - } - - internal struct HHTMLBrowser - { - public uint Value; - - public static implicit operator HHTMLBrowser( uint value ) - { - return new HHTMLBrowser(){ Value = value }; - } - - public static implicit operator uint( HHTMLBrowser value ) - { - return value.Value; - } - } - - internal struct SteamItemInstanceID_t - { - public ulong Value; - - public static implicit operator SteamItemInstanceID_t( ulong value ) - { - return new SteamItemInstanceID_t(){ Value = value }; - } - - public static implicit operator ulong( SteamItemInstanceID_t value ) - { - return value.Value; - } - } - - internal struct SteamItemDef_t - { - public int Value; - - public static implicit operator SteamItemDef_t( int value ) - { - return new SteamItemDef_t(){ Value = value }; - } - - public static implicit operator int( SteamItemDef_t value ) - { - return value.Value; - } - } - - internal struct SteamInventoryResult_t - { - public int Value; - - public static implicit operator SteamInventoryResult_t( int value ) - { - return new SteamInventoryResult_t(){ Value = value }; - } - - public static implicit operator int( SteamInventoryResult_t value ) - { - return value.Value; - } - } - - internal struct SteamInventoryUpdateHandle_t - { - public ulong Value; - - public static implicit operator SteamInventoryUpdateHandle_t( ulong value ) - { - return new SteamInventoryUpdateHandle_t(){ Value = value }; - } - - public static implicit operator ulong( SteamInventoryUpdateHandle_t value ) - { - return value.Value; - } - } - - internal struct CGameID - { - public ulong Value; - - public static implicit operator CGameID( ulong value ) - { - return new CGameID(){ Value = value }; - } - - public static implicit operator ulong( CGameID value ) - { - return value.Value; - } - } - - internal struct CSteamID - { - public ulong Value; - - public static implicit operator CSteamID( ulong value ) - { - return new CSteamID(){ Value = value }; - } - - public static implicit operator ulong( CSteamID value ) - { - return value.Value; - } - } - -} diff --git a/Facepunch.Steamworks/SteamNetworking.cs b/Facepunch.Steamworks/SteamNetworking.cs new file mode 100644 index 0000000..41b592d --- /dev/null +++ b/Facepunch.Steamworks/SteamNetworking.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamNetworking + { + static ISteamNetworking _internal; + internal static ISteamNetworking Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamNetworking(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + P2PSessionRequest_t.Install( x => OnP2PSessionRequest?.Invoke( x.SteamIDRemote ) ); + P2PSessionConnectFail_t.Install( x => OnP2PConnectionFailed?.Invoke( x.SteamIDRemote, (P2PSessionError) x.P2PSessionError ) ); + } + + /// + /// This SteamId wants to send you a message. You should respond by calling AcceptP2PSessionWithUser + /// if you want to recieve their messages + /// + public static Action OnP2PSessionRequest; + + /// + /// Called when packets can't get through to the specified user. + /// All queued packets unsent at this point will be dropped, further attempts + /// to send will retry making the connection (but will be dropped if we fail again). + /// + public static Action OnP2PConnectionFailed; + + /// + /// This should be called in response to a OnP2PSessionRequest + /// + public static bool AcceptP2PSessionWithUser( SteamId user ) => Internal.AcceptP2PSessionWithUser( user ); + + /// + /// Allow or disallow P2P connects to fall back on Steam server relay if direct + /// connection or NAT traversal can't be established. Applies to connections + /// created after setting or old connections that need to reconnect. + /// + public static bool AllowP2PPacketRelay( bool allow ) => Internal.AllowP2PPacketRelay( allow ); + + /// + /// This should be called when you're done communicating with a user, as this will + /// free up all of the resources allocated for the connection under-the-hood. + /// If the remote user tries to send data to you again, a new OnP2PSessionRequest + /// callback will be posted + /// + public static bool CloseP2PSessionWithUser( SteamId user ) => Internal.CloseP2PSessionWithUser( user ); + + /// + /// Checks if a P2P packet is available to read, and gets the size of the message if there is one. + /// + public static bool IsP2PPacketAvailable( int channel = 0 ) + { + uint _ = 0; + return Internal.IsP2PPacketAvailable( ref _, channel ); + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static P2Packet? ReadP2PPacket( int channel = 0 ) + { + uint size = 0; + + if ( !Internal.IsP2PPacketAvailable( ref size, channel ) ) + return null; + + var buffer = Helpers.TakeBuffer( (int) size ); + + fixed ( byte* p = buffer ) + { + SteamId steamid = 1; + if ( !Internal.ReadP2PPacket( (IntPtr)p, (uint) buffer.Length, ref size, ref steamid, channel ) || size == 0 ) + return null; + + var data = new byte[size]; + Array.Copy( buffer, 0, data, 0, size ); + + return new P2Packet + { + SteamId = steamid, + Data = data + }; + } + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static bool ReadP2PPacket( byte[] buffer, ref uint size, ref SteamId steamid, int channel = 0 ) + { + fixed (byte* p = buffer) { + return Internal.ReadP2PPacket( (IntPtr)p, (uint)buffer.Length, ref size, ref steamid, channel ); + } + } + + /// + /// Reads in a packet that has been sent from another user via SendP2PPacket.. + /// + public unsafe static bool ReadP2PPacket( byte* buffer, uint cbuf, ref uint size, ref SteamId steamid, int channel = 0 ) + { + return Internal.ReadP2PPacket( (IntPtr)buffer, cbuf, ref size, ref steamid, channel ); + } + + /// + /// Sends a P2P packet to the specified user. + /// This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. + /// NOTE: The first packet send may be delayed as the NAT-traversal code runs. + /// + public static unsafe bool SendP2PPacket( SteamId steamid, byte[] data, int length = -1, int nChannel = 0, P2PSend sendType = P2PSend.Reliable ) + { + if ( length <= 0 ) + length = data.Length; + + fixed ( byte* p = data ) + { + return Internal.SendP2PPacket( steamid, (IntPtr)p, (uint)length, (P2PSend)sendType, nChannel ); + } + } + + /// + /// Sends a P2P packet to the specified user. + /// This is a session-less API which automatically establishes NAT-traversing or Steam relay server connections. + /// NOTE: The first packet send may be delayed as the NAT-traversal code runs. + /// + public static unsafe bool SendP2PPacket( SteamId steamid, byte* data, uint length, int nChannel = 1, P2PSend sendType = P2PSend.Reliable ) + { + return Internal.SendP2PPacket( steamid, (IntPtr)data, (uint)length, (P2PSend)sendType, nChannel ); + } + + } +} diff --git a/Facepunch.Steamworks/SteamNetworkingSockets.cs b/Facepunch.Steamworks/SteamNetworkingSockets.cs new file mode 100644 index 0000000..03db4ac --- /dev/null +++ b/Facepunch.Steamworks/SteamNetworkingSockets.cs @@ -0,0 +1,157 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamNetworkingSockets + { + static ISteamNetworkingSockets _internal; + internal static ISteamNetworkingSockets Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamNetworkingSockets(); + _internal.Init(); + + SocketInterfaces = new Dictionary(); + ConnectionInterfaces = new Dictionary(); + } + + return _internal; + } + } + + #region SocketInterface + + static Dictionary SocketInterfaces; + + internal static SocketInterface GetSocketInterface( uint id ) + { + if ( SocketInterfaces == null ) return null; + if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); + + if ( SocketInterfaces.TryGetValue( id, out var isocket ) ) + return isocket; + + return null; + } + + internal static void SetSocketInterface( uint id, SocketInterface iface ) + { + if ( id == 0 ) throw new System.ArgumentException( "Invalid Socket" ); + + Console.WriteLine( $"Installing Socket For {id}" ); + SocketInterfaces[id] = iface; + } + #endregion + + #region ConnectionInterface + static Dictionary ConnectionInterfaces; + + + internal static ConnectionInterface GetConnectionInterface( uint id ) + { + if ( ConnectionInterfaces == null ) return null; + if ( id == 0 ) return null; + + if ( ConnectionInterfaces.TryGetValue( id, out var iconnection ) ) + return iconnection; + + return null; + } + + internal static void SetConnectionInterface( uint id, ConnectionInterface iface ) + { + if ( id == 0 ) throw new System.ArgumentException( "Invalid Connection" ); + ConnectionInterfaces[id] = iface; + } + #endregion + + internal static void Shutdown() + { + _internal = null; + SocketInterfaces = null; + ConnectionInterfaces = null; + } + + internal static void InstallEvents( bool server = false ) + { + SteamNetConnectionStatusChangedCallback_t.Install( x => ConnectionStatusChanged( x ), server ); + } + + private static void ConnectionStatusChanged( SteamNetConnectionStatusChangedCallback_t data ) + { + // + // This is a message from/to a listen socket + // + if ( data.Nfo.listenSocket.Id > 0 ) + { + var iface = GetSocketInterface( data.Nfo.listenSocket.Id ); + iface?.OnConnectionChanged( data.Conn, data.Nfo ); + } + else + { + var iface = GetConnectionInterface( data.Conn.Id ); + iface?.OnConnectionChanged( data.Nfo ); + } + + OnConnectionStatusChanged?.Invoke( data.Conn, data.Nfo ); + } + + public static event Action OnConnectionStatusChanged; + + + /// + /// Creates a "server" socket that listens for clients to connect to by calling + /// Connect, over ordinary UDP (IPv4 or IPv6) + /// + public static T CreateNormalSocket( NetAddress address ) where T : SocketInterface, new() + { + var t = new T(); + t.Socket = Internal.CreateListenSocketIP( ref address ); + SetSocketInterface( t.Socket.Id, t ); + return t; + } + + /// + /// Connect to a socket created via CreateListenSocketIP + /// + public static T ConnectNormal( NetAddress address ) where T : ConnectionInterface, new() + { + var t = new T(); + t.Connection = Internal.ConnectByIPAddress( ref address ); + SetConnectionInterface( t.Connection.Id, t ); + return t; + } + + /// + /// Creates a server that will be relayed via Valve's network (hiding the IP and improving ping) + /// + public static T CreateRelaySocket( int virtualport = 0 ) where T : SocketInterface, new() + { + var t = new T(); + t.Socket = Internal.CreateListenSocketP2P( virtualport ); + SetSocketInterface( t.Socket.Id, t ); + return t; + } + + /// + /// Connect to a relay server + /// + public static T ConnectRelay( SteamId serverId, int virtualport = 0 ) where T : ConnectionInterface, new() + { + var t = new T(); + NetIdentity identity = serverId; + t.Connection = Internal.ConnectP2P( ref identity, virtualport ); + SetConnectionInterface( t.Connection.Id, t ); + return t; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamNetworkingUtils.cs b/Facepunch.Steamworks/SteamNetworkingUtils.cs new file mode 100644 index 0000000..6ea3cdc --- /dev/null +++ b/Facepunch.Steamworks/SteamNetworkingUtils.cs @@ -0,0 +1,216 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamNetworkingUtils + { + static ISteamNetworkingUtils _internal; + internal static ISteamNetworkingUtils Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamNetworkingUtils(); + _internal.InitUserless(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + /// + /// Return location info for the current host. + /// + /// It takes a few seconds to initialize access to the relay network. If + /// you call this very soon after startup the data may not be available yet. + /// + /// This always return the most up-to-date information we have available + /// right now, even if we are in the middle of re-calculating ping times. + /// + public static PingLocation? LocalPingLocation + { + get + { + PingLocation location = default; + var age = Internal.GetLocalPingLocation( ref location ); + if ( age < 0 ) + return null; + + return location; + } + } + + /// + /// Same as PingLocation.EstimatePingTo, but assumes that one location is the local host. + /// This is a bit faster, especially if you need to calculate a bunch of + /// these in a loop to find the fastest one. + /// + public static int EstimatePingTo( PingLocation target ) + { + return Internal.EstimatePingTimeFromLocalHost( ref target ); + } + + /// + /// If you need ping information straight away, wait on this. It will return + /// immediately if you already have up to date ping data + /// + public static async Task WaitForPingDataAsync( float maxAgeInSeconds = 60 * 5 ) + { + if ( Internal.CheckPingDataUpToDate( 60.0f ) ) + return; + + while ( Internal.IsPingMeasurementInProgress() ) + { + await Task.Delay( 10 ); + } + } + + public static long LocalTimestamp => Internal.GetLocalTimestamp(); + + + /// + /// [0 - 100] - Randomly discard N pct of packets + /// + public static float FakeSendPacketLoss + { + get => GetConfigFloat( NetConfig.FakePacketLoss_Send ); + set => SetConfigFloat( NetConfig.FakePacketLoss_Send, value ); + } + + /// + /// [0 - 100] - Randomly discard N pct of packets + /// + public static float FakeRecvPacketLoss + { + get => GetConfigFloat( NetConfig.FakePacketLoss_Recv ); + set => SetConfigFloat( NetConfig.FakePacketLoss_Recv, value ); + } + + /// + /// Delay all packets by N ms + /// + public static float FakeSendPacketLag + { + get => GetConfigFloat( NetConfig.FakePacketLag_Send ); + set => SetConfigFloat( NetConfig.FakePacketLag_Send, value ); + } + + /// + /// Delay all packets by N ms + /// + public static float FakeRecvPacketLag + { + get => GetConfigFloat( NetConfig.FakePacketLag_Recv ); + set => SetConfigFloat( NetConfig.FakePacketLag_Recv, value ); + } + + #region Config Internals + + internal unsafe static bool GetConfigInt( NetConfig type, int value ) + { + int* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Global, 0, NetConfigType.Int32, (IntPtr)ptr ); + } + + internal unsafe static int GetConfigInt( NetConfig type ) + { + int value = 0; + NetConfigType dtype = NetConfigType.Int32; + int* ptr = &value; + ulong size = sizeof( int ); + var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr) ptr, ref size ); + if ( result != NetConfigResult.OK ) + return 0; + + return value; + } + + internal unsafe static bool SetConfigFloat( NetConfig type, float value ) + { + float* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Global, 0, NetConfigType.Float, (IntPtr)ptr ); + } + + internal unsafe static float GetConfigFloat( NetConfig type ) + { + float value = 0; + NetConfigType dtype = NetConfigType.Float; + float* ptr = &value; + ulong size = sizeof( float ); + var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); + if ( result != NetConfigResult.OK ) + return 0; + + return value; + } + + internal unsafe static bool SetConfigString( NetConfig type, string value ) + { + var bytes = Encoding.UTF8.GetBytes( value ); + + fixed ( byte* ptr = bytes ) + { + return Internal.SetConfigValue( type, NetScope.Global, 0, NetConfigType.String, (IntPtr)ptr ); + } + } + + /* + internal unsafe static float GetConfigString( NetConfig type ) + { + + float value = 0; + NetConfigType dtype = NetConfigType.Float; + float* ptr = &value; + ulong size = sizeof( float ); + var result = Internal.GetConfigValue( type, NetScope.Global, 0, ref dtype, (IntPtr)ptr, ref size ); + if ( result != SteamNetworkingGetConfigValueResult.OK ) + return 0; + + return value; + } + */ + + + /* + + TODO - Connection object + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, int value ) + { + int* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.Int32, (IntPtr)ptr ); + } + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, float value ) + { + float* ptr = &value; + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.Float, (IntPtr)ptr ); + } + + internal unsafe static bool SetConnectionConfig( uint con, NetConfig type, string value ) + { + var bytes = Encoding.UTF8.GetBytes( value ); + + fixed ( byte* ptr = bytes ) + { + return Internal.SetConfigValue( type, NetScope.Connection, con, NetConfigType.String, (IntPtr)ptr ); + } + }*/ + + #endregion + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamParental.cs b/Facepunch.Steamworks/SteamParental.cs new file mode 100644 index 0000000..4be1016 --- /dev/null +++ b/Facepunch.Steamworks/SteamParental.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamParental + { + static ISteamParentalSettings _internal; + internal static ISteamParentalSettings Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamParentalSettings(); + _internal.Init(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + SteamParentalSettingsChanged_t.Install( x => OnSettingsChanged?.Invoke() ); + } + + /// + /// Parental Settings Changed + /// + public static event Action OnSettingsChanged; + + + /// + /// + /// + public static bool IsParentalLockEnabled => Internal.BIsParentalLockEnabled(); + + /// + /// + /// + public static bool IsParentalLockLocked => Internal.BIsParentalLockLocked(); + + /// + /// + /// + public static bool IsAppBlocked( AppId app ) => Internal.BIsAppBlocked( app.Value ); + + /// + /// + /// + public static bool BIsAppInBlockList( AppId app ) => Internal.BIsAppInBlockList( app.Value ); + + /// + /// + /// + public static bool IsFeatureBlocked( ParentalFeature feature ) => Internal.BIsFeatureBlocked( feature ); + + /// + /// + /// + public static bool BIsFeatureInBlockList( ParentalFeature feature ) => Internal.BIsFeatureInBlockList( feature ); + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamParties.cs b/Facepunch.Steamworks/SteamParties.cs new file mode 100644 index 0000000..d2555c1 --- /dev/null +++ b/Facepunch.Steamworks/SteamParties.cs @@ -0,0 +1,77 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamParties + { + static ISteamParties _internal; + internal static ISteamParties Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamParties(); + _internal.Init(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + AvailableBeaconLocationsUpdated_t.Install( x => OnBeaconLocationsUpdated?.Invoke() ); + ActiveBeaconsUpdated_t.Install( x => OnActiveBeaconsUpdated?.Invoke() ); + } + + /// + /// The list of possible Party beacon locations has changed + /// + public static event Action OnBeaconLocationsUpdated; + + /// + /// The list of active beacons may have changed + /// + public static event Action OnActiveBeaconsUpdated; + + + public static int ActiveBeaconCount => (int) Internal.GetNumActiveBeacons(); + + public static IEnumerable ActiveBeacons + { + get + { + for ( uint i = 0; i < ActiveBeaconCount; i++ ) + { + yield return new PartyBeacon + { + Id = Internal.GetBeaconByIndex( i ) + }; + } + } + } + + /// + /// Create a new party beacon and activate it in the selected location. + /// When people begin responding to your beacon, Steam will send you + /// OnPartyReservation callbacks to let you know who is on the way. + /// + //public async Task CreateBeacon( int slots, string connectString, string meta ) + //{ + // var result = await Internal.CreateBeacon( (uint)slots, null, connectString, meta ); + // if ( !result.HasValue ) return null; + //} + + // TODO - is this useful to anyone, or is it a load of shit? + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamRemoteStorage.cs b/Facepunch.Steamworks/SteamRemoteStorage.cs new file mode 100644 index 0000000..d559ffa --- /dev/null +++ b/Facepunch.Steamworks/SteamRemoteStorage.cs @@ -0,0 +1,180 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamRemoteStorage + { + static ISteamRemoteStorage _internal; + internal static ISteamRemoteStorage Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamRemoteStorage(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + /// + /// Creates a new file, writes the bytes to the file, and then closes the file. + /// If the target file already exists, it is overwritten + /// + public unsafe static bool FileWrite( string filename, byte[] data ) + { + fixed ( byte* ptr = data ) + { + return Internal.FileWrite( filename, (IntPtr) ptr, data.Length ); + } + } + + /// + /// Opens a binary file, reads the contents of the file into a byte array, and then closes the file. + /// + public unsafe static byte[] FileRead( string filename ) + { + var size = FileSize( filename ); + if ( size <= 0 ) return null; + var buffer = new byte[size]; + + fixed ( byte* ptr = buffer ) + { + var readsize = Internal.FileRead( filename, (IntPtr)ptr, size ); + return buffer; + } + } + + /// + /// Checks whether the specified file exists. + /// + public static bool FileExists( string filename ) => Internal.FileExists( filename ); + + /// + /// Checks if a specific file is persisted in the steam cloud. + /// + public static bool FilePersisted( string filename ) => Internal.FilePersisted( filename ); + + /// + /// Gets the specified file's last modified date/time. + /// + public static DateTime FileTime( string filename ) => Epoch.ToDateTime( Internal.GetFileTimestamp( filename ) ); + + /// + /// Gets the specified files size in bytes. 0 if not exists. + /// + public static int FileSize( string filename ) => Internal.GetFileSize( filename ); + + /// + /// Deletes the file from remote storage, but leaves it on the local disk and remains accessible from the API. + /// + public static bool FileForget( string filename ) => Internal.FileForget( filename ); + + /// + /// Deletes a file from the local disk, and propagates that delete to the cloud. + /// + public static bool FileDelete( string filename ) => Internal.FileDelete( filename ); + + + /// + /// Number of bytes total + /// + public static ulong QuotaBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return t; + } + } + + /// + /// Number of bytes used + /// + public static ulong QuotaUsedBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return t - a; + } + } + + /// + /// Number of bytes remaining until your quota is used + /// + public static ulong QuotaRemainingBytes + { + get + { + ulong t = 0, a = 0; + Internal.GetQuota( ref t, ref a ); + return a; + } + } + + /// + /// returns true if IsCloudEnabledForAccount AND IsCloudEnabledForApp + /// + public static bool IsCloudEnabled => IsCloudEnabledForAccount && IsCloudEnabledForApp; + + /// + /// Checks if the account wide Steam Cloud setting is enabled for this user + /// or if they disabled it in the Settings->Cloud dialog. + /// + public static bool IsCloudEnabledForAccount => Internal.IsCloudEnabledForAccount(); + + /// + /// Checks if the per game Steam Cloud setting is enabled for this user + /// or if they disabled it in the Game Properties->Update dialog. + /// + /// This must only ever be set as the direct result of the user explicitly + /// requesting that it's enabled or not. This is typically accomplished with + /// a checkbox within your in-game options + /// + public static bool IsCloudEnabledForApp + { + get => Internal.IsCloudEnabledForApp(); + set => Internal.SetCloudEnabledForApp( value ); + } + + /// + /// Gets the total number of local files synchronized by Steam Cloud. + /// + public static int FileCount => Internal.GetFileCount(); + + /// + /// Get a list of filenames synchronized by Steam Cloud + /// + public static IEnumerable Files + { + get + { + int _ = 0; + for( int i=0; i + /// Undocumented Parental Settings + /// + public static class SteamScreenshots + { + static ISteamScreenshots _internal; + internal static ISteamScreenshots Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamScreenshots(); + _internal.Init(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + ScreenshotRequested_t.Install( x => OnScreenshotRequested?.Invoke() ); + ScreenshotReady_t.Install( x => + { + if ( x.Result != Result.OK ) + OnScreenshotFailed?.Invoke( x.Result ); + else + OnScreenshotReady?.Invoke( new Screenshot { Value = x.Local } ); + } ); + } + + /// + /// A screenshot has been requested by the user from the Steam screenshot hotkey. + /// This will only be called if HookScreenshots has been enabled, in which case Steam + /// will not take the screenshot itself. + /// + public static event Action OnScreenshotRequested; + + /// + /// A screenshot successfully written or otherwise added to the library and can now be tagged. + /// + public static event Action OnScreenshotReady; + + /// + /// A screenshot attempt failed + /// + public static event Action OnScreenshotFailed; + + /// + /// Writes a screenshot to the user's screenshot library given the raw image data, which must be in RGB format. + /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + /// + public unsafe static Screenshot? WriteScreenshot( byte[] data, int width, int height ) + { + fixed ( byte* ptr = data ) + { + var handle = Internal.WriteScreenshot( (IntPtr)ptr, (uint)data.Length, width, height ); + if ( handle.Value == 0 ) return null; + + return new Screenshot { Value = handle }; + } + } + + /// + /// Adds a screenshot to the user's screenshot library from disk. If a thumbnail is provided, it must be 200 pixels wide and the same aspect ratio + /// as the screenshot, otherwise a thumbnail will be generated if the user uploads the screenshot. The screenshots must be in either JPEG or TGA format. + /// The return value is a handle that is valid for the duration of the game process and can be used to apply tags. + /// JPEG, TGA, and PNG formats are supported. + /// + public unsafe static Screenshot? AddScreenshot( string filename, string thumbnail, int width, int height ) + { + var handle = Internal.AddScreenshotToLibrary( filename, thumbnail, width, height ); + if ( handle.Value == 0 ) return null; + + return new Screenshot { Value = handle }; + } + + /// + /// Causes the Steam overlay to take a screenshot. + /// If screenshots are being hooked by the game then a + /// ScreenshotRequested callback is sent back to the game instead. + /// + public static void TriggerScreenshot() => Internal.TriggerScreenshot(); + + /// + /// Toggles whether the overlay handles screenshots when the user presses the screenshot hotkey, or if the game handles them. + /// Hooking is disabled by default, and only ever enabled if you do so with this function. + /// If the hooking is enabled, then the ScreenshotRequested_t callback will be sent if the user presses the hotkey or + /// when TriggerScreenshot is called, and then the game is expected to call WriteScreenshot or AddScreenshotToLibrary in response. + /// + public static bool Hooked + { + get => Internal.IsScreenshotsHooked(); + set => Internal.HookScreenshots( value ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamServer.cs b/Facepunch.Steamworks/SteamServer.cs new file mode 100644 index 0000000..d9771b6 --- /dev/null +++ b/Facepunch.Steamworks/SteamServer.cs @@ -0,0 +1,479 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Provides the core of the Steam Game Servers API + /// + public static partial class SteamServer + { + static bool initialized; + + static ISteamGameServer _internal; + internal static ISteamGameServer Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamGameServer( ); + _internal.InitServer(); + } + + return _internal; + } + } + + public static bool IsValid => initialized; + + + public static Action OnCallbackException; + + internal static void InstallEvents() + { + SteamInventory.InstallEvents(); + SteamNetworkingSockets.InstallEvents(true); + + ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ), true ); + SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke(), true ); + SteamServerConnectFailure_t.Install( x => OnSteamServerConnectFailure?.Invoke( x.Result, x.StillRetrying ), true ); + SteamServersDisconnected_t.Install( x => OnSteamServersDisconnected?.Invoke( x.Result ), true ); + } + + /// + /// User has been authed or rejected + /// + public static event Action OnValidateAuthTicketResponse; + + /// + /// Called when a connections to the Steam back-end has been established. + /// This means the server now is logged on and has a working connection to the Steam master server. + /// + public static event Action OnSteamServersConnected; + + /// + /// This will occur periodically if the Steam client is not connected, and has failed when retrying to establish a connection (result, stilltrying) + /// + public static event Action OnSteamServerConnectFailure; + + /// + /// Disconnected from Steam + /// + public static event Action OnSteamServersDisconnected; + + + /// + /// Initialize the steam server. + /// If asyncCallbacks is false you need to call RunCallbacks manually every frame. + /// + public static void Init( AppId appid, SteamServerInit init, bool asyncCallbacks = true ) + { + uint ipaddress = 0; // Any Port + + if ( init.SteamPort == 0 ) + init = init.WithRandomSteamPort(); + + if ( init.IpAddress != null ) + ipaddress = Utility.IpToInt32( init.IpAddress ); + + System.Environment.SetEnvironmentVariable( "SteamAppId", appid.ToString() ); + System.Environment.SetEnvironmentVariable( "SteamGameId", appid.ToString() ); + var secure = (int)(init.Secure ? 3 : 2); + + // + // Get other interfaces + // + if ( !SteamInternal.GameServer_Init( ipaddress, init.SteamPort, init.GamePort, init.QueryPort, secure, init.VersionString ) ) + { + throw new System.Exception( $"InitGameServer returned false ({ipaddress},{init.SteamPort},{init.GamePort},{init.QueryPort},{secure},\"{init.VersionString}\")" ); + } + + initialized = true; + + // + // Initial settings + // + AutomaticHeartbeats = true; + MaxPlayers = 32; + BotCount = 0; + Product = $"{appid.Value}"; + ModDir = init.ModDir; + GameDescription = init.GameDescription; + Passworded = false; + DedicatedServer = init.DedicatedServer; + + InstallEvents(); + + if ( asyncCallbacks ) + { + RunCallbacksAsync(); + } + } + + static List openIterfaces = new List(); + + internal static void WatchInterface( SteamInterface steamInterface ) + { + if ( openIterfaces.Contains( steamInterface ) ) + throw new System.Exception( "openIterfaces already contains interface!" ); + + openIterfaces.Add( steamInterface ); + } + + internal static void ShutdownInterfaces() + { + foreach ( var e in openIterfaces ) + { + e.Shutdown(); + } + + openIterfaces.Clear(); + } + + public static void Shutdown() + { + Event.DisposeAllServer(); + + initialized = false; + + _internal = null; + + ShutdownInterfaces(); + SteamNetworkingUtils.Shutdown(); + SteamNetworkingSockets.Shutdown(); + SteamInventory.Shutdown(); + + SteamServerStats.Shutdown(); + + SteamGameServer.Shutdown(); + } + + internal static async void RunCallbacksAsync() + { + while ( IsValid ) + { + try + { + RunCallbacks(); + } + catch ( System.Exception e ) + { + OnCallbackException?.Invoke( e ); + } + + await Task.Delay( 16 ); + } + } + + /// + /// Run the callbacks. This is also called in Async callbacks. + /// + public static void RunCallbacks() + { + SteamGameServer.RunCallbacks(); + } + + /// + /// Sets whether this should be marked as a dedicated server. + /// If not, it is assumed to be a listen server. + /// + public static bool DedicatedServer + { + get => _dedicatedServer; + set { if ( _dedicatedServer == value ) return; Internal.SetDedicatedServer( value ); _dedicatedServer = value; } + } + private static bool _dedicatedServer; + + /// + /// Gets or sets the current MaxPlayers. + /// This doesn't enforce any kind of limit, it just updates the master server. + /// + public static int MaxPlayers + { + get => _maxplayers; + set { if ( _maxplayers == value ) return; Internal.SetMaxPlayerCount( value ); _maxplayers = value; } + } + private static int _maxplayers = 0; + + /// + /// Gets or sets the current BotCount. + /// This doesn't enforce any kind of limit, it just updates the master server. + /// + public static int BotCount + { + get => _botcount; + set { if ( _botcount == value ) return; Internal.SetBotPlayerCount( value ); _botcount = value; } + } + private static int _botcount = 0; + + /// + /// Gets or sets the current Map Name. + /// + public static string MapName + { + get => _mapname; + set { if ( _mapname == value ) return; Internal.SetMapName( value ); _mapname = value; } + } + private static string _mapname; + + /// + /// Gets or sets the current ModDir + /// + public static string ModDir + { + get => _modDir; + internal set { if ( _modDir == value ) return; Internal.SetModDir( value ); _modDir = value; } + } + private static string _modDir = ""; + + /// + /// Gets the current product + /// + public static string Product + { + get => _product; + internal set { if ( _product == value ) return; Internal.SetProduct( value ); _product = value; } + } + private static string _product = ""; + + /// + /// Gets or sets the current Product + /// + public static string GameDescription + { + get => _gameDescription; + internal set { if ( _gameDescription == value ) return; Internal.SetGameDescription( value ); _gameDescription = value; } + } + private static string _gameDescription = ""; + + /// + /// Gets or sets the current ServerName + /// + public static string ServerName + { + get => _serverName; + set { if ( _serverName == value ) return; Internal.SetServerName( value ); _serverName = value; } + } + private static string _serverName = ""; + + /// + /// Set whether the server should report itself as passworded + /// + public static bool Passworded + { + get => _passworded; + set { if ( _passworded == value ) return; Internal.SetPasswordProtected( value ); _passworded = value; } + } + private static bool _passworded; + + /// + /// Gets or sets the current GameTags. This is a comma seperated list of tags for this server. + /// When querying the server list you can filter by these tags. + /// + public static string GameTags + { + get => _gametags; + set + { + if ( _gametags == value ) return; + Internal.SetGameTags( value ); + _gametags = value; + } + } + private static string _gametags = ""; + + /// + /// Log onto Steam anonymously. + /// + public static void LogOnAnonymous() + { + Internal.LogOnAnonymous(); + ForceHeartbeat(); + } + + /// + /// Log onto Steam anonymously. + /// + public static void LogOff() + { + Internal.LogOff(); + } + + /// + /// Returns true if the server is connected and registered with the Steam master server + /// You should have called LogOnAnonymous etc on startup. + /// + public static bool LoggedOn => Internal.BLoggedOn(); + + /// + /// To the best of its ability this tries to get the server's + /// current public ip address. Be aware that this is likely to return + /// null for the first few seconds after initialization. + /// + public static System.Net.IPAddress PublicIp + { + get + { + var ip = Internal.GetPublicIP(); + if ( ip == 0 ) return null; + + return Utility.Int32ToIp( ip ); + } + } + + /// + /// Enable or disable heartbeats, which are sent regularly to the master server. + /// Enabled by default. + /// + public static bool AutomaticHeartbeats + { + set { Internal.EnableHeartbeats( value ); } + } + + /// + /// Set heartbeat interval, if automatic heartbeats are enabled. + /// You can leave this at the default. + /// + public static int AutomaticHeartbeatRate + { + set { Internal.SetHeartbeatInterval( value ); } + } + + /// + /// Force send a heartbeat to the master server instead of waiting + /// for the next automatic update (if you've left them enabled) + /// + public static void ForceHeartbeat() + { + Internal.ForceHeartbeat(); + } + + /// + /// Update this connected player's information. You should really call this + /// any time a player's name or score changes. This keeps the information shown + /// to server queries up to date. + /// + public static void UpdatePlayer( SteamId steamid, string name, int score ) + { + Internal.BUpdateUserData( steamid, name, (uint)score ); + } + + static Dictionary KeyValue = new Dictionary(); + + /// + /// Sets a Key Value. These can be anything you like, and are accessible + /// when querying servers from the server list. + /// + /// Information describing gamemodes are common here. + /// + public static void SetKey( string Key, string Value ) + { + if ( KeyValue.ContainsKey( Key ) ) + { + if ( KeyValue[Key] == Value ) + return; + + KeyValue[Key] = Value; + } + else + { + KeyValue.Add( Key, Value ); + } + + Internal.SetKeyValue( Key, Value ); + } + + /// + /// Remove all key values + /// + public static void ClearKeys() + { + KeyValue.Clear(); + Internal.ClearAllKeyValues(); + } + + /// + /// Start authorizing a ticket. This user isn't authorized yet. Wait for a call to OnAuthChange. + /// + public static unsafe bool BeginAuthSession( byte[] data, SteamId steamid ) + { + fixed ( byte* p = data ) + { + var result = Internal.BeginAuthSession( (IntPtr)p, data.Length, steamid ); + + if ( result == BeginAuthResult.OK ) + return true; + + return false; + } + } + + /// + /// Forget this guy. They're no longer in the game. + /// + public static void EndSession( SteamId steamid ) + { + Internal.EndAuthSession( steamid ); + } + + /// + /// If true, Steam wants to send a packet. You should respond by sending + /// this packet in an unconnected way to the returned Address and Port. + /// + /// Packet to send. The Data passed is pooled - so use it immediately. + /// True if we want to send a packet + public static unsafe bool GetOutgoingPacket( out OutgoingPacket packet ) + { + var buffer = Helpers.TakeBuffer( 1024 * 32 ); + packet = new OutgoingPacket(); + + fixed ( byte* ptr = buffer ) + { + uint addr = 0; + ushort port = 0; + + var size = Internal.GetNextOutgoingPacket( (IntPtr)ptr, buffer.Length, ref addr, ref port ); + if ( size == 0 ) + return false; + + packet.Size = size; + packet.Data = buffer; + packet.Address = addr; + packet.Port = port; + return true; + } + } + + /// + /// We have received a server query on our game port. Pass it to Steam to handle. + /// + public static unsafe void HandleIncomingPacket( byte[] data, int size, uint address, ushort port ) + { + fixed ( byte* ptr = data ) + { + HandleIncomingPacket( (IntPtr)ptr, size, address, port ); + } + } + + /// + /// We have received a server query on our game port. Pass it to Steam to handle. + /// + public static unsafe void HandleIncomingPacket( IntPtr ptr, int size, uint address, ushort port ) + { + Internal.HandleIncomingPacket( ptr, size, address, port ); + } + + /// + /// Does the user own this app (which could be DLC) + /// + public static UserHasLicenseForAppResult UserHasLicenseForApp( SteamId steamid, AppId appid ) + { + return Internal.UserHasLicenseForApp( steamid, appid ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamServerStats.cs b/Facepunch.Steamworks/SteamServerStats.cs new file mode 100644 index 0000000..239807a --- /dev/null +++ b/Facepunch.Steamworks/SteamServerStats.cs @@ -0,0 +1,135 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamServerStats + { + static ISteamGameServerStats _internal; + internal static ISteamGameServerStats Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamGameServerStats(); + _internal.InitServer(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + /// + /// Downloads stats for the user + /// If the user has no stats will return fail + /// these stats will only be auto-updated for clients playing on the server + /// + public static async Task RequestUserStats( SteamId steamid ) + { + var r = await Internal.RequestUserStats( steamid ); + if ( !r.HasValue ) return Result.Fail; + return r.Value.Result; + } + + /// + /// Set the named stat for this user. Setting stats should follow the rules + /// you defined in Steamworks. + /// + public static bool SetInt( SteamId steamid, string name, int stat ) + { + return Internal.SetUserStat1( steamid, name, stat ); + } + + /// + /// Set the named stat for this user. Setting stats should follow the rules + /// you defined in Steamworks. + /// + public static bool SetFloat( SteamId steamid, string name, float stat ) + { + return Internal.SetUserStat2( steamid, name, stat ); + } + + /// + /// Get the named stat for this user. If getting the stat failed, will return + /// defaultValue. You should have called Refresh for this userid - which downloads + /// the stats from the backend. If you didn't call it this will always return defaultValue. + /// + public static int GetInt( SteamId steamid, string name, int defaultValue = 0 ) + { + int data = defaultValue; + + if ( !Internal.GetUserStat1( steamid, name, ref data ) ) + return defaultValue; + + return data; + } + + /// + /// Get the named stat for this user. If getting the stat failed, will return + /// defaultValue. You should have called Refresh for this userid - which downloads + /// the stats from the backend. If you didn't call it this will always return defaultValue. + /// + public static float GetFloat( SteamId steamid, string name, float defaultValue = 0 ) + { + float data = defaultValue; + + if ( !Internal.GetUserStat2( steamid, name, ref data ) ) + return defaultValue; + + return data; + } + + /// + /// Unlocks the specified achievement for the specified user. Must have called Refresh on a steamid first. + /// Remember to use Commit after use. + /// + public static bool SetAchievement( SteamId steamid, string name ) + { + return Internal.SetUserAchievement( steamid, name ); + } + + /// + /// Resets the unlock status of an achievement for the specified user. Must have called Refresh on a steamid first. + /// Remember to use Commit after use. + /// + public static bool ClearAchievement( SteamId steamid, string name ) + { + return Internal.ClearUserAchievement( steamid, name ); + } + + /// + /// Return true if available, exists and unlocked + /// + public static bool GetAchievement( SteamId steamid, string name ) + { + bool achieved = false; + + if ( !Internal.GetUserAchievement( steamid, name, ref achieved ) ) + return false; + + return achieved; + } + + /// + /// Once you've set a stat change on a user you need to commit your changes. + /// You can do that using this function. The callback will let you know if + /// your action succeeded, but most of the time you can fire and forget. + /// + public static async Task StoreUserStats( SteamId steamid ) + { + var r = await Internal.StoreUserStats( steamid ); + if ( !r.HasValue ) return Result.Fail; + return r.Value.Result; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamUgc.cs b/Facepunch.Steamworks/SteamUgc.cs new file mode 100644 index 0000000..b230ed4 --- /dev/null +++ b/Facepunch.Steamworks/SteamUgc.cs @@ -0,0 +1,96 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Functions for accessing and manipulating Steam user information. + /// This is also where the APIs for Steam Voice are exposed. + /// + public static class SteamUGC + { + static ISteamUGC _internal; + internal static ISteamUGC Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamUGC(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void InstallEvents() + { + DownloadItemResult_t.Install( x => OnDownloadItemResult?.Invoke( x.Result ) ); + } + + /// + /// Posted after Download call + /// + public static event Action OnDownloadItemResult; + + internal static void Shutdown() + { + _internal = null; + } + + public static async Task DeleteFileAsync( PublishedFileId fileId ) + { + var r = await Internal.DeleteItem( fileId ); + return r?.Result == Result.OK; + } + + public static bool Download( PublishedFileId fileId, bool highPriority = false ) + { + return Internal.DownloadItem( fileId, highPriority ); + } + + /// + /// Utility function to fetch a single item. Internally this uses Ugc.FileQuery - + /// which you can use to query multiple items if you need to. + /// + public static async Task QueryFileAsync( PublishedFileId fileId ) + { + var result = await Ugc.Query.All + .WithFileId( fileId ) + .GetPageAsync( 1 ); + + if ( !result.HasValue || result.Value.ResultCount != 1 ) + return null; + + var item = result.Value.Entries.First(); + + result.Value.Dispose(); + + return item; + } + + public static async Task StartPlaytimeTracking(PublishedFileId fileId) + { + var result = await Internal.StartPlaytimeTracking(new[] {fileId}, 1); + return result.Value.Result == Result.OK; + } + + public static async Task StopPlaytimeTracking(PublishedFileId fileId) + { + var result = await Internal.StopPlaytimeTracking(new[] {fileId}, 1); + return result.Value.Result == Result.OK; + } + + public static async Task StopPlaytimeTrackingForAllItems() + { + var result = await Internal.StopPlaytimeTrackingForAllItems(); + return result.Value.Result == Result.OK; + } + } +} diff --git a/Facepunch.Steamworks/SteamUser.cs b/Facepunch.Steamworks/SteamUser.cs new file mode 100644 index 0000000..0f0d06a --- /dev/null +++ b/Facepunch.Steamworks/SteamUser.cs @@ -0,0 +1,487 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Functions for accessing and manipulating Steam user information. + /// This is also where the APIs for Steam Voice are exposed. + /// + public static class SteamUser + { + static ISteamUser _internal; + internal static ISteamUser Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamUser(); + _internal.Init(); + + richPresence = new Dictionary(); + + SampleRate = OptimalSampleRate; + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + static Dictionary richPresence; + + internal static void InstallEvents() + { + SteamServersConnected_t.Install( x => OnSteamServersConnected?.Invoke() ); + SteamServerConnectFailure_t.Install( x => OnSteamServerConnectFailure?.Invoke() ); + SteamServersDisconnected_t.Install( x => OnSteamServersDisconnected?.Invoke() ); + ClientGameServerDeny_t.Install( x => OnClientGameServerDeny?.Invoke() ); + LicensesUpdated_t.Install( x => OnLicensesUpdated?.Invoke() ); + ValidateAuthTicketResponse_t.Install( x => OnValidateAuthTicketResponse?.Invoke( x.SteamID, x.OwnerSteamID, x.AuthSessionResponse ) ); + MicroTxnAuthorizationResponse_t.Install( x => OnMicroTxnAuthorizationResponse?.Invoke( x.AppID, x.OrderID, x.Authorized != 0 ) ); + GameWebCallback_t.Install( x => OnGameWebCallback?.Invoke( x.URLUTF8() ) ); + GetAuthSessionTicketResponse_t.Install( x => OnGetAuthSessionTicketResponse?.Invoke( x ) ); + } + + /// + /// Called when a connections to the Steam back-end has been established. + /// This means the Steam client now has a working connection to the Steam servers. + /// Usually this will have occurred before the game has launched, and should only be seen if the + /// user has dropped connection due to a networking issue or a Steam server update. + /// + public static event Action OnSteamServersConnected; + + /// + /// Called when a connection attempt has failed. + /// This will occur periodically if the Steam client is not connected, + /// and has failed when retrying to establish a connection. + /// + public static event Action OnSteamServerConnectFailure; + + /// + /// Called if the client has lost connection to the Steam servers. + /// Real-time services will be disabled until a matching OnSteamServersConnected has been posted. + /// + public static event Action OnSteamServersDisconnected; + + /// + /// Sent by the Steam server to the client telling it to disconnect from the specified game server, + /// which it may be in the process of or already connected to. + /// The game client should immediately disconnect upon receiving this message. + /// This can usually occur if the user doesn't have rights to play on the game server. + /// + public static event Action OnClientGameServerDeny; + + /// + /// Called whenever the users licenses (owned packages) changes. + /// + public static event Action OnLicensesUpdated; + + /// + /// Called when an auth ticket has been validated. + /// The first parameter is the steamid of this user + /// The second is the Steam ID that owns the game, this will be different from the first + /// if the game is being borrowed via Steam Family Sharing + /// + public static event Action OnValidateAuthTicketResponse; + + /// + /// Used internally for GetAuthSessionTicketAsync + /// + internal static event Action OnGetAuthSessionTicketResponse; + + /// + /// Called when a user has responded to a microtransaction authorization request. + /// ( appid, orderid, user authorized ) + /// + public static event Action OnMicroTxnAuthorizationResponse; + + /// + /// Sent to your game in response to a steam://gamewebcallback/ command from a user clicking a link in the Steam overlay browser. + /// You can use this to add support for external site signups where you want to pop back into the browser after some web page + /// signup sequence, and optionally get back some detail about that. + /// + public static event Action OnGameWebCallback; + + + + + static bool _recordingVoice; + + /// + /// Starts/Stops voice recording. + /// Once started, use GetAvailableVoice and GetVoice to get the data, and then call StopVoiceRecording + /// when the user has released their push-to-talk hotkey or the game session has completed. + /// + + public static bool VoiceRecord + { + get => _recordingVoice; + set + { + _recordingVoice = value; + if ( value ) Internal.StartVoiceRecording(); + else Internal.StopVoiceRecording(); + } + } + + + /// + /// Returns true if we have voice data waiting to be read + /// + public static bool HasVoiceData + { + get + { + uint szCompressed = 0, deprecated = 0; + + if ( Internal.GetAvailableVoice( ref szCompressed, ref deprecated, 0 ) != VoiceResult.OK ) + return false; + + return szCompressed > 0; + } + } + + static byte[] readBuffer = new byte[1024*128]; + + /// + /// Reads the voice data and returns the number of bytes written. + /// The compressed data can be transmitted by your application and decoded back into raw audio data using + /// DecompressVoice on the other side. The compressed data provided is in an arbitrary format and is not meant to be played directly. + /// This should be called once per frame, and at worst no more than four times a second to keep the microphone input delay as low as + /// possible. Calling this any less may result in gaps in the returned stream. + /// + public static unsafe int ReadVoiceData( System.IO.Stream stream ) + { + if ( !HasVoiceData ) + return 0; + + uint szWritten = 0; + uint deprecated = 0; + + fixed ( byte* b = readBuffer ) + { + if ( Internal.GetVoice( true, (IntPtr)b, (uint)readBuffer.Length, ref szWritten, false, IntPtr.Zero, 0, ref deprecated, 0 ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + stream.Write( readBuffer, 0, (int) szWritten ); + + return (int) szWritten; + } + + /// + /// Reads the voice data and returns the bytes. You should obviously ideally be using + /// ReadVoiceData because it won't be creating a new byte array every call. But this + /// makes it easier to get it working, so let the babies have their bottle. + /// + public static unsafe byte[] ReadVoiceDataBytes() + { + if ( !HasVoiceData ) + return null; + + uint szWritten = 0; + uint deprecated = 0; + + fixed ( byte* b = readBuffer ) + { + if ( Internal.GetVoice( true, (IntPtr)b, (uint)readBuffer.Length, ref szWritten, false, IntPtr.Zero, 0, ref deprecated, 0 ) != VoiceResult.OK ) + return null; + } + + if ( szWritten == 0 ) + return null; + + var arry = new byte[szWritten]; + Array.Copy( readBuffer, 0, arry, 0, szWritten ); + return arry; + } + + static uint sampleRate = 48000; + + public static uint SampleRate + { + get => sampleRate; + + set + { + if ( SampleRate < 11025 ) throw new System.Exception( "Sample Rate must be between 11025 and 48000" ); + if ( SampleRate > 48000 ) throw new System.Exception( "Sample Rate must be between 11025 and 48000" ); + + sampleRate = value; + } + } + + public static uint OptimalSampleRate => Internal.GetVoiceOptimalSampleRate(); + + + /// + /// Decodes the compressed voice data returned by GetVoice. + /// The output data is raw single-channel 16-bit PCM audio.The decoder supports any sample rate from 11025 to 48000. + /// + public static unsafe int DecompressVoice( System.IO.Stream input, int length, System.IO.Stream output ) + { + var from = Helpers.TakeBuffer( length ); + var to = Helpers.TakeBuffer( 1024 * 64 ); + + // + // Copy from input stream to a pinnable buffer + // + using ( var s = new System.IO.MemoryStream( from ) ) + { + input.CopyTo( s ); + } + + uint szWritten = 0; + + fixed ( byte* frm = from ) + fixed ( byte* dst = to ) + { + if ( Internal.DecompressVoice( (IntPtr) frm, (uint) length, (IntPtr)dst, (uint)to.Length, ref szWritten, SampleRate ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + // + // Copy to output buffer + // + output.Write( to, 0, (int)szWritten ); + return (int)szWritten; + } + + public static unsafe int DecompressVoice( byte[] from, System.IO.Stream output ) + { + var to = Helpers.TakeBuffer( 1024 * 64 ); + + uint szWritten = 0; + + fixed ( byte* frm = from ) + fixed ( byte* dst = to ) + { + if ( Internal.DecompressVoice( (IntPtr)frm, (uint)from.Length, (IntPtr)dst, (uint)to.Length, ref szWritten, SampleRate ) != VoiceResult.OK ) + return 0; + } + + if ( szWritten == 0 ) + return 0; + + // + // Copy to output buffer + // + output.Write( to, 0, (int)szWritten ); + return (int)szWritten; + } + + /// + /// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you. + /// + public static unsafe AuthTicket GetAuthSessionTicket() + { + var data = Helpers.TakeBuffer( 1024 ); + + fixed ( byte* b = data ) + { + uint ticketLength = 0; + uint ticket = Internal.GetAuthSessionTicket( (IntPtr)b, data.Length, ref ticketLength ); + + if ( ticket == 0 ) + return null; + + return new AuthTicket() + { + Data = data.Take( (int)ticketLength ).ToArray(), + Handle = ticket + }; + } + } + + /// + /// Retrieve a authentication ticket to be sent to the entity who wishes to authenticate you. + /// This waits for a positive response from the backend before returning the ticket. This means + /// the ticket is definitely ready to go as soon as it returns. Will return null if the callback + /// times out or returns negatively. + /// + public static async Task GetAuthSessionTicketAsync( double timeoutSeconds = 10.0f ) + { + var result = Result.Pending; + AuthTicket ticket = null; + var stopwatch = Stopwatch.StartNew(); + + Action f = ( t ) => + { + if ( t.AuthTicket != ticket.Handle ) return; + result = t.Result; + }; + + OnGetAuthSessionTicketResponse += f; + + try + { + ticket = GetAuthSessionTicket(); + if ( ticket == null ) + return null; + + while ( result == Result.Pending ) + { + await Task.Delay( 10 ); + + if ( stopwatch.Elapsed.TotalSeconds > timeoutSeconds ) + { + ticket.Cancel(); + return null; + } + } + + if ( result == Result.OK ) + return ticket; + + ticket.Cancel(); + return null; + } + finally + { + OnGetAuthSessionTicketResponse -= f; + } + } + + public static unsafe BeginAuthResult BeginAuthSession( byte[] ticketData, SteamId steamid ) + { + fixed ( byte* ptr = ticketData ) + { + return Internal.BeginAuthSession( (IntPtr) ptr, ticketData.Length, steamid ); + } + } + + public static void EndAuthSession( SteamId steamid ) => Internal.EndAuthSession( steamid ); + + + // UserHasLicenseForApp - SERVER VERSION ( DLC CHECKING ) + + /// + /// Checks if the current users looks like they are behind a NAT device. + /// This is only valid if the user is connected to the Steam servers and may not catch all forms of NAT. + /// + public static bool IsBehindNAT => Internal.BIsBehindNAT(); + + /// + /// Gets the Steam level of the user, as shown on their Steam community profile. + /// + public static int SteamLevel => Internal.GetPlayerSteamLevel(); + + /// + /// Requests a URL which authenticates an in-game browser for store check-out, and then redirects to the specified URL. + /// As long as the in-game browser accepts and handles session cookies, Steam microtransaction checkout pages will automatically recognize the user instead of presenting a login page. + /// NOTE: The URL has a very short lifetime to prevent history-snooping attacks, so you should only call this API when you are about to launch the browser, or else immediately navigate to the result URL using a hidden browser window. + /// NOTE: The resulting authorization cookie has an expiration time of one day, so it would be a good idea to request and visit a new auth URL every 12 hours. + /// + public static async Task GetStoreAuthUrlAsync( string url ) + { + var response = await Internal.RequestStoreAuthURL( url ); + if ( !response.HasValue ) + return null; + + return response.Value.URLUTF8(); + } + + /// + /// Checks whether the current user has verified their phone number. + /// + public static bool IsPhoneVerified => Internal.BIsPhoneVerified(); + + /// + /// Checks whether the current user has Steam Guard two factor authentication enabled on their account. + /// + public static bool IsTwoFactorEnabled => Internal.BIsTwoFactorEnabled(); + + /// + /// Checks whether the user's phone number is used to uniquely identify them. + /// + public static bool IsPhoneIdentifying => Internal.BIsPhoneIdentifying(); + + /// + /// Checks whether the current user's phone number is awaiting (re)verification. + /// + public static bool IsPhoneRequiringVerification => Internal.BIsPhoneRequiringVerification(); + + /// + /// Requests an application ticket encrypted with the secret "encrypted app ticket key". + /// The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app. + /// There can only be one call pending, and this call is subject to a 60 second rate limit. + /// This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/ + /// + public static async Task RequestEncryptedAppTicketAsync( byte[] dataToInclude ) + { + var dataPtr = Marshal.AllocHGlobal( dataToInclude.Length ); + Marshal.Copy( dataToInclude, 0, dataPtr, dataToInclude.Length ); + + try + { + var result = await Internal.RequestEncryptedAppTicket( dataPtr, dataToInclude.Length ); + if ( !result.HasValue || result.Value.Result != Result.OK ) return null; + + var ticketData = Marshal.AllocHGlobal( 1024 ); + uint outSize = 0; + byte[] data = null; + + if ( Internal.GetEncryptedAppTicket( ticketData, 1024, ref outSize ) ) + { + data = new byte[outSize]; + Marshal.Copy( ticketData, data, 0, (int) outSize ); + } + + Marshal.FreeHGlobal( ticketData ); + + return data; + } + finally + { + Marshal.FreeHGlobal( dataPtr ); + } + } + + /// + /// Requests an application ticket encrypted with the secret "encrypted app ticket key". + /// The encryption key can be obtained from the Encrypted App Ticket Key page on the App Admin for your app. + /// There can only be one call pending, and this call is subject to a 60 second rate limit. + /// This can fail if you don't have an encrypted ticket set for your app here https://partner.steamgames.com/apps/sdkauth/ + /// + public static async Task RequestEncryptedAppTicketAsync() + { + var result = await Internal.RequestEncryptedAppTicket( IntPtr.Zero, 0 ); + if ( !result.HasValue || result.Value.Result != Result.OK ) return null; + + var ticketData = Marshal.AllocHGlobal( 1024 ); + uint outSize = 0; + byte[] data = null; + + if ( Internal.GetEncryptedAppTicket( ticketData, 1024, ref outSize ) ) + { + data = new byte[outSize]; + Marshal.Copy( ticketData, data, 0, (int)outSize ); + } + + Marshal.FreeHGlobal( ticketData ); + + return data; + + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamUserStats.cs b/Facepunch.Steamworks/SteamUserStats.cs new file mode 100644 index 0000000..241ff42 --- /dev/null +++ b/Facepunch.Steamworks/SteamUserStats.cs @@ -0,0 +1,254 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public static class SteamUserStats + { + static ISteamUserStats _internal; + internal static ISteamUserStats Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamUserStats(); + _internal.Init(); + + RequestCurrentStats(); + } + + return _internal; + } + } + internal static void Shutdown() + { + _internal = null; + } + + public static bool StatsRecieved { get; internal set; } + + internal static void InstallEvents() + { + UserStatsReceived_t.Install( x => + { + if ( x.SteamIDUser == SteamClient.SteamId ) + StatsRecieved = true; + + OnUserStatsReceived?.Invoke( x.SteamIDUser, x.Result ); + } ); + + UserStatsStored_t.Install( x => OnUserStatsStored?.Invoke( x.Result ) ); + UserAchievementStored_t.Install( x => OnAchievementProgress?.Invoke( new Achievement( x.AchievementNameUTF8() ), (int) x.CurProgress, (int)x.MaxProgress ) ); + UserStatsUnloaded_t.Install( x => OnUserStatsUnloaded?.Invoke( x.SteamIDUser ) ); + UserAchievementIconFetched_t.Install( x => OnAchievementIconFetched?.Invoke( x.AchievementNameUTF8(), x.IconHandle ) ); + } + + + /// + /// called when the achivement icon is loaded + /// + internal static event Action OnAchievementIconFetched; + + /// + /// called when the latests stats and achievements have been received + /// from the server + /// + public static event Action OnUserStatsReceived; + + /// + /// result of a request to store the user stats for a game + /// + public static event Action OnUserStatsStored; + + /// + /// result of a request to store the achievements for a game, or an + /// "indicate progress" call. If both m_nCurProgress and m_nMaxProgress + /// are zero, that means the achievement has been fully unlocked + /// + public static event Action OnAchievementProgress; + + + /// + /// Callback indicating that a user's stats have been unloaded + /// + public static event Action OnUserStatsUnloaded; + + /// + /// Get the available achievements + /// + public static IEnumerable Achievements + { + get + { + for( int i=0; i< Internal.GetNumAchievements(); i++ ) + { + yield return new Achievement( Internal.GetAchievementName( (uint) i ) ); + } + } + } + + /// + /// Show the user a pop-up notification with the current progress toward an achievement. + /// Will return false if RequestCurrentStats has not completed and successfully returned + /// its callback, if the achievement doesn't exist/has unpublished changes in the app's + /// Steamworks Admin page, or if the achievement is unlocked. + /// + public static bool IndicateAchievementProgress( string achName, int curProg, int maxProg ) + { + if ( string.IsNullOrEmpty( achName ) ) + throw new ArgumentNullException( "Achievement string is null or empty" ); + + if ( curProg >= maxProg ) + throw new ArgumentException( $" Current progress [{curProg}] arguement toward achievement greater than or equal to max [{maxProg}]" ); + + return Internal.IndicateAchievementProgress( achName, (uint)curProg, (uint)maxProg ); + } + + /// + /// Tries to get the number of players currently playing this game. + /// Or -1 if failed. + /// + public static async Task PlayerCountAsync() + { + var result = await Internal.GetNumberOfCurrentPlayers(); + if ( !result.HasValue || result.Value.Success == 0 ) + return -1; + + return result.Value.CPlayers; + } + + /// + /// Send the changed stats and achievements data to the server for permanent storage. + /// If this fails then nothing is sent to the server. It's advisable to keep trying until the call is successful. + /// This call can be rate limited. Call frequency should be on the order of minutes, rather than seconds.You should only be calling this during major state changes such as the end of a round, the map changing, or the user leaving a server. This call is required to display the achievement unlock notification dialog though, so if you have called SetAchievement then it's advisable to call this soon after that. + /// If you have stats or achievements that you have saved locally but haven't uploaded with this function when your application process ends then this function will automatically be called. + /// You can find additional debug information written to the %steam_install%\logs\stats_log.txt file. + /// This function returns true upon success if : + /// RequestCurrentStats has completed and successfully returned its callback AND + /// the current game has stats associated with it in the Steamworks Partner backend, and those stats are published. + /// + public static bool StoreStats() + { + return Internal.StoreStats(); + } + + /// + /// Asynchronously request the user's current stats and achievements from the server. + /// You must always call this first to get the initial status of stats and achievements. + /// Only after the resulting callback comes back can you start calling the rest of the stats + /// and achievement functions for the current user. + /// + public static bool RequestCurrentStats() + { + return Internal.RequestCurrentStats(); + } + + /// + /// Gets a leaderboard by name, it will create it if it's not yet created. + /// Leaderboards created with this function will not automatically show up in the Steam Community. + /// You must manually set the Community Name field in the App Admin panel of the Steamworks website. + /// As such it's generally recommended to prefer creating the leaderboards in the App Admin panel on + /// the Steamworks website and using FindLeaderboard unless you're expected to have a large amount of + /// dynamically created leaderboards. + /// + public static async Task FindOrCreateLeaderboardAsync( string name, LeaderboardSort sort, LeaderboardDisplay display ) + { + var result = await Internal.FindOrCreateLeaderboard( name, sort, display ); + if ( !result.HasValue || result.Value.LeaderboardFound == 0 ) + return null; + + return new Leaderboard { Id = result.Value.SteamLeaderboard }; + } + + + public static async Task FindLeaderboardAsync( string name ) + { + var result = await Internal.FindLeaderboard( name ); + if ( !result.HasValue || result.Value.LeaderboardFound == 0 ) + return null; + + return new Leaderboard { Id = result.Value.SteamLeaderboard }; + } + + + + /// + /// Adds this amount to the named stat. Internally this calls Get() and adds + /// to that value. Steam doesn't provide a mechanism for atomically increasing + /// stats like this, this functionality is added here as a convenience. + /// + public static bool AddStat( string name, int amount = 1 ) + { + var val = GetStatInt( name ); + val += amount; + return SetStat( name, val ); + } + + /// + /// Adds this amount to the named stat. Internally this calls Get() and adds + /// to that value. Steam doesn't provide a mechanism for atomically increasing + /// stats like this, this functionality is added here as a convenience. + /// + public static bool AddStat( string name, float amount = 1.0f ) + { + var val = GetStatFloat( name ); + val += amount; + return SetStat( name, val ); + } + + /// + /// Set a stat value. This will automatically call StoreStats() after a successful call + /// unless you pass false as the last argument. + /// + public static bool SetStat( string name, int value ) + { + return Internal.SetStat1( name, value ); + } + + /// + /// Set a stat value. This will automatically call StoreStats() after a successful call + /// unless you pass false as the last argument. + /// + public static bool SetStat( string name, float value ) + { + return Internal.SetStat2( name, value ); + } + + /// + /// Get a Int stat value + /// + public static int GetStatInt( string name ) + { + int data = 0; + Internal.GetStat1( name, ref data ); + return data; + } + + /// + /// Get a float stat value + /// + public static float GetStatFloat( string name ) + { + float data = 0; + Internal.GetStat2( name, ref data ); + return data; + } + + /// + /// Practically wipes the slate clean for this user. If includeAchievements is true, will wipe + /// any achievements too. + /// + /// + public static bool ResetAll( bool includeAchievements ) + { + return Internal.ResetAllStats( includeAchievements ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamUtils.cs b/Facepunch.Steamworks/SteamUtils.cs new file mode 100644 index 0000000..40d0cb3 --- /dev/null +++ b/Facepunch.Steamworks/SteamUtils.cs @@ -0,0 +1,271 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Interface which provides access to a range of miscellaneous utility functions + /// + public static class SteamUtils + { + static ISteamUtils _internal; + internal static ISteamUtils Internal + { + get + { + if ( _internal == null ) + { + _internal = new ISteamUtils(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + IPCountry_t.Install( x => OnIpCountryChanged?.Invoke() ); + LowBatteryPower_t.Install( x => OnLowBatteryPower?.Invoke( x.MinutesBatteryLeft ) ); + SteamShutdown_t.Install( x => SteamClosed() ); + GamepadTextInputDismissed_t.Install( x => OnGamepadTextInputDismissed?.Invoke( x.Submitted ) ); + } + + private static void SteamClosed() + { + SteamClient.Cleanup(); + + OnSteamShutdown?.Invoke(); + } + + /// + /// The country of the user changed + /// + public static event Action OnIpCountryChanged; + + /// + /// Fired when running on a laptop and less than 10 minutes of battery is left, fires then every minute + /// The parameter is the number of minutes left + /// + public static event Action OnLowBatteryPower; + + /// + /// Called when Steam wants to shutdown + /// + public static event Action OnSteamShutdown; + + /// + /// Big Picture gamepad text input has been closed. Parameter is true if text was submitted, false if cancelled etc. + /// + public static event Action OnGamepadTextInputDismissed; + + /// + /// Returns the number of seconds since the application was active + /// + public static uint SecondsSinceAppActive => Internal.GetSecondsSinceAppActive(); + + /// + /// Returns the number of seconds since the user last moved the mouse etc + /// + public static uint SecondsSinceComputerActive => Internal.GetSecondsSinceComputerActive(); + + // the universe this client is connecting to + public static Universe ConnectedUniverse => Internal.GetConnectedUniverse(); + + /// + /// Steam server time. Number of seconds since January 1, 1970, GMT (i.e unix time) + /// + public static DateTime SteamServerTime => Epoch.ToDateTime( Internal.GetServerRealTime() ); + + /// + /// returns the 2 digit ISO 3166-1-alpha-2 format country code this client is running in (as looked up via an IP-to-location database) + /// e.g "US" or "UK". + /// + public static string IpCountry => Internal.GetIPCountry(); + + /// + /// returns true if the image exists, and the buffer was successfully filled out + /// results are returned in RGBA format + /// the destination buffer size should be 4 * height * width * sizeof(char) + /// + public static bool GetImageSize( int image, out uint width, out uint height ) + { + width = 0; + height = 0; + return Internal.GetImageSize( image, ref width, ref height ); + } + + /// + /// returns the image in RGBA format + /// + public static Data.Image? GetImage( int image ) + { + if ( image == -1 ) return null; + if ( image == 0 ) return null; + + var i = new Data.Image(); + + if ( !GetImageSize( image, out i.Width, out i.Height ) ) + return null; + + var size = i.Width * i.Height * 4; + + var buf = Helpers.TakeBuffer( (int) size ); + + if ( !Internal.GetImageRGBA( image, buf, (int)size ) ) + return null; + + i.Data = new byte[size]; + Array.Copy( buf, 0, i.Data, 0, size ); + return i; + } + + /// + /// Returns true if we're using a battery (ie, a laptop not plugged in) + /// + public static bool UsingBatteryPower => Internal.GetCurrentBatteryPower() != 255; + + /// + /// Returns battery power [0-1] + /// + public static float CurrentBatteryPower => Math.Min( Internal.GetCurrentBatteryPower() / 100, 1.0f ); + + static NotificationPosition overlayNotificationPosition = NotificationPosition.BottomRight; + + /// + /// Sets the position where the overlay instance for the currently calling game should show notifications. + /// This position is per-game and if this function is called from outside of a game context it will do nothing. + /// + public static NotificationPosition OverlayNotificationPosition + { + get => overlayNotificationPosition; + + set + { + overlayNotificationPosition = value; + Internal.SetOverlayNotificationPosition( value ); + } + } + + /// + /// Returns true if the overlay is running and the user can access it. The overlay process could take a few seconds to + /// start and hook the game process, so this function will initially return false while the overlay is loading. + /// + public static bool IsOverlayEnabled => Internal.IsOverlayEnabled(); + + /// + /// Normally this call is unneeded if your game has a constantly running frame loop that calls the + /// D3D Present API, or OGL SwapBuffers API every frame. + /// + /// However, if you have a game that only refreshes the screen on an event driven basis then that can break + /// the overlay, as it uses your Present/SwapBuffers calls to drive it's internal frame loop and it may also + /// need to Present() to the screen any time an even needing a notification happens or when the overlay is + /// brought up over the game by a user. You can use this API to ask the overlay if it currently need a present + /// in that case, and then you can check for this periodically (roughly 33hz is desirable) and make sure you + /// refresh the screen with Present or SwapBuffers to allow the overlay to do it's work. + /// + public static bool DoesOverlayNeedPresent => Internal.BOverlayNeedsPresent(); + + /// + /// Asynchronous call to check if an executable file has been signed using the public key set on the signing tab + /// of the partner site, for example to refuse to load modified executable files. + /// + public static async Task CheckFileSignatureAsync( string filename ) + { + var r = await Internal.CheckFileSignature( filename ); + + if ( !r.HasValue ) + { + throw new System.Exception( "Something went wrong" ); + } + + return r.Value.CheckFileSignature; + } + + /// + /// Activates the Big Picture text input dialog which only supports gamepad input + /// + public static bool ShowGamepadTextInput( GamepadTextInputMode inputMode, GamepadTextInputLineMode lineInputMode, string description, int maxChars, string existingText = "" ) + { + return Internal.ShowGamepadTextInput( inputMode, lineInputMode, description, (uint)maxChars, existingText ); + } + + /// + /// Returns previously entered text + /// + public static string GetEnteredGamepadText() + { + var len = Internal.GetEnteredGamepadTextLength(); + if ( len == 0 ) return string.Empty; + + if ( !Internal.GetEnteredGamepadTextInput( out var strVal ) ) + return string.Empty; + + return strVal; + } + + /// + /// returns the language the steam client is running in, you probably want + /// Apps.CurrentGameLanguage instead, this is for very special usage cases + /// + public static string SteamUILanguage => Internal.GetSteamUILanguage(); + + /// + /// returns true if Steam itself is running in VR mode + /// + public static bool IsSteamRunningInVR => Internal.IsSteamRunningInVR(); + + /// + /// Sets the inset of the overlay notification from the corner specified by SetOverlayNotificationPosition + /// + public static void SetOverlayNotificationInset( int x, int y ) + { + Internal.SetOverlayNotificationInset( x, y ); + } + + /// + /// returns true if Steam and the Steam Overlay are running in Big Picture mode + /// Games much be launched through the Steam client to enable the Big Picture overlay. During development, + /// a game can be added as a non-steam game to the developers library to test this feature + /// + public static bool IsSteamInBigPictureMode => Internal.IsSteamInBigPictureMode(); + + + /// + /// ask SteamUI to create and render its OpenVR dashboard + /// + public static void StartVRDashboard() => Internal.StartVRDashboard(); + + /// + /// Set whether the HMD content will be streamed via Steam In-Home Streaming + /// If this is set to true, then the scene in the HMD headset will be streamed, and remote input will not be allowed. + /// If this is set to false, then the application window will be streamed instead, and remote input will be allowed. + /// The default is true unless "VRHeadsetStreaming" "0" is in the extended appinfo for a game. + /// (this is useful for games that have asymmetric multiplayer gameplay) + /// + public static bool VrHeadsetStreaming + { + get => Internal.IsVRHeadsetStreamingEnabled(); + + set + { + Internal.SetVRHeadsetStreamingEnabled( value ); + } + } + + internal static bool IsCallComplete( SteamAPICall_t call, out bool failed ) + { + failed = false; + return Internal.IsAPICallCompleted( call, ref failed ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/SteamVideo.cs b/Facepunch.Steamworks/SteamVideo.cs new file mode 100644 index 0000000..2d2a632 --- /dev/null +++ b/Facepunch.Steamworks/SteamVideo.cs @@ -0,0 +1,74 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// Undocumented Parental Settings + /// + public static class SteamVideo + { + static ISteamVideo _internal; + internal static ISteamVideo Internal + { + get + { + SteamClient.ValidCheck(); + + if ( _internal == null ) + { + _internal = new ISteamVideo(); + _internal.Init(); + } + + return _internal; + } + } + + internal static void Shutdown() + { + _internal = null; + } + + internal static void InstallEvents() + { + BroadcastUploadStart_t.Install( x => OnBroadcastStarted?.Invoke() ); + BroadcastUploadStop_t.Install( x => OnBroadcastStopped?.Invoke( x.Result ) ); + } + + public static event Action OnBroadcastStarted; + public static event Action OnBroadcastStopped; + + /// + /// Return true if currently using Steam's live broadcasting + /// + public static bool IsBroadcasting + { + get + { + int viewers = 0; + return Internal.IsBroadcasting( ref viewers ); + } + } + + /// + /// If we're broadcasting, will return the number of live viewers + /// + public static int NumViewers + { + get + { + int viewers = 0; + + if ( !Internal.IsBroadcasting( ref viewers ) ) + return 0; + + return viewers; + } + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Achievement.cs b/Facepunch.Steamworks/Structs/Achievement.cs new file mode 100644 index 0000000..966df12 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Achievement.cs @@ -0,0 +1,148 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct Achievement + { + internal string Value; + + public Achievement( string name ) + { + Value = name; + } + + public override string ToString() => Value; + + /// + /// True if unlocked + /// + public bool State + { + get + { + var state = false; + SteamUserStats.Internal.GetAchievement( Value, ref state ); + return state; + } + } + + public string Identifier => Value; + + public string Name => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "name" ); + + public string Description => SteamUserStats.Internal.GetAchievementDisplayAttribute( Value, "desc" ); + + + /// + /// Should hold the unlock time if State is true + /// + public DateTime? UnlockTime + { + get + { + var state = false; + uint time = 0; + + if ( !SteamUserStats.Internal.GetAchievementAndUnlockTime( Value, ref state, ref time ) || !state ) + return null; + + return Epoch.ToDateTime( time ); + } + } + + /// + /// Gets the icon of the achievement. This can return a null image even though the image exists if the image + /// hasn't been downloaded by Steam yet. You can use GetIconAsync if you want to wait for the image to be downloaded. + /// + public Image? GetIcon() + { + return SteamUtils.GetImage( SteamUserStats.Internal.GetAchievementIcon( Value ) ); + } + + + /// + /// Gets the icon of the achievement, waits for it to load if we have to + /// + public async Task GetIconAsync( int timeout = 5000 ) + { + var i = SteamUserStats.Internal.GetAchievementIcon( Value ); + if ( i != 0 ) return SteamUtils.GetImage( i ); + + var ident = Identifier; + bool gotCallback = false; + + Action f = ( x, icon ) => + { + if ( x != ident ) return; + i = icon; + gotCallback = true; + }; + + try + { + SteamUserStats.OnAchievementIconFetched += f; + + int waited = 0; + while ( !gotCallback ) + { + await Task.Delay( 10 ); + waited += 10; + + // Time out after x milliseconds + if ( waited > timeout ) + return null; + } + + if ( i == 0 ) return null; + return SteamUtils.GetImage( i ); + } + finally + { + SteamUserStats.OnAchievementIconFetched -= f; + } + } + + /// + /// Returns the fraction (0-1) of users who have unlocked the specified achievement, or -1 if no data available. + /// + public float GlobalUnlocked + { + get + { + float pct = 0; + + if ( !SteamUserStats.Internal.GetAchievementAchievedPercent( Value, ref pct ) ) + return -1.0f; + + return pct / 100.0f; + } + } + + /// + /// Make this achievement earned + /// + public bool Trigger( bool apply = true ) + { + var r = SteamUserStats.Internal.SetAchievement( Value ); + + if ( apply && r ) + { + SteamUserStats.Internal.StoreStats(); + } + + return r; + } + + /// + /// Reset this achievement to not achieved + /// + public bool Clear() + { + return SteamUserStats.Internal.ClearAchievement( Value ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/AppId.cs b/Facepunch.Steamworks/Structs/AppId.cs new file mode 100644 index 0000000..16e4dcd --- /dev/null +++ b/Facepunch.Steamworks/Structs/AppId.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks +{ + public struct AppId + { + public uint Value; + + public override string ToString() => Value.ToString(); + + public static implicit operator AppId( uint value ) + { + return new AppId{ Value = value }; + } + + public static implicit operator AppId( int value ) + { + return new AppId { Value = (uint) value }; + } + + public static implicit operator uint( AppId value ) + { + return value.Value; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Connection.cs b/Facepunch.Steamworks/Structs/Connection.cs new file mode 100644 index 0000000..d045d2a --- /dev/null +++ b/Facepunch.Steamworks/Structs/Connection.cs @@ -0,0 +1,117 @@ +using System; +using System.Collections.Generic; + +namespace Steamworks.Data +{ + public struct Connection + { + internal uint Id; + + public override string ToString() => Id.ToString(); + + /// + /// Accept an incoming connection that has been received on a listen socket. + /// + public Result Accept() + { + return SteamNetworkingSockets.Internal.AcceptConnection( this ); + } + + /// + /// Disconnects from the remote host and invalidates the connection handle. Any unread data on the connection is discarded.. + /// reasonCode is defined and used by you. + /// + public bool Close( bool linger = false, int reasonCode = 0, string debugString = "Closing Connection" ) + { + return SteamNetworkingSockets.Internal.CloseConnection( this, reasonCode, debugString, linger ); + } + + /// + /// Get/Set connection user data + /// + public long UserData + { + get => SteamNetworkingSockets.Internal.GetConnectionUserData( this ); + set => SteamNetworkingSockets.Internal.SetConnectionUserData( this, value ); + } + + /// + /// A name for the connection, used mostly for debugging + /// + public string ConnectionName + { + get + { + if ( !SteamNetworkingSockets.Internal.GetConnectionName( this, out var strVal ) ) + return "ERROR"; + + return strVal; + } + + set => SteamNetworkingSockets.Internal.SetConnectionName( this, value ); + } + + + public Result SendMessage( IntPtr ptr, int size, SendType sendType = SendType.Reliable ) + { + return SteamNetworkingSockets.Internal.SendMessageToConnection( this, ptr, (uint) size, (int)sendType ); + } + + public unsafe Result SendMessage( byte[] data, SendType sendType = SendType.Reliable ) + { + fixed ( byte* ptr = data ) + { + return SendMessage( (IntPtr)ptr, data.Length, sendType ); + } + } + + public unsafe Result SendMessage( byte[] data, int offset, int length, SendType sendType = SendType.Reliable ) + { + fixed ( byte* ptr = data ) + { + return SendMessage( (IntPtr)ptr + offset, length, sendType ); + } + } + + public unsafe Result SendMessage( string str, SendType sendType = SendType.Reliable ) + { + var bytes = System.Text.Encoding.UTF8.GetBytes( str ); + return SendMessage( bytes, sendType ); + } + + /// + /// Flush any messages waiting on the Nagle timer and send them at the next transmission opportunity (often that means right now). + /// + public Result Flush() => SteamNetworkingSockets.Internal.FlushMessagesOnConnection( this ); + + public string DetailedStatus() + { + if ( SteamNetworkingSockets.Internal.GetDetailedConnectionStatus( this, out var strVal ) != 0 ) + return null; + + return strVal; + } + + /* + [ThreadStatic] + private static SteamNetworkingMessage_t[] messageBuffer; + + public IEnumerable Messages + { + get + { + if ( messageBuffer == null ) + messageBuffer = new SteamNetworkingMessage_t[128]; + + var num = SteamNetworkingSockets.Internal.ReceiveMessagesOnConnection( this, ref messageBuffer, messageBuffer.Length ); + + for ( int i = 0; i < num; i++) + { + yield return messageBuffer[i]; + messageBuffer[i].Release(); + } + } + }*/ + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/ConnectionInfo.cs b/Facepunch.Steamworks/Structs/ConnectionInfo.cs new file mode 100644 index 0000000..6cbdf22 --- /dev/null +++ b/Facepunch.Steamworks/Structs/ConnectionInfo.cs @@ -0,0 +1,26 @@ +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Size = 696 )] + public struct ConnectionInfo + { + internal NetIdentity identity; + internal long userData; + internal Socket listenSocket; + internal NetAddress address; + internal ushort pad; + internal SteamNetworkingPOPID popRemote; + internal SteamNetworkingPOPID popRelay; + internal ConnectionState state; + internal int endReason; + [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + internal string endDebug; + [MarshalAs( UnmanagedType.ByValTStr, SizeConst = 128 )] + internal string connectionDescription; + + public ConnectionState State => state; + public SteamId SteamId => identity.steamID; + public int EndReason => endReason; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Controller.cs b/Facepunch.Steamworks/Structs/Controller.cs new file mode 100644 index 0000000..f694ecd --- /dev/null +++ b/Facepunch.Steamworks/Structs/Controller.cs @@ -0,0 +1,97 @@ +using Steamworks.Data; +using System.Collections.Generic; +using System.Runtime.InteropServices; + +namespace Steamworks +{ + public struct Controller + { + internal InputHandle_t Handle; + + internal Controller( InputHandle_t inputHandle_t ) + { + this.Handle = inputHandle_t; + } + + public ulong Id => Handle.Value; + public InputType InputType => SteamInput.Internal.GetInputTypeForHandle( Handle ); + + /// + /// Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + /// This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + /// our state loops, instead of trying to place it in all of your state transitions. + /// + public string ActionSet + { + set => SteamInput.Internal.ActivateActionSet( Handle, SteamInput.Internal.GetActionSetHandle( value ) ); + } + + public void DeactivateLayer( string layer ) => SteamInput.Internal.DeactivateActionSetLayer( Handle, SteamInput.Internal.GetActionSetHandle( layer ) ); + public void ActivateLayer( string layer ) => SteamInput.Internal.ActivateActionSetLayer( Handle, SteamInput.Internal.GetActionSetHandle( layer ) ); + public void ClearLayers() => SteamInput.Internal.DeactivateAllActionSetLayers( Handle ); + + + /// + /// Returns the current state of the supplied digital game action + /// + public DigitalState GetDigitalState( string actionName ) + { + return SteamInput.Internal.GetDigitalActionData( Handle, SteamInput.GetDigitalActionHandle( actionName ) ); + } + + /// + /// Returns the current state of these supplied analog game action + /// + public AnalogState GetAnalogState( string actionName ) + { + return SteamInput.Internal.GetAnalogActionData( Handle, SteamInput.GetAnalogActionHandle( actionName ) ); + } + + + public override string ToString() => $"{InputType}.{Handle.Value}"; + + + public static bool operator ==( Controller a, Controller b ) => a.Equals( b ); + public static bool operator !=( Controller a, Controller b ) => !(a == b); + public override bool Equals( object p ) => this.Equals( (Controller)p ); + public override int GetHashCode() => Handle.GetHashCode(); + public bool Equals( Controller p ) => p.Handle == Handle; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct AnalogState + { + public InputSourceMode EMode; // eMode EInputSourceMode + public float X; // x float + public float Y; // y float + internal byte BActive; // bActive byte + public bool Active => BActive != 0; + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + internal struct MotionState + { + public float RotQuatX; // rotQuatX float + public float RotQuatY; // rotQuatY float + public float RotQuatZ; // rotQuatZ float + public float RotQuatW; // rotQuatW float + public float PosAccelX; // posAccelX float + public float PosAccelY; // posAccelY float + public float PosAccelZ; // posAccelZ float + public float RotVelX; // rotVelX float + public float RotVelY; // rotVelY float + public float RotVelZ; // rotVelZ float + } + + [StructLayout( LayoutKind.Sequential, Pack = 1 )] + public struct DigitalState + { + [MarshalAs( UnmanagedType.I1 )] + internal byte BState; // bState byte + [MarshalAs( UnmanagedType.I1 )] + internal byte BActive; // bActive byte + + public bool Pressed => BState != 0; + public bool Active => BActive != 0; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/DepotId.cs b/Facepunch.Steamworks/Structs/DepotId.cs new file mode 100644 index 0000000..305e3b5 --- /dev/null +++ b/Facepunch.Steamworks/Structs/DepotId.cs @@ -0,0 +1,30 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct DepotId + { + public uint Value; + + public static implicit operator DepotId( uint value ) + { + return new DepotId { Value = value }; + } + + public static implicit operator DepotId( int value ) + { + return new DepotId { Value = (uint) value }; + } + + public static implicit operator uint( DepotId value ) + { + return value.Value; + } + + public override string ToString() => Value.ToString(); + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/DlcInformation.cs b/Facepunch.Steamworks/Structs/DlcInformation.cs new file mode 100644 index 0000000..6d02ff8 --- /dev/null +++ b/Facepunch.Steamworks/Structs/DlcInformation.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct DlcInformation + { + public AppId AppId { get; internal set; } + public string Name { get; internal set; } + public bool Available { get; internal set; } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/DownloadProgress.cs b/Facepunch.Steamworks/Structs/DownloadProgress.cs new file mode 100644 index 0000000..1f64d45 --- /dev/null +++ b/Facepunch.Steamworks/Structs/DownloadProgress.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct DownloadProgress + { + public bool Active; + public ulong BytesDownloaded; + public ulong BytesTotal; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/FileDetails.cs b/Facepunch.Steamworks/Structs/FileDetails.cs new file mode 100644 index 0000000..50bd8f7 --- /dev/null +++ b/Facepunch.Steamworks/Structs/FileDetails.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct FileDetails + { + public ulong SizeInBytes; + public string Sha1; + public uint Flags; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Friend.cs b/Facepunch.Steamworks/Structs/Friend.cs new file mode 100644 index 0000000..5a3da5e --- /dev/null +++ b/Facepunch.Steamworks/Structs/Friend.cs @@ -0,0 +1,188 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public struct Friend + { + public SteamId Id; + + public Friend( SteamId steamid ) + { + Id = steamid; + } + + public override string ToString() + { + return $"{Name} ({Id.ToString()})"; + } + + + /// + /// Returns true if this is the local user + /// + public bool IsMe => Id == SteamClient.SteamId; + + /// + /// Return true if this is a friend + /// + public bool IsFriend => Relationship == Relationship.Friend; + + /// + /// Returns true if you have this user blocked + /// + public bool IsBlocked => Relationship == Relationship.Blocked; + + /// + /// Return true if this user is playing the game we're running + /// + public bool IsPlayingThisGame => GameInfo?.GameID == SteamClient.AppId; + + /// + /// Returns true if this friend is online + /// + public bool IsOnline => State != FriendState.Offline; + + /// + /// Sometimes we don't know the user's name. This will wait until we have + /// downloaded the information on this user. + /// + public async Task RequestInfoAsync( int timeout = 5000 ) + { + await SteamFriends.CacheUserInformationAsync( Id, true ); + } + + /// + /// Returns true if this friend is marked as away + /// + public bool IsAway => State == FriendState.Away; + + /// + /// Returns true if this friend is marked as busy + /// + public bool IsBusy => State == FriendState.Busy; + + /// + /// Returns true if this friend is marked as snoozing + /// + public bool IsSnoozing => State == FriendState.Snooze; + + + + public Relationship Relationship => SteamFriends.Internal.GetFriendRelationship( Id ); + public FriendState State => SteamFriends.Internal.GetFriendPersonaState( Id ); + public string Name => SteamFriends.Internal.GetFriendPersonaName( Id ); + public IEnumerable NameHistory + { + get + { + for( int i=0; i<32; i++ ) + { + var n = SteamFriends.Internal.GetFriendPersonaNameHistory( Id, i ); + if ( string.IsNullOrEmpty( n ) ) + break; + + yield return n; + } + } + } + + public int SteamLevel => SteamFriends.Internal.GetFriendSteamLevel( Id ); + + + + public FriendGameInfo? GameInfo + { + get + { + FriendGameInfo_t gameInfo = default( FriendGameInfo_t ); + if ( !SteamFriends.Internal.GetFriendGamePlayed( Id, ref gameInfo ) ) + return null; + + return FriendGameInfo.From( gameInfo ); + } + } + + public bool IsIn( SteamId group_or_room ) + { + return SteamFriends.Internal.IsUserInSource( Id, group_or_room ); + } + + public struct FriendGameInfo + { + internal ulong GameID; // m_gameID class CGameID + internal uint GameIP; // m_unGameIP uint32 + internal ulong SteamIDLobby; // m_steamIDLobby class CSteamID + + public int ConnectionPort; + public int QueryPort; + + public uint IpAddressRaw => GameIP; + public System.Net.IPAddress IpAddress => Utility.Int32ToIp( GameIP ); + + public Lobby? Lobby + { + get + { + if ( SteamIDLobby == 0 ) return null; + return new Lobby( SteamIDLobby ); + } + } + + internal static FriendGameInfo From( FriendGameInfo_t i ) + { + return new FriendGameInfo + { + GameID = i.GameID, + GameIP = i.GameIP, + ConnectionPort = i.GamePort, + QueryPort = i.QueryPort, + SteamIDLobby = i.SteamIDLobby, + }; + } + } + + public async Task GetSmallAvatarAsync() + { + return await SteamFriends.GetSmallAvatarAsync( Id ); + } + + public async Task GetMediumAvatarAsync() + { + return await SteamFriends.GetMediumAvatarAsync( Id ); + } + + public async Task GetLargeAvatarAsync() + { + return await SteamFriends.GetLargeAvatarAsync( Id ); + } + + public string GetRichPresence( string key ) + { + var val = SteamFriends.Internal.GetFriendRichPresence( Id, key ); + if ( string.IsNullOrEmpty( val ) ) return null; + return val; + } + + /// + /// Invite this friend to the game that we are playing + /// + public bool InviteToGame( string Text ) + { + return SteamFriends.Internal.InviteUserToGame( Id, Text ); + } + + /// + /// Sends a message to a Steam friend. Returns true if success + /// + public bool SendMessage( string message ) + { + return SteamFriends.Internal.ReplyToFriendMessage( Id, message ); + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/GameId.cs b/Facepunch.Steamworks/Structs/GameId.cs new file mode 100644 index 0000000..e5940c7 --- /dev/null +++ b/Facepunch.Steamworks/Structs/GameId.cs @@ -0,0 +1,45 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct GameId + { + // TODO - Be able to access these vars + + /* + + enum EGameIDType + { + k_EGameIDTypeApp = 0, + k_EGameIDTypeGameMod = 1, + k_EGameIDTypeShortcut = 2, + k_EGameIDTypeP2P = 3, + }; + + # ifdef VALVE_BIG_ENDIAN + unsigned int m_nModID : 32; + unsigned int m_nType : 8; + unsigned int m_nAppID : 24; + #else + unsigned int m_nAppID : 24; + unsigned int m_nType : 8; + unsigned int m_nModID : 32; + #endif + */ + public ulong Value; + + public static implicit operator GameId( ulong value ) + { + return new GameId { Value = value }; + } + + public static implicit operator ulong( GameId value ) + { + return value.Value; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Image.cs b/Facepunch.Steamworks/Structs/Image.cs new file mode 100644 index 0000000..57b00cd --- /dev/null +++ b/Facepunch.Steamworks/Structs/Image.cs @@ -0,0 +1,37 @@ + +namespace Steamworks.Data +{ + public struct Image + { + public uint Width; + public uint Height; + public byte[] Data; + + public Color GetPixel( int x, int y ) + { + if ( x < 0 || x >= Width ) throw new System.Exception( "x out of bounds" ); + if ( y < 0 || y >= Height ) throw new System.Exception( "y out of bounds" ); + + Color c = new Color(); + + var i = (y * Width + x) * 4; + + c.r = Data[i + 0]; + c.g = Data[i + 1]; + c.b = Data[i + 2]; + c.a = Data[i + 3]; + + return c; + } + + public override string ToString() + { + return $"{Width}x{Height} ({Data.Length}bytes)"; + } + } + + public struct Color + { + public byte r, g, b, a; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/InventoryDef.cs b/Facepunch.Steamworks/Structs/InventoryDef.cs new file mode 100644 index 0000000..4475986 --- /dev/null +++ b/Facepunch.Steamworks/Structs/InventoryDef.cs @@ -0,0 +1,238 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using Steamworks.Data; + +namespace Steamworks +{ + public class InventoryDef : IEquatable + { + internal InventoryDefId _id; + internal Dictionary _properties; + + public InventoryDef( InventoryDefId defId ) + { + _id = defId; + } + + public int Id => _id.Value; + + /// + /// Shortcut to call GetProperty( "name" ) + /// + public string Name => GetProperty( "name" ); + + /// + /// Shortcut to call GetProperty( "description" ) + /// + public string Description => GetProperty( "description" ); + + /// + /// Shortcut to call GetProperty( "icon_url" ) + /// + public string IconUrl => GetProperty( "icon_url" ); + + /// + /// Shortcut to call GetProperty( "icon_url_large" ) + /// + public string IconUrlLarge => GetProperty( "icon_url_large" ); + + /// + /// Shortcut to call GetProperty( "price_category" ) + /// + public string PriceCategory => GetProperty( "price_category" ); + + /// + /// Shortcut to call GetProperty( "type" ) + /// + public string Type => GetProperty( "type" ); + + /// + /// Returns true if this is an item that generates an item, rather + /// than something that is actual an item + /// + public bool IsGenerator => Type == "generator"; + + /// + /// Shortcut to call GetProperty( "exchange" ) + /// + public string ExchangeSchema => GetProperty( "exchange" ); + + /// + /// Get a list of exchanges that are available to make this item + /// + public InventoryRecipe[] GetRecipes() + { + if ( string.IsNullOrEmpty( ExchangeSchema ) ) return null; + + var parts = ExchangeSchema.Split( new[] { ';' }, StringSplitOptions.RemoveEmptyEntries ); + + return parts.Select( x => InventoryRecipe.FromString( x, this ) ).ToArray(); + } + + /// + /// Shortcut to call GetBoolProperty( "marketable" ) + /// + public bool Marketable => GetBoolProperty( "marketable" ); + + /// + /// Shortcut to call GetBoolProperty( "tradable" ) + /// + public bool Tradable => GetBoolProperty( "tradable" ); + + /// + /// Gets the property timestamp + /// + public DateTime Created => GetProperty( "timestamp" ); + + /// + /// Gets the property modified + /// + public DateTime Modified => GetProperty( "modified" ); + + /// + /// Get a specific property by name + /// + public string GetProperty( string name ) + { + if ( _properties!= null && _properties.TryGetValue( name, out string val ) ) + return val; + + uint _ = (uint)Helpers.MaxStringSize; + + if ( !SteamInventory.Internal.GetItemDefinitionProperty( Id, name, out var vl, ref _ ) ) + return null; + + if ( _properties == null ) + _properties = new Dictionary(); + + _properties[name] = vl; + + return vl; + } + + /// + /// Read a raw property from the definition schema + /// + public bool GetBoolProperty( string name ) + { + string val = GetProperty( name ); + + if ( val.Length == 0 ) return false; + if ( val[0] == '0' || val[0] == 'F' || val[0] == 'f' ) return false; + + return true; + } + + /// + /// Read a raw property from the definition schema + /// + public T GetProperty( string name ) + { + string val = GetProperty( name ); + + if ( string.IsNullOrEmpty( val ) ) + return default( T ); + + try + { + return (T)Convert.ChangeType( val, typeof( T ) ); + } + catch ( System.Exception ) + { + return default( T ); + } + } + + /// + /// Gets a list of all properties on this item + /// + public IEnumerable> Properties + { + get + { + var list = GetProperty( null ); + var keys = list.Split( ',' ); + + foreach ( var key in keys ) + { + yield return new KeyValuePair( key, GetProperty( key ) ); + } + } + } + + /// + /// Returns the price of this item in the local currency (SteamInventory.Currency) + /// + public int LocalPrice + { + get + { + ulong curprice = 0; + ulong baseprice = 0; + + if ( !SteamInventory.Internal.GetItemPrice( Id, ref curprice, ref baseprice ) ) + return 0; + + return (int) curprice; + } + } + + public string LocalPriceFormatted => Utility.FormatPrice( SteamInventory.Currency, LocalPrice / 100.0 ); + + /// + /// If the price has been discounted, LocalPrice will differ from LocalBasePrice + /// (assumed, this isn't documented) + /// + public int LocalBasePrice + { + get + { + ulong curprice = 0; + ulong baseprice = 0; + + if ( !SteamInventory.Internal.GetItemPrice( Id, ref curprice, ref baseprice ) ) + return 0; + + return (int)baseprice; + } + } + + public string LocalBasePriceFormatted => Utility.FormatPrice( SteamInventory.Currency, LocalPrice / 100.0 ); + + InventoryRecipe[] _recContaining; + + /// + /// Return a list of recepies that contain this item + /// + public InventoryRecipe[] GetRecipesContainingThis() + { + if ( _recContaining != null ) return _recContaining; + + var allRec = SteamInventory.Definitions + .Select( x => x.GetRecipes() ) + .Where( x => x != null ) + .SelectMany( x => x ); + + _recContaining = allRec.Where( x => x.ContainsIngredient( this ) ).ToArray(); + return _recContaining; + } + + public static bool operator ==( InventoryDef a, InventoryDef b ) + { + if ( Object.ReferenceEquals( a, null ) ) + return Object.ReferenceEquals( b, null ); + + return a.Equals( b ); + } + public static bool operator !=( InventoryDef a, InventoryDef b ) => !(a == b); + public override bool Equals( object p ) => this.Equals( (InventoryDef)p ); + public override int GetHashCode() => Id.GetHashCode(); + public bool Equals( InventoryDef p ) + { + if ( p == null ) return false; + return p.Id == Id; + } + + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/InventoryItem.cs b/Facepunch.Steamworks/Structs/InventoryItem.cs new file mode 100644 index 0000000..c9e21cc --- /dev/null +++ b/Facepunch.Steamworks/Structs/InventoryItem.cs @@ -0,0 +1,175 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public struct InventoryItem : IEquatable + { + internal InventoryItemId _id; + internal InventoryDefId _def; + internal SteamItemFlags _flags; + internal ushort _quantity; + internal Dictionary _properties; + + public InventoryItemId Id => _id; + + public InventoryDefId DefId => _def; + + public int Quantity => _quantity; + + public InventoryDef Def => SteamInventory.FindDefinition( DefId ); + + + /// + /// Only available if the result set was created with the getproperties + /// + public Dictionary Properties => _properties; + + /// + /// This item is account-locked and cannot be traded or given away. + /// This is an item status flag which is permanently attached to specific item instances + /// + public bool IsNoTrade => _flags.HasFlag( SteamItemFlags.NoTrade ); + + /// + /// The item has been destroyed, traded away, expired, or otherwise invalidated. + /// This is an action confirmation flag which is only set one time, as part of a result set. + /// + public bool IsRemoved => _flags.HasFlag( SteamItemFlags.Removed ); + + /// + /// The item quantity has been decreased by 1 via ConsumeItem API. + /// This is an action confirmation flag which is only set one time, as part of a result set. + /// + public bool IsConsumed => _flags.HasFlag( SteamItemFlags.Consumed ); + + /// + /// Consumes items from a user's inventory. If the quantity of the given item goes to zero, it is permanently removed. + /// Once an item is removed it cannot be recovered.This is not for the faint of heart - if your game implements item removal at all, + /// a high-friction UI confirmation process is highly recommended.ConsumeItem can be restricted to certain item definitions or fully + /// blocked via the Steamworks website to minimize support/abuse issues such as the classic "my brother borrowed my laptop and deleted all of my rare items". + /// + public async Task ConsumeAsync( int amount = 1 ) + { + var sresult = default( SteamInventoryResult_t ); + if ( !SteamInventory.Internal.ConsumeItem( ref sresult, Id, (uint)amount ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Split stack into two items + /// + public async Task SplitStackAsync( int quantity = 1 ) + { + var sresult = default( SteamInventoryResult_t ); + if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, Id, (uint)quantity, ulong.MaxValue ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + /// + /// Add x units of the target item to this item + /// + public async Task AddAsync( InventoryItem add, int quantity = 1 ) + { + var sresult = default( SteamInventoryResult_t ); + if ( !SteamInventory.Internal.TransferItemQuantity( ref sresult, add.Id, (uint)quantity, Id ) ) + return null; + + return await InventoryResult.GetAsync( sresult ); + } + + + internal static InventoryItem From( SteamItemDetails_t details ) + { + var i = new InventoryItem + { + _id = details.ItemId, + _def = details.Definition, + _flags = (SteamItemFlags) details.Flags, + _quantity = details.Quantity + }; + + return i; + } + + internal static Dictionary GetProperties( SteamInventoryResult_t result, int index ) + { + var strlen = (uint) Helpers.MaxStringSize; + + if ( !SteamInventory.Internal.GetResultItemProperty( result, (uint)index, null, out var propNames, ref strlen ) ) + return null; + + var props = new Dictionary(); + + foreach ( var propertyName in propNames.Split( ',' ) ) + { + strlen = (uint)Helpers.MaxStringSize; + + if ( SteamInventory.Internal.GetResultItemProperty( result, (uint)index, propertyName, out var strVal, ref strlen ) ) + { + props.Add( propertyName, strVal ); + } + } + + return props; + } + + /// + /// Will try to return the date that this item was aquired. You need to have for the items + /// with their properties for this to work. + /// + public DateTime Acquired + { + get + { + if ( Properties == null ) return DateTime.UtcNow; + + var str = Properties["acquired"]; + + var y = int.Parse( str.Substring( 0, 4 ) ); + var m = int.Parse( str.Substring( 4, 2 ) ); + var d = int.Parse( str.Substring( 6, 2 ) ); + + var h = int.Parse( str.Substring( 9, 2 ) ); + var mn = int.Parse( str.Substring( 11, 2 ) ); + var s = int.Parse( str.Substring( 13, 2 ) ); + + return new DateTime( y, m, d, h, mn, s, DateTimeKind.Utc ); + } + } + + /// + /// Tries to get the origin property. Need properties for this to work. + /// Will return a string like "market" + /// + public string Origin + { + get + { + if ( Properties == null ) return null; + return Properties["origin"]; + } + } + + /// + /// Small utility class to describe an item with a quantity + /// + public struct Amount + { + public InventoryItem Item; + public int Quantity; + } + + public static bool operator ==( InventoryItem a, InventoryItem b ) => a._id == b._id; + public static bool operator !=( InventoryItem a, InventoryItem b ) => a._id != b._id; + public override bool Equals( object p ) => this.Equals( (InventoryItem)p ); + public override int GetHashCode() => _id.GetHashCode(); + public bool Equals( InventoryItem p ) => p._id == _id; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs b/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs new file mode 100644 index 0000000..ef5b682 --- /dev/null +++ b/Facepunch.Steamworks/Structs/InventoryPurchaseResult.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct InventoryPurchaseResult + { + public Result Result; + public ulong OrderID; + public ulong TransID; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/InventoryRecipe.cs b/Facepunch.Steamworks/Structs/InventoryRecipe.cs new file mode 100644 index 0000000..1305eb8 --- /dev/null +++ b/Facepunch.Steamworks/Structs/InventoryRecipe.cs @@ -0,0 +1,104 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + /// + /// A structured description of an item exchange + /// + public struct InventoryRecipe : IEquatable + { + public struct Ingredient + { + /// + /// The definition ID of the ingredient. + /// + public int DefinitionId; + + /// + /// If we don't know about this item definition this might be null. + /// In which case, DefinitionId should still hold the correct id. + /// + public InventoryDef Definition; + + /// + /// The amount of this item needed. Generally this will be 1. + /// + public int Count; + + internal static Ingredient FromString( string part ) + { + var i = new Ingredient(); + i.Count = 1; + + try + { + if ( part.Contains( "x" ) ) + { + var idx = part.IndexOf( 'x' ); + + int count = 0; + if ( int.TryParse( part.Substring( idx + 1 ), out count ) ) + i.Count = count; + + part = part.Substring( 0, idx ); + } + + i.DefinitionId = int.Parse( part ); + i.Definition = SteamInventory.FindDefinition( i.DefinitionId ); + + } + catch ( System.Exception ) + { + return i; + } + + return i; + } + } + + /// + /// The item that this will create. + /// + public InventoryDef Result; + + /// + /// The items, with quantity required to create this item. + /// + public Ingredient[] Ingredients; + + public string Source; + + internal static InventoryRecipe FromString( string part, InventoryDef Result ) + { + var r = new InventoryRecipe + { + Result = Result, + Source = part + }; + + var parts = part.Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ); + + r.Ingredients = parts.Select( x => Ingredient.FromString( x ) ).Where( x => x.DefinitionId != 0 ).ToArray(); + return r; + } + + internal bool ContainsIngredient( InventoryDef inventoryDef ) + { + return Ingredients.Any( x => x.DefinitionId == inventoryDef.Id ); + } + + public static bool operator ==( InventoryRecipe a, InventoryRecipe b ) => a.GetHashCode() == b.GetHashCode(); + public static bool operator !=( InventoryRecipe a, InventoryRecipe b ) => a.GetHashCode() != b.GetHashCode(); + public override bool Equals( object p ) => this.Equals( (InventoryRecipe)p ); + public override int GetHashCode() + { + return Source.GetHashCode(); + } + + public bool Equals( InventoryRecipe p ) => p.GetHashCode() == GetHashCode(); + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/InventoryResult.cs b/Facepunch.Steamworks/Structs/InventoryResult.cs new file mode 100644 index 0000000..5518ba4 --- /dev/null +++ b/Facepunch.Steamworks/Structs/InventoryResult.cs @@ -0,0 +1,118 @@ +using System; +using System.Collections.Generic; +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public struct InventoryResult : IDisposable + { + internal SteamInventoryResult_t _id; + + public bool Expired { get; internal set; } + + internal InventoryResult( SteamInventoryResult_t id, bool expired ) + { + _id = id; + Expired = expired; + } + + public int ItemCount + { + get + { + uint cnt = 0; + + if ( !SteamInventory.Internal.GetResultItems( _id, null, ref cnt ) ) + return 0; + + return (int) cnt; + } + } + + /// + /// Checks whether an inventory result handle belongs to the specified Steam ID. + /// This is important when using Deserialize, to verify that a remote player is not pretending to have a different user's inventory + /// + public bool BelongsTo( SteamId steamId ) + { + return SteamInventory.Internal.CheckResultSteamID( _id, steamId ); + } + + public InventoryItem[] GetItems( bool includeProperties = false ) + { + uint cnt = (uint) ItemCount; + if ( cnt <= 0 ) return null; + + var pOutItemsArray = new SteamItemDetails_t[cnt]; + + if ( !SteamInventory.Internal.GetResultItems( _id, pOutItemsArray, ref cnt ) ) + return null; + + var items = new InventoryItem[cnt]; + + for( int i=0; i< cnt; i++ ) + { + var item = InventoryItem.From( pOutItemsArray[i] ); + + if ( includeProperties ) + item._properties = InventoryItem.GetProperties( _id, i ); + + items[i] = item; + } + + + return items; + } + + public void Dispose() + { + if ( _id.Value == -1 ) return; + + SteamInventory.Internal.DestroyResult( _id ); + } + + internal static async Task GetAsync( SteamInventoryResult_t sresult ) + { + var _result = Result.Pending; + while ( _result == Result.Pending ) + { + _result = SteamInventory.Internal.GetResultStatus( sresult ); + await Task.Delay( 10 ); + } + + if ( _result != Result.OK && _result != Result.Expired ) + return null; + + return new InventoryResult( sresult, _result == Result.Expired ); + } + + /// + /// Serialized result sets contain a short signature which can't be forged or replayed across different game sessions. + /// A result set can be serialized on the local client, transmitted to other players via your game networking, and + /// deserialized by the remote players.This is a secure way of preventing hackers from lying about posessing + /// rare/high-value items. Serializes a result set with signature bytes to an output buffer.The size of a serialized + /// result depends on the number items which are being serialized.When securely transmitting items to other players, + /// it is recommended to use GetItemsByID first to create a minimal result set. + /// Results have a built-in timestamp which will be considered "expired" after an hour has elapsed.See DeserializeResult + /// for expiration handling. + /// + public unsafe byte[] Serialize() + { + uint size = 0; + + if ( !SteamInventory.Internal.SerializeResult( _id, IntPtr.Zero, ref size ) ) + return null; + + var data = new byte[size]; + + fixed ( byte* ptr = data ) + { + if ( !SteamInventory.Internal.SerializeResult( _id, (IntPtr)ptr, ref size ) ) + return null; + } + + return data; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Leaderboard.cs b/Facepunch.Steamworks/Structs/Leaderboard.cs new file mode 100644 index 0000000..2010a33 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Leaderboard.cs @@ -0,0 +1,144 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct Leaderboard + { + internal SteamLeaderboard_t Id; + + /// + /// the name of a leaderboard + /// + public string Name => SteamUserStats.Internal.GetLeaderboardName( Id ); + public LeaderboardSort Sort => SteamUserStats.Internal.GetLeaderboardSortMethod( Id ); + public LeaderboardDisplay Display => SteamUserStats.Internal.GetLeaderboardDisplayType( Id ); + + static int[] detailsBuffer = new int[64]; + static int[] noDetails = new int[0]; + + /// + /// Submit your score and replace your old score even if it was better + /// + public async Task ReplaceScore( int score, int[] details = null ) + { + if ( details == null ) details = noDetails; + + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.ForceUpdate, score, details, details.Length ); + if ( !r.HasValue ) return null; + + return LeaderboardUpdate.From( r.Value ); + } + + /// + /// Submit your new score, but won't replace your high score if it's lower + /// + public async Task SubmitScoreAsync( int score, int[] details = null ) + { + if ( details == null ) details = noDetails; + + var r = await SteamUserStats.Internal.UploadLeaderboardScore( Id, LeaderboardUploadScoreMethod.KeepBest, score, details, details.Length ); + if ( !r.HasValue ) return null; + + return LeaderboardUpdate.From( r.Value ); + } + + /// + /// Attaches a piece of user generated content the user's entry on a leaderboard + /// + public async Task AttachUgc( Ugc file ) + { + var r = await SteamUserStats.Internal.AttachLeaderboardUGC( Id, file.Handle ); + if ( !r.HasValue ) return Result.Fail; + + return r.Value.Result; + } + + /// + /// Used to query for a sequential range of leaderboard entries by leaderboard Sort. + /// + public async Task GetScoresAsync( int count, int offset = 1 ) + { + if ( offset <= 0 ) throw new System.ArgumentException( "Should be 1+", nameof( offset ) ); + + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Global, offset, offset + count ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + /// + /// Used to retrieve leaderboard entries relative a user's entry. If there are not enough entries in the leaderboard + /// before or after the user's entry, Steam will adjust the range to try to return the number of entries requested. + /// For example, if the user is #1 on the leaderboard and start is set to -2, end is set to 2, Steam will return the first + /// 5 entries in the leaderboard. If The current user has no entry, this will return null. + /// + public async Task GetScoresAroundUserAsync( int start = -10, int end = 10 ) + { + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.GlobalAroundUser, start, end ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + /// + /// Used to retrieve all leaderboard entries for friends of the current user + /// + public async Task GetScoresFromFriendsAsync() + { + var r = await SteamUserStats.Internal.DownloadLeaderboardEntries( Id, LeaderboardDataRequest.Friends, 0, 0 ); + if ( !r.HasValue ) + return null; + + return await LeaderboardResultToEntries( r.Value ); + } + + #region util + internal async Task LeaderboardResultToEntries( LeaderboardScoresDownloaded_t r ) + { + if ( r.CEntryCount <= 0 ) + return null; + + var output = new LeaderboardEntry[r.CEntryCount]; + var e = default( LeaderboardEntry_t ); + + for ( int i = 0; i < output.Length; i++ ) + { + if ( SteamUserStats.Internal.GetDownloadedLeaderboardEntry( r.SteamLeaderboardEntries, i, ref e, detailsBuffer, detailsBuffer.Length ) ) + { + output[i] = LeaderboardEntry.From( e, detailsBuffer ); + } + } + + await WaitForUserNames( output ); + + return output; + } + + internal async Task WaitForUserNames( LeaderboardEntry[] entries) + { + bool gotAll = false; + while ( !gotAll ) + { + gotAll = true; + + foreach ( var entry in entries ) + { + if ( entry.User.Id == 0 ) continue; + if ( !SteamFriends.Internal.RequestUserInformation( entry.User.Id, true ) ) continue; + + gotAll = false; + } + + await Task.Delay( 1 ); + } + } + #endregion + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/LeaderboardEntry.cs b/Facepunch.Steamworks/Structs/LeaderboardEntry.cs new file mode 100644 index 0000000..82eb26f --- /dev/null +++ b/Facepunch.Steamworks/Structs/LeaderboardEntry.cs @@ -0,0 +1,31 @@ +using System.Linq; + +namespace Steamworks.Data +{ + public struct LeaderboardEntry + { + public Friend User; + public int GlobalRank; + public int Score; + public int[] Details; + // UGCHandle_t m_hUGC + + internal static LeaderboardEntry From( LeaderboardEntry_t e, int[] detailsBuffer ) + { + var r = new LeaderboardEntry + { + User = new Friend( e.SteamIDUser ), + GlobalRank = e.GlobalRank, + Score = e.Score, + Details = null + }; + + if ( e.CDetails > 0 ) + { + r.Details = detailsBuffer.Take( e.CDetails ).ToArray(); + } + + return r; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs b/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs new file mode 100644 index 0000000..dc0eb12 --- /dev/null +++ b/Facepunch.Steamworks/Structs/LeaderboardUpdate.cs @@ -0,0 +1,22 @@ +using System.Linq; + +namespace Steamworks.Data +{ + public struct LeaderboardUpdate + { + public int Score; + public bool Changed; + public int NewGlobalRank; + public int OldGlobalRank; + public int RankChange => NewGlobalRank - OldGlobalRank; + + internal static LeaderboardUpdate From( LeaderboardScoreUploaded_t e ) => + new LeaderboardUpdate + { + Score = e.Score, + Changed = e.ScoreChanged == 1, + NewGlobalRank = e.GlobalRankNew, + OldGlobalRank = e.GlobalRankPrevious + }; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Lobby.cs b/Facepunch.Steamworks/Structs/Lobby.cs new file mode 100644 index 0000000..037e712 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Lobby.cs @@ -0,0 +1,251 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct Lobby + { + public SteamId Id { get; internal set; } + + + internal Lobby( SteamId id ) + { + Id = id; + } + + /// + /// Try to join this room. Will return RoomEnter.Success on success, + /// and anything else is a failure + /// + public async Task Join() + { + var result = await SteamMatchmaking.Internal.JoinLobby( Id ); + if ( !result.HasValue ) return RoomEnter.Error; + + return (RoomEnter) result.Value.EChatRoomEnterResponse; + } + + /// + /// Leave a lobby; this will take effect immediately on the client side + /// other users in the lobby will be notified by a LobbyChatUpdate_t callback + /// + public void Leave() + { + SteamMatchmaking.Internal.LeaveLobby( Id ); + } + + /// + /// Invite another user to the lobby + /// will return true if the invite is successfully sent, whether or not the target responds + /// returns false if the local user is not connected to the Steam servers + /// + public bool InviteFriend( SteamId steamid ) + { + return SteamMatchmaking.Internal.InviteUserToLobby( Id, steamid ); + } + + /// + /// returns the number of users in the specified lobby + /// + public int MemberCount => SteamMatchmaking.Internal.GetNumLobbyMembers( Id ); + + /// + /// Returns current members. Need to be in the lobby to see the users. + /// + public IEnumerable Members + { + get + { + for( int i = 0; i < MemberCount; i++ ) + { + yield return new Friend( SteamMatchmaking.Internal.GetLobbyMemberByIndex( Id, i ) ); + } + } + } + + + /// + /// Get data associated with this lobby + /// + public string GetData( string key ) + { + return SteamMatchmaking.Internal.GetLobbyData( Id, key ); + } + + /// + /// Get data associated with this lobby + /// + public bool SetData( string key, string value ) + { + if ( key.Length > 255 ) throw new System.ArgumentException( "Key should be < 255 chars", nameof( key ) ); + if ( value.Length > 8192 ) throw new System.ArgumentException( "Value should be < 8192 chars", nameof( key ) ); + + return SteamMatchmaking.Internal.SetLobbyData( Id, key, value ); + } + + /// + /// Removes a metadata key from the lobby + /// + public bool DeleteData( string key ) + { + return SteamMatchmaking.Internal.DeleteLobbyData( Id, key ); + } + + /// + /// Get all data for this lobby + /// + public IEnumerable> Data + { + get + { + var cnt = SteamMatchmaking.Internal.GetLobbyDataCount( Id ); + + for ( int i =0; i( a, b ); + } + } + } + } + + /// + /// Gets per-user metadata for someone in this lobby + /// + public string GetMemberData( Friend member, string key ) + { + return SteamMatchmaking.Internal.GetLobbyMemberData( Id, member.Id, key ); + } + + /// + /// Sets per-user metadata (for the local user implicitly) + /// + public void SetMemberData( Friend member, string key, string value ) + { + SteamMatchmaking.Internal.SetLobbyMemberData( Id, key, value ); + } + + /// + /// Sends a string to the chat room + /// + public bool SendChatString( string message ) + { + var data = System.Text.Encoding.UTF8.GetBytes( message ); + return SendChatBytes( data ); + } + + /// + /// Sends bytes the the chat room + /// this isn't exposed because there's no way to read raw bytes atm, + /// and I figure people can send json if they want something more advanced + /// + internal unsafe bool SendChatBytes( byte[] data ) + { + fixed ( byte* ptr = data ) + { + return SteamMatchmaking.Internal.SendLobbyChatMsg( Id, (IntPtr)ptr, data.Length ); + } + } + + /// + /// Refreshes metadata for a lobby you're not necessarily in right now + /// you never do this for lobbies you're a member of, only if your + /// this will send down all the metadata associated with a lobby + /// this is an asynchronous call + /// returns false if the local user is not connected to the Steam servers + /// results will be returned by a LobbyDataUpdate_t callback + /// if the specified lobby doesn't exist, LobbyDataUpdate_t::m_bSuccess will be set to false + /// + public bool Refresh() + { + return SteamMatchmaking.Internal.RequestLobbyData( Id ); + } + + /// + /// Max members able to join this lobby. Cannot be over 250. + /// Can only be set by the owner + /// + public int MaxMembers + { + get => SteamMatchmaking.Internal.GetLobbyMemberLimit( Id ); + set => SteamMatchmaking.Internal.SetLobbyMemberLimit( Id, value ); + } + + public bool SetPublic() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Public ); + } + + public bool SetPrivate() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Private ); + } + + public bool SetInvisible() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.Invisible ); + } + + public bool SetFriendsOnly() + { + return SteamMatchmaking.Internal.SetLobbyType( Id, LobbyType.FriendsOnly ); + } + + public bool SetJoinable( bool b ) + { + return SteamMatchmaking.Internal.SetLobbyJoinable( Id, b ); + } + + /// + /// [SteamID variant] + /// Allows the owner to set the game server associated with the lobby. Triggers the + /// Steammatchmaking.OnLobbyGameCreated event. + /// + public void SetGameServer( SteamId steamServer ) + { + if ( !steamServer.IsValid ) + throw new ArgumentException( $"SteamId for server is invalid" ); + + SteamMatchmaking.Internal.SetLobbyGameServer( Id, 0, 0, steamServer ); + } + + /// + /// [IP/Port variant] + /// Allows the owner to set the game server associated with the lobby. Triggers the + /// Steammatchmaking.OnLobbyGameCreated event. + /// + public void SetGameServer( string ip, ushort port ) + { + if ( !IPAddress.TryParse( ip, out IPAddress add ) ) + throw new ArgumentException( $"IP address for server is invalid" ); + + SteamMatchmaking.Internal.SetLobbyGameServer( Id, add.IpToInt32(), port, new SteamId() ); + } + + /// + /// Gets the details of the lobby's game server, if set. Returns true if the lobby is + /// valid and has a server set, otherwise returns false. + /// + public bool GetGameServer( ref uint ip, ref ushort port, ref SteamId serverId ) + { + return SteamMatchmaking.Internal.GetLobbyGameServer( Id, ref ip, ref port, ref serverId ); + } + + /// + /// You must be the lobby owner to set the owner + /// + public Friend Owner + { + get => new Friend( SteamMatchmaking.Internal.GetLobbyOwner( Id ) ); + set => SteamMatchmaking.Internal.SetLobbyOwner( Id, value.Id ); + } + + /// + /// Check if the specified SteamId owns the lobby + /// + public bool IsOwnedBy( SteamId k ) => Owner.Id == k; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/LobbyQuery.cs b/Facepunch.Steamworks/Structs/LobbyQuery.cs new file mode 100644 index 0000000..384fede --- /dev/null +++ b/Facepunch.Steamworks/Structs/LobbyQuery.cs @@ -0,0 +1,240 @@ +using System.Threading.Tasks; +using System.Collections.Generic; + +namespace Steamworks.Data +{ + public struct LobbyQuery + { + // TODO FILTERS + // AddRequestLobbyListStringFilter + // - WithoutKeyValue + + #region Distance Filter + internal LobbyDistanceFilter? distance; + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceClose() + { + distance = LobbyDistanceFilter.Close; + return this; + } + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceFar() + { + distance = LobbyDistanceFilter.Far; + return this; + } + + /// + /// only lobbies in the same immediate region will be returned + /// + public LobbyQuery FilterDistanceWorldwide() + { + distance = LobbyDistanceFilter.Worldwide; + return this; + } + #endregion + + #region String key/value filter + internal Dictionary stringFilters; + + /// + /// Filter by specified key/value pair; string parameters + /// + public LobbyQuery WithKeyValue( string key, string value ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( stringFilters == null ) + stringFilters = new Dictionary(); + + stringFilters.Add( key, value ); + + return this; + } + #endregion + + #region Numerical filters + internal List numericalFilters; + + /// + /// Numerical filter where value is less than the value provided + /// + public LobbyQuery WithLower( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.LessThan ); + return this; + } + + /// + /// Numerical filter where value is greater than the value provided + /// + public LobbyQuery WithHigher( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.GreaterThan ); + return this; + } + + /// + /// Numerical filter where value must be equal to the value provided + /// + public LobbyQuery WithEqual( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.Equal ); + return this; + } + + /// + /// Numerical filter where value must not equal the value provided + /// + public LobbyQuery WithNotEqual( string key, int value ) + { + AddNumericalFilter( key, value, LobbyComparison.NotEqual ); + return this; + } + + /// + /// Test key, initialize numerical filter list if necessary, then add new numerical filter + /// + internal void AddNumericalFilter( string key, int value, LobbyComparison compare ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( numericalFilters == null ) + numericalFilters = new List(); + + numericalFilters.Add( new NumericalFilter( key, value, compare ) ); + } + #endregion + + #region Near value filter + internal Dictionary nearValFilters; + + /// + /// Order filtered results according to key/values nearest the provided key/value pair. + /// Can specify multiple near value filters; each successive filter is lower priority than the previous. + /// + public LobbyQuery OrderByNear( string key, int value ) + { + if ( string.IsNullOrEmpty( key ) ) + throw new System.ArgumentException( "Key string provided for LobbyQuery filter is null or empty", nameof( key ) ); + + if ( key.Length > SteamMatchmaking.MaxLobbyKeyLength ) + throw new System.ArgumentException( $"Key length is longer than {SteamMatchmaking.MaxLobbyKeyLength}", nameof( key ) ); + + if ( nearValFilters == null ) + nearValFilters = new Dictionary(); + + nearValFilters.Add( key, value ); + + return this; + } + #endregion + + #region Slots Filter + internal int? slotsAvailable; + + /// + /// returns only lobbies with the specified number of slots available + /// + public LobbyQuery WithSlotsAvailable( int minSlots ) + { + slotsAvailable = minSlots; + return this; + } + + #endregion + + #region Max results filter + internal int? maxResults; + + /// + /// sets how many results to return, the lower the count the faster it is to download the lobby results + /// + public LobbyQuery WithMaxResults( int max ) + { + maxResults = max; + return this; + } + + #endregion + + void ApplyFilters() + { + if ( distance.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListDistanceFilter( distance.Value ); + } + + if ( slotsAvailable.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListFilterSlotsAvailable( slotsAvailable.Value ); + } + + if ( maxResults.HasValue ) + { + SteamMatchmaking.Internal.AddRequestLobbyListResultCountFilter( maxResults.Value ); + } + + if ( stringFilters != null ) + { + foreach ( var k in stringFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListStringFilter( k.Key, k.Value, LobbyComparison.Equal ); + } + } + + if( numericalFilters != null ) + { + foreach ( var n in numericalFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListNumericalFilter( n.Key, n.Value, n.Comparer ); + } + } + + if( nearValFilters != null ) + { + foreach (var v in nearValFilters ) + { + SteamMatchmaking.Internal.AddRequestLobbyListNearValueFilter( v.Key, v.Value ); + } + } + } + + /// + /// Run the query, get the matching lobbies + /// + public async Task RequestAsync() + { + ApplyFilters(); + + LobbyMatchList_t? list = await SteamMatchmaking.Internal.RequestLobbyList(); + if ( !list.HasValue || list.Value.LobbiesMatching == 0 ) + { + return null; + } + + Lobby[] lobbies = new Lobby[list.Value.LobbiesMatching]; + + for ( int i = 0; i < list.Value.LobbiesMatching; i++ ) + { + lobbies[i] = new Lobby { Id = SteamMatchmaking.Internal.GetLobbyByIndex( i ) }; + } + + return lobbies; + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs b/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs new file mode 100644 index 0000000..b82ecf1 --- /dev/null +++ b/Facepunch.Steamworks/Structs/MatchMakingKeyValuePair.cs @@ -0,0 +1,16 @@ +using System; +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential, Pack = Platform.StructPackSize )] + internal struct MatchMakingKeyValuePair + { + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Key; + + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + internal string Value; + } + +} diff --git a/Facepunch.Steamworks/Structs/NetAddress.cs b/Facepunch.Steamworks/Structs/NetAddress.cs new file mode 100644 index 0000000..7add599 --- /dev/null +++ b/Facepunch.Steamworks/Structs/NetAddress.cs @@ -0,0 +1,107 @@ +using System.Net; +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Size = 18, Pack = 1 )] + public struct NetAddress + { + [FieldOffset( 0 )] + internal IPV4 ip; + + [FieldOffset( 16 )] + internal ushort port; + + internal struct IPV4 + { + internal ulong m_8zeros; + internal ushort m_0000; + internal ushort m_ffff; + internal byte ip0; + internal byte ip1; + internal byte ip2; + internal byte ip3; + } + + /// + /// Any IP, specific port + /// + public static NetAddress AnyIp( ushort port ) + { + return new NetAddress + { + ip = new IPV4 + { + m_8zeros = 0, + m_0000 = 0, + m_ffff = 0, + ip0 = 0, + ip1 = 0, + ip2 = 0, + ip3 = 0, + }, + + port = port + }; + } + + /// + /// Localhost IP, specific port + /// + public static NetAddress LocalHost( ushort port ) + { + return new NetAddress + { + ip = new IPV4 + { + m_8zeros = 0, + m_0000 = 0, + m_ffff = 0, + ip0 = 0, + ip1 = 0, + ip2 = 0, + ip3 = 1, + }, + + port = port + }; + } + + /// + /// Specific IP, specific port + /// + public static NetAddress From( string addrStr, ushort port ) + { + return From( IPAddress.Parse( addrStr ), port ); + } + + /// + /// Specific IP, specific port + /// + public static NetAddress From( IPAddress address, ushort port ) + { + var addr = address.GetAddressBytes(); + + if ( addr.Length == 4 ) + { + return new NetAddress + { + ip = new IPV4 + { + m_8zeros = 0, + m_0000 = 0, + m_ffff = 0xffff, + ip0 = addr[0], + ip1 = addr[1], + ip2 = addr[2], + ip3 = addr[3], + }, + + port = port + }; + } + + throw new System.NotImplementedException( "Oops - no IPV6 support yet?" ); + } + } +} diff --git a/Facepunch.Steamworks/Structs/NetIdentity.cs b/Facepunch.Steamworks/Structs/NetIdentity.cs new file mode 100644 index 0000000..c466c99 --- /dev/null +++ b/Facepunch.Steamworks/Structs/NetIdentity.cs @@ -0,0 +1,38 @@ +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Explicit, Size = 136, Pack = 1 )] + public struct NetIdentity + { + [FieldOffset( 0 )] + internal IdentityType type; + + [FieldOffset( 4 )] + internal int m_cbSize; + + [FieldOffset( 8 )] + internal SteamId steamID; + + public static implicit operator NetIdentity( SteamId value ) + { + return new NetIdentity { steamID = value, type = IdentityType.SteamID, m_cbSize = 8 }; + } + + public static implicit operator SteamId( NetIdentity value ) + { + return value.steamID; + } + + public override string ToString() => $"{type};{m_cbSize};{steamID}"; + + internal enum IdentityType + { + Invalid = 0, + IPAddress = 1, + GenericString = 2, + GenericBytes = 3, + SteamID = 16 + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/NetMsg.cs b/Facepunch.Steamworks/Structs/NetMsg.cs new file mode 100644 index 0000000..5555e68 --- /dev/null +++ b/Facepunch.Steamworks/Structs/NetMsg.cs @@ -0,0 +1,33 @@ +using Steamworks.Data; +using System; +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + [StructLayout( LayoutKind.Sequential )] + internal struct NetMsg + { + internal IntPtr DataPtr; + internal int DataSize; + internal Connection Connection; + internal NetIdentity Identity; + internal long ConnectionUserData; + internal long RecvTime; + internal long MessageNumber; + internal IntPtr FreeDataPtr; + internal IntPtr ReleasePtr; + internal int Channel; + + internal delegate void ReleaseDelegate( IntPtr msg ); + + public void Release( IntPtr data ) + { + // + // I think this function might be a static global, so we could probably + // cache this release call. + // + var d = Marshal.GetDelegateForFunctionPointer( ReleasePtr ); + d( data ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/NumericalFilter.cs b/Facepunch.Steamworks/Structs/NumericalFilter.cs new file mode 100644 index 0000000..a0b246a --- /dev/null +++ b/Facepunch.Steamworks/Structs/NumericalFilter.cs @@ -0,0 +1,16 @@ +namespace Steamworks.Data +{ + struct NumericalFilter + { + public string Key { get; internal set; } + public int Value { get; internal set; } + public LobbyComparison Comparer { get; internal set; } + + internal NumericalFilter ( string k, int v, LobbyComparison c ) + { + Key = k; + Value = v; + Comparer = c; + } + } +} diff --git a/Facepunch.Steamworks/Structs/OutgoingPacket.cs b/Facepunch.Steamworks/Structs/OutgoingPacket.cs new file mode 100644 index 0000000..520e96d --- /dev/null +++ b/Facepunch.Steamworks/Structs/OutgoingPacket.cs @@ -0,0 +1,30 @@ +namespace Steamworks.Data +{ + /// + /// A server query packet. + /// + public struct OutgoingPacket + { + /// + /// Target IP address + /// + public uint Address { get; internal set; } + + /// + /// Target port + /// + public ushort Port { get; internal set; } + + /// + /// This data is pooled. Make a copy if you don't use it immediately. + /// This buffer is also quite large - so pay attention to Size. + /// + public byte[] Data { get; internal set; } + + /// + /// Size of the data + /// + public int Size { get; internal set; } + } + +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/P2Packet.cs b/Facepunch.Steamworks/Structs/P2Packet.cs new file mode 100644 index 0000000..ca85773 --- /dev/null +++ b/Facepunch.Steamworks/Structs/P2Packet.cs @@ -0,0 +1,8 @@ +namespace Steamworks.Data +{ + public struct P2Packet + { + public SteamId SteamId; + public byte[] Data; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/PartyBeacon.cs b/Facepunch.Steamworks/Structs/PartyBeacon.cs new file mode 100644 index 0000000..2bb4145 --- /dev/null +++ b/Facepunch.Steamworks/Structs/PartyBeacon.cs @@ -0,0 +1,80 @@ +using System.Threading.Tasks; +using Steamworks.Data; + +namespace Steamworks +{ + public struct PartyBeacon + { + static ISteamParties Internal => SteamParties.Internal; + + internal PartyBeaconID_t Id; + + /// + /// Creator of the beacon + /// + public SteamId Owner + { + get + { + var owner = default( SteamId ); + var location = default( SteamPartyBeaconLocation_t ); + Internal.GetBeaconDetails( Id, ref owner, ref location, out var strVal ); + return owner; + } + } + + /// + /// Creator of the beacon + /// + public string MetaData + { + get + { + var owner = default( SteamId ); + var location = default( SteamPartyBeaconLocation_t ); + Internal.GetBeaconDetails( Id, ref owner, ref location, out var strVal ); + return strVal; + } + } + + /// + /// Will attempt to join the party. If successful will return a connection string. + /// If failed, will return null + /// + public async Task JoinAsync() + { + var result = await Internal.JoinParty( Id ); + if ( !result.HasValue || result.Value.Result != Result.OK ) + return null; + + return result.Value.ConnectStringUTF8(); + } + + /// + /// When a user follows your beacon, Steam will reserve one of the open party slots for them, and send your game a ReservationNotification callback. + /// When that user joins your party, call OnReservationCompleted to notify Steam that the user has joined successfully + /// + public void OnReservationCompleted( SteamId steamid ) + { + Internal.OnReservationCompleted( Id, steamid ); + } + + /// + /// To cancel a reservation (due to timeout or user input), call this. + /// Steam will open a new reservation slot. + /// Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party. + /// + public void CancelReservation( SteamId steamid ) + { + Internal.CancelReservation( Id, steamid ); + } + + /// + /// Turn off the beacon + /// + public bool Destroy() + { + return Internal.DestroyBeacon( Id ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/PingLocation.cs b/Facepunch.Steamworks/Structs/PingLocation.cs new file mode 100644 index 0000000..9eb0a95 --- /dev/null +++ b/Facepunch.Steamworks/Structs/PingLocation.cs @@ -0,0 +1,67 @@ +using System.Runtime.InteropServices; + +namespace Steamworks.Data +{ + /// + /// + /// Object that describes a "location" on the Internet with sufficient + /// detail that we can reasonably estimate an upper bound on the ping between + /// the two hosts, even if a direct route between the hosts is not possible, + /// and the connection must be routed through the Steam Datagram Relay network. + /// This does not contain any information that identifies the host. Indeed, + /// if two hosts are in the same building or otherwise have nearly identical + /// networking characteristics, then it's valid to use the same location + /// object for both of them. + /// + /// NOTE: This object should only be used in the same process! Do not serialize it, + /// send it over the wire, or persist it in a file or database! If you need + /// to do that, convert it to a string representation using the methods in + /// ISteamNetworkingUtils(). + /// + /// + [StructLayout( LayoutKind.Explicit, Size = 512 )] + public struct PingLocation + { + public static PingLocation? TryParseFromString( string str ) + { + var result = default( PingLocation ); + if ( !SteamNetworkingUtils.Internal.ParsePingLocationString( str, ref result ) ) + return null; + + return result; + } + + public override string ToString() + { + SteamNetworkingUtils.Internal.ConvertPingLocationToString( ref this, out var strVal ); + return strVal; + } + + /// Estimate the round-trip latency between two arbitrary locations, in + /// milliseconds. This is a conservative estimate, based on routing through + /// the relay network. For most basic relayed connections, this ping time + /// will be pretty accurate, since it will be based on the route likely to + /// be actually used. + /// + /// If a direct IP route is used (perhaps via NAT traversal), then the route + /// will be different, and the ping time might be better. Or it might actually + /// be a bit worse! Standard IP routing is frequently suboptimal! + /// + /// But even in this case, the estimate obtained using this method is a + /// reasonable upper bound on the ping time. (Also it has the advantage + /// of returning immediately and not sending any packets.) + /// + /// In a few cases we might not able to estimate the route. In this case + /// a negative value is returned. k_nSteamNetworkingPing_Failed means + /// the reason was because of some networking difficulty. (Failure to + /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot + /// currently answer the question for some other reason. + /// + /// Do you need to be able to do this from a backend/matchmaking server? + /// You are looking for the "ticketgen" library. + public int EstimatePingTo( PingLocation target ) + { + return SteamNetworkingUtils.Internal.EstimatePingTimeBetweenTwoLocations( ref this, ref target ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Screenshot.cs b/Facepunch.Steamworks/Structs/Screenshot.cs new file mode 100644 index 0000000..2d6e920 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Screenshot.cs @@ -0,0 +1,37 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks.Data +{ + public struct Screenshot + { + internal ScreenshotHandle Value; + + /// + /// Tags a user as being visible in the screenshot + /// + public bool TagUser( SteamId user ) + { + return SteamScreenshots.Internal.TagUser( Value, user ); + } + + /// + /// Tags a user as being visible in the screenshot + /// + public bool SetLocation( string location ) + { + return SteamScreenshots.Internal.SetLocation( Value, location ); + } + + /// + /// Tags a user as being visible in the screenshot + /// + public bool TagPublishedFile( PublishedFileId file ) + { + return SteamScreenshots.Internal.TagPublishedFile( Value, file ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Server.cs b/Facepunch.Steamworks/Structs/Server.cs new file mode 100644 index 0000000..765e052 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Server.cs @@ -0,0 +1,147 @@ +using System; +using System.Collections.Generic; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct ServerInfo : IEquatable + { + static ISteamMatchmakingServers Internal => Steamworks.ServerList.Base.Internal; + + public string Name { get; set; } + public int Ping { get; set; } + public string GameDir { get; set; } + public string Map { get; set; } + public string Description { get; set; } + public uint AppId { get; set; } + public int Players { get; set; } + public int MaxPlayers { get; set; } + public int BotPlayers { get; set; } + public bool Passworded { get; set; } + public bool Secure { get; set; } + public uint LastTimePlayed { get; set; } + public int Version { get; set; } + public string TagString { get; set; } + public ulong SteamId { get; set; } + public uint AddressRaw { get; set; } + public IPAddress Address { get; set; } + public int ConnectionPort { get; set; } + public int QueryPort { get; set; } + + string[] _tags; + + /// + /// Gets the individual tags for this server + /// + public string[] Tags + { + get + { + if ( _tags == null ) + { + if ( !string.IsNullOrEmpty( TagString ) ) + { + _tags = TagString.Split( ',' ); + } + } + + return _tags; + } + } + + internal static ServerInfo From( gameserveritem_t item ) + { + return new ServerInfo() + { + AddressRaw = item.NetAdr.IP, + Address = Utility.Int32ToIp( item.NetAdr.IP ), + ConnectionPort = item.NetAdr.ConnectionPort, + QueryPort = item.NetAdr.QueryPort, + Name = item.ServerNameUTF8(), + Ping = item.Ping, + GameDir = item.GameDirUTF8(), + Map = item.MapUTF8(), + Description = item.GameDescriptionUTF8(), + AppId = item.AppID, + Players = item.Players, + MaxPlayers = item.MaxPlayers, + BotPlayers = item.BotPlayers, + Passworded = item.Password, + Secure = item.Secure, + LastTimePlayed = item.TimeLastPlayed, + Version = item.ServerVersion, + TagString = item.GameTagsUTF8(), + SteamId = item.SteamID + }; + } + + public ServerInfo( uint ip, ushort cport, ushort qport, uint timeplayed ) : this() + { + AddressRaw = ip; + Address = Utility.Int32ToIp( ip ); + ConnectionPort = cport; + QueryPort = qport; + LastTimePlayed = timeplayed; + } + + internal const uint k_unFavoriteFlagNone = 0x00; + internal const uint k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list + internal const uint k_unFavoriteFlagHistory = 0x02; // this game favorite entry is for the history list + + + + /// + /// Add this server to our history list + /// If we're already in the history list, weill set the last played time to now + /// + public void AddToHistory() + { + SteamMatchmaking.Internal.AddFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory, (uint)Epoch.Current ); + } + + /// + /// If this server responds to source engine style queries, we'll be able to get a list of rules here + /// + public async Task> QueryRulesAsync() + { + return await SourceServerQuery.GetRules( this ); + } + + /// + /// Remove this server from our history list + /// + public void RemoveFromHistory() + { + SteamMatchmaking.Internal.RemoveFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagHistory ); + } + + /// + /// Add this server to our favourite list + /// + public void AddToFavourites() + { + SteamMatchmaking.Internal.AddFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite, (uint)Epoch.Current ); + } + + /// + /// Remove this server from our favourite list + /// + public void RemoveFromFavourites() + { + SteamMatchmaking.Internal.RemoveFavoriteGame( SteamClient.AppId, AddressRaw, (ushort)ConnectionPort, (ushort)QueryPort, k_unFavoriteFlagFavorite ); + } + + public bool Equals( ServerInfo other ) + { + return this.GetHashCode() == other.GetHashCode(); + } + + public override int GetHashCode() + { + return Address.GetHashCode() + SteamId.GetHashCode() + ConnectionPort.GetHashCode() + QueryPort.GetHashCode(); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Server/ServerInit.cs b/Facepunch.Steamworks/Structs/ServerInit.cs similarity index 73% rename from Facepunch.Steamworks/Server/ServerInit.cs rename to Facepunch.Steamworks/Structs/ServerInit.cs index cf1f99b..74b8355 100644 --- a/Facepunch.Steamworks/Server/ServerInit.cs +++ b/Facepunch.Steamworks/Structs/ServerInit.cs @@ -5,43 +5,55 @@ using System.Net; using System.Runtime.InteropServices; using System.Text; -namespace Facepunch.Steamworks +namespace Steamworks { /// /// Used to set up the server. /// The variables in here are all required to be set, and can't be changed once the server is created. /// - public class ServerInit + public struct SteamServerInit { public IPAddress IpAddress; public ushort SteamPort; - public ushort GamePort = 27015; - public ushort QueryPort = 27016; - public bool Secure = true; + public ushort GamePort; + public ushort QueryPort; + public bool Secure; /// /// The version string is usually in the form x.x.x.x, and is used by the master server to detect when the server is out of date. /// If you go into the dedicated server tab on steamworks you'll be able to server the latest version. If this version number is /// less than that latest version then your server won't show. /// - public string VersionString = "2.0.0.0"; + public string VersionString; - /// - /// This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod". - /// - public string ModDir = "unset"; + /// + /// This should be the same directory game where gets installed into. Just the folder name, not the whole path. I.e. "Rust", "Garrysmod". + /// + public string ModDir; /// /// The game description. Setting this to the full name of your game is recommended. /// - public string GameDescription = "unset"; + public string GameDescription; + + /// + /// Is a dedicated server + /// + public bool DedicatedServer; - public ServerInit( string modDir, string gameDesc ) + public SteamServerInit( string modDir, string gameDesc ) { - ModDir = modDir; + DedicatedServer = true; + ModDir = modDir; GameDescription = gameDesc; - } + GamePort = 27015; + QueryPort = 27016; + Secure = true; + VersionString = "1.0.0.0"; + IpAddress = null; + SteamPort = 0; + } public ServerInit(IPAddress ip, string modDir, string gameDesc) { @@ -71,7 +83,7 @@ namespace Facepunch.Steamworks /// /// Set the Steam quert port /// - public ServerInit RandomSteamPort() + public SteamServerInit WithRandomSteamPort() { SteamPort = (ushort)new Random().Next( 10000, 60000 ); return this; @@ -84,7 +96,7 @@ namespace Facepunch.Steamworks /// /// More info about this here: https://partner.steamgames.com/doc/api/ISteamGameServer#HandleIncomingPacket /// - public ServerInit QueryShareGamePort() + public SteamServerInit WithQueryShareGamePort() { QueryPort = 0xFFFF; return this; diff --git a/Facepunch.Steamworks/Structs/Socket.cs b/Facepunch.Steamworks/Structs/Socket.cs new file mode 100644 index 0000000..d589acb --- /dev/null +++ b/Facepunch.Steamworks/Structs/Socket.cs @@ -0,0 +1,23 @@ +namespace Steamworks.Data +{ + public struct Socket + { + internal uint Id; + public override string ToString() => Id.ToString(); + + /// + /// Destroy a listen socket. All the connections that were accepting on the listen + /// socket are closed ungracefully. + /// + public bool Close() + { + return SteamNetworkingSockets.Internal.CloseListenSocket( this ); + } + + public SocketInterface Interface + { + get => SteamNetworkingSockets.GetSocketInterface( Id ); + set => SteamNetworkingSockets.SetSocketInterface( Id, value ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Stat.cs b/Facepunch.Steamworks/Structs/Stat.cs new file mode 100644 index 0000000..1a17861 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Stat.cs @@ -0,0 +1,150 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; + +namespace Steamworks.Data +{ + public struct Stat + { + public string Name { get; internal set; } + public SteamId UserId { get; internal set; } + + public Stat( string name ) + { + Name = name; + UserId = 0; + } + + public Stat( string name, SteamId user ) + { + Name = name; + UserId = user; + } + + internal void LocalUserOnly( [CallerMemberName] string caller = null ) + { + if ( UserId == 0 ) return; + throw new System.Exception( $"Stat.{caller} can only be called for the local user" ); + } + + public double GetGlobalFloat() + { + double val = 0.0; + + if ( SteamUserStats.Internal.GetGlobalStat2( Name, ref val ) ) + return val; + + return 0; + } + + public long GetGlobalInt() + { + long val = 0; + SteamUserStats.Internal.GetGlobalStat1( Name, ref val ); + return val; + } + + public async Task GetGlobalIntDaysAsync( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( result?.Result != Result.OK ) return null; + + var r = new long[days]; + + var rows = SteamUserStats.Internal.GetGlobalStatHistory1( Name, r, (uint) r.Length * sizeof(long) ); + + if ( days != rows ) + r = r.Take( rows ).ToArray(); + + return r; + } + + public async Task GetGlobalFloatDays( int days ) + { + var result = await SteamUserStats.Internal.RequestGlobalStats( days ); + if ( result?.Result != Result.OK ) return null; + + var r = new double[days]; + + var rows = SteamUserStats.Internal.GetGlobalStatHistory2( Name, r, (uint)r.Length * sizeof( double ) ); + + if ( days != rows ) + r = r.Take( rows ).ToArray(); + + return r; + } + + public float GetFloat() + { + float val = 0.0f; + + if ( UserId > 0 ) + { + SteamUserStats.Internal.GetUserStat2( UserId, Name, ref val ); + } + else + { + SteamUserStats.Internal.GetStat2( Name, ref val ); + } + + return 0; + } + + public int GetInt() + { + int val = 0; + + if ( UserId > 0 ) + { + SteamUserStats.Internal.GetUserStat1( UserId, Name, ref val ); + } + else + { + SteamUserStats.Internal.GetStat1( Name, ref val ); + } + + return val; + } + + public bool Set( int val ) + { + LocalUserOnly(); + return SteamUserStats.Internal.SetStat1( Name, val ); + } + + public bool Set( float val ) + { + LocalUserOnly(); + return SteamUserStats.Internal.SetStat2( Name, val ); + } + + public bool Add( int val ) + { + LocalUserOnly(); + return Set( GetInt() + val ); + } + + public bool Add( float val ) + { + LocalUserOnly(); + return Set( GetFloat() + val ); + } + + public bool UpdateAverageRate( float count, float sessionlength ) + { + LocalUserOnly(); + return SteamUserStats.Internal.UpdateAvgRateStat( Name, count, sessionlength ); + } + + public bool Store() + { + LocalUserOnly(); + return SteamUserStats.Internal.StoreStats(); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/SteamId.cs b/Facepunch.Steamworks/Structs/SteamId.cs new file mode 100644 index 0000000..48c0a0c --- /dev/null +++ b/Facepunch.Steamworks/Structs/SteamId.cs @@ -0,0 +1,29 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + + +namespace Steamworks +{ + public struct SteamId + { + public ulong Value; + + public static implicit operator SteamId( ulong value ) + { + return new SteamId { Value = value }; + } + + public static implicit operator ulong( SteamId value ) + { + return value.Value; + } + + public override string ToString() => Value.ToString(); + + public uint AccountId => (uint) (Value & 0xFFFFFFFFul); + + public bool IsValid => Value != default; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/SteamNetworking.cs b/Facepunch.Steamworks/Structs/SteamNetworking.cs new file mode 100644 index 0000000..3b8f786 --- /dev/null +++ b/Facepunch.Steamworks/Structs/SteamNetworking.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; + +namespace Steamworks.Data +{ + delegate void FSteamNetworkingSocketsDebugOutput (DebugOutputType nType, string pszMsg ); + + public struct SteamNetworkingPOPID + { + public uint Value; + + public static implicit operator SteamNetworkingPOPID( uint value ) + { + return new SteamNetworkingPOPID { Value = value }; + } + + public static implicit operator uint( SteamNetworkingPOPID value ) + { + return value.Value; + } + + public override string ToString() => Value.ToString(); + } + + [StructLayout( LayoutKind.Sequential )] + public struct SteamNetworkingQuickConnectionStatus + { + public ConnectionState state; + public int ping; + public float connectionQualityLocal; + public float connectionQualityRemote; + public float outPacketsPerSecond; + public float outBytesPerSecond; + public float inPacketsPerSecond; + public float inBytesPerSecond; + public int sendRateBytesPerSecond; + public int pendingUnreliable; + public int pendingReliable; + public int sentUnackedReliable; + public long queueTime; + + [MarshalAs( UnmanagedType.ByValArray, SizeConst = 16 )] + uint[] reserved; + } + + struct SteamDatagramRelayAuthTicket + { + // Not implemented + }; + + struct SteamDatagramHostedAddress + { + // Not implemented + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/SteamParamStringArray.cs b/Facepunch.Steamworks/Structs/SteamParamStringArray.cs new file mode 100644 index 0000000..e0d2a04 --- /dev/null +++ b/Facepunch.Steamworks/Structs/SteamParamStringArray.cs @@ -0,0 +1,45 @@ +using System; +using System.Runtime.InteropServices; +using Steamworks.Data; + +namespace Steamworks.Ugc +{ + internal struct SteamParamStringArray : IDisposable + { + public SteamParamStringArray_t Value; + + IntPtr[] NativeStrings; + IntPtr NativeArray; + + public static SteamParamStringArray From( string[] array ) + { + var a = new SteamParamStringArray(); + + a.NativeStrings = new IntPtr[array.Length]; + for ( int i = 0; i < a.NativeStrings.Length; i++ ) + { + a.NativeStrings[i] = Marshal.StringToHGlobalAnsi( array[i] ); + } + + var size = Marshal.SizeOf( typeof( IntPtr ) ) * a.NativeStrings.Length; + a.NativeArray = Marshal.AllocHGlobal( size ); + Marshal.Copy( a.NativeStrings, 0, a.NativeArray, a.NativeStrings.Length ); + + a.Value = new SteamParamStringArray_t + { + Strings = a.NativeArray, + NumStrings = array.Length + }; + + return a; + } + + public void Dispose() + { + foreach ( var x in NativeStrings ) + Marshal.FreeHGlobal( x ); + + Marshal.FreeHGlobal( NativeArray ); + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/Ugc.cs b/Facepunch.Steamworks/Structs/Ugc.cs new file mode 100644 index 0000000..f902b33 --- /dev/null +++ b/Facepunch.Steamworks/Structs/Ugc.cs @@ -0,0 +1,9 @@ +using System.Linq; + +namespace Steamworks.Data +{ + public struct Ugc + { + internal UGCHandle_t Handle; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/UgcEditor.cs b/Facepunch.Steamworks/Structs/UgcEditor.cs new file mode 100644 index 0000000..b842df8 --- /dev/null +++ b/Facepunch.Steamworks/Structs/UgcEditor.cs @@ -0,0 +1,237 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Threading.Tasks; +using Steamworks.Data; + +using QueryType = Steamworks.Ugc.Query; + +namespace Steamworks.Ugc +{ + public struct Editor + { + PublishedFileId fileId; + + bool creatingNew; + WorkshopFileType creatingType; + AppId consumerAppId; + + internal Editor( WorkshopFileType filetype ) : this() + { + this.creatingNew = true; + this.creatingType = filetype; + } + + public Editor( PublishedFileId fileId ) : this() + { + this.fileId = fileId; + } + + /// + /// Create a Normal Workshop item that can be subscribed to + /// + public static Editor NewCommunityFile => new Editor( WorkshopFileType.Community ); + + /// + /// Workshop item that is meant to be voted on for the purpose of selling in-game + /// + public static Editor NewMicrotransactionFile => new Editor( WorkshopFileType.Microtransaction ); + + public Editor ForAppId( AppId id ) { this.consumerAppId = id; return this; } + + string Title; + public Editor WithTitle( string t ) { this.Title = t; return this; } + + string Description; + public Editor WithDescription( string t ) { this.Description = t; return this; } + + string MetaData; + public Editor WithMetaData( string t ) { this.MetaData = t; return this; } + + string ChangeLog; + public Editor WithChangeLog( string t ) { this.ChangeLog = t; return this; } + + string Language; + public Editor InLanguage( string t ) { this.Language = t; return this; } + + string PreviewFile; + public Editor WithPreviewFile( string t ) { this.PreviewFile = t; return this; } + + System.IO.DirectoryInfo ContentFolder; + public Editor WithContent( System.IO.DirectoryInfo t ) { this.ContentFolder = t; return this; } + public Editor WithContent( string folderName ) { return WithContent( new System.IO.DirectoryInfo( folderName ) ); } + + RemoteStoragePublishedFileVisibility? Visibility; + + public Editor WithPublicVisibility() { Visibility = RemoteStoragePublishedFileVisibility.Public; return this; } + public Editor WithFriendsOnlyVisibility() { Visibility = RemoteStoragePublishedFileVisibility.FriendsOnly; return this; } + public Editor WithPrivateVisibility() { Visibility = RemoteStoragePublishedFileVisibility.Private; return this; } + + List Tags; + Dictionary KeyValueTags; + + public Editor WithTag( string tag ) + { + if ( Tags == null ) Tags = new List(); + + Tags.Add( tag ); + + return this; + } + + public Editor AddKeyValueTag(string key, string value) + { + if (KeyValueTags == null) KeyValueTags = new Dictionary(); + KeyValueTags.Add(key, value); + return this; + } + + public async Task SubmitAsync( IProgress progress = null ) + { + var result = default( PublishResult ); + + progress?.Report( 0 ); + + if ( consumerAppId == 0 ) + consumerAppId = SteamClient.AppId; + + // + // Item Create + // + if ( creatingNew ) + { + result.Result = Steamworks.Result.Fail; + + var created = await SteamUGC.Internal.CreateItem( consumerAppId, creatingType ); + if ( !created.HasValue ) return result; + + result.Result = created.Value.Result; + + if ( result.Result != Steamworks.Result.OK ) + return result; + + fileId = created.Value.PublishedFileId; + result.NeedsWorkshopAgreement = created.Value.UserNeedsToAcceptWorkshopLegalAgreement; + result.FileId = fileId; + } + + + result.FileId = fileId; + + // + // Item Update + // + { + var handle = SteamUGC.Internal.StartItemUpdate( consumerAppId, fileId ); + if ( handle == 0xffffffffffffffff ) + return result; + + if ( Title != null ) SteamUGC.Internal.SetItemTitle( handle, Title ); + if ( Description != null ) SteamUGC.Internal.SetItemDescription( handle, Description ); + if ( MetaData != null ) SteamUGC.Internal.SetItemMetadata( handle, MetaData ); + if ( Language != null ) SteamUGC.Internal.SetItemUpdateLanguage( handle, Language ); + if ( ContentFolder != null ) SteamUGC.Internal.SetItemContent( handle, ContentFolder.FullName ); + if ( PreviewFile != null ) SteamUGC.Internal.SetItemPreview( handle, PreviewFile ); + if ( Visibility.HasValue ) SteamUGC.Internal.SetItemVisibility( handle, Visibility.Value ); + if ( Tags != null && Tags.Count > 0 ) + { + using ( var a = SteamParamStringArray.From( Tags.ToArray() ) ) + { + var val = a.Value; + SteamUGC.Internal.SetItemTags( handle, ref val ); + } + } + + if (KeyValueTags != null && KeyValueTags.Count > 0) + { + foreach (var keyValueTag in KeyValueTags) + { + SteamUGC.Internal.AddItemKeyValueTag(handle, keyValueTag.Key, keyValueTag.Value); + } + } + + result.Result = Steamworks.Result.Fail; + + if ( ChangeLog == null ) + ChangeLog = ""; + + var updating = SteamUGC.Internal.SubmitItemUpdate( handle, ChangeLog ); + + while ( !updating.IsCompleted ) + { + if ( progress != null ) + { + ulong total = 0; + ulong processed = 0; + + var r = SteamUGC.Internal.GetItemUpdateProgress( handle, ref processed, ref total ); + + switch ( r ) + { + case ItemUpdateStatus.PreparingConfig: + { + progress?.Report( 0.1f ); + break; + } + + case ItemUpdateStatus.PreparingContent: + { + progress?.Report( 0.2f ); + break; + } + case ItemUpdateStatus.UploadingContent: + { + var uploaded = total > 0 ? ((float)processed / (float)total) : 0.0f; + progress?.Report( 0.2f + uploaded * 0.7f ); + break; + } + case ItemUpdateStatus.UploadingPreviewFile: + { + progress?.Report( 0.8f ); + break; + } + case ItemUpdateStatus.CommittingChanges: + { + progress?.Report( 1 ); + break; + } + } + } + + await Task.Delay( 1000 / 60 ); + } + + progress?.Report( 1 ); + + var updated = updating.Result; + + if ( !updated.HasValue ) return result; + + result.Result = updated.Value.Result; + + if ( result.Result != Steamworks.Result.OK ) + return result; + + result.NeedsWorkshopAgreement = updated.Value.UserNeedsToAcceptWorkshopLegalAgreement; + result.FileId = fileId; + + } + + return result; + } + } + + public struct PublishResult + { + public bool Success => Result == Steamworks.Result.OK; + + public Steamworks.Result Result; + public PublishedFileId FileId; + + /// + /// https://partner.steamgames.com/doc/features/workshop/implementation#Legal + /// + public bool NeedsWorkshopAgreement; + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/UgcItem.cs b/Facepunch.Steamworks/Structs/UgcItem.cs new file mode 100644 index 0000000..fe5dd05 --- /dev/null +++ b/Facepunch.Steamworks/Structs/UgcItem.cs @@ -0,0 +1,437 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Steamworks.Data; + +using QueryType = Steamworks.Ugc.Query; + +namespace Steamworks.Ugc +{ + public struct Item + { + internal SteamUGCDetails_t details; + internal PublishedFileId _id; + + public Item( PublishedFileId id ) : this() + { + _id = id; + } + + /// + /// The actual ID of this file + /// + public PublishedFileId Id => _id; + + /// + /// The given title of this item + /// + public string Title { get; internal set; } + + /// + /// The description of this item, in your local language if available + /// + public string Description { get; internal set; } + + /// + /// A list of tags for this item, all lowercase + /// + public string[] Tags { get; internal set; } + + /// + /// App Id of the app that created this item + /// + public AppId CreatorApp => details.CreatorAppID; + + /// + /// App Id of the app that will consume this item. + /// + public AppId ConsumerApp => details.ConsumerAppID; + + /// + /// User who created this content + /// + public Friend Owner => new Friend( details.SteamIDOwner ); + + /// + /// The bayesian average for up votes / total votes, between [0,1] + /// + public float Score => details.Score; + + /// + /// Time when the published item was created + /// + public DateTime Created => Epoch.ToDateTime( details.TimeCreated ); + + /// + /// Time when the published item was last updated + /// + public DateTime Updated => Epoch.ToDateTime( details.TimeUpdated ); + + /// + /// True if this is publically visible + /// + public bool IsPublic => details.Visibility == RemoteStoragePublishedFileVisibility.Public; + + /// + /// True if this item is only visible by friends of the creator + /// + public bool IsFriendsOnly => details.Visibility == RemoteStoragePublishedFileVisibility.FriendsOnly; + + /// + /// True if this is only visible to the creator + /// + public bool IsPrivate => details.Visibility == RemoteStoragePublishedFileVisibility.Private; + + /// + /// True if this item has been banned + /// + public bool IsBanned => details.Banned; + + /// + /// Whether the developer of this app has specifically flagged this item as accepted in the Workshop + /// + public bool IsAcceptedForUse => details.AcceptedForUse; + + /// + /// The number of upvotes of this item + /// + public uint VotesUp => details.VotesUp; + + /// + /// The number of downvotes of this item + /// + public uint VotesDown => details.VotesDown; + + public bool IsInstalled => (State & ItemState.Installed) == ItemState.Installed; + public bool IsDownloading => (State & ItemState.Downloading) == ItemState.Downloading; + public bool IsDownloadPending => (State & ItemState.DownloadPending) == ItemState.DownloadPending; + public bool IsSubscribed => (State & ItemState.Subscribed) == ItemState.Subscribed; + public bool NeedsUpdate => (State & ItemState.NeedsUpdate) == ItemState.NeedsUpdate; + + public string Directory + { + get + { + ulong size = 0; + uint ts = 0; + + if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out var strVal, ref ts ) ) + return null; + + return strVal; + } + } + + /// + /// Start downloading this item. + /// If this returns false the item isn#t getting downloaded. + /// + public bool Download( bool highPriority = false ) + { + return SteamUGC.Internal.DownloadItem( Id, highPriority ); + } + + /// + /// If we're downloading, how big the total download is + /// + public long DownloadBytesTotal + { + get + { + if ( !NeedsUpdate ) + return SizeBytes; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) ) + return (long) total; + + return -1; + } + } + + /// + /// If we're downloading, how much we've downloaded + /// + public long DownloadBytesDownloaded + { + get + { + if ( !NeedsUpdate ) + return SizeBytes; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) ) + return (long)downloaded; + + return -1; + } + } + + /// + /// If we're installed, how big is the install + /// + public long SizeBytes + { + get + { + if ( NeedsUpdate ) + return DownloadBytesDownloaded; + + ulong size = 0; + uint ts = 0; + + if ( !SteamUGC.Internal.GetItemInstallInfo( Id, ref size, out var strVal, ref ts ) ) + return 0; + + return (long) size; + } + } + + /// + /// If we're downloading our current progress as a delta betwen 0-1 + /// + public float DownloadAmount + { + get + { + //changed from NeedsUpdate as it's false when validating and redownloading ugc + //possibly similar properties should also be changed + if ( !IsDownloading ) return 1; + + ulong downloaded = 0; + ulong total = 0; + if ( SteamUGC.Internal.GetItemDownloadInfo( Id, ref downloaded, ref total ) && total > 0 ) + return (float)((double)downloaded / (double)total); + + if ( NeedsUpdate || !IsInstalled || IsDownloading ) + return 0; + + return 1; + } + } + + private ItemState State => (ItemState) SteamUGC.Internal.GetItemState( Id ); + + public static async Task GetAsync( PublishedFileId id, int maxageseconds = 60 * 30 ) + { + var result = await SteamUGC.Internal.RequestUGCDetails( id, (uint) maxageseconds ); + if ( !result.HasValue ) return null; + + return From( result.Value.Details ); + } + + internal static Item From( SteamUGCDetails_t details ) + { + var d = new Item + { + _id = details.PublishedFileId, + details = details, + Title = details.TitleUTF8(), + Description = details.DescriptionUTF8(), + Tags = details.TagsUTF8().ToLower().Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ) + }; + + return d; + } + + /// + /// A case insensitive check for tag + /// + public bool HasTag( string find ) + { + if ( Tags.Length == 0 ) return false; + + return Tags.Contains( find, StringComparer.OrdinalIgnoreCase ); + } + + /// + /// Allows the user to subscribe to this item + /// + public async Task Subscribe () + { + var result = await SteamUGC.Internal.SubscribeItem( _id ); + return result?.Result == Result.OK; + } + + /// + /// Allows the user to subscribe to this item and wait for it to be downloaded + /// If CancellationToken is default then there is 60 seconds timeout + /// Progress will be set to 0-1 + /// + public async Task SubscribeDownloadAsync( Action progress = null, CancellationToken ct = default, int milisecondsUpdateDelay = 60 ) + { + if ( ct == default ) + ct = new CancellationTokenSource( TimeSpan.FromSeconds( 60 ) ).Token; + + progress?.Invoke( 0 ); + await Task.Delay( milisecondsUpdateDelay ); + + //Subscribe + { + var subResult = await SteamUGC.Internal.SubscribeItem( _id ); + if ( subResult?.Result != Result.OK ) + return false; + } + + progress?.Invoke( 0.1f ); + await Task.Delay( milisecondsUpdateDelay ); + + //Try to start downloading + { + if ( Download( true ) == false ) + return State.HasFlag( ItemState.Installed ); + + //Steam docs about Download: + //If the return value is true then register and wait + //for the Callback DownloadItemResult_t before calling + //GetItemInstallInfo or accessing the workshop item on disk. + + //Wait for DownloadItemResult_t + { + var downloadStarted = false; + Action onDownloadStarted = null; + onDownloadStarted = r => + { + SteamUGC.OnDownloadItemResult -= onDownloadStarted; + downloadStarted = true; + }; + SteamUGC.OnDownloadItemResult += onDownloadStarted; + + while ( downloadStarted == false ) + { + if ( ct.IsCancellationRequested ) + break; + + await Task.Delay( milisecondsUpdateDelay ); + } + } + } + + progress?.Invoke( 0.2f ); + await Task.Delay( milisecondsUpdateDelay ); + + //Wait for downloading completion + { + while ( true ) + { + if ( ct.IsCancellationRequested ) + break; + + progress?.Invoke( 0.2f + DownloadAmount * 0.8f ); + + if ( !IsDownloading && State.HasFlag( ItemState.Installed ) ) + break; + + await Task.Delay( milisecondsUpdateDelay ); + } + } + + return State.HasFlag( ItemState.Installed ); + } + + /// + /// Allows the user to unsubscribe from this item + /// + public async Task Unsubscribe () + { + var result = await SteamUGC.Internal.UnsubscribeItem( _id ); + return result?.Result == Result.OK; + } + + /// + /// Adds item to user favorite list + /// + public async Task AddFavorite() + { + var result = await SteamUGC.Internal.AddItemToFavorites(details.ConsumerAppID, _id); + return result?.Result == Result.OK; + } + + /// + /// Removes item from user favorite list + /// + public async Task RemoveFavorite() + { + var result = await SteamUGC.Internal.RemoveItemFromFavorites(details.ConsumerAppID, _id); + return result?.Result == Result.OK; + } + + /// + /// Allows the user to rate a workshop item up or down. + /// + public async Task Vote( bool up ) + { + var r = await SteamUGC.Internal.SetUserItemVote( Id, up ); + return r?.Result; + } + + /// + /// Gets the current users vote on the item + /// + public async Task GetUserVote() + { + var result = await SteamUGC.Internal.GetUserItemVote(_id); + if (!result.HasValue) + return null; + return UserItemVote.From(result.Value); + } + + /// + /// Return a URL to view this item online + /// + public string Url => $"http://steamcommunity.com/sharedfiles/filedetails/?source=Facepunch.Steamworks&id={Id}"; + + /// + /// The URl to view this item's changelog + /// + public string ChangelogUrl => $"http://steamcommunity.com/sharedfiles/filedetails/changelog/{Id}"; + + /// + /// The URL to view the comments on this item + /// + public string CommentsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/comments/{Id}"; + + /// + /// The URL to discuss this item + /// + public string DiscussUrl => $"http://steamcommunity.com/sharedfiles/filedetails/discussions/{Id}"; + + /// + /// The URL to view this items stats online + /// + public string StatsUrl => $"http://steamcommunity.com/sharedfiles/filedetails/stats/{Id}"; + + public ulong NumSubscriptions { get; internal set; } + public ulong NumFavorites { get; internal set; } + public ulong NumFollowers { get; internal set; } + public ulong NumUniqueSubscriptions { get; internal set; } + public ulong NumUniqueFavorites { get; internal set; } + public ulong NumUniqueFollowers { get; internal set; } + public ulong NumUniqueWebsiteViews { get; internal set; } + public ulong ReportScore { get; internal set; } + public ulong NumSecondsPlayed { get; internal set; } + public ulong NumPlaytimeSessions { get; internal set; } + public ulong NumComments { get; internal set; } + public ulong NumSecondsPlayedDuringTimePeriod { get; internal set; } + public ulong NumPlaytimeSessionsDuringTimePeriod { get; internal set; } + + /// + /// The URL to the preview image for this item + /// + public string PreviewImageUrl { get; internal set; } + + /// + /// Edit this item + /// + public Ugc.Editor Edit() + { + return new Ugc.Editor( Id ); + } + + public Result Result => details.Result; + } +} diff --git a/Facepunch.Steamworks/Structs/UgcQuery.cs b/Facepunch.Steamworks/Structs/UgcQuery.cs new file mode 100644 index 0000000..986bdcd --- /dev/null +++ b/Facepunch.Steamworks/Structs/UgcQuery.cs @@ -0,0 +1,303 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using Steamworks.Data; + +using QueryType = Steamworks.Ugc.Query; + +namespace Steamworks.Ugc +{ + public struct Query + { + UgcType matchingType; + UGCQuery queryType; + AppId consumerApp; + AppId creatorApp; + string searchText; + + public Query( UgcType type ) : this() + { + matchingType = type; + } + + public static Query All => new Query( UgcType.All ); + public static Query Items => new Query( UgcType.Items ); + public static Query ItemsMtx => new Query( UgcType.Items_Mtx ); + public static Query ItemsReadyToUse => new Query( UgcType.Items_ReadyToUse ); + public static Query Collections => new Query( UgcType.Collections ); + public static Query Artwork => new Query( UgcType.Artwork ); + public static Query Videos => new Query( UgcType.Videos ); + public static Query Screenshots => new Query( UgcType.Screenshots ); + public static Query AllGuides => new Query( UgcType.AllGuides ); + public static Query WebGuides => new Query( UgcType.WebGuides ); + public static Query IntegratedGuides => new Query( UgcType.IntegratedGuides ); + public static Query UsableInGame => new Query( UgcType.UsableInGame ); + public static Query ControllerBindings => new Query( UgcType.ControllerBindings ); + public static Query GameManagedItems => new Query( UgcType.GameManagedItems ); + + + public Query RankedByVote() { queryType = UGCQuery.RankedByVote; return this; } + public Query RankedByPublicationDate() { queryType = UGCQuery.RankedByPublicationDate; return this; } + public Query RankedByAcceptanceDate() { queryType = UGCQuery.AcceptedForGameRankedByAcceptanceDate; return this; } + public Query RankedByTrend() { queryType = UGCQuery.RankedByTrend; return this; } + public Query FavoritedByFriends() { queryType = UGCQuery.FavoritedByFriendsRankedByPublicationDate; return this; } + public Query CreatedByFriends() { queryType = UGCQuery.CreatedByFriendsRankedByPublicationDate; return this; } + public Query RankedByNumTimesReported() { queryType = UGCQuery.RankedByNumTimesReported; return this; } + public Query CreatedByFollowedUsers() { queryType = UGCQuery.CreatedByFollowedUsersRankedByPublicationDate; return this; } + public Query NotYetRated() { queryType = UGCQuery.NotYetRated; return this; } + public Query RankedByTotalVotesAsc() { queryType = UGCQuery.RankedByTotalVotesAsc; return this; } + public Query RankedByVotesUp() { queryType = UGCQuery.RankedByVotesUp; return this; } + public Query RankedByTextSearch() { queryType = UGCQuery.RankedByTextSearch; return this; } + public Query RankedByTotalUniqueSubscriptions() { queryType = UGCQuery.RankedByTotalUniqueSubscriptions; return this; } + public Query RankedByPlaytimeTrend() { queryType = UGCQuery.RankedByPlaytimeTrend; return this; } + public Query RankedByTotalPlaytime() { queryType = UGCQuery.RankedByTotalPlaytime; return this; } + public Query RankedByAveragePlaytimeTrend() { queryType = UGCQuery.RankedByAveragePlaytimeTrend; return this; } + public Query RankedByLifetimeAveragePlaytime() { queryType = UGCQuery.RankedByLifetimeAveragePlaytime; return this; } + public Query RankedByPlaytimeSessionsTrend() { queryType = UGCQuery.RankedByPlaytimeSessionsTrend; return this; } + public Query RankedByLifetimePlaytimeSessions() { queryType = UGCQuery.RankedByLifetimePlaytimeSessions; return this; } + + #region UserQuery + + SteamId? steamid; + + UserUGCList userType; + UserUGCListSortOrder userSort; + + internal Query LimitUser( SteamId steamid ) + { + if ( steamid.Value == 0 ) + steamid = SteamClient.SteamId; + + this.steamid = steamid; + return this; + } + + public Query WhereUserPublished( SteamId user = default ) { userType = UserUGCList.Published; LimitUser( user ); return this; } + public Query WhereUserVotedOn( SteamId user = default ) { userType = UserUGCList.VotedOn; LimitUser( user ); return this; } + public Query WhereUserVotedUp( SteamId user = default ) { userType = UserUGCList.VotedUp; LimitUser( user ); return this; } + public Query WhereUserVotedDown( SteamId user = default ) { userType = UserUGCList.VotedDown; LimitUser( user ); return this; } + public Query WhereUserWillVoteLater( SteamId user = default ) { userType = UserUGCList.WillVoteLater; LimitUser( user ); return this; } + public Query WhereUserFavorited( SteamId user = default ) { userType = UserUGCList.Favorited; LimitUser( user ); return this; } + public Query WhereUserSubscribed( SteamId user = default ) { userType = UserUGCList.Subscribed; LimitUser( user ); return this; } + public Query WhereUserUsedOrPlayed( SteamId user = default ) { userType = UserUGCList.UsedOrPlayed; LimitUser( user ); return this; } + public Query WhereUserFollowed( SteamId user = default ) { userType = UserUGCList.Followed; LimitUser( user ); return this; } + + public Query SortByCreationDate() { userSort = UserUGCListSortOrder.CreationOrderDesc; return this; } + public Query SortByCreationDateAsc() { userSort = UserUGCListSortOrder.CreationOrderAsc; return this; } + public Query SortByTitleAsc() { userSort = UserUGCListSortOrder.TitleAsc; return this; } + public Query SortByUpdateDate() { userSort = UserUGCListSortOrder.LastUpdatedDesc; return this; } + public Query SortBySubscriptionDate() { userSort = UserUGCListSortOrder.SubscriptionDateDesc; return this; } + public Query SortByVoteScore() { userSort = UserUGCListSortOrder.VoteScoreDesc; return this; } + public Query SortByModeration() { userSort = UserUGCListSortOrder.ForModeration; return this; } + + public Query WhereSearchText(string searchText) { this.searchText = searchText; return this; } + + #endregion + + #region Files + PublishedFileId[] Files; + + public Query WithFileId( params PublishedFileId[] files ) + { + Files = files; + return this; + } + #endregion + + public async Task GetPageAsync( int page ) + { + if ( page <= 0 ) throw new System.Exception( "page should be > 0" ); + + if ( consumerApp == 0 ) consumerApp = SteamClient.AppId; + if ( creatorApp == 0 ) creatorApp = consumerApp; + + UGCQueryHandle_t handle; + + if ( Files != null ) + { + handle = SteamUGC.Internal.CreateQueryUGCDetailsRequest( Files, (uint)Files.Length ); + } + else if ( steamid.HasValue ) + { + handle = SteamUGC.Internal.CreateQueryUserUGCRequest( steamid.Value.AccountId, userType, matchingType, userSort, creatorApp.Value, consumerApp.Value, (uint)page ); + } + else + { + handle = SteamUGC.Internal.CreateQueryAllUGCRequest1( queryType, matchingType, creatorApp.Value, consumerApp.Value, (uint)page ); + } + + ApplyReturns(handle); + + if (maxCacheAge.HasValue) + { + SteamUGC.Internal.SetAllowCachedResponse(handle, (uint)maxCacheAge.Value); + } + + ApplyConstraints( handle ); + + var result = await SteamUGC.Internal.SendQueryUGCRequest( handle ); + if ( !result.HasValue ) + return null; + + if ( result.Value.Result != Steamworks.Result.OK ) + return null; + + return new ResultPage + { + Handle = result.Value.Handle, + ResultCount = (int) result.Value.NumResultsReturned, + TotalCount = (int)result.Value.TotalMatchingResults, + CachedData = result.Value.CachedData + }; + } + + #region SharedConstraints + public QueryType WithType( UgcType type ) { matchingType = type; return this; } + int? maxCacheAge; + public QueryType AllowCachedResponse( int maxSecondsAge ) { maxCacheAge = maxSecondsAge; return this; } + string language; + public QueryType InLanguage( string lang ) { language = lang; return this; } + + int? trendDays; + public QueryType WithTrendDays( int days ) { trendDays = days; return this; } + + List requiredTags; + bool? matchAnyTag; + List excludedTags; + Dictionary requiredKv; + + /// + /// Found items must have at least one of the defined tags + /// + public QueryType MatchAnyTag() { matchAnyTag = true; return this; } + + /// + /// Found items must have all defined tags + /// + public QueryType MatchAllTags() { matchAnyTag = false; return this; } + + public QueryType WithTag( string tag ) + { + if ( requiredTags == null ) requiredTags = new List(); + requiredTags.Add( tag ); + return this; + } + + public QueryType AddRequiredKeyValueTag(string key, string value) + { + if (requiredKv == null) requiredKv = new Dictionary(); + requiredKv.Add(key, value); + return this; + } + + public QueryType WithoutTag( string tag ) + { + if ( excludedTags == null ) excludedTags = new List(); + excludedTags.Add( tag ); + return this; + } + + void ApplyConstraints( UGCQueryHandle_t handle ) + { + if ( requiredTags != null ) + { + foreach ( var tag in requiredTags ) + SteamUGC.Internal.AddRequiredTag( handle, tag ); + } + + if ( excludedTags != null ) + { + foreach ( var tag in excludedTags ) + SteamUGC.Internal.AddExcludedTag( handle, tag ); + } + + if ( requiredKv != null ) + { + foreach ( var tag in requiredKv ) + SteamUGC.Internal.AddRequiredKeyValueTag( handle, tag.Key, tag.Value ); + } + + if ( matchAnyTag.HasValue ) + { + SteamUGC.Internal.SetMatchAnyTag( handle, matchAnyTag.Value ); + } + + if ( trendDays.HasValue ) + { + SteamUGC.Internal.SetRankedByTrendDays( handle, (uint)trendDays.Value ); + } + + if ( !string.IsNullOrEmpty( searchText ) ) + { + SteamUGC.Internal.SetSearchText( handle, searchText ); + } + } + + #endregion + + #region ReturnValues + + bool? WantsReturnOnlyIDs; + public QueryType WithOnlyIDs(bool b) { WantsReturnOnlyIDs = b; return this; } + bool? WantsReturnKeyValueTags; + public QueryType WithKeyValueTag(bool b) { WantsReturnKeyValueTags = b; return this; } + bool? WantsReturnLongDescription; + public QueryType WithLongDescription(bool b) { WantsReturnLongDescription = b; return this; } + bool? WantsReturnMetadata; + public QueryType WithMetadata(bool b) { WantsReturnMetadata = b; return this; } + bool? WantsReturnChildren; + public QueryType WithChildren(bool b) { WantsReturnChildren = b; return this; } + bool? WantsReturnAdditionalPreviews; + public QueryType WithAdditionalPreviews(bool b) { WantsReturnAdditionalPreviews = b; return this; } + bool? WantsReturnTotalOnly; + public QueryType WithTotalOnly(bool b) { WantsReturnTotalOnly = b; return this; } + uint? WantsReturnPlaytimeStats; + public QueryType WithPlaytimeStats(uint unDays) { WantsReturnPlaytimeStats = unDays; return this; } + + private void ApplyReturns(UGCQueryHandle_t handle) + { + if (WantsReturnOnlyIDs.HasValue) + { + SteamUGC.Internal.SetReturnOnlyIDs(handle, WantsReturnOnlyIDs.Value); + } + + if (WantsReturnKeyValueTags.HasValue) + { + SteamUGC.Internal.SetReturnKeyValueTags(handle, WantsReturnKeyValueTags.Value); + } + + if (WantsReturnLongDescription.HasValue) + { + SteamUGC.Internal.SetReturnLongDescription(handle, WantsReturnLongDescription.Value); + } + + if (WantsReturnMetadata.HasValue) + { + SteamUGC.Internal.SetReturnMetadata(handle, WantsReturnMetadata.Value); + } + + if (WantsReturnChildren.HasValue) + { + SteamUGC.Internal.SetReturnChildren(handle, WantsReturnChildren.Value); + } + + if (WantsReturnAdditionalPreviews.HasValue) + { + SteamUGC.Internal.SetReturnAdditionalPreviews(handle, WantsReturnAdditionalPreviews.Value); + } + + if (WantsReturnTotalOnly.HasValue) + { + SteamUGC.Internal.SetReturnTotalOnly(handle, WantsReturnTotalOnly.Value); + } + + if (WantsReturnPlaytimeStats.HasValue) + { + SteamUGC.Internal.SetReturnPlaytimeStats(handle, WantsReturnPlaytimeStats.Value); + } + } + + #endregion + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/UgcResultPage.cs b/Facepunch.Steamworks/Structs/UgcResultPage.cs new file mode 100644 index 0000000..77044af --- /dev/null +++ b/Facepunch.Steamworks/Structs/UgcResultPage.cs @@ -0,0 +1,77 @@ +using System.Collections.Generic; +using Steamworks.Data; + +namespace Steamworks.Ugc +{ + public struct ResultPage : System.IDisposable + { + internal UGCQueryHandle_t Handle; + + public int ResultCount; + public int TotalCount; + + public bool CachedData; + + public IEnumerable Entries + { + get + { + + var details = default( SteamUGCDetails_t ); + for ( uint i=0; i< ResultCount; i++ ) + { + if ( SteamUGC.Internal.GetQueryUGCResult( Handle, i, ref details ) ) + { + var item = Item.From( details ); + + item.NumSubscriptions = GetStat( i, ItemStatistic.NumSubscriptions ); + item.NumFavorites = GetStat( i, ItemStatistic.NumFavorites ); + item.NumFollowers = GetStat( i, ItemStatistic.NumFollowers ); + item.NumUniqueSubscriptions = GetStat( i, ItemStatistic.NumUniqueSubscriptions ); + item.NumUniqueFavorites = GetStat( i, ItemStatistic.NumUniqueFavorites ); + item.NumUniqueFollowers = GetStat( i, ItemStatistic.NumUniqueFollowers ); + item.NumUniqueWebsiteViews = GetStat( i, ItemStatistic.NumUniqueWebsiteViews ); + item.ReportScore = GetStat( i, ItemStatistic.ReportScore ); + item.NumSecondsPlayed = GetStat( i, ItemStatistic.NumSecondsPlayed ); + item.NumPlaytimeSessions = GetStat( i, ItemStatistic.NumPlaytimeSessions ); + item.NumComments = GetStat( i, ItemStatistic.NumComments ); + item.NumSecondsPlayedDuringTimePeriod = GetStat( i, ItemStatistic.NumSecondsPlayedDuringTimePeriod ); + item.NumPlaytimeSessionsDuringTimePeriod = GetStat( i, ItemStatistic.NumPlaytimeSessionsDuringTimePeriod ); + + if ( SteamUGC.Internal.GetQueryUGCPreviewURL( Handle, i, out string preview ) ) + { + item.PreviewImageUrl = preview; + } + + // TODO GetQueryUGCAdditionalPreview + // TODO GetQueryUGCChildren + // TODO GetQueryUGCKeyValueTag + // TODO GetQueryUGCMetadata + + + yield return item; + } + } + } + } + + private ulong GetStat( uint index, ItemStatistic stat ) + { + ulong val = 0; + + if ( !SteamUGC.Internal.GetQueryUGCStatistic( Handle, index, stat, ref val ) ) + return 0; + + return val; + } + + public void Dispose() + { + if ( Handle > 0 ) + { + SteamUGC.Internal.ReleaseQueryUGCRequest( Handle ); + Handle = 0; + } + } + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Structs/UserItemVote.cs b/Facepunch.Steamworks/Structs/UserItemVote.cs new file mode 100644 index 0000000..191faed --- /dev/null +++ b/Facepunch.Steamworks/Structs/UserItemVote.cs @@ -0,0 +1,21 @@ +using Steamworks.Data; + +namespace Steamworks.Ugc +{ + public struct UserItemVote + { + public bool VotedUp; + public bool VotedDown; + public bool VoteSkipped; + + internal static UserItemVote? From(GetUserItemVoteResult_t result) + { + return new UserItemVote + { + VotedUp = result.VotedUp, + VotedDown = result.VotedDown, + VoteSkipped = result.VoteSkipped + }; + } + } +} diff --git a/Facepunch.Steamworks/Utility.cs b/Facepunch.Steamworks/Utility.cs deleted file mode 100644 index 1bb7e43..0000000 --- a/Facepunch.Steamworks/Utility.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net; -using System.Text; - -namespace Facepunch.Steamworks -{ - public static partial class Utility - { - static internal uint Swap( uint x ) - { - return ((x & 0x000000ff) << 24) + - ((x & 0x0000ff00) << 8) + - ((x & 0x00ff0000) >> 8) + - ((x & 0xff000000) >> 24); - } - - static public uint IpToInt32( this IPAddress ipAddress ) - { - return Swap( (uint) ipAddress.Address ); - } - - static public IPAddress Int32ToIp( uint ipAddress ) - { - return new IPAddress( Swap( ipAddress ) ); - } - - static internal class Epoch - { - private static readonly DateTime epoch = new DateTime( 1970, 1, 1, 0, 0, 0, DateTimeKind.Utc ); - - /// - /// Returns the current Unix Epoch - /// - public static int Current - { - get - { - return (int)( DateTime.UtcNow.Subtract( epoch ).TotalSeconds ); - } - } - - /// - /// Convert an epoch to a datetime - /// - public static DateTime ToDateTime( decimal unixTime ) - { - return epoch.AddSeconds( (long)unixTime ); - } - - /// - /// Convert a DateTime to a unix time - /// - public static uint FromDateTime( DateTime dt ) - { - return (uint)( dt.Subtract( epoch ).TotalSeconds ); - } - - } - - internal static string FormatPrice(string currency, ulong price) - { - var decimaled = (price / 100.0).ToString("0.00"); - - switch (currency ) - { - case "GBP": return $"£{decimaled}"; - case "USD": return $"${decimaled}"; - case "CAD": return $"${decimaled} CAD"; - case "EUR": return $"€{decimaled}"; - case "RUB": return $"₽{decimaled}"; - case "NZD": return $"${decimaled} NZD"; - - // TODO - all of them - - default: return $"{decimaled}{currency}"; - } - } - - public static string ReadNullTerminatedUTF8String( this BinaryReader br, byte[] buffer = null ) - { - if ( buffer == null ) - buffer = new byte[1024]; - - byte chr; - int i = 0; - while ( (chr = br.ReadByte()) != 0 && i < buffer.Length ) - { - buffer[i] = chr; - i++; - } - - return Encoding.UTF8.GetString( buffer, 0, i ); - } - - } -} diff --git a/Facepunch.Steamworks/Utility/Epoch.cs b/Facepunch.Steamworks/Utility/Epoch.cs new file mode 100644 index 0000000..c64b0fc --- /dev/null +++ b/Facepunch.Steamworks/Utility/Epoch.cs @@ -0,0 +1,24 @@ +using System; + +namespace Steamworks +{ + static internal class Epoch + { + private static readonly DateTime epoch = new DateTime( 1970, 1, 1, 0, 0, 0, DateTimeKind.Utc ); + + /// + /// Returns the current Unix Epoch + /// + public static int Current => (int)(DateTime.UtcNow.Subtract( epoch ).TotalSeconds); + + /// + /// Convert an epoch to a datetime + /// + public static DateTime ToDateTime( decimal unixTime ) => epoch.AddSeconds( (long)unixTime ); + + /// + /// Convert a DateTime to a unix time + /// + public static uint FromDateTime( DateTime dt ) => (uint)(dt.Subtract( epoch ).TotalSeconds); + } +} diff --git a/Facepunch.Steamworks/Utility/Helpers.cs b/Facepunch.Steamworks/Utility/Helpers.cs new file mode 100644 index 0000000..549ea06 --- /dev/null +++ b/Facepunch.Steamworks/Utility/Helpers.cs @@ -0,0 +1,99 @@ +using System; +using System.Runtime.InteropServices; +using System.Text; +using System.Collections.Generic; + +namespace Steamworks +{ + internal static class Helpers + { + public const int MaxStringSize = 1024 * 32; + + private static IntPtr[] MemoryPool; + private static int MemoryPoolIndex; + + public static unsafe IntPtr TakeMemory() + { + if ( MemoryPool == null ) + { + // + // The pool has 5 items. This should be safe because we shouldn't really + // ever be using more than 2 memory pools + // + MemoryPool = new IntPtr[5]; + + for ( int i = 0; i < MemoryPool.Length; i++ ) + MemoryPool[i] = Marshal.AllocHGlobal( MaxStringSize ); + } + + MemoryPoolIndex++; + if ( MemoryPoolIndex >= MemoryPool.Length ) + MemoryPoolIndex = 0; + + var take = MemoryPool[MemoryPoolIndex]; + + ((byte*)take)[0] = 0; + + return take; + } + + + private static byte[][] BufferPool; + private static int BufferPoolIndex; + + /// + /// Returns a buffer. This will get returned and reused later on. + /// + public static byte[] TakeBuffer( int minSize ) + { + if ( BufferPool == null ) + { + // + // The pool has 8 items. + // + BufferPool = new byte[8][]; + + for ( int i = 0; i < BufferPool.Length; i++ ) + BufferPool[i] = new byte[ 1024 * 128 ]; + } + + BufferPoolIndex++; + if ( BufferPoolIndex >= BufferPool.Length ) + BufferPoolIndex = 0; + + if ( BufferPool[BufferPoolIndex].Length < minSize ) + { + BufferPool[BufferPoolIndex] = new byte[minSize + 1024]; + } + + return BufferPool[BufferPoolIndex]; + } + + internal unsafe static string MemoryToString( IntPtr ptr ) + { + var len = 0; + + for( len = 0; len < MaxStringSize; len++ ) + { + if ( ((byte*)ptr)[len] == 0 ) + break; + } + + if ( len == 0 ) + return string.Empty; + + return UTF8Encoding.UTF8.GetString( (byte*)ptr, len ); + } + } + + internal class MonoPInvokeCallbackAttribute : Attribute + { + public MonoPInvokeCallbackAttribute() { } + } + + /// + /// Prevent unity from stripping shit we depend on + /// https://docs.unity3d.com/Manual/ManagedCodeStripping.html + /// + internal class PreserveAttribute : System.Attribute { } +} diff --git a/Facepunch.Steamworks/Utility/Platform.cs b/Facepunch.Steamworks/Utility/Platform.cs new file mode 100644 index 0000000..1145021 --- /dev/null +++ b/Facepunch.Steamworks/Utility/Platform.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Steamworks +{ + internal static class Platform + { +#if PLATFORM_WIN64 + public const int StructPlatformPackSize = 8; + public const string LibraryName = "steam_api64"; + public const CallingConvention MemberConvention = CallingConvention.Cdecl; +#elif PLATFORM_WIN32 + public const int StructPlatformPackSize = 8; + public const string LibraryName = "steam_api"; + public const CallingConvention MemberConvention = CallingConvention.ThisCall; +#elif PLATFORM_POSIX32 + public const int StructPlatformPackSize = 4; + public const string LibraryName = "libsteam_api"; + public const CallingConvention MemberConvention = CallingConvention.Cdecl; +#elif PLATFORM_POSIX64 + public const int StructPlatformPackSize = 4; + public const string LibraryName = "libsteam_api"; + public const CallingConvention MemberConvention = CallingConvention.Cdecl; +#endif + + public const int StructPackSize = 4; + + + + public static int MemoryOffset( int memLocation ) + { +#if PLATFORM_64 + return memLocation; +#else + return memLocation / 2; +#endif + } + } +} diff --git a/Facepunch.Steamworks/Utility/SourceServerQuery.cs b/Facepunch.Steamworks/Utility/SourceServerQuery.cs index fa8c3a5..15fc24e 100644 --- a/Facepunch.Steamworks/Utility/SourceServerQuery.cs +++ b/Facepunch.Steamworks/Utility/SourceServerQuery.cs @@ -4,203 +4,174 @@ using System.IO; using System.Linq; using System.Net; using System.Net.Sockets; +using System.Threading.Tasks; +using Steamworks.Data; -namespace Facepunch.Steamworks +namespace Steamworks { + internal static class SourceServerQuery + { + private static readonly byte[] A2S_SERVERQUERY_GETCHALLENGE = { 0x55, 0xFF, 0xFF, 0xFF, 0xFF }; + // private static readonly byte A2S_PLAYER = 0x55; + private static readonly byte A2S_RULES = 0x56; - internal class SourceServerQuery : IDisposable - { - public static List Current = new List(); + private static readonly Dictionary>> PendingQueries = + new Dictionary>>(); - public static void Cycle() + internal static Task> GetRules( ServerInfo server ) { - if ( Current.Count == 0 ) - return; + var endpoint = new IPEndPoint(server.Address, server.QueryPort); - for( int i = Current.Count; i>0; i-- ) + lock (PendingQueries) { - Current[i-1].Update(); + if (PendingQueries.TryGetValue(endpoint, out var pending)) + return pending; + + var task = GetRulesImpl(endpoint, server) + .ContinueWith(t => + { + lock (PendingQueries) + { + PendingQueries.Remove(endpoint); + } + + return t; + }) + .Unwrap(); + + PendingQueries.Add(endpoint, task); + return task; } } - private static readonly byte[] A2S_SERVERQUERY_GETCHALLENGE = { 0x55, 0xFF, 0xFF, 0xFF, 0xFF }; - private static readonly byte A2S_PLAYER = 0x55; - private static readonly byte A2S_RULES = 0x56; - - public volatile bool IsRunning; - public volatile bool IsSuccessful; - - private ServerList.Server Server; - private UdpClient udpClient; - private IPEndPoint endPoint; - private System.Threading.Thread thread; - private byte[] _challengeBytes; - - private Dictionary rules = new Dictionary(); - - public SourceServerQuery( ServerList.Server server, IPAddress address, int queryPort ) - { - Server = server; - endPoint = new IPEndPoint( address, queryPort ); - - Current.Add( this ); - - IsRunning = true; - IsSuccessful = false; - thread = new System.Threading.Thread( ThreadedStart ); - thread.Start(); - } - - void Update() - { - if ( !IsRunning ) - { - Current.Remove( this ); - Server.OnServerRulesReceiveFinished( rules, IsSuccessful ); - } - } - - private void ThreadedStart( object obj ) + private static async Task> GetRulesImpl( IPEndPoint endpoint, ServerInfo server ) { try { - using ( udpClient = new UdpClient() ) + using (var client = new UdpClient()) { - udpClient.Client.SendTimeout = 3000; - udpClient.Client.ReceiveTimeout = 3000; - udpClient.Connect( endPoint ); + client.Client.SendTimeout = 3000; + client.Client.ReceiveTimeout = 3000; + client.Connect(endpoint); - GetRules(); - - IsSuccessful = true; + return await GetRules(client); } } - catch ( System.Exception ) + catch (System.Exception e) { - IsSuccessful = false; + //Console.Error.WriteLine( e.Message ); + return null; } + } - udpClient = null; - IsRunning = false; - } + static async Task> GetRules( UdpClient client ) + { + var challengeBytes = await GetChallengeData( client ); + challengeBytes[0] = A2S_RULES; + await Send( client, challengeBytes ); + var ruleData = await Receive( client ); - void GetRules() - { - GetChallengeData(); + var rules = new Dictionary(); - _challengeBytes[0] = A2S_RULES; - Send( _challengeBytes ); - var ruleData = Receive(); + using ( var br = new BinaryReader( new MemoryStream( ruleData ) ) ) + { + if ( br.ReadByte() != 0x45 ) + throw new Exception( "Invalid data received in response to A2S_RULES request" ); - using ( var br = new BinaryReader( new MemoryStream( ruleData ) ) ) - { - if ( br.ReadByte() != 0x45 ) - throw new Exception( "Invalid data received in response to A2S_RULES request" ); + var numRules = br.ReadUInt16(); + for ( int index = 0; index < numRules; index++ ) + { + rules.Add( br.ReadNullTerminatedUTF8String(), br.ReadNullTerminatedUTF8String() ); + } + } - var numRules = br.ReadUInt16(); - for ( int index = 0; index < numRules; index++ ) - { - rules.Add( br.ReadNullTerminatedUTF8String( readBuffer ), br.ReadNullTerminatedUTF8String( readBuffer ) ); - } - } + return rules; + } - } - byte[] readBuffer = new byte[1024 * 4]; - private byte[] Receive() - { - byte[][] packets = null; - byte packetNumber = 0, packetCount = 1; + static async Task Receive( UdpClient client ) + { + byte[][] packets = null; + byte packetNumber = 0, packetCount = 1; - do - { - var result = udpClient.Receive( ref endPoint ); + do + { + var result = await client.ReceiveAsync(); + var buffer = result.Buffer; - using ( var br = new BinaryReader( new MemoryStream( result ) ) ) - { - var header = br.ReadInt32(); + using ( var br = new BinaryReader( new MemoryStream( buffer ) ) ) + { + var header = br.ReadInt32(); - if ( header == -1 ) - { - var unsplitdata = new byte[result.Length - br.BaseStream.Position]; - Buffer.BlockCopy( result, (int)br.BaseStream.Position, unsplitdata, 0, unsplitdata.Length ); - return unsplitdata; - } - else if ( header == -2 ) - { - int requestId = br.ReadInt32(); - packetNumber = br.ReadByte(); - packetCount = br.ReadByte(); - int splitSize = br.ReadInt32(); - } - else - { - throw new System.Exception( "Invalid Header" ); - } + if ( header == -1 ) + { + var unsplitdata = new byte[buffer.Length - br.BaseStream.Position]; + Buffer.BlockCopy( buffer, (int)br.BaseStream.Position, unsplitdata, 0, unsplitdata.Length ); + return unsplitdata; + } + else if ( header == -2 ) + { + int requestId = br.ReadInt32(); + packetNumber = br.ReadByte(); + packetCount = br.ReadByte(); + int splitSize = br.ReadInt32(); + } + else + { + throw new System.Exception( "Invalid Header" ); + } - if ( packets == null ) packets = new byte[packetCount][]; + if ( packets == null ) packets = new byte[packetCount][]; - var data = new byte[result.Length - br.BaseStream.Position]; - Buffer.BlockCopy( result, (int)br.BaseStream.Position, data, 0, data.Length ); - packets[packetNumber] = data; - } - } - while ( packets.Any( p => p == null ) ); + var data = new byte[buffer.Length - br.BaseStream.Position]; + Buffer.BlockCopy( buffer, (int)br.BaseStream.Position, data, 0, data.Length ); + packets[packetNumber] = data; + } + } + while ( packets.Any( p => p == null ) ); - var combinedData = Combine( packets ); - return combinedData; - } + var combinedData = Combine( packets ); + return combinedData; + } - private void GetChallengeData() - { - if ( _challengeBytes != null ) return; + private static async Task GetChallengeData( UdpClient client ) + { + await Send( client, A2S_SERVERQUERY_GETCHALLENGE ); - Send( A2S_SERVERQUERY_GETCHALLENGE ); + var challengeData = await Receive( client ); - var challengeData = Receive(); + if ( challengeData[0] != 0x41 ) + throw new Exception( "Invalid Challenge" ); - if ( challengeData[0] != 0x41 ) - throw new Exception( "Invalid Challenge" ); + return challengeData; + } - _challengeBytes = challengeData; - } + static async Task Send( UdpClient client, byte[] message ) + { + var sendBuffer = new byte[message.Length + 4]; - byte[] sendBuffer = new byte[1024]; + sendBuffer[0] = 0xFF; + sendBuffer[1] = 0xFF; + sendBuffer[2] = 0xFF; + sendBuffer[3] = 0xFF; - private void Send( byte[] message ) - { - sendBuffer[0] = 0xFF; - sendBuffer[1] = 0xFF; - sendBuffer[2] = 0xFF; - sendBuffer[3] = 0xFF; + Buffer.BlockCopy( message, 0, sendBuffer, 4, message.Length ); - Buffer.BlockCopy( message, 0, sendBuffer, 4, message.Length ); + await client.SendAsync( sendBuffer, message.Length + 4 ); + } - udpClient.Send( sendBuffer, message.Length + 4 ); - } + static byte[] Combine( byte[][] arrays ) + { + var rv = new byte[arrays.Sum( a => a.Length )]; + int offset = 0; + foreach ( byte[] array in arrays ) + { + Buffer.BlockCopy( array, 0, rv, offset, array.Length ); + offset += array.Length; + } + return rv; + } + }; - private byte[] Combine( byte[][] arrays ) - { - var rv = new byte[arrays.Sum( a => a.Length )]; - int offset = 0; - foreach ( byte[] array in arrays ) - { - Buffer.BlockCopy( array, 0, rv, offset, array.Length ); - offset += array.Length; - } - return rv; - } - - public void Dispose() - { - if ( thread != null && thread.IsAlive ) - { - thread.Abort(); - } - - thread = null; - } - }; - } diff --git a/Facepunch.Steamworks/Utility/SteamInterface.cs b/Facepunch.Steamworks/Utility/SteamInterface.cs new file mode 100644 index 0000000..d9d10ba --- /dev/null +++ b/Facepunch.Steamworks/Utility/SteamInterface.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Sockets; +using System.Runtime.InteropServices; +using System.Text; + +namespace Steamworks +{ + internal abstract class SteamInterface + { + public IntPtr Self; + public IntPtr VTable; + + public virtual string InterfaceName => null; + public bool IsValid => Self != IntPtr.Zero && VTable != IntPtr.Zero; + + public void Init() + { + if ( SteamClient.IsValid ) + { + InitClient(); + return; + } + + if ( SteamServer.IsValid ) + { + InitServer(); + return; + } + + throw new System.Exception( "Trying to initialize Steam Interface but Steam not initialized" ); + } + + public void InitClient() + { + + // + // There's an issue for us using FindOrCreateUserInterface on Rust. + // We have a different appid for our staging branch, but we use Rust's + // appid so we can still test with the live data/setup. The issue is + // if we run the staging branch and get interfaces using FindOrCreate + // then some callbacks don't work. I assume this is because these interfaces + // have already been initialized using the old appid pipe, but since I + // can't see inside Steam this is just a gut feeling. Either way using + // CreateInterface doesn't seem to have caused any fires, so we'll just use that. + // + + // + // var pipe = SteamAPI.GetHSteamPipe(); + // + + Self = SteamInternal.CreateInterface( InterfaceName ); + + if ( Self == IntPtr.Zero ) + { + var user = SteamAPI.GetHSteamUser(); + Self = SteamInternal.FindOrCreateUserInterface( user, InterfaceName ); + } + + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Couldn't find interface {InterfaceName}" ); + + VTable = Marshal.ReadIntPtr( Self, 0 ); + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Invalid VTable for {InterfaceName}" ); + + InitInternals(); + SteamClient.WatchInterface( this ); + } + + public void InitServer() + { + var user = SteamGameServer.GetHSteamUser(); + Self = SteamInternal.FindOrCreateGameServerInterface( user, InterfaceName ); + + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Couldn't find server interface {InterfaceName}" ); + + VTable = Marshal.ReadIntPtr( Self, 0 ); + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Invalid VTable for server {InterfaceName}" ); + + InitInternals(); + SteamServer.WatchInterface( this ); + } + + public virtual void InitUserless() + { + Self = SteamInternal.FindOrCreateUserInterface( 0, InterfaceName ); + + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Couldn't find interface {InterfaceName}" ); + + VTable = Marshal.ReadIntPtr( Self, 0 ); + if ( Self == IntPtr.Zero ) + throw new System.Exception( $"Invalid VTable for {InterfaceName}" ); + + InitInternals(); + } + + internal virtual void Shutdown() + { + Self = IntPtr.Zero; + VTable = IntPtr.Zero; + + } + + public abstract void InitInternals(); + } +} \ No newline at end of file diff --git a/Facepunch.Steamworks/Utility/Utf8String.cs b/Facepunch.Steamworks/Utility/Utf8String.cs new file mode 100644 index 0000000..ac73835 --- /dev/null +++ b/Facepunch.Steamworks/Utility/Utf8String.cs @@ -0,0 +1,68 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Runtime.InteropServices; +using System.Text; + +namespace Steamworks +{ + internal unsafe class Utf8StringToNative : ICustomMarshaler + { + public IntPtr MarshalManagedToNative(object managedObj) + { + if ( managedObj == null ) + return IntPtr.Zero; + + if ( managedObj is string str ) + { + fixed ( char* strPtr = str ) + { + int len = Encoding.UTF8.GetByteCount( str ); + var mem = Marshal.AllocHGlobal( len + 1 ); + + var wlen = System.Text.Encoding.UTF8.GetBytes( strPtr, str.Length, (byte*)mem, len + 1 ); + + ( (byte*)mem )[wlen] = 0; + + return mem; + } + } + + return IntPtr.Zero; + } + + public object MarshalNativeToManaged(IntPtr pNativeData) => throw new System.NotImplementedException(); + public void CleanUpNativeData(IntPtr pNativeData) => Marshal.FreeHGlobal( pNativeData ); + public void CleanUpManagedData(object managedObj) => throw new System.NotImplementedException(); + public int GetNativeDataSize() => -1; + + [Preserve] + public static ICustomMarshaler GetInstance(string cookie) => new Utf8StringToNative(); + } + + internal struct Utf8StringPointer + { + internal IntPtr ptr; + + public unsafe static implicit operator string( Utf8StringPointer p ) + { + if ( p.ptr == IntPtr.Zero ) + return null; + + var bytes = (byte*)p.ptr; + + var dataLen = 0; + while ( dataLen < 1024 * 1024 * 64 ) + { + if ( bytes[dataLen] == 0 ) + break; + + dataLen++; + } + + return Encoding.UTF8.GetString( bytes, dataLen ); + } + } +} diff --git a/Facepunch.Steamworks/Utility/Utility.cs b/Facepunch.Steamworks/Utility/Utility.cs new file mode 100644 index 0000000..4f52dd7 --- /dev/null +++ b/Facepunch.Steamworks/Utility/Utility.cs @@ -0,0 +1,101 @@ +using System; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Text; + +namespace Steamworks +{ + public static partial class Utility + { + static internal uint Swap( uint x ) + { + return ((x & 0x000000ff) << 24) + + ((x & 0x0000ff00) << 8) + + ((x & 0x00ff0000) >> 8) + + ((x & 0xff000000) >> 24); + } + + static public uint IpToInt32( this IPAddress ipAddress ) + { + return Swap( (uint) ipAddress.Address ); + } + + static public IPAddress Int32ToIp( uint ipAddress ) + { + return new IPAddress( Swap( ipAddress ) ); + } + + public static string FormatPrice(string currency, double price) + { + var decimaled = price.ToString("0.00"); + + switch (currency) + { + case "AED": return $"{decimaled}د.إ"; + case "ARS": return $"${decimaled} ARS"; + case "AUD": return $"A${decimaled}"; + case "BRL": return $"R${decimaled}"; + case "CAD": return $"C${decimaled}"; + case "CHF": return $"Fr. {decimaled}"; + case "CLP": return $"${decimaled} CLP"; + case "CNY": return $"{decimaled}元"; + case "COP": return $"COL$ {decimaled}"; + case "CRC": return $"₡{decimaled}"; + case "EUR": return $"€{decimaled}"; + case "SEK": return $"{decimaled}kr"; + case "GBP": return $"£{decimaled}"; + case "HKD": return $"HK${decimaled}"; + case "ILS": return $"₪{decimaled}"; + case "IDR": return $"Rp{decimaled}"; + case "INR": return $"₹{decimaled}"; + case "JPY": return $"¥{decimaled}"; + case "KRW": return $"₩{decimaled}"; + case "KWD": return $"KD {decimaled}"; + case "KZT": return $"{decimaled}₸"; + case "MXN": return $"Mex${decimaled}"; + case "MYR": return $"RM {decimaled}"; + case "NOK": return $"{decimaled} kr"; + case "NZD": return $"${decimaled} NZD"; + case "PEN": return $"S/. {decimaled}"; + case "PHP": return $"₱{decimaled}"; + case "PLN": return $"{decimaled}zł"; + case "QAR": return $"QR {decimaled}"; + case "RUB": return $"{decimaled}₽"; + case "SAR": return $"SR {decimaled}"; + case "SGD": return $"S${decimaled}"; + case "THB": return $"฿{decimaled}"; + case "TRY": return $"₺{decimaled}"; + case "TWD": return $"NT$ {decimaled}"; + case "UAH": return $"₴{decimaled}"; + case "USD": return $"${decimaled}"; + case "UYU": return $"$U {decimaled}"; // yes the U goes after $ + case "VND": return $"₫{decimaled}"; + case "ZAR": return $"R {decimaled}"; + + // TODO - check all of them https://partner.steamgames.com/doc/store/pricing/currencies + + default: return $"{decimaled} {currency}"; + } + } + + static byte[] readBuffer = new byte[1024 * 8]; + + public static string ReadNullTerminatedUTF8String( this BinaryReader br ) + { + lock ( readBuffer ) + { + byte chr; + int i = 0; + while ( (chr = br.ReadByte()) != 0 && i < readBuffer.Length ) + { + readBuffer[i] = chr; + i++; + } + + return Encoding.UTF8.GetString( readBuffer, 0, i ); + } + } + } +} diff --git a/Facepunch.Steamworks/libsteam_api.dylib b/Facepunch.Steamworks/libsteam_api.dylib new file mode 100644 index 0000000..ce8dc57 Binary files /dev/null and b/Facepunch.Steamworks/libsteam_api.dylib differ diff --git a/Facepunch.Steamworks/libsteam_api.so b/Facepunch.Steamworks/libsteam_api.so new file mode 100644 index 0000000..eb230a9 Binary files /dev/null and b/Facepunch.Steamworks/libsteam_api.so differ diff --git a/Facepunch.Steamworks/steam_api64.dll b/Facepunch.Steamworks/steam_api64.dll new file mode 100644 index 0000000..328dade Binary files /dev/null and b/Facepunch.Steamworks/steam_api64.dll differ diff --git a/Generator/Argument.cs b/Generator/Argument.cs deleted file mode 100644 index ba69fd0..0000000 --- a/Generator/Argument.cs +++ /dev/null @@ -1,294 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Generator -{ - class Argument - { - public string Name; - public string NativeType; - public string ManagedType; - public CodeWriter.TypeDef TypeDef; - - public Argument( string Name, string ManagedType, Dictionary typeDefs ) - { - this.Name = Name; - this.NativeType = ManagedType; - - Build( typeDefs ); - } - - private void Build( Dictionary typeDefs ) - { - var cleanNative = NativeType.Trim( '*', ' ' ).Replace( "class ", "" ).Replace( "const ", "" ); - - if ( typeDefs != null && typeDefs.ContainsKey( cleanNative ) ) - { - TypeDef = typeDefs[cleanNative]; - } - - ManagedType = ToManagedType( NativeType ); - - if ( ManagedType.EndsWith( "*" ) ) - { - ManagedType = ToManagedType( ManagedType.Trim( '*', ' ' ) ) + "*"; - } - } - - bool IsInputArray - { - get - { - if ( !NativeType.Contains( "const" ) ) return false; - if ( !NativeType.EndsWith( "*" ) ) return false; - - if ( NativeType.Contains( "const char" ) ) return false; - if ( NativeType.Contains( "const void" ) ) return false; - if ( NativeType.Contains( "SteamParamStringArray_t" ) ) return false; - - return true; - } - } - - bool IsStruct - { - get - { - return ManagedType.Contains( "_t" ); - } - } - - bool IsStructShouldBePassedAsRef - { - get - { - if ( ManagedType.Contains( "bool*" ) ) - return true; - - return ManagedType.EndsWith( "*" ) && ManagedType.Contains( "_t" ) && Name.StartsWith( "p" ) && !Name.StartsWith( "pvec" ); - } - } - - bool ShouldBePassedAsOut - { - get - { - - - return ManagedType.EndsWith( "*" ) && !ManagedType.Contains( "_t" ) && !ManagedType.Contains( "char" ) && !ManagedType.Contains( "bool" ); - } - } - - bool ShouldBeIntPtr - { - get - { - if ( IsInputArray ) - return false; - - if ( Name.Contains( "Flags" ) ) - return false; - - if ( ManagedType.Contains( "SteamUGCDetails_t" ) || ManagedType.Contains( "SteamParamStringArray_t" ) ) - return false; - - if ( Name == "pOutItemsArray" || Name == "handlesOut" ) - return true; - - if ( Name.Contains( "Dest" ) && ManagedType.EndsWith( "*" ) ) - return true; - - if ( ManagedType.EndsWith( "*" ) ) - { - if ( Name.EndsWith( "s" ) && !Name.EndsWith( "Bytes" ) ) return true; - } - - return false; - } - } - - bool PassedToNativeAsValue - { - get - { - if ( Name.StartsWith( "pvec" ) ) return false; - if ( TypeDef == null ) return false; - if ( ManagedType.Contains( "IntPtr" ) ) return false; - if ( Name.Contains( "IntPtr" ) ) return false; - - return true; - } - } - - - private static string ToManagedType( string type ) - { - type = type.Replace( "ISteamHTMLSurface::", "" ); - type = type.Replace( "class ", "" ); - type = type.Replace( "struct ", "" ); - type = type.Replace( "const void", "void" ); - - switch ( type ) - { - case "uint64": return "ulong"; - case "uint32": return "uint"; - case "int32": return "int"; - case "int64": return "long"; - case "void *": return "IntPtr"; - case "int16": return "short"; - case "uint8": return "byte"; - case "int8": return "char"; - case "unsigned short": return "ushort"; - case "unsigned int": return "uint"; - case "uint16": return "ushort"; - case "const char *": return "string"; - - case "SteamAPIWarningMessageHook_t": return "IntPtr"; - } - - //type = type.Trim( '*', ' ' ); - - // Enums - skip the 'E' - if ( type[0] == 'E' ) - { - return type.Substring( 1 ); - } - - if ( type.StartsWith( "const " ) ) - return ToManagedType( type.Replace( "const ", "" ) ); - - if ( type.StartsWith( "ISteamMatchmak" ) ) - return "IntPtr"; - - return type; - } - - internal string ManagedParameter() - { - if ( IsInputArray ) - return $"{ManagedType.Trim( '*', ' ' )}[] {Name} /*{NativeType}*/"; - - if ( ShouldBeIntPtr ) - return $"IntPtr {Name} /*{NativeType}*/"; - - if ( IsStructShouldBePassedAsRef ) - return $"ref {ManagedType.Trim( '*', ' ' )} {Name} /*{NativeType}*/"; - - if ( ShouldBePassedAsOut ) - return $"out {ManagedType.Trim( '*', ' ' )} {Name} /*{NativeType}*/"; - - return $"{ManagedType} {Name} /*{NativeType}*/"; - } - - internal string InteropVariable( bool AsRawValues ) - { - if ( IsInputArray ) - { - if ( AsRawValues && IsStruct ) return $"{Name}.Select( x => x.Value ).ToArray()"; - return $"{Name}"; - } - - if ( ShouldBeIntPtr ) - return $"{Name}"; - - var value = (PassedToNativeAsValue && AsRawValues) ? ".Value" : ""; - - if ( IsStructShouldBePassedAsRef ) - return $"ref {Name}{value}"; - - if ( ShouldBePassedAsOut ) - return $"out {Name}{value}"; - - return $"{Name}{value}"; - } - - internal string InteropParameter( bool LargePack, bool includeMarshalling = false ) - { - var ps = LargePack ? "" : ".PackSmall"; - var marshalling = ""; - if ( !NativeType.Contains( "_t" ) ) - ps = string.Empty; - - if ( TypeDef != null ) - ps = string.Empty; - - if ( includeMarshalling ) - { - if ( NativeType == "bool" ) marshalling = "[MarshalAs(UnmanagedType.U1)]"; - if ( NativeType == "bool *" ) marshalling = "[MarshalAs(UnmanagedType.U1)]"; - - if ( PassedToNativeAsValue && !ShouldBeIntPtr ) - { - if ( IsInputArray ) - return $"{TypeDef.ManagedType}[] {Name}"; - else if ( IsStructShouldBePassedAsRef ) - return $"ref {TypeDef.ManagedType} {Name}"; - else if ( ShouldBePassedAsOut ) - return $"out {TypeDef.ManagedType} {Name}"; - else - return $"{TypeDef.ManagedType} {Name}"; - } - } - - if ( ShouldBeIntPtr ) - return $"IntPtr /*{NativeType}*/ {Name}".Trim(); - - if ( IsStructShouldBePassedAsRef ) - return $"{marshalling} ref {ManagedType.Trim( '*', ' ' )}{ps} /*{NativeType}*/ {Name}".Trim(); - - if ( IsInputArray ) - return $"{marshalling} {ManagedType.Trim( '*', ' ' )}[] /*{NativeType}*/ {Name}".Trim(); - - if ( ShouldBePassedAsOut ) - return $"{marshalling} out {ManagedType.Trim( '*', ' ' )} /*{NativeType}*/ {Name}".Trim(); - - if ( NativeType == "char *" || NativeType == "char **" ) - { - return $"System.Text.StringBuilder /*{NativeType}*/ {Name}".Trim(); - } - - if ( TypeDef != null ) - { - if ( NativeType.EndsWith( "*" ) ) - { - return $"IntPtr /*{NativeType}*/ {Name}".Trim(); - } - else - { - return $"{marshalling} {TypeDef.Name} /*{NativeType}*/ {Name}".Trim(); - } - } - - - if ( NativeType.EndsWith( "*" ) && ManagedType.Contains( "_t" ) ) - { - return $"IntPtr /*{NativeType}*/ {Name} ".Trim(); - } - - return $"{marshalling} {ManagedType} /*{NativeType}*/ {Name} ".Trim(); - } - - internal string Return() - { - if ( ManagedType.EndsWith( "*" ) ) - { - return $"IntPtr /*{NativeType}*/"; - } - - if ( TypeDef != null ) - { - return $"{TypeDef.Name} /*({NativeType})*/"; - } - - if ( ManagedType == "string" ) - return "IntPtr"; - - return $"{ManagedType} /*{NativeType}*/"; - } - - - } -} diff --git a/Generator/Cleanup.cs b/Generator/Cleanup.cs new file mode 100644 index 0000000..fd0ccd2 --- /dev/null +++ b/Generator/Cleanup.cs @@ -0,0 +1,107 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Newtonsoft.Json; + + +public static class Cleanup +{ + public static string ConvertType( string type ) + { + type = type.Replace( "CSteamID", "SteamId" ); + type = type.Replace( "CGameID", "GameId" ); + type = type.Replace( "PersonaState", "FriendState" ); + type = type.Replace( "AudioPlayback_Status", "MusicStatus" ); + type = type.Replace( "AuthSessionResponse", "AuthResponse" ); + type = type.Replace( "FriendRelationship", "Relationship" ); + type = type.Replace( "BeginAuthSessionResult", "BeginAuthResult" ); + type = type.Replace( "PublishedFileId_t", "PublishedFileId" ); + type = type.Replace( "PublishedFileId_t", "PublishedFileId" ); + type = type.Replace( "AppId_t", "AppId" ); + type = type.Replace( "LeaderboardSortMethod", "LeaderboardSort" ); + type = type.Replace( "LeaderboardDisplayType", "LeaderboardDisplay" ); + type = type.Replace( "UGCMatchingUGCType", "UgcType" ); + type = type.Replace( "SteamItemInstanceID_t", "InventoryItemId" ); + type = type.Replace( "SteamItemDef_t", "InventoryDefId" ); + type = type.Replace( "ChatRoomEnterResponse", "RoomEnter" ); + type = type.Replace( "SteamNetworkPingLocation_t", "PingLocation" ); + type = type.Replace( "SteamNetworkingConfigValue", "NetConfig" ); + type = type.Replace( "SteamNetworkingConfigScope", "NetScope" ); + type = type.Replace( "SteamNetworkingConfigDataType", "NetConfigType" ); + type = type.Replace( "HSteamNetConnection", "Connection" ); + type = type.Replace( "HSteamListenSocket", "Socket" ); + type = type.Replace( "SteamNetworkingIPAddr", "NetAddress" ); + type = type.Replace( "SteamNetworkingIdentity", "NetIdentity" ); + type = type.Replace( "SteamNetConnectionInfo_t", "ConnectionInfo" ); + type = type.Replace( "SteamNetworkingConnectionState", "ConnectionState" ); + type = type.Replace( "SteamNetworkingMicroseconds", "long" ); + type = type.Replace( "SteamNetworkingSocketsDebugOutputType", "DebugOutputType" ); + type = type.Replace( "SteamNetworkingGetConfigValueResult", "NetConfigResult" ); + type = type.Replace( "SteamInputType", "InputType" ); + type = type.Replace( "InputDigitalActionData_t", "DigitalState" ); + type = type.Replace( "InputAnalogActionData_t", "AnalogState" ); + type = type.Replace( "InputMotionData_t", "MotionState" ); + type = type.Replace( "MatchMakingKeyValuePair_t", "MatchMakingKeyValuePair" ); + + return type; + } + + public static bool ShouldCreate( string type ) + { + if ( type == "SteamId" ) return false; + if ( type == "LeaderboardSort" ) return false; + if ( type == "LeaderboardDisplay" ) return false; + if ( type == "AppId" ) return false; + if ( type == "AnalogState" ) return false; + if ( type == "DigitalState" ) return false; + if ( type == "MotionState" ) return false; + if ( type == "MatchMakingKeyValuePair" ) return false; + + return true; + } + + internal static string Expose( string name ) + { + if ( name == "FriendState" ) return "public"; + if (name == "FriendFlags") return "public"; + if ( name == "MusicStatus" ) return "public"; + if ( name == "ParentalFeature" ) return "public"; + if ( name == "AuthResponse" ) return "public"; + if ( name == "Relationship" ) return "public"; + if ( name == "BeginAuthResult" ) return "public"; + if ( name == "Universe" ) return "public"; + if ( name == "NotificationPosition" ) return "public"; + if ( name == "GamepadTextInputMode" ) return "public"; + if ( name == "GamepadTextInputLineMode" ) return "public"; + if ( name == "CheckFileSignature" ) return "public"; + if ( name == "BroadcastUploadResult" ) return "public"; + if ( name == "PublishedFileId" ) return "public"; + if ( name == "Result" ) return "public"; + if ( name == "UgcType" ) return "public"; + if ( name == "InventoryItemId" ) return "public"; + if ( name == "InventoryDefId" ) return "public"; + if ( name == "P2PSend" ) return "public"; + if ( name == "RoomEnter" ) return "public"; + if ( name == "P2PSessionError" ) return "public"; + if ( name == "InputType" ) return "public"; + if ( name == "InputSourceMode" ) return "public"; + if ( name == "UserHasLicenseForAppResult" ) return "public"; + + return "internal"; + } + + internal static bool IsDeprecated( string name ) + { + if ( name.StartsWith( "ISteamRemoteStorage." ) ) + { + if ( name.Contains( "Publish" ) ) return true; + if ( name.Contains( "ResetFileRequestState" ) ) return true; + if ( name.Contains( "EnumerateUserSubscribedFiles" ) ) return true; + if ( name.Contains( "EnumerateUserSharedWorkshopFile" ) ) return true; + } + + return false; + } +} diff --git a/Generator/CodeParser/CodeParser.Class.cs b/Generator/CodeParser/CodeParser.Class.cs new file mode 100644 index 0000000..bcb72d7 --- /dev/null +++ b/Generator/CodeParser/CodeParser.Class.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text.RegularExpressions; + +namespace Generator +{ + partial class CodeParser + { + public class Class + { + public string Name; + public string InterfaceString; + + public class Function + { + public string Name; + public string DuplicateName; + public Dictionary Arguments = new Dictionary(); + + public string ReturnType; + public string CallResult; + } + + public List Functions = new List(); + + internal Function AddFunction( string funcName, string returnType, string args ) + { + if ( funcName == "Init" ) funcName = "DoInit"; + if ( funcName == "Shutdown" ) funcName = "DoShutdown"; + + var f = new Function + { + Name = funcName, + ReturnType = returnType + }; + + args = Regex.Replace( args, "", "" ); + + foreach ( var arg in args.Split( new[] { ',' }, StringSplitOptions.RemoveEmptyEntries ) ) + { + var m = Regex.Match( arg.Trim(), @"(.+?[ |\*|\&])?([a-zA-Z0-9_]+?)( = (.+?))?$" ); + + var t = m.Groups[1].Value.Trim(); + var n = m.Groups[2].Value.Trim(); + + t = Cleanup.ConvertType( t ); + + f.Arguments.Add( n, t ); + } + + Functions.Add( f ); + + return f; + } + + public void PostProcess() + { + var duplicateFunctions = Functions + .GroupBy( x => x.Name ) + .Where( x => x.Count() > 1 ); + + foreach ( var group in duplicateFunctions ) + { + var g = group.ToArray(); + for ( int i=0; i< g.Count(); i++ ) + { + g[i].DuplicateName = g[i].Name; + g[i].Name = $"{g[i].Name}{i+1}"; + } + } + } + } + + } +} diff --git a/Generator/CodeParser/CodeParser.cs b/Generator/CodeParser/CodeParser.cs index caefe23..7c03b15 100644 --- a/Generator/CodeParser/CodeParser.cs +++ b/Generator/CodeParser/CodeParser.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; namespace Generator { - class CodeParser + public partial class CodeParser { public string Content; @@ -28,6 +28,8 @@ namespace Generator // Get a list of CallbackIds // def.CallbackIds = new Dictionary(); + + //v1 { var r = new Regex( @"enum { (k_[i|I](?:.+)) = ([0-9]+) };" ); var ma = r.Matches( Content ); @@ -38,12 +40,10 @@ namespace Generator } } - - - // - // Associate callbackIds with structs - // - foreach ( var t in def.structs ) + // + // Associate callbackIds with structs + // + foreach ( var t in def.structs ) { if ( !string.IsNullOrEmpty( t.CallbackId ) ) continue; @@ -83,7 +83,23 @@ namespace Generator t.CallbackId = $"{kName} + {num}"; } } - } + + // Even Newer Style + { + var r = new Regex( @"STEAM_CALLBACK_BEGIN\( " + t.Name + @", (.+) \+ ([0-9]+) \)" ); + var m = r.Match( Content ); + if ( m.Success ) + { + var kName = m.Groups[1].Value; + var num = m.Groups[2].Value; + + //kName = kName.Replace( "k_i", "CallbackIdentifiers." ).Replace( "Callbacks", "" ); + kName = "CallbackIdentifiers." + kName.Substring( 3 ).Replace( "Callbacks", "" ); + + t.CallbackId = $"{kName} + {num}"; + } + } + } // // Find defines @@ -139,6 +155,20 @@ namespace Generator //Console.ReadKey(); } - } + // + // Change all struct bool fields to bytes (they're technically bytes anyway, and it helps with marshalling) + // + { + foreach ( var s in def.structs ) + { + foreach ( var f in s.Fields ) + { + if ( f.Type == "bool" ) + f.Type = "byte"; + } + } + } + + } } } diff --git a/Generator/CodeParser/ParseClasses.cs b/Generator/CodeParser/ParseClasses.cs new file mode 100644 index 0000000..5ebc6a7 --- /dev/null +++ b/Generator/CodeParser/ParseClasses.cs @@ -0,0 +1,155 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; +using System.Threading.Tasks; + +namespace Generator +{ + partial class CodeParser + { + public List Classes = new List(); + + public void ParseClasses() + { + var source = RemoveAnnotations( Content ); + + { + var r = new Regex( @"class ([a-zA-Z]+)[\r|\n]+{[\r|\n]((?s).*?)};" ); + var ma = r.Matches( source ); + + foreach ( Match m in ma ) + { + ProcessClass( m.Groups[0].Value.Trim(), m.Groups[1].Value.Trim(), m.Groups[2].Value.Trim() ); + //def.CallbackIds.Add( m.Groups[1].Value.Substring( 3 ).Replace( "Callbacks", "" ), int.Parse( m.Groups[2].Value ) ); + } + } + + Console.WriteLine( "OKay" ); + } + + public void ProcessClass( string fulldef, string classname, string inner ) + { + Console.WriteLine( $"Class: {classname} " ); + + var lines = inner.Split( new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries ); + + var func = new Regex( @"virtual (.+[\t |\*])([a-z0-9A-Z]+?)\((.+?)?\) = 0 ?;$" ); + + var c = new Class(); + c.Name = classname; + + var interfaceMatch = Regex.Match( Content, $"#define {classname.ToUpper().Substring( 1 )}_INTERFACE_VERSION \"(.+?)\"" ); + if ( interfaceMatch.Success ) + { + c.InterfaceString = interfaceMatch.Groups[1].Value; + } + + var lastCallResult = ""; + + var partialLine = ""; + + var needsEndIf = false; + + foreach ( var linestr in lines ) + { + var line = linestr.Trim(); + + var commentPos = line.IndexOf( "//" ); + if ( commentPos > 0 ) + line = line.Substring( 0, commentPos-1 ).Trim(); + + if ( line.Trim().Length < 4 ) continue; + if ( line.Trim().StartsWith( "public:" ) ) continue; + if ( line.Trim().StartsWith( "//" ) ) continue; + + if ( line.Trim().StartsWith( "#ifdef _PS3" ) || line.Trim().StartsWith( "#if defined(_PS3)" ) ) + { + needsEndIf = true; + continue; + } + + if ( needsEndIf ) + { + needsEndIf = !line.Trim().StartsWith( "#endif" ); + continue; + } + + var callresult = Regex.Match( line, @"STEAM_CALL_RESULT\((.+?)\)" ); + if ( callresult.Success ) + { + partialLine = ""; + lastCallResult = callresult.Groups[1].Value.Trim(); + continue; + } + + if ( !string.IsNullOrEmpty( partialLine ) ) + { + partialLine += " " + line.Trim(); + + if ( !partialLine.Trim().EndsWith( ";" ) ) + continue; + + line = partialLine; + partialLine = ""; + } + + var f = func.Match( line ); + if ( f.Success ) + { + var returnType = f.Groups[1].Value.Trim(); + var funcName = f.Groups[2].Value.Trim(); + var args = f.Groups[3].Value.Trim(); + // Console.WriteLine( $"Function: {funcName} returns {returnType} with args {args}" ); + + if ( funcName == "RequestUGCDetails" ) lastCallResult = "SteamUGCRequestUGCDetailsResult_t"; + if ( funcName == "DownloadClanActivityCounts" ) lastCallResult = "DownloadClanActivityCountsResult_t"; + + if ( funcName.Contains( ' ' ) || funcName.Contains( '*' ) ) + throw new System.Exception( "Parsing Error!" ); + + var fnc = c.AddFunction( funcName, returnType, args ); + + fnc.CallResult = lastCallResult; + lastCallResult = null; + partialLine = ""; + } + else + { + if ( line.Trim().StartsWith( "virtual " ) ) + { + partialLine = line; + } + + Console.WriteLine( $"Unknown Line: {line}" ); + } + } + + c.PostProcess(); + + Classes.Add( c ); + } + + public string RemoveAnnotations( string str ) + { + str = Regex.Replace( str, @"STEAM_OUT_ARRAY_CALL\((.+?)\)", "" ); + str = Regex.Replace( str, @"STEAM_PRIVATE_API\((.+)\)", "$1" ); + str = Regex.Replace( str, @"STEAM_ARRAY_COUNT\((.+?)\) ", "" ); + str = Regex.Replace( str, @"STEAM_OUT_STRUCT\(\) ", "" ); + str = Regex.Replace( str, @"STEAM_OUT_STRUCT\((.+?)\) ", "" ); + str = Regex.Replace( str, @"STEAM_OUT_ARRAY_COUNT\((.+?)\)", "" ); + str = Regex.Replace( str, @"STEAM_ARRAY_COUNT_D\((.+?)\)", "" ); + str = Regex.Replace( str, @"STEAM_OUT_STRING_COUNT\((.+?)\)", "" ); + str = Regex.Replace( str, @"STEAM_OUT_STRING\(\) ", "" ); + str = Regex.Replace( str, @"STEAM_OUT_BUFFER_COUNT\((.+?)\) ", "" ); + str = Regex.Replace( str, @"STEAM_BUFFER_COUNT\((.+?)\) ", "" ); + str = Regex.Replace( str, @"STEAM_DESC\((.+?)\) ", "" ); + + + + return str; + } + + } +} diff --git a/Generator/CodeWriter/Class.cs b/Generator/CodeWriter/Class.cs deleted file mode 100644 index 5325278..0000000 --- a/Generator/CodeWriter/Class.cs +++ /dev/null @@ -1,490 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Generator -{ - public partial class CodeWriter - { - string LastMethodName; - int MethodNameCount; - List BeforeLines; - List AfterLines; - string ReturnType; - string ReturnVar; - SteamApiDefinition.MethodDef MethodDef; - string ClassName; - - // - // Output a class into a file - // - void GenerateClasses( string FileName ) - { - foreach ( var g in def.methods.GroupBy( x => x.ClassName ) ) - { - if ( ShouldIgnoreClass( g.Key ) ) continue; - - sb = new StringBuilder(); - Header(); - Class( g.Key, g.OrderBy( x => x.Name ).ToArray() ); - Footer(); - System.IO.File.WriteAllText( $"{FileName}{InterfaceNameToClass(g.Key)}.cs", sb.ToString() ); - } - } - - private void Class( string classname, SteamApiDefinition.MethodDef[] methodDef ) - { - StartBlock( $"internal unsafe class {InterfaceNameToClass(classname)} : IDisposable" ); - { - WriteLine( "//" ); - WriteLine( "// Holds a platform specific implentation" ); - WriteLine( "//" ); - WriteLine( "internal Platform.Interface platform;" ); - - if ( classname != "SteamApi" ) - WriteLine( "internal Facepunch.Steamworks.BaseSteamworks steamworks;" ); - - WriteLine(); - - WriteLine( "//" ); - WriteLine( "// Constructor decides which implementation to use based on current platform" ); - WriteLine( "//" ); - - if ( classname == "SteamApi" ) - { - - StartBlock( $"internal {InterfaceNameToClass( classname )}()" ); - { - WriteLine( "" ); - WriteLine( "if ( Platform.IsWindows64 ) platform = new Platform.Win64( ((IntPtr)1) );" ); - WriteLine( "else if ( Platform.IsWindows32 ) platform = new Platform.Win32( ((IntPtr)1) );" ); - WriteLine( "else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( ((IntPtr)1) );" ); - WriteLine( "else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( ((IntPtr)1) );" ); - WriteLine( "else if ( Platform.IsOsx ) platform = new Platform.Mac( ((IntPtr)1) );" ); - } - EndBlock(); - } - else - { - StartBlock( $"internal {InterfaceNameToClass( classname )}( Facepunch.Steamworks.BaseSteamworks steamworks, IntPtr pointer )" ); - { - WriteLine( "this.steamworks = steamworks;" ); - WriteLine( "" ); - WriteLine( "if ( Platform.IsWindows64 ) platform = new Platform.Win64( pointer );" ); - WriteLine( "else if ( Platform.IsWindows32 ) platform = new Platform.Win32( pointer );" ); - WriteLine( "else if ( Platform.IsLinux32 ) platform = new Platform.Linux32( pointer );" ); - WriteLine( "else if ( Platform.IsLinux64 ) platform = new Platform.Linux64( pointer );" ); - WriteLine( "else if ( Platform.IsOsx ) platform = new Platform.Mac( pointer );" ); - } - EndBlock(); - } - - WriteLine(); - - WriteLine( "//" ); - WriteLine( "// Class is invalid if we don't have a valid implementation" ); - WriteLine( "//" ); - WriteLine( "public bool IsValid{ get{ return platform != null && platform.IsValid; } }" ); - WriteLine(); - - WriteLine( "//" ); - WriteLine( "// When shutting down clear all the internals to avoid accidental use" ); - WriteLine( "//" ); - StartBlock( $"public virtual void Dispose()" ); - { - StartBlock( " if ( platform != null )" ); - { - WriteLine( "platform.Dispose();" ); - WriteLine( "platform = null;" ); - } - EndBlock(); - } - EndBlock(); - WriteLine(); - - // - // Methods - // - foreach ( var m in methodDef ) - { - ClassMethod( classname, m ); - } - } - EndBlock(); - } - - - - private void ClassMethod( string classname, SteamApiDefinition.MethodDef m ) - { - var argList = BuildArguments( m.Params ); - var callargs = BuildArguments( m.Params ); - - BeforeLines = new List(); - AfterLines = new List(); - ReturnType = ToManagedType( m.ReturnType ); - ReturnVar = ""; - MethodDef = m; - ClassName = classname; - - var statc = classname == null ? " static" : ""; - - Detect_VectorReturn( argList, callargs ); - Detect_InterfaceReturn( argList, callargs ); - Detect_StringFetch( argList, callargs ); - Detect_StringReturn( argList, callargs ); - Detect_MatchmakingFilters( argList, callargs ); - Detect_ReturningStruct(); - Detect_IntPtrArgs( argList, callargs ); - Detect_MultiSizeArrayReturn( argList, callargs ); - Detect_StringArray( argList, callargs ); - Detect_CallResult( argList, callargs ); - - var methodName = m.Name; - - if (LastMethodName == methodName) - { - methodName += MethodNameCount.ToString(); - MethodNameCount++; - } - else - { - MethodNameCount = 0; - } - - var argString = string.Join( ", ", argList.Select( x => x.ManagedParameter() ) ); - if ( argString != "" ) argString = " " + argString + " "; - StartBlock( $"public{statc} {ReturnType} {methodName}({argString})" ); - - CallPlatformClass( classname, m, callargs.Select( x => x.InteropVariable( true ) ).ToList(), ReturnVar ); - - WriteLines( BeforeLines ); - - WriteLines( AfterLines ); - - EndBlock(); - WriteLine(); - - LastMethodName = m.Name; - } - - private void Detect_CallResult( List argList, List callargs ) - { - if ( ReturnType != "SteamAPICall_t" ) return; - if ( string.IsNullOrEmpty( MethodDef.CallResult ) ) return; - - argList.Insert( argList.Count, new Argument( "CallbackFunction = null", $"Action<{MethodDef.CallResult}, bool>", null ) ); - BeforeLines.Insert( 0, "SteamAPICall_t callback = 0;" ); - - ReturnVar = "callback"; - ReturnType = $"CallbackHandle"; - - AfterLines.Add( "" ); - AfterLines.Add( "if ( CallbackFunction == null ) return null;" ); - AfterLines.Add("if ( callback == 0 ) return null;"); - AfterLines.Add( "" ); - - AfterLines.Add( $"return {MethodDef.CallResult}.CallResult( steamworks, callback, CallbackFunction );" ); - } - - private void Detect_StringArray( List argList, List callargs ) - { - var arg = argList.FirstOrDefault( x => x.NativeType.Contains( "SteamParamStringArray_t") ); - if ( arg == null ) return; - - arg.ManagedType = "string[]"; - - WriteLine( "// using: Detect_StringArray" ); - - BeforeLines.Add( "// Create strings" ); - BeforeLines.Add( $"var nativeStrings = new IntPtr[{arg.Name}.Length];" ); - BeforeLines.Add( $"for ( int i = 0; i < {arg.Name}.Length; i++ )" ); - BeforeLines.Add( $"{{" ); - BeforeLines.Add( $"nativeStrings[i] = Marshal.StringToHGlobalAnsi( {arg.Name}[i] );" ); - BeforeLines.Add( $"}}" ); - - BeforeLines.Add( "try" ); - BeforeLines.Add( "{" ); - - BeforeLines.Add( "" ); - BeforeLines.Add( "// Create string array" ); - BeforeLines.Add( $"var size = Marshal.SizeOf( typeof( IntPtr ) ) * nativeStrings.Length;" ); - BeforeLines.Add( $"var nativeArray = Marshal.AllocHGlobal( size );" ); - BeforeLines.Add( $"Marshal.Copy( nativeStrings, 0, nativeArray, nativeStrings.Length );" ); - - BeforeLines.Add( "" ); - BeforeLines.Add( "// Create SteamParamStringArray_t" ); - BeforeLines.Add( $"var tags = new SteamParamStringArray_t();" ); - BeforeLines.Add( $"tags.Strings = nativeArray;" ); - BeforeLines.Add( $"tags.NumStrings = {arg.Name}.Length;" ); - - AfterLines.Add( "}" ); - AfterLines.Add( "finally" ); - AfterLines.Add( "{" ); - AfterLines.Add( $"foreach ( var x in nativeStrings )" ); - AfterLines.Add( $" Marshal.FreeHGlobal( x );" ); - AfterLines.Add( $"" ); - AfterLines.Add( "}" ); - - foreach ( var a in callargs ) - if ( a.Name == arg.Name ) a.Name = "ref tags"; - } - - private void Detect_MultiSizeArrayReturn( List argList, List callargs ) - { - if ( ReturnType != "bool" ) return; - - var argPtr = argList.FirstOrDefault( x => x.Name == "pItemDefIDs" ); - var argNum = argList.FirstOrDefault( x => x.Name == "punItemDefIDsArraySize" ); - - if ( argPtr == null ) - { - argPtr = argList.FirstOrDefault( x => x.Name == "pOutItemsArray" ); - argNum = argList.FirstOrDefault( x => x.Name == "punOutItemsArraySize" ); - } - - if ( argPtr == null || argNum == null ) - return; - - WriteLine( "// using: Detect_MultiSizeArrayReturn" ); - - var typeName = argPtr.ManagedType.Trim( '*', ' ' ); - - BeforeLines.Add( $"{argNum.ManagedType.Trim( '*', ' ' )} {argNum.Name} = 0;" ); - BeforeLines.Add( $"" ); - BeforeLines.Add( $"bool success = false;" ); - - ReturnType = argPtr.ManagedType.Trim( '*', ' ' ) + "[]"; - ReturnVar = "success"; - - CallPlatformClass( ClassName, MethodDef, callargs.Select( x => x.Name.Replace( "(IntPtr) ", "" ) == argPtr.Name ? "IntPtr.Zero" : x.InteropVariable( true ) ).ToArray().ToList(), ReturnVar ); - BeforeLines.Add( $"if ( !success || {argNum.Name} == 0) return null;" ); - BeforeLines.Add( "" ); - - BeforeLines.Add( $"var {argPtr.Name} = new {typeName}[{argNum.Name}];" ); - BeforeLines.Add( $"fixed ( void* {argPtr.Name}_ptr = {argPtr.Name} )" ); - BeforeLines.Add( $"{{" ); - - foreach ( var arg in callargs.Where( x => x.Name.Replace( "(IntPtr) ", "" ) == argPtr.Name ) ) - { - arg.Name += "_ptr"; - } - - AfterLines.Add( $"if ( !success ) return null;" ); - AfterLines.Add( $"return {argPtr.Name};" ); - AfterLines.Add( $"}}" ); - - argList.Remove( argPtr ); - argList.Remove( argNum ); - - } - - private void Detect_IntPtrArgs( List argList, List callargs ) - { - foreach ( var a in callargs ) - { - if ( !a.InteropParameter( false ).StartsWith( "IntPtr" ) ) - { - continue; - } - - a.Name = "(IntPtr) " + a.Name; - } - } - - private void Detect_ReturningStruct() - { - if ( !MethodDef.ReturnType.EndsWith( "*" ) ) return; - if ( !MethodDef.ReturnType.Contains( "_t" ) ) return; - - WriteLine( "// with: Detect_ReturningStruct" ); - - ReturnType = ReturnType.Trim( '*', ' ' ); - ReturnVar = "struct_pointer"; - - BeforeLines.Add( "IntPtr struct_pointer;" ); - - AfterLines.Add( $"if ( struct_pointer == IntPtr.Zero ) return default({ReturnType});" ); - AfterLines.Add( $"return {ReturnType}.FromPointer( struct_pointer );" ); - - } - - private void Detect_MatchmakingFilters( List argList, List callargs ) - { - if ( !argList.Any( x => x.Name == "ppchFilters" ) ) return; - if ( !argList.Any( x => x.Name == "nFilters" ) ) return; - - var filters = argList.Single( x => x.Name == "ppchFilters" ); - filters.ManagedType = "IntPtr"; - - WriteLine( "// with: Detect_MatchmakingFilters" ); - - } - - private void Detect_StringReturn( List argList, List callargs ) - { - if ( ReturnType != "string" ) return; - if ( MethodDef.ReturnType != "const char *" ) return; - WriteLine( "// with: Detect_StringReturn" ); - - BeforeLines.Add( "IntPtr string_pointer;" ); - ReturnVar = "string_pointer"; - - AfterLines.Add( "return Marshal.PtrToStringAnsi( string_pointer );" ); - } - - private void Detect_StringFetch( List argList, List callargs ) - { - bool ReturnString = argList.Count < 4 && (ReturnType == "bool" || ReturnType == "void" || ReturnType == "int"|| ReturnType == "uint"); - bool IsFirst = true; - - //System.Text.StringBuilder pStrBuffer1 = new System.Text.StringBuilder(2048); - //bool result = NativeEntrypoints.SteamAPI_ISteamUGC_GetQueryUGCMetadata(m_pSteamUGC,handle,index,pStrBuffer1,2048); - //pchMetadata = pStrBuffer1.ToString(); - - for ( int i=0; i< argList.Count; i++ ) - { - if ( argList[i].ManagedType != "char*" ) continue; - if ( i == argList.Count ) continue; - - var chr = argList[i]; - var num = argList[i+1]; - - var IntReturn = ReturnType.Contains( "int" ); - - if ( num.ManagedType.Trim( '*' ) != "int" && num.ManagedType.Trim( '*' ) != "uint" ) continue; - - argList.Remove( num ); - - if ( ReturnString ) - argList.Remove( chr ); - - chr.ManagedType = "out string"; - - WriteLine( "// with: Detect_StringFetch " + ReturnString ); - - if ( IsFirst ) - BeforeLines.Add( $"{ReturnType} bSuccess = default( {ReturnType} );" ); - - if ( !ReturnString ) - BeforeLines.Add( $"{chr.Name} = string.Empty;" ); - - BeforeLines.Add( $"System.Text.StringBuilder {chr.Name}_sb = Helpers.TakeStringBuilder();" ); - - if ( ReturnString ) ReturnType = "string"; - ReturnVar = "bSuccess"; - - BeforeLines.Add( $"{num.ManagedType.Trim( '*' )} {num.Name} = 4096;" ); - - callargs.Where( x => x.Name == chr.Name ).All( x => { x.Name = x.Name + "_sb"; return true; } ); - // callargs.Where( x => x.Name == num.Name ).All( x => { x.Name = "4096"; return true; } ); - - - - if ( ReturnString ) AfterLines.Insert( 0, $"return {chr.Name}_sb.ToString();" ); - else AfterLines.Insert( 0, $"{chr.Name} = {chr.Name}_sb.ToString();" ); - - - if ( IntReturn ) - { - if ( ReturnString ) AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return null;" ); - else AfterLines.Insert( 0, "if ( bSuccess <= 0 ) return bSuccess;" ); - } - else - { - if ( ReturnString ) AfterLines.Insert( 0, "if ( !bSuccess ) return null;" ); - else AfterLines.Insert( 0, "if ( !bSuccess ) return bSuccess;" ); - } - - IsFirst = false; - } - - if ( !IsFirst ) - { - if ( !ReturnString ) AfterLines.Add( "return bSuccess;" ); - } - - /* - - - argList.Clear(); - ReturnType = "string"; - ReturnVar = "bSuccess"; - - - - - */ - } - - private void Detect_InterfaceReturn( List argList, List callargs ) - { - WriteLine( "// " + ReturnType ); - if ( !ReturnType.StartsWith( "ISteam" ) ) - return; - - BeforeLines.Add( "IntPtr interface_pointer;" ); - - ReturnVar = "interface_pointer"; - ReturnType = ReturnType.Substring( 1 ).Trim( '*', ' ' ); - - AfterLines.Add( $"return new {ReturnType}( steamworks, interface_pointer );" ); - } - - private void Detect_VectorReturn( List argList, List callArgs ) - { - var vec = argList.FirstOrDefault( x => x.Name.StartsWith( "pvec" ) ); - var max = argList.FirstOrDefault( x => x.Name.StartsWith( "unMax" ) ); - if ( max == null ) max = argList.FirstOrDefault( x => x.Name.StartsWith( "unNum" ) ); - - if ( vec == null || max == null ) - return; - - WriteLine( "// with: Detect_VectorReturn" ); - - //argList.Remove( vec ); - argList.Remove( max ); - - vec.ManagedType = vec.ManagedType.Replace( "*", "[]" ); - - BeforeLines.Add( $"var {max.Name} = ({max.ManagedType}) {vec.Name}.Length;" ); - BeforeLines.Add( $"fixed ( {vec.ManagedType.Trim( '[', ']' ) }* {vec.Name}_ptr = {vec.Name} )" ); - BeforeLines.Add( $"{{" ); - - AfterLines.Add( $"}}" ); - - foreach ( var arg in callArgs.Where( x => x.Name == vec.Name ) ) - { - arg.Name += "_ptr"; - } - - } - - private void CallPlatformClass( string classname, SteamApiDefinition.MethodDef m, List argList, string returnVar ) - { - if ( classname == null ) - { - classname = "SteamApi"; - } - - var methodName = m.Name; - - if ( LastMethodName == methodName ) - methodName += "0"; - - var args = string.Join( ", ", argList ); - if ( args != "" ) args = $" {args} "; - - var r = ""; - if ( ReturnType != "void" ) - r = "return "; - - if ( returnVar != "" ) - r = returnVar + " = "; - - BeforeLines.Add( $"{r}platform.{classname}_{methodName}({args});" ); - } - } -} diff --git a/Generator/CodeWriter/ClassVTable.cs b/Generator/CodeWriter/ClassVTable.cs new file mode 100644 index 0000000..84b444b --- /dev/null +++ b/Generator/CodeWriter/ClassVTable.cs @@ -0,0 +1,313 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Generator +{ + public partial class CodeWriter + { + public void GenerateVTableClass( string className, string filename ) + { + var clss = Parser.Classes.Single( x => x.Name == className ); + + sb = new StringBuilder(); + + WriteLine( $"using System;" ); + WriteLine( $"using System.Runtime.InteropServices;" ); + WriteLine( $"using System.Text;" ); + WriteLine( $"using System.Threading.Tasks;" ); + WriteLine( $"using Steamworks.Data;" ); + WriteLine(); + + WriteLine(); + + StartBlock( $"namespace Steamworks" ); + { + StartBlock( $"internal class {clss.Name} : SteamInterface" ); + { + WriteLine( $"public override string InterfaceName => \"{clss.InterfaceString}\";" ); + WriteLine(); + + WriteFunctionPointerReader( clss ); + + WriteLine(); + + foreach ( var func in clss.Functions ) + { + if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) + continue; + + + WriteFunction( clss, func ); + WriteLine(); + } + + } + EndBlock(); + } + EndBlock(); + + System.IO.File.WriteAllText( $"{filename}", sb.ToString() ); + } + + void WriteFunctionPointerReader( CodeParser.Class clss ) + { + // TODO - we'll probably have to do this PER platform + + int[] standardLocations = new int[clss.Functions.Count]; + int[] windowsLocations = new int[clss.Functions.Count]; + + for ( int i = 0; i < clss.Functions.Count; i++ ) + { + windowsLocations[i] = i * 8; + standardLocations[i] = i * 8; + } + + // + // MSVC switches the order in the vtable of overloaded functions + // I'm not going to try to try to work out how to order shit + // so lets just manually fix shit here + // + if ( clss.Name == "ISteamUserStats" ) + { + Swap( clss, "GetStat1", "GetStat2", windowsLocations ); + Swap( clss, "SetStat1", "SetStat2", windowsLocations ); + Swap( clss, "GetUserStat1", "GetUserStat2", windowsLocations ); + Swap( clss, "GetGlobalStat1", "GetGlobalStat2", windowsLocations ); + Swap( clss, "GetGlobalStatHistory1", "GetGlobalStatHistory2", windowsLocations ); + } + + if ( clss.Name == "ISteamGameServerStats" ) + { + Swap( clss, "GetUserStat1", "GetUserStat2", windowsLocations ); + Swap( clss, "SetUserStat1", "SetUserStat2", windowsLocations ); + } + + if ( clss.Name == "ISteamUGC" ) + { + Swap( clss, "CreateQueryAllUGCRequest1", "CreateQueryAllUGCRequest2", windowsLocations ); + } + + + StartBlock( $"public override void InitInternals()" ); + { + var different = new List(); + + for ( int i = 0; i < clss.Functions.Count; i++ ) + { + var func = clss.Functions[i]; + + if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) + { + WriteLine( $" // {func.Name} is deprecated" ); + } + else + { + if ( standardLocations[i] != windowsLocations[i] ) + { + different.Add( i ); + continue; + } + + WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {standardLocations[i]} ) ) );" ); + } + } + + if ( different.Count > 0 ) + { + WriteLine( "" ); + WriteLine( "#if PLATFORM_WIN" ); + foreach ( var i in different ) + { + var func = clss.Functions[i]; + WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {windowsLocations[i]} ) ) );" ); + } + WriteLine( "#else" ); + foreach ( var i in different ) + { + var func = clss.Functions[i]; + WriteLine( $"_{func.Name} = Marshal.GetDelegateForFunctionPointer( Marshal.ReadIntPtr( VTable, Platform.MemoryOffset( {standardLocations[i]} ) ) );" ); + } + WriteLine( "#endif" ); + } + + } + EndBlock(); + + StartBlock( $"internal override void Shutdown()" ); + { + WriteLine( $"base.Shutdown();" ); + WriteLine( "" ); + + for ( int i = 0; i < clss.Functions.Count; i++ ) + { + var func = clss.Functions[i]; + var returnType = BaseType.Parse( func.ReturnType ); + var args = func.Arguments.Select( x => BaseType.Parse( x.Value, x.Key ) ).ToArray(); + var windowsSpecific = NeedsWindowsSpecificFunction( func, returnType, args ); + + if ( Cleanup.IsDeprecated( $"{clss.Name}.{func.Name}" ) ) + continue; + + WriteLine( $"_{func.Name} = null;" ); + } + } + EndBlock(); + } + + private bool NeedsWindowsSpecificFunction( CodeParser.Class.Function func, BaseType returnType, BaseType[] args ) + { + if ( returnType.IsReturnedWeird ) return true; + if ( returnType.WindowsSpecific ) return true; + if ( args.Any( x => x.WindowsSpecific ) ) return true; + + return false; + } + + + private void Swap( CodeParser.Class clss, string v1, string v2, int[] locations ) + { + var a = clss.Functions.IndexOf( clss.Functions.Single( x => x.Name == v1 ) ); + var b = clss.Functions.IndexOf( clss.Functions.Single( x => x.Name == v2 ) ); + + var s = locations[a]; + locations[a] = locations[b]; + locations[b] = s; + } + + private void WriteFunction( CodeParser.Class clss, CodeParser.Class.Function func ) + { + var returnType = BaseType.Parse( func.ReturnType ); + returnType.Func = func.Name; + + var args = func.Arguments.Select( x => + { + var bt = BaseType.Parse( x.Value, x.Key ); + bt.Func = func.Name; + return bt; + } ).ToArray(); + + for( int i=0; i !x.ShouldSkipAsArgument ).Select( x => x.AsArgument() ) ); ; + var delegateargstr = string.Join( ", ", args.Select( x => x.AsNativeArgument() ) ); + + var windowsSpecific = NeedsWindowsSpecificFunction( func, returnType, args ); + + if ( returnType is SteamApiCallType sap ) + { + sap.CallResult = func.CallResult; + + argstr = string.Join( ", ", args.Select( x => x.AsArgument().Replace( "ref ", " /* ref */ " ) ) ); + } + + WriteLine( $"#region FunctionMeta" ); + + WriteLine( $"[UnmanagedFunctionPointer( Platform.MemberConvention )]" ); + + if ( returnType.ReturnAttribute != null) + WriteLine( returnType.ReturnAttribute ); + + if ( returnType.IsReturnedWeird ) + { + WriteLine( "#if PLATFORM_WIN" ); + WriteLine( $"private delegate void F{func.Name}( IntPtr self, ref {returnType.TypeName} retVal, {delegateargstr} );".Replace( " retVal, )", " retVal )" ) ); + WriteLine( "#else" ); + } + + WriteLine( $"private delegate {returnType.TypeNameFrom} F{func.Name}( IntPtr self, {delegateargstr} );".Replace( "( IntPtr self, )", "( IntPtr self )" ) ); + + if ( returnType.IsReturnedWeird ) + { + WriteLine( "#endif" ); + } + + WriteLine( $"private F{func.Name} _{func.Name};" ); + + WriteLine(); + WriteLine( $"#endregion" ); + + StartBlock( $"internal {returnType.ReturnType} {func.Name}( {argstr} )".Replace( "( )", "()" ) ); + { + var callargs = string.Join( ", ", args.Select( x => x.AsCallArgument() ) ); + + // + // Code before any calls + // + foreach ( var arg in args ) + { + if ( arg is StringType sb ) + { + WriteLine( $"IntPtr mem{sb.VarName} = Helpers.TakeMemory();" ); + } + } + + // + // The actual call + // + if ( returnType.IsReturnedWeird ) + { + WriteLine( "#if PLATFORM_WIN" ); + { + WriteLine( $"var retVal = default( {returnType.TypeName} );" ); + WriteLine( $"_{func.Name}( Self, ref retVal, {callargs} );".Replace( ", );", " );" ) ); + WriteLine( $"{returnType.Return( "retVal" )}" ); + } + WriteLine( "#else" ); + } + + if ( returnType.IsVoid ) + { + WriteLine( $"_{func.Name}( Self, {callargs} );".Replace( "( Self, )", "( Self )" ) ); + } + else + { + WriteLine( $"var returnValue = _{func.Name}( Self, {callargs} );".Replace( "( Self, )", "( Self )" ) ); + } + + // + // Code after the call + // + foreach ( var arg in args ) + { + if ( arg is StringType sb ) + { + WriteLine( $"{sb.VarName} = Helpers.MemoryToString( mem{sb.VarName} );" ); + } + } + + // + // Return + // + if ( !returnType.IsVoid ) + { + WriteLine( returnType.Return( "returnValue" ) ); + } + + if ( returnType.IsReturnedWeird ) + { + WriteLine( "#endif" ); + } + } + EndBlock(); + } + } +} diff --git a/Generator/CodeWriter/CodeWriter.cs b/Generator/CodeWriter/CodeWriter.cs index 8cfea4c..f1c8c23 100644 --- a/Generator/CodeWriter/CodeWriter.cs +++ b/Generator/CodeWriter/CodeWriter.cs @@ -11,10 +11,13 @@ namespace Generator public partial class CodeWriter { private SteamApiDefinition def; + public CodeParser Parser; - public CodeWriter( SteamApiDefinition def ) + public CodeWriter( CodeParser parser, SteamApiDefinition def ) { - this.def = def; + Parser = parser; + + this.def = def; WorkoutTypes(); } @@ -25,91 +28,66 @@ namespace Generator Header(); Enums(); Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Enums.cs", sb.ToString() ); + System.IO.File.WriteAllText( $"{folder}SteamEnums.cs", sb.ToString() ); } { sb = new StringBuilder(); - Header(); + Header( "Steamworks.Data" ); Types(); Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Types.cs", sb.ToString() ); + System.IO.File.WriteAllText( $"{folder}SteamTypes.cs", sb.ToString() ); } { sb = new StringBuilder(); - Header(); + Header( "Steamworks.Data" ); Structs(); Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Structs.cs", sb.ToString() ); + System.IO.File.WriteAllText( $"{folder}SteamStructs.cs", sb.ToString() ); } { sb = new StringBuilder(); - Header(); + Header( "Steamworks.Data" ); Constants(); Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Constants.cs", sb.ToString() ); + System.IO.File.WriteAllText( $"{folder}SteamConstants.cs", sb.ToString() ); } - { - sb = new StringBuilder(); - Header(); - PlatformInterface(); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Interface.cs", sb.ToString() ); - } + { + GenerateGlobalFunctions( "SteamAPI", $"{folder}../Generated/SteamAPI.cs" ); + GenerateGlobalFunctions( "SteamGameServer", $"{folder}../Generated/SteamGameServer.cs" ); + GenerateGlobalFunctions( "SteamInternal", $"{folder}../Generated/SteamInternal.cs" ); + } - { - sb = new StringBuilder(); - Header(); - PlatformClass( "Win32", "steam_api.dll", true ); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Win32.cs", sb.ToString() ); - } - - { - sb = new StringBuilder(); - Header(); - PlatformClass( "Win64", "steam_api64.dll", true ); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Win64.cs", sb.ToString() ); - } - - { - sb = new StringBuilder(); - Header(); - PlatformClass( "Linux32", "libsteam_api.so", false ); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Linux32.cs", sb.ToString() ); - } - - { - sb = new StringBuilder(); - Header(); - PlatformClass( "Linux64", "libsteam_api64.so", false ); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Linux64.cs", sb.ToString() ); - } - - { - sb = new StringBuilder(); - Header(); - PlatformClass( "Mac", "libsteam_api.dylib", false ); - Footer(); - System.IO.File.WriteAllText( $"{folder}SteamNative.Platform.Mac.cs", sb.ToString() ); - } - - { - GenerateClasses( $"{folder}SteamNative." ); - } - } + { + GenerateVTableClass( "ISteamApps", $"{folder}../Generated/Interfaces/ISteamApps.cs" ); + GenerateVTableClass( "ISteamUtils", $"{folder}../Generated/Interfaces/ISteamUtils.cs" ); + GenerateVTableClass( "ISteamParentalSettings", $"{folder}../Generated/Interfaces/ISteamParentalSettings.cs" ); + GenerateVTableClass( "ISteamMusic", $"{folder}../Generated/Interfaces/ISteamMusic.cs" ); + GenerateVTableClass( "ISteamVideo", $"{folder}../Generated/Interfaces/ISteamVideo.cs" ); + GenerateVTableClass( "ISteamUser", $"{folder}../Generated/Interfaces/ISteamUser.cs" ); + GenerateVTableClass( "ISteamMatchmakingServers", $"{folder}../Generated/Interfaces/ISteamMatchmakingServers.cs" ); + GenerateVTableClass( "ISteamFriends", $"{folder}../Generated/Interfaces/ISteamFriends.cs" ); + GenerateVTableClass( "ISteamGameServer", $"{folder}../Generated/Interfaces/ISteamGameServer.cs" ); + GenerateVTableClass( "ISteamScreenshots", $"{folder}../Generated/Interfaces/ISteamScreenshots.cs" ); + GenerateVTableClass( "ISteamUserStats", $"{folder}../Generated/Interfaces/ISteamUserStats.cs" ); + GenerateVTableClass( "ISteamUGC", $"{folder}../Generated/Interfaces/ISteamUGC.cs" ); + GenerateVTableClass( "ISteamRemoteStorage", $"{folder}../Generated/Interfaces/ISteamRemoteStorage.cs" ); + GenerateVTableClass( "ISteamInventory", $"{folder}../Generated/Interfaces/ISteamInventory.cs" ); + GenerateVTableClass( "ISteamNetworking", $"{folder}../Generated/Interfaces/ISteamNetworking.cs" ); + GenerateVTableClass( "ISteamMatchmaking", $"{folder}../Generated/Interfaces/ISteamMatchmaking.cs" ); + GenerateVTableClass( "ISteamParties", $"{folder}../Generated/Interfaces/ISteamParties.cs" ); + GenerateVTableClass( "ISteamNetworkingUtils", $"{folder}../Generated/Interfaces/ISteamNetworkingUtils.cs" ); + GenerateVTableClass( "ISteamNetworkingSockets", $"{folder}../Generated/Interfaces/ISteamNetworkingSockets.cs" ); + GenerateVTableClass( "ISteamGameServerStats", $"{folder}../Generated/Interfaces/ISteamGameServerStats.cs" ); + GenerateVTableClass( "ISteamInput", $"{folder}../Generated/Interfaces/ISteamInput.cs" ); + } + } void WorkoutTypes() { - def.typedefs.Add( new SteamApiDefinition.TypeDef() { Name = "CGameID", Type = "ulong" } ); - def.typedefs.Add( new SteamApiDefinition.TypeDef() { Name = "CSteamID", Type = "ulong" } ); - foreach ( var c in def.typedefs ) { if ( c.Name.StartsWith( "uint" ) || c.Name.StartsWith( "int" ) || c.Name.StartsWith( "lint" ) || c.Name.StartsWith( "luint" ) || c.Name.StartsWith( "ulint" ) ) @@ -123,7 +101,7 @@ namespace Generator type = ToManagedType( type ); - TypeDefs.Add( c.Name, new TypeDef() + TypeDefs.Add( c.Name, new TypeDef() { Name = c.Name, NativeType = c.Type, @@ -132,25 +110,13 @@ namespace Generator } } - private List BuildArguments( SteamApiDefinition.MethodDef.ParamType[] ps ) - { - var args = new List(); - if ( ps == null ) return args; - - foreach ( var p in ps ) - { - var a = new Argument( p.Name, p.Type, TypeDefs ); - args.Add( a ); - } - - return args; - } - - private void Header( string NamespaceName = "SteamNative" ) + private void Header( string NamespaceName = "Steamworks" ) { WriteLine( "using System;" ); WriteLine( "using System.Runtime.InteropServices;" ); WriteLine( "using System.Linq;" ); + WriteLine( "using Steamworks.Data;" ); + WriteLine( "using System.Threading.Tasks;" ); WriteLine(); StartBlock( "namespace " + NamespaceName ); } diff --git a/Generator/CodeWriter/Enums.cs b/Generator/CodeWriter/Enums.cs index 2b89512..cc5c6be 100644 --- a/Generator/CodeWriter/Enums.cs +++ b/Generator/CodeWriter/Enums.cs @@ -25,7 +25,12 @@ namespace Generator if ( name[0] == 'E' ) name = name.Substring( 1 ); - StartBlock( $"internal enum {name} : int" ); + name = Cleanup.ConvertType( name ); + + if ( !Cleanup.ShouldCreate( name ) ) + continue; + + StartBlock( $"{Cleanup.Expose( name )} enum {name} : int" ); { // // If all the enum values start with the same diff --git a/Generator/CodeWriter/GlobalFunctions.cs b/Generator/CodeWriter/GlobalFunctions.cs new file mode 100644 index 0000000..3f4224f --- /dev/null +++ b/Generator/CodeWriter/GlobalFunctions.cs @@ -0,0 +1,128 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Generator +{ + public partial class CodeWriter + { + public void GenerateGlobalFunctions( string startingWith, string filename ) + { + var functions = def.methods.Where( x => x.Name.StartsWith( startingWith ) ); + + sb = new StringBuilder(); + + WriteLine( $"using System;" ); + WriteLine( $"using System.Runtime.InteropServices;" ); + WriteLine( $"using System.Text;" ); + WriteLine( $"using System.Threading.Tasks;" ); + WriteLine( $"using Steamworks.Data;" ); + WriteLine(); + + WriteLine(); + + StartBlock( $"namespace Steamworks" ); + { + StartBlock( $"internal static class {startingWith}" ); + { + StartBlock( $"internal static class Native" ); + { + foreach ( var func in functions ) + { + WriteMarshalledFunction( func ); + } + } + EndBlock(); + + foreach ( var func in functions ) + { + WriteGlobalFunction( startingWith, func ); + WriteLine(); + } + + } + EndBlock(); + } + EndBlock(); + + System.IO.File.WriteAllText( $"{filename}", sb.ToString().Replace( "( )", "()" ) ); + } + + private void WriteGlobalFunction( string cname, SteamApiDefinition.MethodDef func ) + { + var cleanName = func.Name.Substring( cname.Length ).Trim( '_' ); + + var returnType = BaseType.Parse( func.ReturnType ); + returnType.Func = func.Name; + + if ( func.Params == null ) + func.Params = new SteamApiDefinition.MethodDef.ParamType[0]; + + var args = func.Params.Select( x => + { + var bt = BaseType.Parse( x.Type, x.Name ); + bt.Func = func.Name; + return bt; + } ).ToArray(); + var argstr = string.Join( ", ", args.Select( x => x.AsArgument() ) ); + var delegateargstr = string.Join( ", ", args.Select( x => x.AsArgument() ) ); + + if ( returnType.IsReturnedWeird ) + { + throw new System.Exception( "TODO" ); + } + + StartBlock( $"static internal {returnType.ReturnType} {cleanName}( {argstr} )" ); + { + var callargs = string.Join( ", ", args.Select( x => x.AsCallArgument() ) ); + + if ( returnType.IsReturnedWeird ) + { + WriteLine( $"var retVal = default( {returnType.TypeName} );" ); + WriteLine( $"Native.{func.Name}( ref retVal, {callargs} );" ); + WriteLine( $"{returnType.Return( "retVal" )}" ); + } + else if ( returnType.IsVoid ) + { + WriteLine( $"Native.{func.Name}( {callargs} );" ); + } + else + { + var v = $"Native.{func.Name}( {callargs} )"; + + WriteLine( returnType.Return( v ) ); + } + } + EndBlock(); + + } + + private void WriteMarshalledFunction( SteamApiDefinition.MethodDef func ) + { + var returnType = BaseType.Parse( func.ReturnType ); + returnType.Func = func.Name; + + if ( func.Params == null ) + func.Params = new SteamApiDefinition.MethodDef.ParamType[0]; + + var args = func.Params.Select( x => + { + var bt = BaseType.Parse( x.Type, x.Name ); + bt.Func = func.Name; + return bt; + } ).ToArray(); + var argstr = string.Join( ", ", args.Select( x => x.AsArgument() ) ); + var delegateargstr = string.Join( ", ", args.Select( x => x.AsArgument() ) ); + + WriteLine( $"[DllImport( Platform.LibraryName, EntryPoint = \"{func.Name}\", CallingConvention = CallingConvention.Cdecl )]" ); + + if ( returnType.ReturnAttribute != null ) + WriteLine( returnType.ReturnAttribute ); + + WriteLine( $"public static extern {(returnType.IsReturnedWeird ? "void" : returnType.TypeNameFrom)} {func.Name}( {delegateargstr} );" ); + WriteLine(); + } + } +} diff --git a/Generator/CodeWriter/Interface.cs b/Generator/CodeWriter/Interface.cs deleted file mode 100644 index f7d7d36..0000000 --- a/Generator/CodeWriter/Interface.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Generator -{ - public partial class CodeWriter - { - // - // Writes the RustNative.Platform.Interface - // - void PlatformInterface() - { - StartBlock( $"internal static partial class Platform" ); - { - StartBlock( $"internal interface Interface : IDisposable" ); - { - WriteLine( "// Implementation should return true if _ptr is non null" ); - WriteLine( "bool IsValid { get; } " ); - WriteLine(); - - - foreach ( var m in def.methods.OrderBy( x => x.ClassName ) ) - { - if ( ShouldIgnoreClass( m.ClassName ) ) continue; - - PlatformInterfaceMethod( m ); - } - - } - EndBlock(); - } - EndBlock(); - } - - - private void PlatformInterfaceMethod( SteamApiDefinition.MethodDef m ) - { - var arguments = BuildArguments( m.Params ); - var ret = new Argument( "return", m.ReturnType, TypeDefs ); - - var methodName = m.Name; - - if ( LastMethodName == methodName ) - methodName = methodName + "0"; - - var flatName = $"SteamAPI_{m.ClassName}_{methodName}"; - - if ( m.ClassName == "SteamApi" ) - flatName = methodName; - - var argstring = string.Join( ", ", arguments.Select( x => x.InteropParameter( true, true ) ) ); - if ( argstring != "" ) argstring = $" {argstring} "; - - WriteLine( $"{ret.Return()} {m.ClassName}_{methodName}({argstring});" ); - LastMethodName = m.Name; - } - } -} diff --git a/Generator/CodeWriter/PlatformClass.cs b/Generator/CodeWriter/PlatformClass.cs deleted file mode 100644 index 68837b8..0000000 --- a/Generator/CodeWriter/PlatformClass.cs +++ /dev/null @@ -1,205 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Generator -{ - public partial class CodeWriter - { - bool LargePack; - bool X86; - - private void PlatformClass( string type, string libraryName, bool LargePack ) - { - this.LargePack = LargePack; - X86 = type.EndsWith( "32" ); - - StartBlock( $"internal static partial class Platform" ); - { - StartBlock( $"internal class {type} : Interface" ); - { - WriteLine( "internal IntPtr _ptr;" ); - WriteLine( "public bool IsValid { get{ return _ptr != IntPtr.Zero; } }" ); - WriteLine(); - - WriteLine( "//" ); - WriteLine( "// Constructor sets pointer to native class" ); - WriteLine( "//" ); - StartBlock( $"internal {type}( IntPtr pointer )" ); - { - WriteLine( "_ptr = pointer;" ); - } - EndBlock(); - - WriteLine( "//" ); - WriteLine( "// When shutting down clear all the internals to avoid accidental use" ); - WriteLine( "//" ); - StartBlock( $"public virtual void Dispose()" ); - { - WriteLine( "_ptr = IntPtr.Zero;" ); - } - EndBlock(); - WriteLine(); - - foreach ( var c in def.methods.GroupBy( x => x.ClassName ) ) - { - PlatformClass( c.Key, c.ToArray() ); - } - - StartBlock( $"internal static unsafe class Native" ); - { - foreach ( var c in def.methods.GroupBy( x => x.ClassName ) ) - { - InteropClass( libraryName, c.Key, c.ToArray() ); - } - } - EndBlock(); - } - EndBlock(); - } - EndBlock(); - } - - private void PlatformClass( string className, SteamApiDefinition.MethodDef[] methodDef ) - { - if ( ShouldIgnoreClass( className ) ) return; - - LastMethodName = ""; - foreach ( var m in methodDef ) - { - PlatformClassMethod( className, m ); - } - - WriteLine(); - } - - private void PlatformClassMethod( string classname, SteamApiDefinition.MethodDef methodDef ) - { - var arguments = BuildArguments( methodDef.Params ); - - var ret = new Argument( "return", methodDef.ReturnType, TypeDefs ); - - var methodName = methodDef.Name; - - if ( LastMethodName == methodName ) - methodName = methodName + "0"; - - var flatName = $"SteamAPI_{classname}_{methodName}"; - - if ( classname == "SteamApi" ) - flatName = methodName; - - var argstring = string.Join( ", ", arguments.Select( x => x.InteropParameter( true, true ) ) ); - if ( argstring != "" ) argstring = $" {argstring} "; - - StartBlock( $"public virtual {ret.Return()} {classname}_{methodName}({argstring})" ); - { - - // var vars = string.Join( " + \",\" + ", arguments.Where( x => !x.InteropParameter( true, true ).StartsWith( "out " ) ).Select( x => x.Name ) ); - // if ( vars != "" ) vars = "\" + " + vars + " + \""; - // WriteLine( $"Console.WriteLine( \"{classname}_{methodName}( {vars} )\" );" ); - - if ( methodDef.NeedsSelfPointer ) - { - WriteLine( $"if ( _ptr == IntPtr.Zero ) throw new System.Exception( \"{classname} _ptr is null!\" );" ); - WriteLine(); - } - - var retcode = ""; - if ( ret.NativeType != "void" ) - retcode = "return "; - - AfterLines = new List(); - - foreach ( var a in arguments ) - { - if ( a.InteropParameter( LargePack ).Contains( ".PackSmall" ) ) - { - WriteLine( $"var {a.Name}_ps = new {a.ManagedType.Trim( '*' )}.PackSmall();" ); - AfterLines.Add( $"{a.Name} = {a.Name}_ps;" ); - a.Name = "ref " + a.Name + "_ps"; - - if ( retcode != "" ) - retcode = "var ret = "; - } - } - - argstring = string.Join( ", ", arguments.Select( x => x.InteropVariable( false ) ) ); - - if ( methodDef.NeedsSelfPointer ) - argstring = "_ptr" + ( argstring.Length > 0 ? ", " : "" ) + argstring; - - WriteLine( $"{retcode}Native.{flatName}({argstring});" ); - - WriteLines( AfterLines ); - - if ( retcode.StartsWith( "var" ) ) - { - WriteLine( "return ret;" ); - } - - } - EndBlock(); - - LastMethodName = methodDef.Name; - } - - - - private void InteropClass( string libraryName, string className, SteamApiDefinition.MethodDef[] methodDef ) - { - if ( ShouldIgnoreClass( className ) ) return; - - WriteLine( $"//" ); - WriteLine( $"// {className} " ); - WriteLine( $"//" ); - - LastMethodName = ""; - foreach ( var m in methodDef ) - { - InteropClassMethod( libraryName, className, m ); - } - - WriteLine(); - } - - private void InteropClassMethod( string library, string classname, SteamApiDefinition.MethodDef methodDef ) - { - var arguments = BuildArguments( methodDef.Params ); - var ret = new Argument( "return", methodDef.ReturnType, TypeDefs ); - - var methodName = methodDef.Name; - - if ( LastMethodName == methodName ) - methodName = methodName + "0"; - - var flatName = $"SteamAPI_{classname}_{methodName}"; - - if ( classname == "SteamApi" ) - flatName = methodName; - - var argstring = string.Join( ", ", arguments.Select( x => x.InteropParameter( LargePack, true ) ) ); - - if ( methodDef.NeedsSelfPointer ) - { - argstring = "IntPtr " + classname + ( argstring.Length > 0 ? ", " : "" ) + argstring; - } - - if ( argstring != "" ) argstring = $" {argstring} "; - - if ( X86 ) - Write( $"[DllImport( \"{library}\", CallingConvention = CallingConvention.Cdecl )] " ); - else - Write( $"[DllImport( \"{library}\" )] " ); - - if ( ret.Return() == "bool" ) WriteLine( "[return: MarshalAs(UnmanagedType.U1)]" ); - - WriteLine( $"internal static extern {ret.Return()} {flatName}({argstring});" ); - LastMethodName = methodDef.Name; - } - - - } -} diff --git a/Generator/CodeWriter/Struct.cs b/Generator/CodeWriter/Struct.cs index a79ecad..69059f4 100644 --- a/Generator/CodeWriter/Struct.cs +++ b/Generator/CodeWriter/Struct.cs @@ -27,8 +27,9 @@ namespace Generator "CCallResult", "CCallback", "ValvePackingSentinel_t", - "CCallbackBase" - }; + "CCallbackBase", + "CSteamGameServerAPIContext" + }; public readonly static string[] ForceLargePackStructs = new string[] { @@ -41,100 +42,106 @@ namespace Generator foreach ( var c in def.structs ) { - if ( SkipStructs.Contains( c.Name ) ) + var name = Cleanup.ConvertType( c.Name ); + + if ( SkipStructs.Contains( c.Name ) ) continue; - if ( c.Name.Contains( "::" ) ) + if ( !Cleanup.ShouldCreate( name ) ) + continue; + + if ( name.Contains( "::" ) ) continue; - int defaultPack = 8; + int defaultPack = c.IsPack4OnWindows ? 4 : 8; - if ( c.Fields.Any( x => x.Type.Contains( "class CSteamID" ) ) && !ForceLargePackStructs.Contains( c.Name ) ) - defaultPack = 4; + var isCallback = !string.IsNullOrEmpty( c.CallbackId ); - // - // Main struct - // - WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = {defaultPack} )]" ); - StartBlock( $"internal struct {c.Name}" ); + // + // Main struct + // + WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = Platform.{(c.IsPack4OnWindows?"StructPackSize": "StructPlatformPackSize")} )]" ); + StartBlock( $"{Cleanup.Expose( name )} struct {name}" ); { - if ( !string.IsNullOrEmpty( c.CallbackId ) ) + // + // The fields + // + StructFields( c.Fields ); + WriteLine(); + + if ( isCallback ) { - WriteLine( "internal const int CallbackId = " + c.CallbackId + ";" ); - } + WriteLine( "#region SteamCallback" ); + { - // - // The fields - // - StructFields( c.Fields ); + WriteLine( $"internal static readonly int StructSize = System.Runtime.InteropServices.Marshal.SizeOf( typeof({name}) );" ); + WriteLine( $"internal static {name} Fill( IntPtr p ) => (({name})({name}) Marshal.PtrToStructure( p, typeof({name}) ) );" ); + WriteLine(); + WriteLine( $"static Action<{name}> actionClient;" ); + WriteLine( $"[MonoPInvokeCallback] static void OnClient( IntPtr thisptr, IntPtr pvParam ) => actionClient?.Invoke( Fill( pvParam ) );" ); - WriteLine(); - WriteLine( "//" ); - WriteLine( "// Read this struct from a pointer, usually from Native. It will automatically do the awesome stuff." ); - WriteLine( "//" ); - StartBlock( $"internal static {c.Name} FromPointer( IntPtr p )" ); - { - WriteLine( $"if ( Platform.PackSmall ) return (PackSmall) Marshal.PtrToStructure( p, typeof(PackSmall) );" ); + WriteLine( $"static Action<{name}> actionServer;" ); + WriteLine( $"[MonoPInvokeCallback] static void OnServer( IntPtr thisptr, IntPtr pvParam ) => actionServer?.Invoke( Fill( pvParam ) );" ); - WriteLine( $"return ({c.Name}) Marshal.PtrToStructure( p, typeof({c.Name}) );" ); - } - EndBlock(); + StartBlock( $"public static void Install( Action<{name}> action, bool server = false )" ); + { + StartBlock( "if ( server )" ); + { + WriteLine( $"Event.Register( OnServer, StructSize, {c.CallbackId}, true );" ); + WriteLine( $"actionServer = action;" ); + } + Else(); + { + WriteLine( $"Event.Register( OnClient, StructSize, {c.CallbackId}, false );" ); + WriteLine( $"actionClient = action;" ); + } + EndBlock(); - WriteLine(); - WriteLine( "//" ); - WriteLine( "// Get the size of the structure we're going to be using." ); - WriteLine( "//" ); - StartBlock( $"internal static int StructSize()" ); - { - WriteLine( $"if ( Platform.PackSmall ) return System.Runtime.InteropServices.Marshal.SizeOf( typeof(PackSmall) );" ); + } + EndBlock(); - WriteLine( $"return System.Runtime.InteropServices.Marshal.SizeOf( typeof({c.Name}) );" ); - } - EndBlock(); + StartBlock( $"public static async Task<{name}?> GetResultAsync( SteamAPICall_t handle )" ); + { + WriteLine( $"bool failed = false;" ); + WriteLine(); + StartBlock( $"while ( !SteamUtils.IsCallComplete( handle, out failed ) )" ); + { + WriteLine( $"await Task.Delay( 1 );" ); + WriteLine( $"if ( !SteamClient.IsValid && !SteamServer.IsValid ) return null;" ); + } + EndBlock(); - if ( defaultPack == 8 ) - defaultPack = 4; - - // - // Small packed struct (for osx, linux) - // - WriteLine(); - WriteLine( $"[StructLayout( LayoutKind.Sequential, Pack = {defaultPack} )]" ); - StartBlock( $"internal struct PackSmall" ); - { - StructFields( c.Fields ); - - // - // Implicit convert from PackSmall to regular - // - WriteLine(); - WriteLine( "//" ); - WriteLine( $"// Easily convert from PackSmall to {c.Name}" ); - WriteLine( "//" ); - StartBlock( $"public static implicit operator {c.Name} ( {c.Name}.PackSmall d )" ); - { - StartBlock( $"return new {c.Name}()" ); - { - foreach ( var f in c.Fields ) - { - WriteLine( $"{CleanMemberName( f.Name )} = d.{CleanMemberName( f.Name )}," ); - } - } - EndBlock( ";" ); - } - EndBlock(); - - } - EndBlock(); - - if ( c.IsCallResult ) - { - CallResult( c ); - } + WriteLine( $"if ( failed ) return null;" ); + WriteLine( $"" ); + WriteLine( $"var ptr = Marshal.AllocHGlobal( StructSize );" ); + WriteLine( $"" ); + WriteLine( $"try" ); + WriteLine( $"{{" ); + WriteLine( $" if ( !SteamUtils.Internal.GetAPICallResult( handle, ptr, StructSize, {c.CallbackId}, ref failed ) || failed )" ); + WriteLine( $" return null;" ); + WriteLine( $"" ); + WriteLine( $" return Fill( ptr );" ); + WriteLine( $"}}" ); + WriteLine( $"finally" ); + WriteLine( $"{{" ); + WriteLine( $" Marshal.FreeHGlobal( ptr );" ); + WriteLine( $"}}" ); + } + EndBlock(); + } + WriteLine( "#endregion" ); + } + else + { + WriteLine( "#region Marshalling" ); + { + WriteLine( $"internal static {name} Fill( IntPtr p ) => (({name})({name}) Marshal.PtrToStructure( p, typeof({name}) ) );" ); + } + WriteLine( "#endregion" ); + } if ( !string.IsNullOrEmpty( c.CallbackId ) ) { - Callback( c ); callbackList.Add( c ); } @@ -142,17 +149,6 @@ namespace Generator EndBlock(); WriteLine(); } - - StartBlock( $"internal static class Callbacks" ); - StartBlock( $"internal static void RegisterCallbacks( Facepunch.Steamworks.BaseSteamworks steamworks )" ); - { - foreach ( var c in callbackList ) - { - WriteLine( $"{c.Name}.Register( steamworks );" ); - } - } - EndBlock(); - EndBlock(); } private void StructFields( SteamApiDefinition.StructDef.StructFields[] fields ) @@ -161,7 +157,9 @@ namespace Generator { var t = ToManagedType( m.Type ); - if ( TypeDefs.ContainsKey( t ) ) + t = Cleanup.ConvertType( t ); + + if ( TypeDefs.ContainsKey( t ) ) { t = TypeDefs[t].ManagedType; } @@ -173,29 +171,31 @@ namespace Generator if ( t.StartsWith( "char " ) && t.Contains( "[" ) ) { - var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' ); - t = "string"; - WriteLine( $"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {num})]" ); + WriteLine( $"internal string {CleanMemberName( m.Name )}UTF8() => System.Text.Encoding.UTF8.GetString( {CleanMemberName( m.Name )}, 0, System.Array.IndexOf( {CleanMemberName( m.Name )}, 0 ) );" ); + + var num = t.Replace( "char", "" ).Trim( '[', ']', ' ' ); + t = "byte[]"; + WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num})] // {t} {m.Name}" ); } if ( t.StartsWith( "uint8 " ) && t.Contains( "[" ) ) { var num = t.Replace( "uint8", "" ).Trim( '[', ']', ' ' ); - t = "char"; - WriteLine( $"[MarshalAs(UnmanagedType.ByValTStr, SizeConst = {num})]" ); + t = "byte[]"; + WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num})] // {m.Name}" ); } - if ( t.StartsWith( "CSteamID " ) && t.Contains( "[" ) ) + if ( t.StartsWith( "SteamId" ) && t.Contains( "[" ) ) { - var num = t.Replace( "CSteamID", "" ).Trim( '[', ']', ' ' ); + var num = t.Replace( "SteamId", "" ).Trim( '[', ']', ' ' ); t = $"ulong[]"; WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U8)]" ); } - if ( t.StartsWith( "PublishedFileId_t " ) && t.Contains( "[" ) ) + if ( t.StartsWith( "PublishedFileId " ) && t.Contains( "[" ) ) { - var num = t.Replace( "PublishedFileId_t", "" ).Trim( '[', ']', ' ' ); - t = $"ulong[]"; + var num = t.Replace( "PublishedFileId", "" ).Trim( '[', ']', ' ' ); + t = $"PublishedFileId[]"; WriteLine( $"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U8)]" ); } @@ -218,164 +218,15 @@ namespace Generator t = "IntPtr"; } - if (t.StartsWith("AppId_t ") && t.Contains("[")) + if (t.StartsWith("AppId ") && t.Contains("[")) { - var num = t.Replace("AppId_t", "").Trim('[', ']', ' '); - t = $"AppId_t[]"; + var num = t.Replace("AppId", "").Trim('[', ']', ' '); + t = $"AppId[]"; WriteLine($"[MarshalAs(UnmanagedType.ByValArray, SizeConst = {num}, ArraySubType = UnmanagedType.U4)]"); } WriteLine( $"internal {t} {CleanMemberName( m.Name )}; // {m.Name} {m.Type}" ); } } - - private void Callback( SteamApiDefinition.StructDef c ) - { - WriteLine(); - StartBlock( $"internal static void Register( Facepunch.Steamworks.BaseSteamworks steamworks )" ); - { - WriteLine( $"var handle = new CallbackHandle( steamworks );" ); - WriteLine( $"" ); - - CallbackCall( c ); - - WriteLine( "" ); - WriteLine( "//" ); - WriteLine( "// Register the callback with Steam" ); - WriteLine( "//" ); - WriteLine( $"steamworks.native.api.SteamAPI_RegisterCallback( handle.PinnedCallback.AddrOfPinnedObject(), CallbackId );" ); - - WriteLine(); - WriteLine( "steamworks.RegisterCallbackHandle( handle );" ); - } - EndBlock(); - - WriteLine(); - WriteLine( "[MonoPInvokeCallback]" ); - WriteLine( "internal static void OnResultThis( IntPtr self, IntPtr param ){ OnResult( param ); }" ); - WriteLine( "[MonoPInvokeCallback]" ); - WriteLine( "internal static void OnResultWithInfoThis( IntPtr self, IntPtr param, bool failure, SteamNative.SteamAPICall_t call ){ OnResultWithInfo( param, failure, call ); }" ); - WriteLine( "[MonoPInvokeCallback]" ); - WriteLine( "internal static int OnGetSizeThis( IntPtr self ){ return OnGetSize(); }" ); - WriteLine( "[MonoPInvokeCallback]" ); - WriteLine( "internal static int OnGetSize(){ return StructSize(); }" ); - - WriteLine(); - WriteLine( "[MonoPInvokeCallback]" ); - StartBlock( "internal static void OnResult( IntPtr param )" ); - { - WriteLine( $"OnResultWithInfo( param, false, 0 );" ); - } - EndBlock(); - - WriteLine(); - WriteLine( "[MonoPInvokeCallback]" ); - StartBlock( "internal static void OnResultWithInfo( IntPtr param, bool failure, SteamNative.SteamAPICall_t call )" ); - { - WriteLine( $"if ( failure ) return;" ); - WriteLine(); - WriteLine( "var value = FromPointer( param );" ); - - WriteLine(); - WriteLine( "if ( Facepunch.Steamworks.Client.Instance != null )" ); - WriteLine( $" Facepunch.Steamworks.Client.Instance.OnCallback<{c.Name}>( value );" ); - - WriteLine(); - WriteLine( "if ( Facepunch.Steamworks.Server.Instance != null )" ); - WriteLine( $" Facepunch.Steamworks.Server.Instance.OnCallback<{c.Name}>( value );" ); - } - EndBlock(); - } - - - private void CallResult( SteamApiDefinition.StructDef c ) - { - WriteLine(); - StartBlock( $"internal static CallResult<{c.Name}> CallResult( Facepunch.Steamworks.BaseSteamworks steamworks, SteamAPICall_t call, Action<{c.Name}, bool> CallbackFunction )" ); - { - WriteLine( $"return new CallResult<{c.Name}>( steamworks, call, CallbackFunction, FromPointer, StructSize(), CallbackId );" ); - } - EndBlock(); - } - - - private void CallbackCall( SteamApiDefinition.StructDef c ) - { - WriteLine( "//" ); - WriteLine( "// Create the functions we need for the vtable" ); - WriteLine( "//" ); - - StartBlock( "if ( Facepunch.Steamworks.Config.UseThisCall )" ); - { - CallFunctions( c, "ThisCall", "_" ); - } - Else(); - { - CallFunctions( c, "StdCall", "" ); - } - EndBlock(); - - WriteLine( "" ); - WriteLine( "//" ); - WriteLine( "// Create the callback object" ); - WriteLine( "//" ); - WriteLine( $"var cb = new Callback();" ); - WriteLine( $"cb.vTablePtr = handle.vTablePtr;" ); - WriteLine( $"cb.CallbackFlags = steamworks.IsGameServer ? (byte) SteamNative.Callback.Flags.GameServer : (byte) 0;" ); - WriteLine( $"cb.CallbackId = CallbackId;" ); - - WriteLine( "" ); - WriteLine( "//" ); - WriteLine( "// Pin the callback, so it doesn't get garbage collected and we can pass the pointer to native" ); - WriteLine( "//" ); - WriteLine( $"handle.PinnedCallback = GCHandle.Alloc( cb, GCHandleType.Pinned );" ); - } - - private void CallFunctions( SteamApiDefinition.StructDef c, string ThisCall, string ThisArg ) - { - var ThisArgC = ThisArg.Length > 0 ? $"{ThisArg}, " : ""; - var This = ThisArg.Length > 0 ? "This" : ""; - - WriteLine( "//" ); - WriteLine( "// Create the VTable by manually allocating the memory and copying across" ); - WriteLine( "//" ); - StartBlock( "if ( Platform.IsWindows )" ); - { - WriteLine( $"handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTableWin{This} ) ) );" ); - StartBlock( $"var vTable = new Callback.VTableWin{This}" ); - { - WriteLine( $"ResultA = OnResult{This}," ); - WriteLine( $"ResultB = OnResultWithInfo{This}," ); - WriteLine( $"GetSize = OnGetSize{This}," ); - } - EndBlock( ";" ); - - WriteLine( "handle.FuncA = GCHandle.Alloc( vTable.ResultA );" ); - WriteLine( "handle.FuncB = GCHandle.Alloc( vTable.ResultB );" ); - WriteLine( "handle.FuncC = GCHandle.Alloc( vTable.GetSize );" ); - - WriteLine( "Marshal.StructureToPtr( vTable, handle.vTablePtr, false );" ); - } - Else(); - { - WriteLine( $"handle.vTablePtr = Marshal.AllocHGlobal( Marshal.SizeOf( typeof( Callback.VTable{This} ) ) );" ); - StartBlock( $"var vTable = new Callback.VTable{This}" ); - { - WriteLine( $"ResultA = OnResult{This}," ); - WriteLine( $"ResultB = OnResultWithInfo{This}," ); - WriteLine( $"GetSize = OnGetSize{This}," ); - } - EndBlock( ";" ); - - WriteLine( "handle.FuncA = GCHandle.Alloc( vTable.ResultA );" ); - WriteLine( "handle.FuncB = GCHandle.Alloc( vTable.ResultB );" ); - WriteLine( "handle.FuncC = GCHandle.Alloc( vTable.GetSize );" ); - - WriteLine( "Marshal.StructureToPtr( vTable, handle.vTablePtr, false );" ); - } - EndBlock(); - - - } } } diff --git a/Generator/CodeWriter/Types.cs b/Generator/CodeWriter/Types.cs index 759c74b..a4f2b1b 100644 --- a/Generator/CodeWriter/Types.cs +++ b/Generator/CodeWriter/Types.cs @@ -37,28 +37,35 @@ namespace Generator { foreach ( var o in def.typedefs.Where( x => !x.Name.Contains( "::" ) ) ) { - if ( SkipTypes.Contains( o.Name ) ) + var typeName = Cleanup.ConvertType( o.Name ); + + if ( !Cleanup.ShouldCreate( typeName ) ) + continue; + + if ( SkipTypes.Contains( o.Name ) ) continue; if ( SkipTypesStartingWith.Any( x => o.Name.StartsWith( x ) ) ) continue; - StartBlock( $"internal struct {o.Name}" ); + StartBlock( $"{Cleanup.Expose( typeName )} struct {typeName} : IEquatable<{typeName}>, IComparable<{typeName}>" ); { - WriteLine( $"public {ToManagedType( o.Type )} Value;" ); - WriteLine(); - StartBlock( $"public static implicit operator {o.Name}( {ToManagedType( o.Type )} value )" ); - { - WriteLine( $"return new {o.Name}(){{ Value = value }};" ); - } - EndBlock(); - WriteLine(); - StartBlock( $"public static implicit operator {ToManagedType( o.Type )}( {o.Name} value )" ); - { - WriteLine( $"return value.Value;" ); - } - EndBlock(); - } + WriteLine( $"public {ToManagedType( o.Type )} Value;" ); + WriteLine(); + WriteLine( $"public static implicit operator {typeName}( {ToManagedType( o.Type )} value ) => new {typeName}(){{ Value = value }};" ); + WriteLine( $"public static implicit operator {ToManagedType( o.Type )}( {typeName} value ) => value.Value;" ); + WriteLine( $"public override string ToString() => Value.ToString();" ); + WriteLine( $"public override int GetHashCode() => Value.GetHashCode();" ); + WriteLine( $"public override bool Equals( object p ) => this.Equals( ({typeName}) p );" ); + WriteLine( $"public bool Equals( {typeName} p ) => p.Value == Value;" ); + WriteLine( $"public static bool operator ==( {typeName} a, {typeName} b ) => a.Equals( b );" ); + WriteLine( $"public static bool operator !=( {typeName} a, {typeName} b ) => !a.Equals( b );" ); + + if ( ToManagedType( o.Type ) == "IntPtr" ) + WriteLine( $"public int CompareTo( {typeName} other ) => Value.ToInt64().CompareTo( other.Value.ToInt64() );" ); + else + WriteLine( $"public int CompareTo( {typeName} other ) => Value.CompareTo( other.Value );" ); + } EndBlock(); WriteLine(); } diff --git a/Generator/CodeWriter/Types/BaseType.cs b/Generator/CodeWriter/Types/BaseType.cs new file mode 100644 index 0000000..1e03c50 --- /dev/null +++ b/Generator/CodeWriter/Types/BaseType.cs @@ -0,0 +1,268 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +internal class BaseType +{ + public string VarName; + public string NativeType; + public virtual string TypeName => $"{NativeType}"; + public virtual string TypeNameFrom => TypeName; + + public string Func; + + public virtual bool WindowsSpecific => false; + + public static BaseType Parse( string type, string varname = null ) + { + type = Cleanup.ConvertType( type ); + + if ( varname == "ppOutMessages" ) return new PointerType { NativeType = "void *", VarName = varname }; + if ( type == "SteamAPIWarningMessageHook_t" ) return new PointerType { NativeType = type, VarName = varname }; + + if ( type == "SteamAPICall_t" ) return new SteamApiCallType { NativeType = type, VarName = varname }; + + if ( type == "void" ) return new VoidType { NativeType = type, VarName = varname }; + if ( type.Replace( " ", "" ).StartsWith( "constchar*" ) ) return new ConstCharType { NativeType = type, VarName = varname }; + if ( type == "char *" ) return new StringType { NativeType = type, VarName = varname }; + + var basicType = type.Replace( "const ", "" ).Trim( ' ', '*', '&' ); + + if ( basicType == "void" ) return new PointerType { NativeType = type, VarName = varname }; + if ( basicType.StartsWith( "ISteam" ) ) return new PointerType { NativeType = type, VarName = varname }; + if ( basicType == "const void" ) return new PointerType { NativeType = type, VarName = varname }; + if ( basicType == "int32" || basicType == "int" ) return new IntType { NativeType = type, VarName = varname }; + if ( basicType == "uint32" ) return new UIntType { NativeType = type, VarName = varname }; + if ( basicType == "unsigned int" ) return new UIntType { NativeType = type, VarName = varname }; + if ( basicType == "uint8" ) return new UInt8Type { NativeType = type, VarName = varname }; + if ( basicType == "uint16" ) return new UInt16Type { NativeType = type, VarName = varname }; + if ( basicType == "unsigned short" ) return new UInt16Type { NativeType = type, VarName = varname }; + if ( basicType == "SteamId" ) return new CSteamIdType { NativeType = type, VarName = varname }; + + // DANGER DANGER Danger + if ( basicType == "size_t" ) return new ULongType { NativeType = type, VarName = varname }; + if ( basicType == "intptr_t" ) return new LongType { NativeType = type, VarName = varname }; + if ( basicType == "ptrdiff_t" ) return new LongType { NativeType = type, VarName = varname }; + + if ( basicType == "uint64" ) return new ULongType { NativeType = type, VarName = varname }; + if ( basicType == "int64" ) return new LongType { NativeType = type, VarName = varname }; + if ( basicType == "bool" ) return new BoolType { NativeType = type, VarName = varname }; + + if ( basicType.EndsWith( "_t" ) ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "InventoryItemId" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "InventoryDefId" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "PingLocation" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "NetIdentity" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "NetAddress" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "ConnectionInfo" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "DigitalState" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "AnalogState" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType == "MotionState" ) return new StructType { NativeType = type, VarName = varname, StructName = basicType }; + if ( basicType.StartsWith( "E" ) && char.IsUpper( basicType[1] ) ) return new EnumType { NativeType = type.Substring( 1 ), VarName = varname }; + + return new BaseType { NativeType = type, VarName = varname }; + } + + public virtual bool ShouldSkipAsArgument => false; + + public virtual string AsNativeArgument() => AsArgument(); + public virtual string AsArgument() => IsVector ? $"[In,Out] {Ref}{TypeName.Trim( '*', ' ' )}[] {VarName}" : $"{Ref}{TypeName.Trim( '*', ' ' )} {VarName}"; + public virtual string AsCallArgument() => $"{Ref}{VarName}"; + + public virtual string Return( string varname ) => $"return {varname};"; + public virtual string ReturnAttribute => null; + + public virtual string ReturnType => TypeName; + + public virtual string Ref => !IsVector && NativeType.EndsWith( "*" ) || NativeType.EndsWith( "**" ) || NativeType.Contains( "&" ) ? "ref " : ""; + public virtual bool IsVector + { + get + { + if ( Func == "ReadP2PPacket" ) return false; + if ( Func == "SendP2PPacket" ) return false; + + if ( VarName == "pOut" ) return false; + if ( VarName == "pOutBuffer" ) return false; + if ( VarName == "pubRGB" ) return false; + if ( VarName == "pOutResultHandle" ) return false; + if ( VarName == "pOutDataType" ) return false; + + if ( VarName == "psteamIDClans" ) return true; + if ( VarName == "pScoreDetails" ) return true; + if ( VarName == "prgUsers" ) return true; + if ( VarName == "pBasePrices" ) return true; + if ( VarName == "pCurrentPrices" ) return true; + if ( VarName == "pItemDefIDs" ) return true; + if ( VarName == "handlesOut" ) return true; + if ( VarName == "pDetails" && Func == "GetDownloadedLeaderboardEntry" ) return true; + if ( VarName == "pData" && NativeType.EndsWith( "*" ) && Func.StartsWith( "GetGlobalStatHistory" ) ) return true; + if ( NativeType.EndsWith( "**" ) ) return true; + if ( VarName.StartsWith( "pArray" ) ) return true; + if ( VarName.StartsWith( "punArray" ) ) return true; + + if ( NativeType.EndsWith( "*" ) ) + { + if ( VarName.StartsWith( "pvec" ) ) return true; + if ( VarName.StartsWith( "pub" ) ) return true; + if ( VarName.StartsWith( "pOut" ) ) return true; + } + + return false; + } + } + + + public virtual bool IsVoid => false; + public virtual bool IsReturnedWeird => false; +} + + +internal class BoolType : BaseType +{ + public override string TypeName => $"bool"; + public override string AsArgument() => $"[MarshalAs( UnmanagedType.U1 )] {Ref}{TypeName} {VarName}"; + public override string ReturnAttribute => "[return: MarshalAs( UnmanagedType.I1 )]"; + +} + +internal class StructType : BaseType +{ + public string StructName; + + public override string TypeName => StructName; + + public override string TypeNameFrom => NativeType.EndsWith( "*" ) ? "IntPtr" : base.ReturnType; + + public override string Return( string varname ) + { + if ( NativeType.EndsWith( "*" ) ) + { + return $"return {TypeName}.Fill( {varname} );"; + } + + return base.Return( varname ); + } + + public override bool WindowsSpecific + { + get + { + var s = Generator.Program.Definitions.structs.FirstOrDefault( x => x.Name == StructName ); + if ( s == null ) return false; + + return !s.IsPack4OnWindows; + } + } + + + static string[] SpecialTypes = new string[] + { + "DigitalState", + "AnalogState", + "MotionState", + }; + + public override bool IsReturnedWeird => SpecialTypes.Contains( StructName ); +} + +internal class SteamApiCallType : BaseType +{ + public string CallResult; + public override string TypeName => "SteamAPICall_t"; + public override string Return( string varname ) => $"return await {CallResult}.GetResultAsync( {varname} );"; + public override string ReturnType => $"async Task<{CallResult}?>"; +} + +internal class CSteamIdType : BaseType +{ + public override bool IsReturnedWeird => true; +} + +internal class IntType : BaseType +{ + public override string TypeName => $"int"; +} + +internal class UIntType : BaseType +{ + public override string TypeName => $"uint"; +} +internal class UInt8Type : BaseType +{ + public override string TypeName => $"byte"; +} + +internal class UInt16Type : BaseType +{ + public override string TypeName => $"ushort"; +} + +internal class PointerType : BaseType +{ + public override string TypeName => $"IntPtr"; + public override string Ref => ""; +} + +internal class ULongType : BaseType +{ + public override string TypeName => $"ulong"; +} + +internal class LongType : BaseType +{ + public override string TypeName => $"long"; +} + +internal class ConstCharType : BaseType +{ + public override string TypeName => $"string"; + public override string TypeNameFrom => $"Utf8StringPointer"; + public override string AsArgument() => $"[MarshalAs( UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof( Utf8StringToNative ) )] {Ref}{TypeName} {VarName}"; + public override string Ref => ""; +} + +internal class StringType : BaseType +{ + public override string TypeName => $"string"; + public override string AsArgument() => $"out string {VarName}"; + + public override string AsNativeArgument() => $"IntPtr {VarName}"; + + public override string AsCallArgument() => $"mem{VarName}"; + public override string Ref => ""; +} + +internal class VoidType : BaseType +{ + public override string TypeName => $"void"; + public override string TypeNameFrom => $"void"; + public override string Return( string varname ) => $""; + public override bool IsVoid => true; +} + +internal class EnumType : BaseType +{ + +} + +internal class ConstValueType : BaseType +{ + private string Value; + BaseType basetype; + + public ConstValueType( BaseType basetype, string value ) + { + this.basetype = basetype; + this.Value = value; + } + + public override bool ShouldSkipAsArgument => true; + + public override string Ref => ""; + public override bool IsVector => false; + public override string AsArgument() => basetype.AsArgument(); + public override string AsCallArgument() => Value; +} \ No newline at end of file diff --git a/Generator/CodeWriter/Utility.cs b/Generator/CodeWriter/Utility.cs index e6e5623..308b209 100644 --- a/Generator/CodeWriter/Utility.cs +++ b/Generator/CodeWriter/Utility.cs @@ -8,28 +8,6 @@ namespace Generator { public partial class CodeWriter { - static string[] IgnoredClasses = new string[] - { - "ISteamMatchmakingPingResponse", - "ISteamMatchmakingServerListResponse", - "ISteamMatchmakingPlayersResponse", - "ISteamMatchmakingRulesResponse", - "ISteamMatchmakingPingResponse", - }; - - public static bool ShouldIgnoreClass( string name ) - { - return IgnoredClasses.Contains( name ); - } - - public string InterfaceNameToClass( string name ) - { - if ( name[0] == 'I' ) - name = name.Substring( 1 ); - - return name; - } - string CleanMemberName( string m ) { if ( m == "m_pubParam" ) return "ParamPtr"; @@ -72,7 +50,9 @@ namespace Generator type = type.Replace( "union ", "" ); type = type.Replace( "enum ", "" ); - switch ( type ) + type = Cleanup.ConvertType( type ); + + switch ( type ) { case "uint64": return "ulong"; case "uint32": return "uint"; @@ -88,7 +68,7 @@ namespace Generator case "uint16": return "ushort"; case "const char *": return "string"; case "_Bool": return "bool"; - case "CSteamID": return "ulong"; + case "SteamId": return "ulong"; case "SteamAPIWarningMessageHook_t": return "IntPtr"; } diff --git a/Generator/Generator.csproj b/Generator/Generator.csproj index 64bfb3d..009fd46 100644 --- a/Generator/Generator.csproj +++ b/Generator/Generator.csproj @@ -47,24 +47,26 @@ - + - + + + + - + - diff --git a/Generator/Program.cs b/Generator/Program.cs index 47512fb..57f9790 100644 --- a/Generator/Program.cs +++ b/Generator/Program.cs @@ -9,7 +9,9 @@ namespace Generator { class Program { - static void Main( string[] args ) + public static SteamApiDefinition Definitions; + + static void Main( string[] args ) { var content = System.IO.File.ReadAllText( "steam_sdk/steam_api.json" ); var def = Newtonsoft.Json.JsonConvert.DeserializeObject( content ); @@ -18,11 +20,14 @@ namespace Generator var parser = new CodeParser( @"steam_sdk" ); - parser.ExtendDefinition( def ); + parser.ParseClasses(); + parser.ExtendDefinition( def ); - var generator = new CodeWriter( def ); + Definitions = def; - generator.ToFolder( "../Facepunch.Steamworks/SteamNative/" ); + var generator = new CodeWriter( parser, def ); + + generator.ToFolder( "../Facepunch.Steamworks/Generated/" ); } private static void AddMissing( SteamApiDefinition output ) diff --git a/Generator/SteamApiDefinition.cs b/Generator/SteamApiDefinition.cs index f0b7b02..fa159df 100644 --- a/Generator/SteamApiDefinition.cs +++ b/Generator/SteamApiDefinition.cs @@ -54,6 +54,22 @@ namespace Generator public string CallbackId { get; set; } public bool IsCallResult { get; set; } + + + public bool IsPack4OnWindows + { + get + { + // 4/8 packing is irrevant to these classes + if ( Name.Contains( "MatchMakingKeyValuePair_t" ) ) return true; + + if ( Fields.Any( x => x.Type.Contains( "CSteamID" ) ) ) + return true; + + return false; + } + } + } public List structs { get; set; } diff --git a/Generator/steam_api_missing.json b/Generator/steam_api_missing.json index 642d738..c058d0d 100644 --- a/Generator/steam_api_missing.json +++ b/Generator/steam_api_missing.json @@ -1,281 +1,450 @@ { - "structs": - [ - { - "struct": "ItemInstalled_t", - "fields": - [ - { - "fieldname": "m_unAppID", - "fieldtype": "AppId_t" - }, - { - "fieldname": "m_nPublishedFileId", - "fieldtype": "PublishedFileId_t" - } - ] - }, + "structs": [ + + + + { + "struct": "AvailableBeaconLocationsUpdated_t", + "fields": [ ] + }, + { + "struct": "ActiveBeaconsUpdated_t", + "fields": [ ] + }, - { - "struct": "SteamInventoryDefinitionUpdate_t" - }, + { + "struct": "PlaybackStatusHasChanged_t", + "fields": [ ] + }, - { - "struct": "SteamParentalSettingsChanged_t" - }, + { + "struct": "BroadcastUploadStart_t", + "fields": [ ] + }, + + { + "struct": "NewUrlLaunchParameters_t", + "fields": [ ] + }, + + { + "struct": "ItemInstalled_t", + "fields": [ + { + "fieldname": "m_unAppID", + "fieldtype": "AppId_t" + }, + { + "fieldname": "m_nPublishedFileId", + "fieldtype": "PublishedFileId_t" + } + ] + }, - { - "struct": "SteamServersConnected_t" - }, - { - "struct": "NewLaunchQueryParameters_t" - }, + { + "struct": "SteamNetConnectionStatusChangedCallback_t", + "fields": [ + { + "fieldname": "m_hConn", + "fieldtype": "HSteamNetConnection" + }, + { + "fieldname": "m_info", + "fieldtype": "SteamNetConnectionInfo_t" + }, + { + "fieldname": "m_eOldState", + "fieldtype": "ESteamNetworkingConnectionState" + } + ] + }, + + { + "struct": "InputAnalogActionData_t", + "fields": [ + { + "fieldname": "eMode", + "fieldtype": "EInputSourceMode" + }, + { + "fieldname": "x", + "fieldtype": "float" + }, + { + "fieldname": "y", + "fieldtype": "float" + }, + { + "fieldname": "bActive", + "fieldtype": "bool" + } + ] + }, + + { + "struct": "InputMotionData_t", + "fields": [ + { + "fieldname": "rotQuatX", + "fieldtype": "float" + }, + + { + "fieldname": "rotQuatY", + "fieldtype": "float" + }, + + { + "fieldname": "rotQuatZ", + "fieldtype": "float" + }, + + { + "fieldname": "rotQuatW", + "fieldtype": "float" + }, + + { + "fieldname": "posAccelX", + "fieldtype": "float" + }, + + { + "fieldname": "posAccelY", + "fieldtype": "float" + }, + + { + "fieldname": "posAccelZ", + "fieldtype": "float" + }, + + { + "fieldname": "rotVelX", + "fieldtype": "float" + }, + + { + "fieldname": "rotVelY", + "fieldtype": "float" + }, + + { + "fieldname": "rotVelZ", + "fieldtype": "float" + } + + ] + }, + + { + "struct": "InputDigitalActionData_t", + "fields": [ + { + "fieldname": "bState", + "fieldtype": "bool" + }, + { + "fieldname": "bActive", + "fieldtype": "bool" + } + ] + }, + + { + "struct": "SteamInventoryDefinitionUpdate_t" + }, + + { + "struct": "SteamParentalSettingsChanged_t" + }, + + { + "struct": "SteamServersConnected_t" + }, + { + "struct": "NewLaunchQueryParameters_t" + }, + + { + "struct": "GCMessageAvailable_t", + "fields": [ + { + "fieldname": "m_nMessageSize", + "fieldtype": "uint32" + } + ] + }, + { + "struct": "GCMessageFailed_t" + }, + { + "struct": "ScreenshotRequested_t" + }, + { + "struct": "LicensesUpdated_t" + }, + { + "struct": "SteamShutdown_t" + }, + { + "struct": "IPCountry_t" + }, + { + "struct": "IPCFailure_t", + "fields": [ + { + "fieldname": "m_eFailureType", + "fieldtype": "uint8" + } + ] + } + ], + + "methods": + [ + { + "classname": "SteamApi", + "methodname": "SteamAPI_Init", + "returntype": "bool", + "NeedsSelfPointer": false + }, + + { + "classname": "SteamApi", + "methodname": "SteamAPI_RunCallbacks", + "returntype": "void", + "NeedsSelfPointer": false + }, + + + { + "classname": "SteamApi", + "methodname": "SteamGameServer_RunCallbacks", + "returntype": "void", + "NeedsSelfPointer": false + }, + + + { + "classname": "SteamApi", + "methodname": "SteamAPI_RegisterCallback", + "returntype": "void", + "NeedsSelfPointer": false, + "params": + [ + { + "paramname": "pCallback", + "paramtype": "void *" + }, + + { + "paramname": "callback", + "paramtype": "int" + } + ] + }, + + + { + "classname": "SteamApi", + "methodname": "SteamAPI_UnregisterCallback", + "returntype": "void", + "NeedsSelfPointer": false, + "params": + [ + { + "paramname": "pCallback", + "paramtype": "void *" + } + ] + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_RegisterCallResult", + "returntype": "void", + "params": + [ + { + "paramname": "pCallback", + "paramtype": "void *" + }, + { + "paramname": "callback", + "paramtype": "SteamAPICall_t" + } + ] + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_UnregisterCallResult", + "returntype": "void", + "params": + [ + { + "paramname": "pCallback", + "paramtype": "void *" + }, + { + "paramname": "callback", + "paramtype": "SteamAPICall_t" + } + ] + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamInternal_GameServer_Init", + "returntype": "bool", + "params": + [ + { + "paramname": "unIP", + "paramtype": "uint32" + }, + { + "paramname": "usPort", + "paramtype": "uint16" + }, + { + "paramname": "usGamePort", + "paramtype": "uint16" + }, + { + "paramname": "usQueryPort", + "paramtype": "uint16" + }, + { + "paramname": "eServerMode", + "paramtype": "int" + }, + { + "paramname": "pchVersionString", + "paramtype": "const char *" + } + ] + }, - { - "struct": "GCMessageAvailable_t", - "fields": - [ - { - "fieldname": "m_nMessageSize", - "fieldtype": "uint32" - } - ] - }, - { - "struct": "GCMessageFailed_t" - }, - { - "struct": "ScreenshotRequested_t" - }, - { - "struct": "LicensesUpdated_t" - }, - { - "struct": "SteamShutdown_t" - }, - { - "struct": "IPCountry_t" - }, - { - "struct": "IPCFailure_t", - "fields": - [ - { - "fieldname": "m_eFailureType", - "fieldtype": "uint8" - } - ] - } - ], + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamInternal_FindOrCreateUserInterface", + "returntype": "void *", + "params": + [ + { + "paramname": "steamuser", + "paramtype": "int32" + }, + { + "paramname": "versionname", + "paramtype": "const char *" + } + ] + }, - "methods": - [ - { - "classname": "SteamApi", - "methodname": "SteamAPI_Init", - "returntype": "bool", - "NeedsSelfPointer": false - }, - - { - "classname": "SteamApi", - "methodname": "SteamAPI_RunCallbacks", - "returntype": "void", - "NeedsSelfPointer": false - }, - - - { - "classname": "SteamApi", - "methodname": "SteamGameServer_RunCallbacks", - "returntype": "void", - "NeedsSelfPointer": false - }, - - - { - "classname": "SteamApi", - "methodname": "SteamAPI_RegisterCallback", - "returntype": "void", - "NeedsSelfPointer": false, - "params": - [ - { - "paramname": "pCallback", - "paramtype": "void *" - }, - - { - "paramname": "callback", - "paramtype": "int" - } - ] - }, - - - { - "classname": "SteamApi", - "methodname": "SteamAPI_UnregisterCallback", - "returntype": "void", - "NeedsSelfPointer": false, - "params": - [ - { - "paramname": "pCallback", - "paramtype": "void *" - } - ] - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_RegisterCallResult", - "returntype": "void", - "params": - [ - { - "paramname": "pCallback", - "paramtype": "void *" - }, - { - "paramname": "callback", - "paramtype": "SteamAPICall_t" - } - ] - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_UnregisterCallResult", - "returntype": "void", - "params": - [ - { - "paramname": "pCallback", - "paramtype": "void *" - }, - { - "paramname": "callback", - "paramtype": "SteamAPICall_t" - } - ] - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamInternal_GameServer_Init", - "returntype": "bool", - "params": - [ - { - "paramname": "unIP", - "paramtype": "uint32" - }, - { - "paramname": "usPort", - "paramtype": "uint16" - }, - { - "paramname": "usGamePort", - "paramtype": "uint16" - }, - { - "paramname": "usQueryPort", - "paramtype": "uint16" - }, - { - "paramname": "eServerMode", - "paramtype": "int" - }, - { - "paramname": "pchVersionString", - "paramtype": "const char *" - } - ] - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_Shutdown", - "returntype": "void" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamGameServer_Shutdown", - "returntype": "void" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_GetHSteamUser", - "returntype": "HSteamUser" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_GetHSteamPipe", - "returntype": "HSteamPipe" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamGameServer_GetHSteamUser", - "returntype": "HSteamUser" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamGameServer_GetHSteamPipe", - "returntype": "HSteamPipe" - }, - - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamInternal_CreateInterface", - "returntype": "void *", - "params": - [ - { - "paramname": "version", - "paramtype": "const char *" - } - ] - }, - - { - "NeedsSelfPointer": false, - "classname": "SteamApi", - "methodname": "SteamAPI_RestartAppIfNecessary", - "returntype": "bool", - "params": - [ - { - "paramname": "unOwnAppID", - "paramtype": "uint32" - } - ] - } - ] -} \ No newline at end of file + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamInternal_FindOrCreateGameServerInterface", + "returntype": "void *", + "params": + [ + { + "paramname": "steamuser", + "paramtype": "int32" + }, + { + "paramname": "versionname", + "paramtype": "const char *" + } + ] + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_Shutdown", + "returntype": "void" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamGameServer_Shutdown", + "returntype": "void" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_GetHSteamUser", + "returntype": "HSteamUser" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_GetHSteamPipe", + "returntype": "HSteamPipe" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamGameServer_GetHSteamUser", + "returntype": "HSteamUser" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamGameServer_GetHSteamPipe", + "returntype": "HSteamPipe" + }, + + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamInternal_CreateInterface", + "returntype": "void *", + "params": + [ + { + "paramname": "version", + "paramtype": "const char *" + } + ] + }, + + { + "NeedsSelfPointer": false, + "classname": "SteamApi", + "methodname": "SteamAPI_RestartAppIfNecessary", + "returntype": "bool", + "params": + [ + { + "paramname": "unOwnAppID", + "paramtype": "uint32" + } + ] + } + ] + } \ No newline at end of file diff --git a/Generator/steam_sdk/isteamapplist.h b/Generator/steam_sdk/isteamapplist.h index d678909..45441bb 100644 --- a/Generator/steam_sdk/isteamapplist.h +++ b/Generator/steam_sdk/isteamapplist.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "steamtypes.h" //----------------------------------------------------------------------------- @@ -25,7 +25,7 @@ public: virtual uint32 GetNumInstalledApps() = 0; virtual uint32 GetInstalledApps( AppId_t *pvecAppID, uint32 unMaxAppIDs ) = 0; - virtual int GetAppName( AppId_t nAppID, OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found + virtual int GetAppName( AppId_t nAppID, STEAM_OUT_STRING() char *pchName, int cchNameMax ) = 0; // returns -1 if no name was found virtual int GetAppInstallDir( AppId_t nAppID, char *pchDirectory, int cchNameMax ) = 0; // returns -1 if no dir was found virtual int GetAppBuildId( AppId_t nAppID ) = 0; // return the buildid of this app, may change at any time based on backend updates to the game @@ -33,30 +33,34 @@ public: #define STEAMAPPLIST_INTERFACE_VERSION "STEAMAPPLIST_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamAppList *SteamAppList(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamAppList *, SteamAppList, STEAMAPPLIST_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //--------------------------------------------------------------------------------- // Purpose: Sent when a new app is installed //--------------------------------------------------------------------------------- -DEFINE_CALLBACK( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); - CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( SteamAppInstalled_t, k_iSteamAppListCallbacks + 1 ); + STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +STEAM_CALLBACK_END(1) //--------------------------------------------------------------------------------- // Purpose: Sent when an app is uninstalled //--------------------------------------------------------------------------------- -DEFINE_CALLBACK( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); - CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( SteamAppUninstalled_t, k_iSteamAppListCallbacks + 2 ); + STEAM_CALLBACK_MEMBER( 0, AppId_t, m_nAppID ) // ID of the app that installs +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamapps.h b/Generator/steam_sdk/isteamapps.h index 9a97b4a..550cb8f 100644 --- a/Generator/steam_sdk/isteamapps.h +++ b/Generator/steam_sdk/isteamapps.h @@ -10,6 +10,8 @@ #pragma once #endif +#include "steam_api_common.h" + const int k_cubAppProofOfPurchaseKeyMax = 240; // max supported length of a legacy cd key @@ -65,13 +67,16 @@ public: virtual uint32 GetAppInstallDir( AppId_t appID, char *pchFolder, uint32 cchFolderBufferSize ) = 0; virtual bool BIsAppInstalled( AppId_t appID ) = 0; // returns true if that app is installed (not necessarily owned) - virtual CSteamID GetAppOwner() = 0; // returns the SteamID of the original owner. If different from current user, it's borrowed + // returns the SteamID of the original owner. If this CSteamID is different from ISteamUser::GetSteamID(), + // the user has a temporary license borrowed via Family Sharing + virtual CSteamID GetAppOwner() = 0; - // Returns the associated launch param if the game is run via steam://run///?param1=value1;param2=value2;param3=value3 etc. + // Returns the associated launch param if the game is run via steam://run///?param1=value1¶m2=value2¶m3=value3 etc. // Parameter names starting with the character '@' are reserved for internal use and will always return and empty string. // Parameter names starting with an underscore '_' are reserved for steam features -- they can be queried by the game, // but it is advised that you not param names beginning with an underscore for your own features. - virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; + // Check for new launch parameters on callback NewUrlLaunchParameters_t + virtual const char *GetLaunchQueryParam( const char *pchKey ) = 0; // get download progress for optional DLC virtual bool GetDlcDownloadProgress( AppId_t nAppID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; @@ -85,19 +90,40 @@ public: // member is k_uAppIdInvalid (zero). virtual void RequestAllProofOfPurchaseKeys() = 0; - CALL_RESULT( FileDetailsResult_t ) + STEAM_CALL_RESULT( FileDetailsResult_t ) virtual SteamAPICall_t GetFileDetails( const char* pszFileName ) = 0; + + // Get command line if game was launched via Steam URL, e.g. steam://run////. + // This method of passing a connect string (used when joining via rich presence, accepting an + // invite, etc) is preferable to passing the connect string on the operating system command + // line, which is a security risk. In order for rich presence joins to go through this + // path and not be placed on the OS command line, you must set a value in your app's + // configuration on Steam. Ask Valve for help with this. + // + // If game was already running and launched again, the NewUrlLaunchParameters_t will be fired. + virtual int GetLaunchCommandLine( char *pszCommandLine, int cubCommandLine ) = 0; + + // Check if user borrowed this game via Family Sharing, If true, call GetAppOwner() to get the lender SteamID + virtual bool BIsSubscribedFromFamilySharing() = 0; }; #define STEAMAPPS_INTERFACE_VERSION "STEAMAPPS_INTERFACE_VERSION008" +// Global interface accessor +inline ISteamApps *SteamApps(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamApps *, SteamApps, STEAMAPPS_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamApps *SteamGameServerApps(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamApps *, SteamGameServerApps, STEAMAPPS_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- // Purpose: posted after the user gains ownership of DLC & that DLC is installed @@ -134,12 +160,12 @@ struct RegisterActivationCodeResponse_t //--------------------------------------------------------------------------------- -// Purpose: posted after the user gains executes a steam url with query parameters -// such as steam://run///?param1=value1;param2=value2;param3=value3; etc +// Purpose: posted after the user gains executes a Steam URL with command line or query parameters +// such as steam://run///-commandline/?param1=value1¶m2=value2¶m3=value3 etc // while the game is already running. The new params can be queried -// with GetLaunchQueryParam. +// with GetLaunchQueryParam and GetLaunchCommandLine //--------------------------------------------------------------------------------- -struct NewLaunchQueryParameters_t +struct NewUrlLaunchParameters_t { enum { k_iCallback = k_iSteamAppsCallbacks + 14 }; }; diff --git a/Generator/steam_sdk/isteamclient.h b/Generator/steam_sdk/isteamclient.h index af8828d..72115b9 100644 --- a/Generator/steam_sdk/isteamclient.h +++ b/Generator/steam_sdk/isteamclient.h @@ -1,8 +1,9 @@ -//====== Copyright � 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: Main interface for loading and accessing Steamworks API's from the -// Steam client. -// For most uses, this code is wrapped inside of SteamAPI_Init() +// Internal low-level access to Steamworks interfaces. +// +// Most users of the Steamworks SDK do not need to include this file. +// You should only include this if you are doing something special. //============================================================================= #ifndef ISTEAMCLIENT_H @@ -11,102 +12,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" - -// Define compile time assert macros to let us validate the structure sizes. -#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; - -#ifndef REFERENCE -#define REFERENCE(arg) ((void)arg) -#endif - -#if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) -#define STEAM_PRIVATE_API( ... ) __VA_ARGS__ -#elif defined(STEAM_API_EXPORTS) && defined(API_GEN) -#define STEAM_PRIVATE_API( ... ) -#else -#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public: -#endif - -#if defined(__linux__) || defined(__APPLE__) -// The 32-bit version of gcc has the alignment requirement for uint64 and double set to -// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. -// The 64-bit version of gcc has the alignment requirement for these types set to -// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. -// The 64-bit structure packing has to match the 32-bit structure packing for each platform. -#define VALVE_CALLBACK_PACK_SMALL -#else -#define VALVE_CALLBACK_PACK_LARGE -#endif - -#if defined( VALVE_CALLBACK_PACK_SMALL ) -#pragma pack( push, 4 ) -#elif defined( VALVE_CALLBACK_PACK_LARGE ) -#pragma pack( push, 8 ) -#else -#error ??? -#endif - -typedef struct ValvePackingSentinel_t -{ - uint32 m_u32; - uint64 m_u64; - uint16 m_u16; - double m_d; -} ValvePackingSentinel_t; - -#pragma pack( pop ) - - -#if defined(VALVE_CALLBACK_PACK_SMALL) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) -#elif defined(VALVE_CALLBACK_PACK_LARGE) -VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) -#else -#error ??? -#endif - - -// handle to a communication pipe to the Steam client -typedef int32 HSteamPipe; -// handle to single instance of a steam user -typedef int32 HSteamUser; -// function prototype -#if defined( POSIX ) -#define __cdecl -#endif -extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); -extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); -#if defined( __SNC__ ) - #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor -#endif - -// interface predec -class ISteamUser; -class ISteamGameServer; -class ISteamFriends; -class ISteamUtils; -class ISteamMatchmaking; -class ISteamContentServer; -class ISteamMatchmakingServers; -class ISteamUserStats; -class ISteamApps; -class ISteamNetworking; -class ISteamRemoteStorage; -class ISteamScreenshots; -class ISteamMusic; -class ISteamMusicRemote; -class ISteamGameServerStats; -class ISteamPS3OverlayRender; -class ISteamHTTP; -class ISteamController; -class ISteamUGC; -class ISteamAppList; -class ISteamHTMLSurface; -class ISteamInventory; -class ISteamVideo; -class ISteamParentalSettings; +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: Interface to creating a new steam instance, or to @@ -185,6 +91,9 @@ public: // user screenshots virtual ISteamScreenshots *GetISteamScreenshots( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + // game search + virtual ISteamGameSearch *GetISteamGameSearch( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + // Deprecated. Applications should use SteamAPI_RunCallbacks() or SteamGameServer_RunCallbacks() instead. STEAM_PRIVATE_API( virtual void RunFrame() = 0; ) @@ -209,7 +118,7 @@ public: // Deprecated - the ISteamUnifiedMessages interface is no longer intended for public consumption. STEAM_PRIVATE_API( virtual void *DEPRECATED_GetISteamUnifiedMessages( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0 ; ) - // Exposes the ISteamController interface + // Exposes the ISteamController interface - deprecated in favor of Steam Input virtual ISteamController *GetISteamController( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; // Exposes the ISteamUGC interface @@ -240,287 +149,26 @@ public: // Parental controls virtual ISteamParentalSettings *GetISteamParentalSettings( HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Exposes the Steam Input interface for controller support + virtual ISteamInput *GetISteamInput( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + + // Steam Parties interface + virtual ISteamParties *GetISteamParties( HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char *pchVersion ) = 0; + }; +#define STEAMCLIENT_INTERFACE_VERSION "SteamClient018" +#ifndef STEAM_API_EXPORTS -#define STEAMCLIENT_INTERFACE_VERSION "SteamClient017" +// Global ISteamClient interface accessor +inline ISteamClient *SteamClient(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamClient *, SteamClient, SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ) ); -//----------------------------------------------------------------------------- -// Purpose: Base values for callback identifiers, each callback must -// have a unique ID. -//----------------------------------------------------------------------------- -enum { k_iSteamUserCallbacks = 100 }; -enum { k_iSteamGameServerCallbacks = 200 }; -enum { k_iSteamFriendsCallbacks = 300 }; -enum { k_iSteamBillingCallbacks = 400 }; -enum { k_iSteamMatchmakingCallbacks = 500 }; -enum { k_iSteamContentServerCallbacks = 600 }; -enum { k_iSteamUtilsCallbacks = 700 }; -enum { k_iClientFriendsCallbacks = 800 }; -enum { k_iClientUserCallbacks = 900 }; -enum { k_iSteamAppsCallbacks = 1000 }; -enum { k_iSteamUserStatsCallbacks = 1100 }; -enum { k_iSteamNetworkingCallbacks = 1200 }; -enum { k_iClientRemoteStorageCallbacks = 1300 }; -enum { k_iClientDepotBuilderCallbacks = 1400 }; -enum { k_iSteamGameServerItemsCallbacks = 1500 }; -enum { k_iClientUtilsCallbacks = 1600 }; -enum { k_iSteamGameCoordinatorCallbacks = 1700 }; -enum { k_iSteamGameServerStatsCallbacks = 1800 }; -enum { k_iSteam2AsyncCallbacks = 1900 }; -enum { k_iSteamGameStatsCallbacks = 2000 }; -enum { k_iClientHTTPCallbacks = 2100 }; -enum { k_iClientScreenshotsCallbacks = 2200 }; -enum { k_iSteamScreenshotsCallbacks = 2300 }; -enum { k_iClientAudioCallbacks = 2400 }; -enum { k_iClientUnifiedMessagesCallbacks = 2500 }; -enum { k_iSteamStreamLauncherCallbacks = 2600 }; -enum { k_iClientControllerCallbacks = 2700 }; -enum { k_iSteamControllerCallbacks = 2800 }; -enum { k_iClientParentalSettingsCallbacks = 2900 }; -enum { k_iClientDeviceAuthCallbacks = 3000 }; -enum { k_iClientNetworkDeviceManagerCallbacks = 3100 }; -enum { k_iClientMusicCallbacks = 3200 }; -enum { k_iClientRemoteClientManagerCallbacks = 3300 }; -enum { k_iClientUGCCallbacks = 3400 }; -enum { k_iSteamStreamClientCallbacks = 3500 }; -enum { k_IClientProductBuilderCallbacks = 3600 }; -enum { k_iClientShortcutsCallbacks = 3700 }; -enum { k_iClientRemoteControlManagerCallbacks = 3800 }; -enum { k_iSteamAppListCallbacks = 3900 }; -enum { k_iSteamMusicCallbacks = 4000 }; -enum { k_iSteamMusicRemoteCallbacks = 4100 }; -enum { k_iClientVRCallbacks = 4200 }; -enum { k_iClientGameNotificationCallbacks = 4300 }; -enum { k_iSteamGameNotificationCallbacks = 4400 }; -enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; -enum { k_iClientVideoCallbacks = 4600 }; -enum { k_iClientInventoryCallbacks = 4700 }; -enum { k_iClientBluetoothManagerCallbacks = 4800 }; -enum { k_iClientSharedConnectionCallbacks = 4900 }; -enum { k_ISteamParentalSettingsCallbacks = 5000 }; -enum { k_iClientShaderCallbacks = 5100 }; - -//----------------------------------------------------------------------------- -// The CALLBACK macros are for client side callback logging enabled with -// log_callback -// Do not change any of these. -//----------------------------------------------------------------------------- - -#ifdef STEAM_CALLBACK_INSPECTION_ENABLED - -#define DEFINE_CALLBACK( callbackname, callbackid ) \ -struct callbackname { \ - typedef callbackname SteamCallback_t; \ - enum { k_iCallback = callbackid }; \ - static callbackname *GetNullPointer() { return 0; } \ - static const char *GetCallbackName() { return #callbackname; } \ - static uint32 GetCallbackID() { return callbackname::k_iCallback; } - -#define CALLBACK_MEMBER( varidx, vartype, varname ) \ - public: vartype varname ; \ - static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - varOffset = (unsigned int)(size_t)&GetNullPointer()->varname; \ - varSize = sizeof( vartype ); \ - varCount = 1; \ - *pszName = #varname; *pszType = #vartype; } - -#define CALLBACK_ARRAY( varidx, vartype, varname, varcount ) \ - public: vartype varname [ varcount ]; \ - static void GetMemberVar_##varidx( unsigned int &varOffset, unsigned int &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - varOffset = (unsigned int)(size_t)&GetNullPointer()->varname[0]; \ - varSize = sizeof( vartype ); \ - varCount = varcount; \ - *pszName = #varname; *pszType = #vartype; } - - -#define END_CALLBACK_INTERNAL_BEGIN( numvars ) \ - static uint32 GetNumMemberVariables() { return numvars; } \ - static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { \ - switch ( index ) { default : return false; - - -#define END_CALLBACK_INTERNAL_SWITCH( varidx ) case varidx : GetMemberVar_##varidx( varOffset, varSize, varCount, pszName, pszType ); return true; - -#define END_CALLBACK_INTERNAL_END() }; } }; - -#define END_DEFINE_CALLBACK_0() \ - static uint32 GetNumMemberVariables() { return 0; } \ - static bool GetMemberVariable( uint32 index, uint32 &varOffset, uint32 &varSize, uint32 &varCount, const char **pszName, const char **pszType ) { REFERENCE( pszType ); REFERENCE( pszName ); REFERENCE( varCount ); REFERENCE( varSize ); REFERENCE( varOffset ); REFERENCE( index ); return false; } \ - }; - -#else - -#define DEFINE_CALLBACK( callbackname, callbackid ) struct callbackname { typedef callbackname SteamCallback_t; enum { k_iCallback = callbackid }; -#define CALLBACK_MEMBER( varidx, vartype, varname ) public: vartype varname ; -#define CALLBACK_ARRAY( varidx, vartype, varname, varcount ) public: vartype varname [ varcount ]; -#define END_CALLBACK_INTERNAL_BEGIN( numvars ) -#define END_CALLBACK_INTERNAL_SWITCH( varidx ) -#define END_CALLBACK_INTERNAL_END() }; -#define END_DEFINE_CALLBACK_0() }; +// The internal ISteamClient used for the gameserver interface. +// (This is actually the same thing. You really shouldn't need to access any of this stuff directly.) +inline ISteamClient *SteamGameServerClient() { return SteamClient(); } #endif -#define END_DEFINE_CALLBACK_1() \ - END_CALLBACK_INTERNAL_BEGIN( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_2() \ - END_CALLBACK_INTERNAL_BEGIN( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_3() \ - END_CALLBACK_INTERNAL_BEGIN( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_4() \ - END_CALLBACK_INTERNAL_BEGIN( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_5() \ - END_CALLBACK_INTERNAL_BEGIN( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_END() - - -#define END_DEFINE_CALLBACK_6() \ - END_CALLBACK_INTERNAL_BEGIN( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_7() \ - END_CALLBACK_INTERNAL_BEGIN( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_8() \ - END_CALLBACK_INTERNAL_BEGIN( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_9() \ - END_CALLBACK_INTERNAL_BEGIN( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_10() \ - END_CALLBACK_INTERNAL_BEGIN( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_11() \ - END_CALLBACK_INTERNAL_BEGIN( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_12() \ - END_CALLBACK_INTERNAL_BEGIN( 12 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_13() \ - END_CALLBACK_INTERNAL_BEGIN( 13 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 12 ) \ - END_CALLBACK_INTERNAL_END() - -#define END_DEFINE_CALLBACK_14() \ - END_CALLBACK_INTERNAL_BEGIN( 14 ) \ - END_CALLBACK_INTERNAL_SWITCH( 0 ) \ - END_CALLBACK_INTERNAL_SWITCH( 1 ) \ - END_CALLBACK_INTERNAL_SWITCH( 2 ) \ - END_CALLBACK_INTERNAL_SWITCH( 3 ) \ - END_CALLBACK_INTERNAL_SWITCH( 4 ) \ - END_CALLBACK_INTERNAL_SWITCH( 5 ) \ - END_CALLBACK_INTERNAL_SWITCH( 6 ) \ - END_CALLBACK_INTERNAL_SWITCH( 7 ) \ - END_CALLBACK_INTERNAL_SWITCH( 8 ) \ - END_CALLBACK_INTERNAL_SWITCH( 9 ) \ - END_CALLBACK_INTERNAL_SWITCH( 10 ) \ - END_CALLBACK_INTERNAL_SWITCH( 11 ) \ - END_CALLBACK_INTERNAL_SWITCH( 12 ) \ - END_CALLBACK_INTERNAL_SWITCH( 13 ) \ - END_CALLBACK_INTERNAL_END() - #endif // ISTEAMCLIENT_H diff --git a/Generator/steam_sdk/isteamcontroller.h b/Generator/steam_sdk/isteamcontroller.h index 6f31b75..1b1ed78 100644 --- a/Generator/steam_sdk/isteamcontroller.h +++ b/Generator/steam_sdk/isteamcontroller.h @@ -1,6 +1,12 @@ -//====== Copyright 1996-2013, Valve Corporation, All rights reserved. ======= +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// Note: The older ISteamController interface has been deprecated in favor of ISteamInput - this interface +// was updated in this SDK but will be removed from future SDK's. The Steam Client will retain +// compatibility with the older interfaces so your any existing integrations should be unaffected. // -// Purpose: interface to valve controller +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller // //============================================================================= @@ -10,7 +16,8 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" +#include "isteaminput.h" #define STEAM_CONTROLLER_MAX_COUNT 16 @@ -26,11 +33,13 @@ #define STEAM_CONTROLLER_MIN_ANALOG_ACTION_DATA -1.0f #define STEAM_CONTROLLER_MAX_ANALOG_ACTION_DATA 1.0f +#ifndef ISTEAMINPUT_H enum ESteamControllerPad { k_ESteamControllerPad_Left, k_ESteamControllerPad_Right }; +#endif enum EControllerSource { @@ -42,12 +51,15 @@ enum EControllerSource k_EControllerSource_Switch, k_EControllerSource_LeftTrigger, k_EControllerSource_RightTrigger, + k_EControllerSource_LeftBumper, + k_EControllerSource_RightBumper, k_EControllerSource_Gyro, k_EControllerSource_CenterTrackpad, // PS4 k_EControllerSource_RightJoystick, // Traditional Controllers k_EControllerSource_DPad, // Traditional Controllers - k_EControllerSource_Key, // Keyboards with scan codes - k_EControllerSource_Mouse, // Traditional mouse + k_EControllerSource_Key, // Keyboards with scan codes - Unused + k_EControllerSource_Mouse, // Traditional mouse - Unused + k_EControllerSource_LeftGyro, // Secondary Gyro - Switch - Unused k_EControllerSource_Count }; @@ -72,6 +84,10 @@ enum EControllerSourceMode k_EControllerSourceMode_Switches }; +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead +// Versions of Steam that add new controller types in the future will extend this enum if you're +// using a lookup table please check the bounds of any origins returned by Steam. enum EControllerActionOrigin { // Steam Controller @@ -237,9 +253,9 @@ enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Y, k_EControllerActionOrigin_SteamV2_LeftBumper, k_EControllerActionOrigin_SteamV2_RightBumper, - k_EControllerActionOrigin_SteamV2_LeftGrip, - k_EControllerActionOrigin_SteamV2_RightGrip, + k_EControllerActionOrigin_SteamV2_LeftGrip_Lower, k_EControllerActionOrigin_SteamV2_LeftGrip_Upper, + k_EControllerActionOrigin_SteamV2_RightGrip_Lower, k_EControllerActionOrigin_SteamV2_RightGrip_Upper, k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure, k_EControllerActionOrigin_SteamV2_RightBumper_Pressure, @@ -280,13 +296,90 @@ enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Gyro_Yaw, k_EControllerActionOrigin_SteamV2_Gyro_Roll, - k_EControllerActionOrigin_Count + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EControllerActionOrigin_Switch_A, + k_EControllerActionOrigin_Switch_B, + k_EControllerActionOrigin_Switch_X, + k_EControllerActionOrigin_Switch_Y, + k_EControllerActionOrigin_Switch_LeftBumper, + k_EControllerActionOrigin_Switch_RightBumper, + k_EControllerActionOrigin_Switch_Plus, //Start + k_EControllerActionOrigin_Switch_Minus, //Back + k_EControllerActionOrigin_Switch_Capture, + k_EControllerActionOrigin_Switch_LeftTrigger_Pull, + k_EControllerActionOrigin_Switch_LeftTrigger_Click, + k_EControllerActionOrigin_Switch_RightTrigger_Pull, + k_EControllerActionOrigin_Switch_RightTrigger_Click, + k_EControllerActionOrigin_Switch_LeftStick_Move, + k_EControllerActionOrigin_Switch_LeftStick_Click, + k_EControllerActionOrigin_Switch_LeftStick_DPadNorth, + k_EControllerActionOrigin_Switch_LeftStick_DPadSouth, + k_EControllerActionOrigin_Switch_LeftStick_DPadWest, + k_EControllerActionOrigin_Switch_LeftStick_DPadEast, + k_EControllerActionOrigin_Switch_RightStick_Move, + k_EControllerActionOrigin_Switch_RightStick_Click, + k_EControllerActionOrigin_Switch_RightStick_DPadNorth, + k_EControllerActionOrigin_Switch_RightStick_DPadSouth, + k_EControllerActionOrigin_Switch_RightStick_DPadWest, + k_EControllerActionOrigin_Switch_RightStick_DPadEast, + k_EControllerActionOrigin_Switch_DPad_North, + k_EControllerActionOrigin_Switch_DPad_South, + k_EControllerActionOrigin_Switch_DPad_West, + k_EControllerActionOrigin_Switch_DPad_East, + k_EControllerActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EControllerActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + // Switch JoyCon Specific + k_EControllerActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EControllerActionOrigin_Switch_LeftGyro_Move, + k_EControllerActionOrigin_Switch_LeftGyro_Pitch, + k_EControllerActionOrigin_Switch_LeftGyro_Yaw, + k_EControllerActionOrigin_Switch_LeftGyro_Roll, + k_EControllerActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EControllerActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EControllerActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + + k_EControllerActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EControllerActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. }; -enum ESteamControllerLEDFlag +#ifndef ISTEAMINPUT_H +enum EXboxOrigin { - k_ESteamControllerLEDFlag_SetColor, - k_ESteamControllerLEDFlag_RestoreUserDefault + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, }; enum ESteamInputType @@ -295,8 +388,24 @@ enum ESteamInputType k_ESteamInputType_SteamController, k_ESteamInputType_XBox360Controller, k_ESteamInputType_XBoxOneController, - k_ESteamInputType_GenericXInput, + k_ESteamInputType_GenericGamepad, // DirectInput controllers k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; +#endif + +enum ESteamControllerLEDFlag +{ + k_ESteamControllerLEDFlag_SetColor, + k_ESteamControllerLEDFlag_RestoreUserDefault }; // ControllerHandle_t is used to refer to a specific controller. @@ -312,6 +421,11 @@ typedef uint64 ControllerAnalogActionHandle_t; #pragma pack( push, 1 ) +#ifdef ISTEAMINPUT_H +#define ControllerAnalogActionData_t InputAnalogActionData_t +#define ControllerDigitalActionData_t InputDigitalActionData_t +#define ControllerMotionData_t InputMotionData_t +#else struct ControllerAnalogActionData_t { // Type of data coming from this action, this will match what got specified in the action set @@ -351,12 +465,12 @@ struct ControllerMotionData_t float rotVelY; float rotVelZ; }; - +#endif #pragma pack( pop ) //----------------------------------------------------------------------------- -// Purpose: Native Steam controller support API +// Purpose: Steam Input API //----------------------------------------------------------------------------- class ISteamController { @@ -368,7 +482,8 @@ public: // Synchronize API state with the latest Steam Controller inputs available. This // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest - // possible latency, you call this directly before reading controller state. + // possible latency, you call this directly before reading controller state. This must + // be called from somewhere before GetConnectedControllers will return any handles virtual void RunFrame() = 0; // Enumerate currently connected controllers @@ -376,11 +491,10 @@ public: // Returns the number of handles written to handlesOut virtual int GetConnectedControllers( ControllerHandle_t *handlesOut ) = 0; - // Invokes the Steam overlay and brings up the binding screen - // Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode - virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; - + //----------------------------------------------------------------------------- // ACTION SETS + //----------------------------------------------------------------------------- + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. virtual ControllerActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; @@ -390,13 +504,16 @@ public: virtual void ActivateActionSet( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle ) = 0; virtual ControllerActionSetHandle_t GetCurrentActionSet( ControllerHandle_t controllerHandle ) = 0; + // ACTION SET LAYERS virtual void ActivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; virtual void DeactivateActionSetLayer( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetLayerHandle ) = 0; virtual void DeactivateAllActionSetLayers( ControllerHandle_t controllerHandle ) = 0; virtual int GetActiveActionSetLayers( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t *handlesOut ) = 0; - + //----------------------------------------------------------------------------- // ACTIONS + //----------------------------------------------------------------------------- + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. virtual ControllerDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; @@ -404,7 +521,8 @@ public: virtual ControllerDigitalActionData_t GetDigitalActionData( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle ) = 0; // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. - // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. virtual int GetDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin *originsOut ) = 0; // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. @@ -414,11 +532,25 @@ public: virtual ControllerAnalogActionData_t GetAnalogActionData( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle ) = 0; // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. - // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles + // originsOut should point to a STEAM_CONTROLLER_MAX_ORIGINS sized array of EControllerActionOrigin handles. The EControllerActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. virtual int GetAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin *originsOut ) = 0; - - virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + // Get a local path to art for on-screen glyph for a particular origin - this call is cheap + virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized + virtual const char *GetStringForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + + virtual void StopAnalogActionMomentum( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified controller + virtual ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + // Trigger a haptic pulse on a controller virtual void TriggerHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; @@ -426,36 +558,48 @@ public: // nFlags is currently unused and reserved for future use. virtual void TriggerRepeatedHapticPulse( ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; - // Tigger a vibration event on supported controllers. + // Trigger a vibration event on supported controllers. virtual void TriggerVibration( ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; // Set the controller LED color on supported controllers. virtual void SetLEDColor( ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; - // Returns the associated gamepad index for the specified controller, if emulating a gamepad - virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0; - - // Returns the associated controller handle for the specified emulated gamepad - virtual ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; - - // Returns raw motion data from the specified controller - virtual ControllerMotionData_t GetMotionData( ControllerHandle_t controllerHandle ) = 0; - - // Attempt to display origins of given action in the controller HUD, for the currently active action set - // Returns false is overlay is disabled / unavailable, or the user is not in Big Picture mode - virtual bool ShowDigitalActionOrigins( ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition ) = 0; - virtual bool ShowAnalogActionOrigins( ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition ) = 0; + //----------------------------------------------------------------------------- + // Utility functions availible without using the rest of Steam Input API + //----------------------------------------------------------------------------- - // Returns a localized string (from Steam's language setting) for the specified origin - virtual const char *GetStringForActionOrigin( EControllerActionOrigin eOrigin ) = 0; - - // Get a local path to art for on-screen glyph for a particular origin - virtual const char *GetGlyphForActionOrigin( EControllerActionOrigin eOrigin ) = 0; + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( ControllerHandle_t controllerHandle ) = 0; // Returns the input type for a particular handle virtual ESteamInputType GetInputTypeForHandle( ControllerHandle_t controllerHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual ControllerHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( ControllerHandle_t ulControllerHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized. + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EControllerActionOrigin GetActionOriginFromXboxOrigin( ControllerHandle_t controllerHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EControllerActionOrigin_None + virtual EControllerActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin ) = 0; }; -#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController006" +#define STEAMCONTROLLER_INTERFACE_VERSION "SteamController007" + +// Global interface accessor +inline ISteamController *SteamController(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamController *, SteamController, STEAMCONTROLLER_INTERFACE_VERSION ); #endif // ISTEAMCONTROLLER_H diff --git a/Generator/steam_sdk/isteamfriends.h b/Generator/steam_sdk/isteamfriends.h index c1754c2..8a280c3 100644 --- a/Generator/steam_sdk/isteamfriends.h +++ b/Generator/steam_sdk/isteamfriends.h @@ -1,4 +1,4 @@ -//====== Copyright (C) 1996-2008, Valve Corporation, All rights reserved. ===== +//====== Copyright Valve Corporation, All rights reserved. ==================== // // Purpose: interface to both friends list data and general information about users // @@ -10,9 +10,7 @@ #pragma once #endif -#include "isteamclient.h" -#include "steamclientpublic.h" - +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: set of relationships to other users @@ -59,6 +57,7 @@ enum EPersonaState k_EPersonaStateSnooze = 4, // auto-away for a long time k_EPersonaStateLookingToTrade = 5, // Online, trading k_EPersonaStateLookingToPlay = 6, // Online, wanting to play + k_EPersonaStateInvisible = 7, // Online, but appears offline to friends. This status is never published to clients. k_EPersonaStateMax, }; @@ -92,7 +91,7 @@ enum EFriendFlags #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct FriendGameInfo_t { @@ -143,7 +142,7 @@ struct FriendSessionStateInfo_t const uint32 k_cubChatMetadataMax = 8192; // size limits on Rich Presence data -enum { k_cchMaxRichPresenceKeys = 20 }; +enum { k_cchMaxRichPresenceKeys = 30 }; enum { k_cchMaxRichPresenceKeyLength = 64 }; enum { k_cchMaxRichPresenceValueLength = 256 }; @@ -155,6 +154,21 @@ enum EOverlayToStoreFlag k_EOverlayToStoreFlag_AddToCartAndShow = 2, }; + +//----------------------------------------------------------------------------- +// Purpose: Tells Steam where to place the browser window inside the overlay +//----------------------------------------------------------------------------- +enum EActivateGameOverlayToWebPageMode +{ + k_EActivateGameOverlayToWebPageMode_Default = 0, // Browser will open next to all other windows that the user has open in the overlay. + // The window will remain open, even if the user closes then re-opens the overlay. + + k_EActivateGameOverlayToWebPageMode_Modal = 1 // Browser will be opened in a special overlay configuration which hides all other windows + // that the user has open in the overlay. When the user closes the overlay, the browser window + // will also close. When the user closes the browser window, the overlay will automatically close. +}; + + //----------------------------------------------------------------------------- // Purpose: interface to accessing information about individual users, // that can be a friend, in a group, on a game server or in a lobby with the local user @@ -176,7 +190,7 @@ public: // // If the name change fails to happen on the server, then an additional global PersonaStateChange_t will be posted // to change the name back, in addition to the SetPersonaNameResponse_t callback. - CALL_RESULT( SetPersonaNameResponse_t ) + STEAM_CALL_RESULT( SetPersonaNameResponse_t ) virtual SteamAPICall_t SetPersonaName( const char *pchPersonaName ) = 0; // gets the status of the current user @@ -207,13 +221,14 @@ public: virtual const char *GetFriendPersonaName( CSteamID steamIDFriend ) = 0; // returns true if the friend is actually in a game, and fills in pFriendGameInfo with an extra details - virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; + virtual bool GetFriendGamePlayed( CSteamID steamIDFriend, STEAM_OUT_STRUCT() FriendGameInfo_t *pFriendGameInfo ) = 0; // accesses old friends names - returns an empty string when their are no more items in the history virtual const char *GetFriendPersonaNameHistory( CSteamID steamIDFriend, int iPersonaName ) = 0; // friends steam level virtual int GetFriendSteamLevel( CSteamID steamIDFriend ) = 0; // Returns nickname the current user has set for the specified player. Returns NULL if the no nickname has been set for that player. + // DEPRECATED: GetPersonaName follows the Steam nickname preferences, so apps shouldn't need to care about nicknames explicitly. virtual const char *GetPlayerNickname( CSteamID steamIDPlayer ) = 0; // friend grouping (tag) apis @@ -226,7 +241,7 @@ public: // returns the number of members in a given friends group virtual int GetFriendsGroupMembersCount( FriendsGroupID_t friendsGroupID ) = 0; // gets up to nMembersCount members of the given friends group, if fewer exist than requested those positions' SteamIDs will be invalid - virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; + virtual void GetFriendsGroupMembersList( FriendsGroupID_t friendsGroupID, STEAM_OUT_ARRAY_CALL(nMembersCount, GetFriendsGroupMembersCount, friendsGroupID ) CSteamID *pOutSteamIDMembers, int nMembersCount ) = 0; // returns true if the specified user meets any of the criteria specified in iFriendFlags // iFriendFlags can be the union (binary or, |) of one or more k_EFriendFlags values @@ -240,7 +255,7 @@ public: // returns the most recent information we have about what's happening in a clan virtual bool GetClanActivityCounts( CSteamID steamIDClan, int *pnOnline, int *pnInGame, int *pnChatting ) = 0; // for clans a user is a member of, they will have reasonably up-to-date information, but for others you'll have to download the info to have the latest - virtual SteamAPICall_t DownloadClanActivityCounts( ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; + virtual SteamAPICall_t DownloadClanActivityCounts( STEAM_ARRAY_COUNT(cClansToRequest) CSteamID *psteamIDClans, int cClansToRequest ) = 0; // iterators for getting users in a chat room, lobby, game server or clan // note that large clans that cannot be iterated by the local user @@ -256,7 +271,8 @@ public: virtual void SetInGameVoiceSpeaking( CSteamID steamIDUser, bool bSpeaking ) = 0; // activates the game overlay, with an optional dialog to open - // valid options are "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements" + // valid options include "Friends", "Community", "Players", "Settings", "OfficialGameGroup", "Stats", "Achievements", + // "chatroomgroup/nnnn" virtual void ActivateGameOverlay( const char *pchDialog ) = 0; // activates game overlay to a specific place @@ -274,7 +290,7 @@ public: // activates game overlay web browser directly to the specified URL // full address with protocol type is required, e.g. http://www.steamgames.com/ - virtual void ActivateGameOverlayToWebPage( const char *pchURL ) = 0; + virtual void ActivateGameOverlayToWebPage( const char *pchURL, EActivateGameOverlayToWebPageMode eMode = k_EActivateGameOverlayToWebPageMode_Default ) = 0; // activates game overlay to store page for app virtual void ActivateGameOverlayToStore( AppId_t nAppID, EOverlayToStoreFlag eFlag ) = 0; @@ -309,7 +325,7 @@ public: // you can only ask about clans that a user is a member of // note that this won't download avatars automatically; if you get an officer, // and no avatar image is available, call RequestUserInformation( steamID, false ) to download the avatar - CALL_RESULT( ClanOfficerListResponse_t ) + STEAM_CALL_RESULT( ClanOfficerListResponse_t ) virtual SteamAPICall_t RequestClanOfficerList( CSteamID steamIDClan ) = 0; // iteration of clan officers - can only be done when a RequestClanOfficerList() call has completed @@ -343,10 +359,10 @@ public: // Requests rich presence for a specific user. virtual void RequestFriendRichPresence( CSteamID steamIDFriend ) = 0; - // rich invite support - // if the target accepts the invite, the pchConnectString gets added to the command-line for launching the game - // if the game is already running, a GameRichPresenceJoinRequested_t callback is posted containing the connect string - // invites can only be sent to friends + // Rich invite support. + // If the target accepts the invite, a GameRichPresenceJoinRequested_t callback is posted containing the connect string. + // (Or you can configure yout game so that it is passed on the command line instead. This is a deprecated path; ask us if you really need this.) + // Invites can only be sent to friends. virtual bool InviteUserToGame( CSteamID steamIDFriend, const char *pchConnectString ) = 0; // recently-played-with friends iteration @@ -361,13 +377,13 @@ public: // this allows in-game access to group (clan) chats from in the game // the behavior is somewhat sophisticated, because the user may or may not be already in the group chat from outside the game or in the overlay // use ActivateGameOverlayToUser( "chat", steamIDClan ) to open the in-game overlay version of the chat - CALL_RESULT( JoinClanChatRoomCompletionResult_t ) + STEAM_CALL_RESULT( JoinClanChatRoomCompletionResult_t ) virtual SteamAPICall_t JoinClanChatRoom( CSteamID steamIDClan ) = 0; virtual bool LeaveClanChatRoom( CSteamID steamIDClan ) = 0; virtual int GetClanChatMemberCount( CSteamID steamIDClan ) = 0; virtual CSteamID GetChatMemberByIndex( CSteamID steamIDClan, int iUser ) = 0; virtual bool SendClanChatMessage( CSteamID steamIDClanChat, const char *pchText ) = 0; - virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, OUT_STRUCT() CSteamID *psteamidChatter ) = 0; + virtual int GetClanChatMessage( CSteamID steamIDClanChat, int iMessage, void *prgchText, int cchTextMax, EChatEntryType *peChatEntryType, STEAM_OUT_STRUCT() CSteamID *psteamidChatter ) = 0; virtual bool IsClanChatAdmin( CSteamID steamIDClanChat, CSteamID steamIDUser ) = 0; // interact with the Steam (game overlay / desktop) @@ -382,18 +398,30 @@ public: virtual int GetFriendMessage( CSteamID steamIDFriend, int iMessageID, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; // following apis - CALL_RESULT( FriendsGetFollowerCount_t ) + STEAM_CALL_RESULT( FriendsGetFollowerCount_t ) virtual SteamAPICall_t GetFollowerCount( CSteamID steamID ) = 0; - CALL_RESULT( FriendsIsFollowing_t ) + STEAM_CALL_RESULT( FriendsIsFollowing_t ) virtual SteamAPICall_t IsFollowing( CSteamID steamID ) = 0; - CALL_RESULT( FriendsEnumerateFollowingList_t ) + STEAM_CALL_RESULT( FriendsEnumerateFollowingList_t ) virtual SteamAPICall_t EnumerateFollowingList( uint32 unStartIndex ) = 0; virtual bool IsClanPublic( CSteamID steamIDClan ) = 0; virtual bool IsClanOfficialGameGroup( CSteamID steamIDClan ) = 0; + + /// Return the number of chats (friends or chat rooms) with unread messages. + /// A "priority" message is one that would generate some sort of toast or + /// notification, and depends on user settings. + /// + /// You can register for UnreadChatMessagesChanged_t callbacks to know when this + /// has potentially changed. + virtual int GetNumChatsWithUnreadPriorityMessages() = 0; }; -#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends015" +#define STEAMFRIENDS_INTERFACE_VERSION "SteamFriends017" + +// Global interface accessor +inline ISteamFriends *SteamFriends(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamFriends *, SteamFriends, STEAMFRIENDS_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -401,7 +429,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -431,9 +459,10 @@ enum EPersonaChange k_EPersonaChangeLeftSource = 0x0100, k_EPersonaChangeRelationshipChanged = 0x0200, k_EPersonaChangeNameFirstSet = 0x0400, - k_EPersonaChangeFacebookInfo = 0x0800, + k_EPersonaChangeBroadcast = 0x0800, k_EPersonaChangeNickname = 0x1000, k_EPersonaChangeSteamLevel = 0x2000, + k_EPersonaChangeRichPresence = 0x4000, }; @@ -633,6 +662,13 @@ struct SetPersonaNameResponse_t EResult m_result; // detailed result code }; +//----------------------------------------------------------------------------- +// Purpose: Invoked when the status of unread messages changes +//----------------------------------------------------------------------------- +struct UnreadChatMessagesChanged_t +{ + enum { k_iCallback = k_iSteamFriendsCallbacks + 48 }; +}; #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamgamecoordinator.h b/Generator/steam_sdk/isteamgamecoordinator.h index 5ab0637..89b740d 100644 --- a/Generator/steam_sdk/isteamgamecoordinator.h +++ b/Generator/steam_sdk/isteamgamecoordinator.h @@ -10,8 +10,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" +#include "steam_api_common.h" // list of possible return values from the ISteamGameCoordinator API @@ -54,7 +53,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif // callback notification - A new message is available for reading from the message queue diff --git a/Generator/steam_sdk/isteamgameserver.h b/Generator/steam_sdk/isteamgameserver.h index e19f1dd..6a0aada 100644 --- a/Generator/steam_sdk/isteamgameserver.h +++ b/Generator/steam_sdk/isteamgameserver.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #define MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE ((uint16)-1) @@ -193,7 +193,7 @@ public: // these two functions s are deprecated, and will not return results // they will be removed in a future version of the SDK virtual void GetGameplayStats( ) = 0; - CALL_RESULT( GSReputation_t ) + STEAM_CALL_RESULT( GSReputation_t ) virtual SteamAPICall_t GetServerReputation() = 0; // Returns the public IP of the server according to Steam, useful when the server is @@ -241,17 +241,21 @@ public: virtual void ForceHeartbeat() = 0; // associate this game server with this clan for the purposes of computing player compat - CALL_RESULT( AssociateWithClanResult_t ) + STEAM_CALL_RESULT( AssociateWithClanResult_t ) virtual SteamAPICall_t AssociateWithClan( CSteamID steamIDClan ) = 0; // ask if any of the current players dont want to play with this new player - or vice versa - CALL_RESULT( ComputeNewPlayerCompatibilityResult_t ) + STEAM_CALL_RESULT( ComputeNewPlayerCompatibilityResult_t ) virtual SteamAPICall_t ComputeNewPlayerCompatibility( CSteamID steamIDNewPlayer ) = 0; }; #define STEAMGAMESERVER_INTERFACE_VERSION "SteamGameServer012" +// Global accessor +inline ISteamGameServer *SteamGameServer(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServer *, SteamGameServer, STEAMGAMESERVER_INTERFACE_VERSION ); + // game server flags const uint32 k_unServerFlagNone = 0x00; const uint32 k_unServerFlagActive = 0x01; // server has users playing @@ -271,7 +275,7 @@ const uint32 k_unServerFlagPrivate = 0x20; // server shouldn't list on master #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif diff --git a/Generator/steam_sdk/isteamgameserverstats.h b/Generator/steam_sdk/isteamgameserverstats.h index e7922c9..aacac4b 100644 --- a/Generator/steam_sdk/isteamgameserverstats.h +++ b/Generator/steam_sdk/isteamgameserverstats.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: Functions for authenticating users via Steam to play on a game server @@ -23,7 +23,7 @@ public: // if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail // these stats will only be auto-updated for clients playing on the server. For other // users you'll need to call RequestUserStats() again to refresh any data - CALL_RESULT( GSStatsReceived_t ) + STEAM_CALL_RESULT( GSStatsReceived_t ) virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; // requests stat information for a user, usable after a successful call to RequestUserStats() @@ -48,19 +48,23 @@ public: // uploaded has been rejected, either because they broke constraints // or were out of date. In this case the server sends back updated values. // The stats should be re-iterated to keep in sync. - CALL_RESULT( GSStatsStored_t ) + STEAM_CALL_RESULT( GSStatsStored_t ) virtual SteamAPICall_t StoreUserStats( CSteamID steamIDUser ) = 0; }; - #define STEAMGAMESERVERSTATS_INTERFACE_VERSION "SteamGameServerStats001" +// Global accessor +inline ISteamGameServerStats *SteamGameServerStats(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamGameServerStats *, SteamGameServerStats, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); + + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamhtmlsurface.h b/Generator/steam_sdk/isteamhtmlsurface.h index 117599c..086a842 100644 --- a/Generator/steam_sdk/isteamhtmlsurface.h +++ b/Generator/steam_sdk/isteamhtmlsurface.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" typedef uint32 HHTMLBrowser; const uint32 INVALID_HTMLBROWSER = 0; @@ -40,7 +40,7 @@ public: // not implement these callback handlers, the browser may appear to hang instead of // navigating to new pages or triggering javascript popups. // - CALL_RESULT( HTML_BrowserReady_t ) + STEAM_CALL_RESULT( HTML_BrowserReady_t ) virtual SteamAPICall_t CreateBrowser( const char *pchUserAgent, const char *pchUserCSS ) = 0; // Call this when you are done with a html surface, this lets us free the resources being used by it @@ -137,8 +137,9 @@ public: k_eHTMLKeyModifier_ShiftDown = 1 << 2, }; - // keyboard interactions, native keycode is the virtual key code value from your OS - virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; + // keyboard interactions, native keycode is the virtual key code value from your OS, system key flags the key to not + // be sent as a typed character as well as a key down + virtual void KeyDown( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey = false ) = 0; virtual void KeyUp( HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; // cUnicodeChar is the unicode character point for this keypress (and potentially multiple chars per press) virtual void KeyChar( HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, EHTMLKeyModifiers eHTMLKeyModifiers ) = 0; @@ -181,6 +182,9 @@ public: // Specifies the ratio between physical and logical pixels. virtual void SetDPIScalingFactor( HHTMLBrowser unBrowserHandle, float flDPIScaling ) = 0; + // Open HTML/JS developer tools + virtual void OpenDeveloperTools( HHTMLBrowser unBrowserHandle ) = 0; + // CALLBACKS // // These set of functions are used as responses to callback requests @@ -197,11 +201,15 @@ public: virtual void JSDialogResponse( HHTMLBrowser unBrowserHandle, bool bResult ) = 0; // You MUST call this in response to a HTML_FileOpenDialog_t callback - IGNOREATTR() + STEAM_IGNOREATTR() virtual void FileLoadDialogResponse( HHTMLBrowser unBrowserHandle, const char **pchSelectedFiles ) = 0; }; -#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_004" +#define STEAMHTMLSURFACE_INTERFACE_VERSION "STEAMHTMLSURFACE_INTERFACE_VERSION_005" + +// Global interface accessor +inline ISteamHTMLSurface *SteamHTMLSurface(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTMLSurface *, SteamHTMLSurface, STEAMHTMLSURFACE_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -209,156 +217,156 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- // Purpose: The browser is ready for use //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( HTML_BrowserReady_t, k_iSteamHTMLSurfaceCallbacks + 1 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this browser is now fully created and ready to navigate to pages +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: the browser has a pending paint //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint -CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called -CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture -CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture -CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update -CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update -CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update -CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update -CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered -CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered -CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered -CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages -END_DEFINE_CALLBACK_12() +STEAM_CALLBACK_BEGIN(HTML_NeedsPaint_t, k_iSteamHTMLSurfaceCallbacks + 2) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the browser that needs the paint +STEAM_CALLBACK_MEMBER(1, const char *, pBGRA ) // a pointer to the B8G8R8A8 data for this surface, valid until SteamAPI_RunCallbacks is next called +STEAM_CALLBACK_MEMBER(2, uint32, unWide) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER(3, uint32, unTall) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER(4, uint32, unUpdateX) // the offset in X for the damage rect for this update +STEAM_CALLBACK_MEMBER(5, uint32, unUpdateY) // the offset in Y for the damage rect for this update +STEAM_CALLBACK_MEMBER(6, uint32, unUpdateWide) // the width of the damage rect for this update +STEAM_CALLBACK_MEMBER(7, uint32, unUpdateTall) // the height of the damage rect for this update +STEAM_CALLBACK_MEMBER(8, uint32, unScrollX) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(9, uint32, unScrollY) // the page scroll the browser was at when this texture was rendered +STEAM_CALLBACK_MEMBER(10, float, flPageScale) // the page scale factor on this page when rendered +STEAM_CALLBACK_MEMBER(11, uint32, unPageSerial) // incremented on each new page load, you can use this to reject draws while navigating to new pages +STEAM_CALLBACK_END(12) //----------------------------------------------------------------------------- // Purpose: The browser wanted to navigate to a new page // NOTE - you MUST call AllowStartRequest in response to this callback //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating -CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to -CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) -CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request -CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request -END_DEFINE_CALLBACK_5() +STEAM_CALLBACK_BEGIN(HTML_StartRequest_t, k_iSteamHTMLSurfaceCallbacks + 3) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER(1, const char *, pchURL) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER(2, const char *, pchTarget) // the html link target type (i.e _blank, _self, _parent, _top ) +STEAM_CALLBACK_MEMBER(3, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER(4, bool, bIsRedirect) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_END(5) //----------------------------------------------------------------------------- // Purpose: The browser has been requested to close due to user interaction (usually from a javascript window.close() call) //----------------------------------------------------------------------------- -DEFINE_CALLBACK(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) -CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN(HTML_CloseBrowser_t, k_iSteamHTMLSurfaceCallbacks + 4) +STEAM_CALLBACK_MEMBER(0, HHTMLBrowser, unBrowserHandle) // the handle of the surface +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: the browser is navigating to a new url //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating -CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to -CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request -CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request -CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page -CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_URLChanged_t, k_iSteamHTMLSurfaceCallbacks + 5 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface navigating +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the url they wish to navigate to +STEAM_CALLBACK_MEMBER( 2, const char *, pchPostData ) // any posted data for the request +STEAM_CALLBACK_MEMBER( 3, bool, bIsRedirect ) // true if this was a http/html redirect from the last load request +STEAM_CALLBACK_MEMBER( 4, const char *, pchPageTitle ) // the title of the page +STEAM_CALLBACK_MEMBER( 5, bool, bNewNavigation ) // true if this was from a fresh tab and not a click on an existing page +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: A page is finished loading //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // -CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_FinishedRequest_t, k_iSteamHTMLSurfaceCallbacks + 6 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchPageTitle ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: a request to load this url in a new tab //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_OpenLinkInNewTab_t, k_iSteamHTMLSurfaceCallbacks + 7 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: the page has a new title now //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchTitle ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_ChangedTitle_t, k_iSteamHTMLSurfaceCallbacks + 8 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: results from a search //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unResults ) // -CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_SearchResults_t, k_iSteamHTMLSurfaceCallbacks + 9 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unResults ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unCurrentMatch ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: page history status changed on the ability to go backwards and forward //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, bool, bCanGoBack ) // -CALLBACK_MEMBER( 2, bool, bCanGoForward ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_CanGoBackAndForward_t, k_iSteamHTMLSurfaceCallbacks + 10 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, bool, bCanGoBack ) // +STEAM_CALLBACK_MEMBER( 2, bool, bCanGoForward ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the horizontal scrollbar //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unScrollMax ) // -CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // -CALLBACK_MEMBER( 3, float, flPageScale ) // -CALLBACK_MEMBER( 4, bool , bVisible ) // -CALLBACK_MEMBER( 5, uint32, unPageSize ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_HorizontalScroll_t, k_iSteamHTMLSurfaceCallbacks + 11 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool , bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: details on the visibility and size of the vertical scrollbar //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, unScrollMax ) // -CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // -CALLBACK_MEMBER( 3, float, flPageScale ) // -CALLBACK_MEMBER( 4, bool, bVisible ) // -CALLBACK_MEMBER( 5, uint32, unPageSize ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_VerticalScroll_t, k_iSteamHTMLSurfaceCallbacks + 12 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, unScrollMax ) // +STEAM_CALLBACK_MEMBER( 2, uint32, unScrollCurrent ) // +STEAM_CALLBACK_MEMBER( 3, float, flPageScale ) // +STEAM_CALLBACK_MEMBER( 4, bool, bVisible ) // +STEAM_CALLBACK_MEMBER( 5, uint32, unPageSize ) // +STEAM_CALLBACK_END(6) //----------------------------------------------------------------------------- // Purpose: response to GetLinkAtPosition call //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set -CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set -CALLBACK_MEMBER( 3, const char *, pchURL ) // -CALLBACK_MEMBER( 4, bool, bInput ) // -CALLBACK_MEMBER( 5, bool, bLiveLink ) // -END_DEFINE_CALLBACK_6() +STEAM_CALLBACK_BEGIN( HTML_LinkAtPosition_t, k_iSteamHTMLSurfaceCallbacks + 13 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, x ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 2, uint32, y ) // NOTE - Not currently set +STEAM_CALLBACK_MEMBER( 3, const char *, pchURL ) // +STEAM_CALLBACK_MEMBER( 4, bool, bInput ) // +STEAM_CALLBACK_MEMBER( 5, bool, bLiveLink ) // +STEAM_CALLBACK_END(6) @@ -366,98 +374,104 @@ END_DEFINE_CALLBACK_6() // Purpose: show a Javascript alert dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMessage ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_JSAlert_t, k_iSteamHTMLSurfaceCallbacks + 14 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: show a Javascript confirmation dialog, call JSDialogResponse // when the user dismisses this dialog (or right away to ignore it) //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMessage ) // -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_JSConfirm_t, k_iSteamHTMLSurfaceCallbacks + 15 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMessage ) // +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: when received show a file open dialog // then call FileLoadDialogResponse with the file(s) the user selected. //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchTitle ) // -CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( HTML_FileOpenDialog_t, k_iSteamHTMLSurfaceCallbacks + 16 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchTitle ) // +STEAM_CALLBACK_MEMBER( 2, const char *, pchInitialFile ) // +STEAM_CALLBACK_END(3) //----------------------------------------------------------------------------- -// Purpose: a new html window has been created +// Purpose: a new html window is being created. +// +// IMPORTANT NOTE: at this time, the API does not allow you to acknowledge or +// render the contents of this new window, so the new window is always destroyed +// immediately. The URL and other parameters of the new window are passed here +// to give your application the opportunity to call CreateBrowser and set up +// a new browser in response to the attempted popup, if you wish to do so. //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface -CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load -CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup -CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup -CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture -CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture -CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle ) // the handle of the new window surface -END_DEFINE_CALLBACK_7() +STEAM_CALLBACK_BEGIN( HTML_NewWindow_t, k_iSteamHTMLSurfaceCallbacks + 21 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the current surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchURL ) // the page to load +STEAM_CALLBACK_MEMBER( 2, uint32, unX ) // the x pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 3, uint32, unY ) // the y pos into the page to display the popup +STEAM_CALLBACK_MEMBER( 4, uint32, unWide ) // the total width of the pBGRA texture +STEAM_CALLBACK_MEMBER( 5, uint32, unTall ) // the total height of the pBGRA texture +STEAM_CALLBACK_MEMBER( 6, HHTMLBrowser, unNewWindow_BrowserHandle_IGNORE ) +STEAM_CALLBACK_END(7) //----------------------------------------------------------------------------- // Purpose: change the cursor to display //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_SetCursor_t, k_iSteamHTMLSurfaceCallbacks + 22 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, uint32, eMouseCursor ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: informational message from the browser //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_StatusText_t, k_iSteamHTMLSurfaceCallbacks + 23 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: show a tooltip //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_ShowToolTip_t, k_iSteamHTMLSurfaceCallbacks + 24 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: update the text of an existing tooltip //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_UpdateToolTip_t, k_iSteamHTMLSurfaceCallbacks + 25 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_MEMBER( 1, const char *, pchMsg ) // the EMouseCursor to display +STEAM_CALLBACK_END(2) //----------------------------------------------------------------------------- // Purpose: hide the tooltip you are showing //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( HTML_HideToolTip_t, k_iSteamHTMLSurfaceCallbacks + 26 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // the handle of the surface +STEAM_CALLBACK_END(1) //----------------------------------------------------------------------------- // Purpose: The browser has restarted due to an internal failure, use this new handle value //----------------------------------------------------------------------------- -DEFINE_CALLBACK( HTML_BrowserRestarted_t, k_iSteamHTMLSurfaceCallbacks + 27 ) -CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new browser handle after the restart -CALLBACK_MEMBER( 1, HHTMLBrowser, unOldBrowserHandle ) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( HTML_BrowserRestarted_t, k_iSteamHTMLSurfaceCallbacks + 27 ) +STEAM_CALLBACK_MEMBER( 0, HHTMLBrowser, unBrowserHandle ) // this is the new browser handle after the restart +STEAM_CALLBACK_MEMBER( 1, HHTMLBrowser, unOldBrowserHandle ) // the handle for the browser before the restart, if your handle was this then switch to using unBrowserHandle for API calls +STEAM_CALLBACK_END(2) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamhttp.h b/Generator/steam_sdk/isteamhttp.h index 8fab537..26a02b3 100644 --- a/Generator/steam_sdk/isteamhttp.h +++ b/Generator/steam_sdk/isteamhttp.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "steamhttpenums.h" // Handle to a HTTP Request handle @@ -128,7 +128,8 @@ public: // Set the extra user agent info for a request, this doesn't clobber the normal user agent, it just adds the extra info on the end virtual bool SetHTTPRequestUserAgentInfo( HTTPRequestHandle hRequest, const char *pchUserAgentInfo ) = 0; - // Set that https request should require verified SSL certificate via machines certificate trust store + // Disable or re-enable verification of SSL/TLS certificates. + // By default, certificates are checked for all HTTPS requests. virtual bool SetHTTPRequestRequiresVerifiedCertificate( HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate ) = 0; // Set an absolute timeout on the HTTP request, this is just a total time timeout different than the network activity timeout @@ -139,7 +140,15 @@ public: virtual bool GetHTTPRequestWasTimedOut( HTTPRequestHandle hRequest, bool *pbWasTimedOut ) = 0; }; -#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION002" +#define STEAMHTTP_INTERFACE_VERSION "STEAMHTTP_INTERFACE_VERSION003" + +// Global interface accessor +inline ISteamHTTP *SteamHTTP(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamHTTP, STEAMHTTP_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamHTTP *SteamGameServerHTTP(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamHTTP *, SteamGameServerHTTP, STEAMHTTP_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -147,7 +156,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct HTTPRequestCompleted_t diff --git a/Generator/steam_sdk/isteaminput.h b/Generator/steam_sdk/isteaminput.h new file mode 100644 index 0000000..dfd3980 --- /dev/null +++ b/Generator/steam_sdk/isteaminput.h @@ -0,0 +1,619 @@ +//====== Copyright 1996-2018, Valve Corporation, All rights reserved. ======= +// +// Purpose: Steam Input is a flexible input API that supports over three hundred devices including all +// common variants of Xbox, Playstation, Nintendo Switch Pro, and Steam Controllers. +// For more info including a getting started guide for developers +// please visit: https://partner.steamgames.com/doc/features/steam_controller +// +//============================================================================= + +#ifndef ISTEAMINPUT_H +#define ISTEAMINPUT_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steam_api_common.h" + +#define STEAM_INPUT_MAX_COUNT 16 + +#define STEAM_INPUT_MAX_ANALOG_ACTIONS 16 + +#define STEAM_INPUT_MAX_DIGITAL_ACTIONS 128 + +#define STEAM_INPUT_MAX_ORIGINS 8 + +// When sending an option to a specific controller handle, you can send to all devices via this command +#define STEAM_INPUT_HANDLE_ALL_CONTROLLERS UINT64_MAX + +#define STEAM_INPUT_MIN_ANALOG_ACTION_DATA -1.0f +#define STEAM_INPUT_MAX_ANALOG_ACTION_DATA 1.0f + +enum EInputSource +{ + k_EInputSource_None, + k_EInputSource_LeftTrackpad, + k_EInputSource_RightTrackpad, + k_EInputSource_Joystick, + k_EInputSource_ABXY, + k_EInputSource_Switch, + k_EInputSource_LeftTrigger, + k_EInputSource_RightTrigger, + k_EInputSource_LeftBumper, + k_EInputSource_RightBumper, + k_EInputSource_Gyro, + k_EInputSource_CenterTrackpad, // PS4 + k_EInputSource_RightJoystick, // Traditional Controllers + k_EInputSource_DPad, // Traditional Controllers + k_EInputSource_Key, // Keyboards with scan codes - Unused + k_EInputSource_Mouse, // Traditional mouse - Unused + k_EInputSource_LeftGyro, // Secondary Gyro - Switch - Unused + k_EInputSource_Count +}; + +enum EInputSourceMode +{ + k_EInputSourceMode_None, + k_EInputSourceMode_Dpad, + k_EInputSourceMode_Buttons, + k_EInputSourceMode_FourButtons, + k_EInputSourceMode_AbsoluteMouse, + k_EInputSourceMode_RelativeMouse, + k_EInputSourceMode_JoystickMove, + k_EInputSourceMode_JoystickMouse, + k_EInputSourceMode_JoystickCamera, + k_EInputSourceMode_ScrollWheel, + k_EInputSourceMode_Trigger, + k_EInputSourceMode_TouchMenu, + k_EInputSourceMode_MouseJoystick, + k_EInputSourceMode_MouseRegion, + k_EInputSourceMode_RadialMenu, + k_EInputSourceMode_SingleButton, + k_EInputSourceMode_Switches +}; + +// Note: Please do not use action origins as a way to identify controller types. There is no +// guarantee that they will be added in a contiguous manner - use GetInputTypeForHandle instead. +// Versions of Steam that add new controller types in the future will extend this enum so if you're +// using a lookup table please check the bounds of any origins returned by Steam. +enum EInputActionOrigin +{ + // Steam Controller + k_EInputActionOrigin_None, + k_EInputActionOrigin_SteamController_A, + k_EInputActionOrigin_SteamController_B, + k_EInputActionOrigin_SteamController_X, + k_EInputActionOrigin_SteamController_Y, + k_EInputActionOrigin_SteamController_LeftBumper, + k_EInputActionOrigin_SteamController_RightBumper, + k_EInputActionOrigin_SteamController_LeftGrip, + k_EInputActionOrigin_SteamController_RightGrip, + k_EInputActionOrigin_SteamController_Start, + k_EInputActionOrigin_SteamController_Back, + k_EInputActionOrigin_SteamController_LeftPad_Touch, + k_EInputActionOrigin_SteamController_LeftPad_Swipe, + k_EInputActionOrigin_SteamController_LeftPad_Click, + k_EInputActionOrigin_SteamController_LeftPad_DPadNorth, + k_EInputActionOrigin_SteamController_LeftPad_DPadSouth, + k_EInputActionOrigin_SteamController_LeftPad_DPadWest, + k_EInputActionOrigin_SteamController_LeftPad_DPadEast, + k_EInputActionOrigin_SteamController_RightPad_Touch, + k_EInputActionOrigin_SteamController_RightPad_Swipe, + k_EInputActionOrigin_SteamController_RightPad_Click, + k_EInputActionOrigin_SteamController_RightPad_DPadNorth, + k_EInputActionOrigin_SteamController_RightPad_DPadSouth, + k_EInputActionOrigin_SteamController_RightPad_DPadWest, + k_EInputActionOrigin_SteamController_RightPad_DPadEast, + k_EInputActionOrigin_SteamController_LeftTrigger_Pull, + k_EInputActionOrigin_SteamController_LeftTrigger_Click, + k_EInputActionOrigin_SteamController_RightTrigger_Pull, + k_EInputActionOrigin_SteamController_RightTrigger_Click, + k_EInputActionOrigin_SteamController_LeftStick_Move, + k_EInputActionOrigin_SteamController_LeftStick_Click, + k_EInputActionOrigin_SteamController_LeftStick_DPadNorth, + k_EInputActionOrigin_SteamController_LeftStick_DPadSouth, + k_EInputActionOrigin_SteamController_LeftStick_DPadWest, + k_EInputActionOrigin_SteamController_LeftStick_DPadEast, + k_EInputActionOrigin_SteamController_Gyro_Move, + k_EInputActionOrigin_SteamController_Gyro_Pitch, + k_EInputActionOrigin_SteamController_Gyro_Yaw, + k_EInputActionOrigin_SteamController_Gyro_Roll, + k_EInputActionOrigin_SteamController_Reserved0, + k_EInputActionOrigin_SteamController_Reserved1, + k_EInputActionOrigin_SteamController_Reserved2, + k_EInputActionOrigin_SteamController_Reserved3, + k_EInputActionOrigin_SteamController_Reserved4, + k_EInputActionOrigin_SteamController_Reserved5, + k_EInputActionOrigin_SteamController_Reserved6, + k_EInputActionOrigin_SteamController_Reserved7, + k_EInputActionOrigin_SteamController_Reserved8, + k_EInputActionOrigin_SteamController_Reserved9, + k_EInputActionOrigin_SteamController_Reserved10, + + // PS4 Dual Shock + k_EInputActionOrigin_PS4_X, + k_EInputActionOrigin_PS4_Circle, + k_EInputActionOrigin_PS4_Triangle, + k_EInputActionOrigin_PS4_Square, + k_EInputActionOrigin_PS4_LeftBumper, + k_EInputActionOrigin_PS4_RightBumper, + k_EInputActionOrigin_PS4_Options, //Start + k_EInputActionOrigin_PS4_Share, //Back + k_EInputActionOrigin_PS4_LeftPad_Touch, + k_EInputActionOrigin_PS4_LeftPad_Swipe, + k_EInputActionOrigin_PS4_LeftPad_Click, + k_EInputActionOrigin_PS4_LeftPad_DPadNorth, + k_EInputActionOrigin_PS4_LeftPad_DPadSouth, + k_EInputActionOrigin_PS4_LeftPad_DPadWest, + k_EInputActionOrigin_PS4_LeftPad_DPadEast, + k_EInputActionOrigin_PS4_RightPad_Touch, + k_EInputActionOrigin_PS4_RightPad_Swipe, + k_EInputActionOrigin_PS4_RightPad_Click, + k_EInputActionOrigin_PS4_RightPad_DPadNorth, + k_EInputActionOrigin_PS4_RightPad_DPadSouth, + k_EInputActionOrigin_PS4_RightPad_DPadWest, + k_EInputActionOrigin_PS4_RightPad_DPadEast, + k_EInputActionOrigin_PS4_CenterPad_Touch, + k_EInputActionOrigin_PS4_CenterPad_Swipe, + k_EInputActionOrigin_PS4_CenterPad_Click, + k_EInputActionOrigin_PS4_CenterPad_DPadNorth, + k_EInputActionOrigin_PS4_CenterPad_DPadSouth, + k_EInputActionOrigin_PS4_CenterPad_DPadWest, + k_EInputActionOrigin_PS4_CenterPad_DPadEast, + k_EInputActionOrigin_PS4_LeftTrigger_Pull, + k_EInputActionOrigin_PS4_LeftTrigger_Click, + k_EInputActionOrigin_PS4_RightTrigger_Pull, + k_EInputActionOrigin_PS4_RightTrigger_Click, + k_EInputActionOrigin_PS4_LeftStick_Move, + k_EInputActionOrigin_PS4_LeftStick_Click, + k_EInputActionOrigin_PS4_LeftStick_DPadNorth, + k_EInputActionOrigin_PS4_LeftStick_DPadSouth, + k_EInputActionOrigin_PS4_LeftStick_DPadWest, + k_EInputActionOrigin_PS4_LeftStick_DPadEast, + k_EInputActionOrigin_PS4_RightStick_Move, + k_EInputActionOrigin_PS4_RightStick_Click, + k_EInputActionOrigin_PS4_RightStick_DPadNorth, + k_EInputActionOrigin_PS4_RightStick_DPadSouth, + k_EInputActionOrigin_PS4_RightStick_DPadWest, + k_EInputActionOrigin_PS4_RightStick_DPadEast, + k_EInputActionOrigin_PS4_DPad_North, + k_EInputActionOrigin_PS4_DPad_South, + k_EInputActionOrigin_PS4_DPad_West, + k_EInputActionOrigin_PS4_DPad_East, + k_EInputActionOrigin_PS4_Gyro_Move, + k_EInputActionOrigin_PS4_Gyro_Pitch, + k_EInputActionOrigin_PS4_Gyro_Yaw, + k_EInputActionOrigin_PS4_Gyro_Roll, + k_EInputActionOrigin_PS4_Reserved0, + k_EInputActionOrigin_PS4_Reserved1, + k_EInputActionOrigin_PS4_Reserved2, + k_EInputActionOrigin_PS4_Reserved3, + k_EInputActionOrigin_PS4_Reserved4, + k_EInputActionOrigin_PS4_Reserved5, + k_EInputActionOrigin_PS4_Reserved6, + k_EInputActionOrigin_PS4_Reserved7, + k_EInputActionOrigin_PS4_Reserved8, + k_EInputActionOrigin_PS4_Reserved9, + k_EInputActionOrigin_PS4_Reserved10, + + // XBox One + k_EInputActionOrigin_XBoxOne_A, + k_EInputActionOrigin_XBoxOne_B, + k_EInputActionOrigin_XBoxOne_X, + k_EInputActionOrigin_XBoxOne_Y, + k_EInputActionOrigin_XBoxOne_LeftBumper, + k_EInputActionOrigin_XBoxOne_RightBumper, + k_EInputActionOrigin_XBoxOne_Menu, //Start + k_EInputActionOrigin_XBoxOne_View, //Back + k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Click, + k_EInputActionOrigin_XBoxOne_RightTrigger_Pull, + k_EInputActionOrigin_XBoxOne_RightTrigger_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_Move, + k_EInputActionOrigin_XBoxOne_LeftStick_Click, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast, + k_EInputActionOrigin_XBoxOne_RightStick_Move, + k_EInputActionOrigin_XBoxOne_RightStick_Click, + k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth, + k_EInputActionOrigin_XBoxOne_RightStick_DPadWest, + k_EInputActionOrigin_XBoxOne_RightStick_DPadEast, + k_EInputActionOrigin_XBoxOne_DPad_North, + k_EInputActionOrigin_XBoxOne_DPad_South, + k_EInputActionOrigin_XBoxOne_DPad_West, + k_EInputActionOrigin_XBoxOne_DPad_East, + k_EInputActionOrigin_XBoxOne_Reserved0, + k_EInputActionOrigin_XBoxOne_Reserved1, + k_EInputActionOrigin_XBoxOne_Reserved2, + k_EInputActionOrigin_XBoxOne_Reserved3, + k_EInputActionOrigin_XBoxOne_Reserved4, + k_EInputActionOrigin_XBoxOne_Reserved5, + k_EInputActionOrigin_XBoxOne_Reserved6, + k_EInputActionOrigin_XBoxOne_Reserved7, + k_EInputActionOrigin_XBoxOne_Reserved8, + k_EInputActionOrigin_XBoxOne_Reserved9, + k_EInputActionOrigin_XBoxOne_Reserved10, + + // XBox 360 + k_EInputActionOrigin_XBox360_A, + k_EInputActionOrigin_XBox360_B, + k_EInputActionOrigin_XBox360_X, + k_EInputActionOrigin_XBox360_Y, + k_EInputActionOrigin_XBox360_LeftBumper, + k_EInputActionOrigin_XBox360_RightBumper, + k_EInputActionOrigin_XBox360_Start, //Start + k_EInputActionOrigin_XBox360_Back, //Back + k_EInputActionOrigin_XBox360_LeftTrigger_Pull, + k_EInputActionOrigin_XBox360_LeftTrigger_Click, + k_EInputActionOrigin_XBox360_RightTrigger_Pull, + k_EInputActionOrigin_XBox360_RightTrigger_Click, + k_EInputActionOrigin_XBox360_LeftStick_Move, + k_EInputActionOrigin_XBox360_LeftStick_Click, + k_EInputActionOrigin_XBox360_LeftStick_DPadNorth, + k_EInputActionOrigin_XBox360_LeftStick_DPadSouth, + k_EInputActionOrigin_XBox360_LeftStick_DPadWest, + k_EInputActionOrigin_XBox360_LeftStick_DPadEast, + k_EInputActionOrigin_XBox360_RightStick_Move, + k_EInputActionOrigin_XBox360_RightStick_Click, + k_EInputActionOrigin_XBox360_RightStick_DPadNorth, + k_EInputActionOrigin_XBox360_RightStick_DPadSouth, + k_EInputActionOrigin_XBox360_RightStick_DPadWest, + k_EInputActionOrigin_XBox360_RightStick_DPadEast, + k_EInputActionOrigin_XBox360_DPad_North, + k_EInputActionOrigin_XBox360_DPad_South, + k_EInputActionOrigin_XBox360_DPad_West, + k_EInputActionOrigin_XBox360_DPad_East, + k_EInputActionOrigin_XBox360_Reserved0, + k_EInputActionOrigin_XBox360_Reserved1, + k_EInputActionOrigin_XBox360_Reserved2, + k_EInputActionOrigin_XBox360_Reserved3, + k_EInputActionOrigin_XBox360_Reserved4, + k_EInputActionOrigin_XBox360_Reserved5, + k_EInputActionOrigin_XBox360_Reserved6, + k_EInputActionOrigin_XBox360_Reserved7, + k_EInputActionOrigin_XBox360_Reserved8, + k_EInputActionOrigin_XBox360_Reserved9, + k_EInputActionOrigin_XBox360_Reserved10, + + + // Switch - Pro or Joycons used as a single input device. + // This does not apply to a single joycon + k_EInputActionOrigin_Switch_A, + k_EInputActionOrigin_Switch_B, + k_EInputActionOrigin_Switch_X, + k_EInputActionOrigin_Switch_Y, + k_EInputActionOrigin_Switch_LeftBumper, + k_EInputActionOrigin_Switch_RightBumper, + k_EInputActionOrigin_Switch_Plus, //Start + k_EInputActionOrigin_Switch_Minus, //Back + k_EInputActionOrigin_Switch_Capture, + k_EInputActionOrigin_Switch_LeftTrigger_Pull, + k_EInputActionOrigin_Switch_LeftTrigger_Click, + k_EInputActionOrigin_Switch_RightTrigger_Pull, + k_EInputActionOrigin_Switch_RightTrigger_Click, + k_EInputActionOrigin_Switch_LeftStick_Move, + k_EInputActionOrigin_Switch_LeftStick_Click, + k_EInputActionOrigin_Switch_LeftStick_DPadNorth, + k_EInputActionOrigin_Switch_LeftStick_DPadSouth, + k_EInputActionOrigin_Switch_LeftStick_DPadWest, + k_EInputActionOrigin_Switch_LeftStick_DPadEast, + k_EInputActionOrigin_Switch_RightStick_Move, + k_EInputActionOrigin_Switch_RightStick_Click, + k_EInputActionOrigin_Switch_RightStick_DPadNorth, + k_EInputActionOrigin_Switch_RightStick_DPadSouth, + k_EInputActionOrigin_Switch_RightStick_DPadWest, + k_EInputActionOrigin_Switch_RightStick_DPadEast, + k_EInputActionOrigin_Switch_DPad_North, + k_EInputActionOrigin_Switch_DPad_South, + k_EInputActionOrigin_Switch_DPad_West, + k_EInputActionOrigin_Switch_DPad_East, + k_EInputActionOrigin_Switch_ProGyro_Move, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Pitch, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Yaw, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_ProGyro_Roll, // Primary Gyro in Pro Controller, or Right JoyCon + k_EInputActionOrigin_Switch_Reserved0, + k_EInputActionOrigin_Switch_Reserved1, + k_EInputActionOrigin_Switch_Reserved2, + k_EInputActionOrigin_Switch_Reserved3, + k_EInputActionOrigin_Switch_Reserved4, + k_EInputActionOrigin_Switch_Reserved5, + k_EInputActionOrigin_Switch_Reserved6, + k_EInputActionOrigin_Switch_Reserved7, + k_EInputActionOrigin_Switch_Reserved8, + k_EInputActionOrigin_Switch_Reserved9, + k_EInputActionOrigin_Switch_Reserved10, + + // Switch JoyCon Specific + k_EInputActionOrigin_Switch_RightGyro_Move, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Pitch, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Yaw, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_RightGyro_Roll, // Right JoyCon Gyro generally should correspond to Pro's single gyro + k_EInputActionOrigin_Switch_LeftGyro_Move, + k_EInputActionOrigin_Switch_LeftGyro_Pitch, + k_EInputActionOrigin_Switch_LeftGyro_Yaw, + k_EInputActionOrigin_Switch_LeftGyro_Roll, + k_EInputActionOrigin_Switch_LeftGrip_Lower, // Left JoyCon SR Button + k_EInputActionOrigin_Switch_LeftGrip_Upper, // Left JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Lower, // Right JoyCon SL Button + k_EInputActionOrigin_Switch_RightGrip_Upper, // Right JoyCon SR Button + k_EInputActionOrigin_Switch_Reserved11, + k_EInputActionOrigin_Switch_Reserved12, + k_EInputActionOrigin_Switch_Reserved13, + k_EInputActionOrigin_Switch_Reserved14, + k_EInputActionOrigin_Switch_Reserved15, + k_EInputActionOrigin_Switch_Reserved16, + k_EInputActionOrigin_Switch_Reserved17, + k_EInputActionOrigin_Switch_Reserved18, + k_EInputActionOrigin_Switch_Reserved19, + k_EInputActionOrigin_Switch_Reserved20, + + k_EInputActionOrigin_Count, // If Steam has added support for new controllers origins will go here. + k_EInputActionOrigin_MaximumPossibleValue = 32767, // Origins are currently a maximum of 16 bits. +}; + +enum EXboxOrigin +{ + k_EXboxOrigin_A, + k_EXboxOrigin_B, + k_EXboxOrigin_X, + k_EXboxOrigin_Y, + k_EXboxOrigin_LeftBumper, + k_EXboxOrigin_RightBumper, + k_EXboxOrigin_Menu, //Start + k_EXboxOrigin_View, //Back + k_EXboxOrigin_LeftTrigger_Pull, + k_EXboxOrigin_LeftTrigger_Click, + k_EXboxOrigin_RightTrigger_Pull, + k_EXboxOrigin_RightTrigger_Click, + k_EXboxOrigin_LeftStick_Move, + k_EXboxOrigin_LeftStick_Click, + k_EXboxOrigin_LeftStick_DPadNorth, + k_EXboxOrigin_LeftStick_DPadSouth, + k_EXboxOrigin_LeftStick_DPadWest, + k_EXboxOrigin_LeftStick_DPadEast, + k_EXboxOrigin_RightStick_Move, + k_EXboxOrigin_RightStick_Click, + k_EXboxOrigin_RightStick_DPadNorth, + k_EXboxOrigin_RightStick_DPadSouth, + k_EXboxOrigin_RightStick_DPadWest, + k_EXboxOrigin_RightStick_DPadEast, + k_EXboxOrigin_DPad_North, + k_EXboxOrigin_DPad_South, + k_EXboxOrigin_DPad_West, + k_EXboxOrigin_DPad_East, + k_EXboxOrigin_Count, +}; + +enum ESteamControllerPad +{ + k_ESteamControllerPad_Left, + k_ESteamControllerPad_Right +}; + +enum ESteamInputType +{ + k_ESteamInputType_Unknown, + k_ESteamInputType_SteamController, + k_ESteamInputType_XBox360Controller, + k_ESteamInputType_XBoxOneController, + k_ESteamInputType_GenericGamepad, // DirectInput controllers + k_ESteamInputType_PS4Controller, + k_ESteamInputType_AppleMFiController, // Unused + k_ESteamInputType_AndroidController, // Unused + k_ESteamInputType_SwitchJoyConPair, // Unused + k_ESteamInputType_SwitchJoyConSingle, // Unused + k_ESteamInputType_SwitchProController, + k_ESteamInputType_MobileTouch, // Steam Link App On-screen Virtual Controller + k_ESteamInputType_PS3Controller, // Currently uses PS4 Origins + k_ESteamInputType_Count, + k_ESteamInputType_MaximumPossibleValue = 255, +}; + +// These values are passed into SetLEDColor +enum ESteamInputLEDFlag +{ + k_ESteamInputLEDFlag_SetColor, + // Restore the LED color to the user's preference setting as set in the controller personalization menu. + // This also happens automatically on exit of your game. + k_ESteamInputLEDFlag_RestoreUserDefault +}; + +// InputHandle_t is used to refer to a specific controller. +// This handle will consistently identify a controller, even if it is disconnected and re-connected +typedef uint64 InputHandle_t; + + +// These handles are used to refer to a specific in-game action or action set +// All action handles should be queried during initialization for performance reasons +typedef uint64 InputActionSetHandle_t; +typedef uint64 InputDigitalActionHandle_t; +typedef uint64 InputAnalogActionHandle_t; + +#pragma pack( push, 1 ) + +struct InputAnalogActionData_t +{ + // Type of data coming from this action, this will match what got specified in the action set + EInputSourceMode eMode; + + // The current state of this action; will be delta updates for mouse actions + float x, y; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputDigitalActionData_t +{ + // The current state of this action; will be true if currently pressed + bool bState; + + // Whether or not this action is currently available to be bound in the active action set + bool bActive; +}; + +struct InputMotionData_t +{ + // Sensor-fused absolute rotation; will drift in heading + float rotQuatX; + float rotQuatY; + float rotQuatZ; + float rotQuatW; + + // Positional acceleration + float posAccelX; + float posAccelY; + float posAccelZ; + + // Angular velocity + float rotVelX; + float rotVelY; + float rotVelZ; +}; + +#pragma pack( pop ) + + +//----------------------------------------------------------------------------- +// Purpose: Steam Input API +//----------------------------------------------------------------------------- +class ISteamInput +{ +public: + + // Init and Shutdown must be called when starting/ending use of this interface + virtual bool Init() = 0; + virtual bool Shutdown() = 0; + + // Synchronize API state with the latest Steam Controller inputs available. This + // is performed automatically by SteamAPI_RunCallbacks, but for the absolute lowest + // possible latency, you call this directly before reading controller state. This must + // be called from somewhere before GetConnectedControllers will return any handles + virtual void RunFrame() = 0; + + // Enumerate currently connected Steam Input enabled devices - developers can opt in controller by type (ex: Xbox/Playstation/etc) via + // the Steam Input settings in the Steamworks site or users can opt-in in their controller settings in Steam. + // handlesOut should point to a STEAM_INPUT_MAX_COUNT sized array of InputHandle_t handles + // Returns the number of handles written to handlesOut + virtual int GetConnectedControllers( InputHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTION SETS + //----------------------------------------------------------------------------- + + // Lookup the handle for an Action Set. Best to do this once on startup, and store the handles for all future API calls. + virtual InputActionSetHandle_t GetActionSetHandle( const char *pszActionSetName ) = 0; + + // Reconfigure the controller to use the specified action set (ie 'Menu', 'Walk' or 'Drive') + // This is cheap, and can be safely called repeatedly. It's often easier to repeatedly call it in + // your state loops, instead of trying to place it in all of your state transitions. + virtual void ActivateActionSet( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle ) = 0; + virtual InputActionSetHandle_t GetCurrentActionSet( InputHandle_t inputHandle ) = 0; + + // ACTION SET LAYERS + virtual void ActivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateActionSetLayer( InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle ) = 0; + virtual void DeactivateAllActionSetLayers( InputHandle_t inputHandle ) = 0; + virtual int GetActiveActionSetLayers( InputHandle_t inputHandle, InputActionSetHandle_t *handlesOut ) = 0; + + //----------------------------------------------------------------------------- + // ACTIONS + //----------------------------------------------------------------------------- + + // Lookup the handle for a digital action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputDigitalActionHandle_t GetDigitalActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of the supplied digital game action + virtual InputDigitalActionData_t GetDigitalActionData( InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle ) = 0; + + // Get the origin(s) for a digital action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetDigitalActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin *originsOut ) = 0; + + // Lookup the handle for an analog action. Best to do this once on startup, and store the handles for all future API calls. + virtual InputAnalogActionHandle_t GetAnalogActionHandle( const char *pszActionName ) = 0; + + // Returns the current state of these supplied analog game action + virtual InputAnalogActionData_t GetAnalogActionData( InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle ) = 0; + + // Get the origin(s) for an analog action within an action set. Returns the number of origins supplied in originsOut. Use this to display the appropriate on-screen prompt for the action. + // originsOut should point to a STEAM_INPUT_MAX_ORIGINS sized array of EInputActionOrigin handles. The EInputActionOrigin enum will get extended as support for new controller controllers gets added to + // the Steam client and will exceed the values from this header, please check bounds if you are using a look up table. + virtual int GetAnalogActionOrigins( InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin *originsOut ) = 0; + + // Get a local path to art for on-screen glyph for a particular origin - this call is cheap + virtual const char *GetGlyphForActionOrigin( EInputActionOrigin eOrigin ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified origin - this call is serialized + virtual const char *GetStringForActionOrigin( EInputActionOrigin eOrigin ) = 0; + + // Stop analog momentum for the action if it is a mouse action in trackball mode + virtual void StopAnalogActionMomentum( InputHandle_t inputHandle, InputAnalogActionHandle_t eAction ) = 0; + + // Returns raw motion data from the specified device + virtual InputMotionData_t GetMotionData( InputHandle_t inputHandle ) = 0; + + //----------------------------------------------------------------------------- + // OUTPUTS + //----------------------------------------------------------------------------- + + // Trigger a vibration event on supported controllers - Steam will translate these commands into haptic pulses for Steam Controllers + virtual void TriggerVibration( InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed ) = 0; + + // Set the controller LED color on supported controllers. nFlags is a bitmask of values from ESteamInputLEDFlag - 0 will default to setting a color. Steam will handle + // the behavior on exit of your program so you don't need to try restore the default as you are shutting down + virtual void SetLEDColor( InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags ) = 0; + + // Trigger a haptic pulse on a Steam Controller - if you are approximating rumble you may want to use TriggerVibration instead. + // Good uses for Haptic pulses include chimes, noises, or directional gameplay feedback (taking damage, footstep locations, etc). + virtual void TriggerHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec ) = 0; + + // Trigger a haptic pulse with a duty cycle of usDurationMicroSec / usOffMicroSec, unRepeat times. If you are approximating rumble you may want to use TriggerVibration instead. + // nFlags is currently unused and reserved for future use. + virtual void TriggerRepeatedHapticPulse( InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags ) = 0; + + //----------------------------------------------------------------------------- + // Utility functions availible without using the rest of Steam Input API + //----------------------------------------------------------------------------- + + // Invokes the Steam overlay and brings up the binding screen if the user is using Big Picture Mode + // If the user is not in Big Picture Mode it will open up the binding in a new window + virtual bool ShowBindingPanel( InputHandle_t inputHandle ) = 0; + + // Returns the input type for a particular handle + virtual ESteamInputType GetInputTypeForHandle( InputHandle_t inputHandle ) = 0; + + // Returns the associated controller handle for the specified emulated gamepad - can be used with the above 2 functions + // to identify controllers presented to your game over Xinput. Returns 0 if the Xinput index isn't associated with Steam Input + virtual InputHandle_t GetControllerForGamepadIndex( int nIndex ) = 0; + + // Returns the associated gamepad index for the specified controller, if emulating a gamepad or -1 if not associated with an Xinput index + virtual int GetGamepadIndexForController( InputHandle_t ulinputHandle ) = 0; + + // Returns a localized string (from Steam's language setting) for the specified Xbox controller origin. This function is cheap. + virtual const char *GetStringForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get a local path to art for on-screen glyph for a particular Xbox controller origin. This function is serialized. + virtual const char *GetGlyphForXboxOrigin( EXboxOrigin eOrigin ) = 0; + + // Get the equivalent ActionOrigin for a given Xbox controller origin this can be chained with GetGlyphForActionOrigin to provide future proof glyphs for + // non-Steam Input API action games. Note - this only translates the buttons directly and doesn't take into account any remapping a user has made in their configuration + virtual EInputActionOrigin GetActionOriginFromXboxOrigin( InputHandle_t inputHandle, EXboxOrigin eOrigin ) = 0; + + // Convert an origin to another controller type - for inputs not present on the other controller type this will return k_EInputActionOrigin_None + // When a new input type is added you will be able to pass in k_ESteamInputType_Unknown amd the closest origin that your version of the SDK regonized will be returned + // ex: if a Playstation 5 controller was released this function would return Playstation 4 origins. + virtual EInputActionOrigin TranslateActionOrigin( ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin ) = 0; +}; + +#define STEAMINPUT_INTERFACE_VERSION "SteamInput001" + +// Global interface accessor +inline ISteamInput *SteamInput(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInput *, SteamInput, STEAMINPUT_INTERFACE_VERSION ); + +#endif // ISTEAMINPUT_H diff --git a/Generator/steam_sdk/isteaminventory.h b/Generator/steam_sdk/isteaminventory.h index 85090a2..1cd21b8 100644 --- a/Generator/steam_sdk/isteaminventory.h +++ b/Generator/steam_sdk/isteaminventory.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +18,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -86,14 +86,14 @@ public: // k_EResultServiceUnavailable - ERROR: service temporarily down, you may retry later // k_EResultLimitExceeded - ERROR: operation would exceed per-user inventory limits // k_EResultFail - ERROR: unknown / generic error - METHOD_DESC(Find out the status of an asynchronous inventory result handle.) + STEAM_METHOD_DESC(Find out the status of an asynchronous inventory result handle.) virtual EResult GetResultStatus( SteamInventoryResult_t resultHandle ) = 0; // Copies the contents of a result set into a flat array. The specific // contents of the result set depend on which query which was used. - METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.) + STEAM_METHOD_DESC(Copies the contents of a result set into a flat array. The specific contents of the result set depend on which query which was used.) virtual bool GetResultItems( SteamInventoryResult_t resultHandle, - OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, + STEAM_OUT_ARRAY_COUNT( punOutItemsArraySize,Output array) SteamItemDetails_t *pOutItemsArray, uint32 *punOutItemsArraySize ) = 0; // In combination with GetResultItems, you can use GetResultItemProperty to retrieve @@ -111,21 +111,21 @@ public: virtual bool GetResultItemProperty( SteamInventoryResult_t resultHandle, uint32 unItemIndex, const char *pchPropertyName, - OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + STEAM_OUT_STRING_COUNT( punValueBufferSizeOut ) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; // Returns the server time at which the result was generated. Compare against // the value of IClientUtils::GetServerRealTime() to determine age. - METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.) + STEAM_METHOD_DESC(Returns the server time at which the result was generated. Compare against the value of IClientUtils::GetServerRealTime() to determine age.) virtual uint32 GetResultTimestamp( SteamInventoryResult_t resultHandle ) = 0; // Returns true if the result belongs to the target steam ID, false if the // result does not. This is important when using DeserializeResult, to verify // that a remote player is not pretending to have a different user's inventory. - METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.) + STEAM_METHOD_DESC(Returns true if the result belongs to the target steam ID or false if the result does not. This is important when using DeserializeResult to verify that a remote player is not pretending to have a different users inventory.) virtual bool CheckResultSteamID( SteamInventoryResult_t resultHandle, CSteamID steamIDExpected ) = 0; // Destroys a result handle and frees all associated memory. - METHOD_DESC(Destroys a result handle and frees all associated memory.) + STEAM_METHOD_DESC(Destroys a result handle and frees all associated memory.) virtual void DestroyResult( SteamInventoryResult_t resultHandle ) = 0; @@ -139,7 +139,7 @@ public: // cached results if called too frequently. It is suggested that you call // this function only when you are about to display the user's full inventory, // or if you expect that the inventory may have changed. - METHOD_DESC(Captures the entire state of the current users Steam inventory.) + STEAM_METHOD_DESC(Captures the entire state of the current users Steam inventory.) virtual bool GetAllItems( SteamInventoryResult_t *pResultHandle ) = 0; @@ -150,8 +150,8 @@ public: // For example, you could call GetItemsByID with the IDs of the user's // currently equipped cosmetic items and serialize this to a buffer, and // then transmit this buffer to other players upon joining a game. - METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.) - virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; + STEAM_METHOD_DESC(Captures the state of a subset of the current users Steam inventory identified by an array of item instance IDs.) + virtual bool GetItemsByID( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT( unCountInstanceIDs ) const SteamItemInstanceID_t *pInstanceIDs, uint32 unCountInstanceIDs ) = 0; // RESULT SERIALIZATION AND AUTHENTICATION @@ -169,7 +169,7 @@ public: // recommended to use "GetItemsByID" first to create a minimal result set. // Results have a built-in timestamp which will be considered "expired" after // an hour has elapsed. See DeserializeResult for expiration handling. - virtual bool SerializeResult( SteamInventoryResult_t resultHandle, OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; + virtual bool SerializeResult( SteamInventoryResult_t resultHandle, STEAM_OUT_BUFFER_COUNT(punOutBufferSize) void *pOutBuffer, uint32 *punOutBufferSize ) = 0; // Deserializes a result set and verifies the signature bytes. Returns false // if bRequireFullOnlineVerify is set but Steam is running in Offline mode. @@ -187,7 +187,7 @@ public: // ISteamUtils::GetServerRealTime() to determine how old the data is. You could // simply ignore the "expired" result code and continue as normal, or you // could challenge the player with expired data to send an updated result set. - virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; + virtual bool DeserializeResult( SteamInventoryResult_t *pOutResultHandle, STEAM_BUFFER_COUNT(punOutBufferSize) const void *pBuffer, uint32 unBufferSize, bool bRESERVED_MUST_BE_FALSE = false ) = 0; // INVENTORY ASYNC MODIFICATION @@ -199,13 +199,13 @@ public: // for your game. // If punArrayQuantity is not NULL, it should be the same length as pArrayItems and should // describe the quantity of each item to generate. - virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + virtual bool GenerateItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; // GrantPromoItems() checks the list of promotional items for which the user may be eligible // and grants the items (one time only). On success, the result set will include items which // were granted, if any. If no items were granted because the user isn't eligible for any // promotions, this is still considered a success. - METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).) + STEAM_METHOD_DESC(GrantPromoItems() checks the list of promotional items for which the user may be eligible and grants the items (one time only).) virtual bool GrantPromoItems( SteamInventoryResult_t *pResultHandle ) = 0; // AddPromoItem() / AddPromoItems() are restricted versions of GrantPromoItems(). Instead of @@ -213,12 +213,12 @@ public: // definition or set of item definitions. This can be useful if your game has custom UI for // showing a specific promo item to the user. virtual bool AddPromoItem( SteamInventoryResult_t *pResultHandle, SteamItemDef_t itemDef ) = 0; - virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; + virtual bool AddPromoItems( SteamInventoryResult_t *pResultHandle, STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, uint32 unArrayLength ) = 0; // ConsumeItem() removes items from the inventory, permanently. They cannot be recovered. // Not for the faint of heart - if your game implements item removal at all, a high-friction // UI confirmation process is highly recommended. - METHOD_DESC(ConsumeItem() removes items from the inventory permanently.) + STEAM_METHOD_DESC(ConsumeItem() removes items from the inventory permanently.) virtual bool ConsumeItem( SteamInventoryResult_t *pResultHandle, SteamItemInstanceID_t itemConsume, uint32 unQuantity ) = 0; // ExchangeItems() is an atomic combination of item generation and consumption. @@ -230,8 +230,8 @@ public: // components do not match the recipe, or do not contain sufficient quantity, the // exchange will fail. virtual bool ExchangeItems( SteamInventoryResult_t *pResultHandle, - ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, - ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; + STEAM_ARRAY_COUNT(unArrayGenerateLength) const SteamItemDef_t *pArrayGenerate, STEAM_ARRAY_COUNT(unArrayGenerateLength) const uint32 *punArrayGenerateQuantity, uint32 unArrayGenerateLength, + STEAM_ARRAY_COUNT(unArrayDestroyLength) const SteamItemInstanceID_t *pArrayDestroy, STEAM_ARRAY_COUNT(unArrayDestroyLength) const uint32 *punArrayDestroyQuantity, uint32 unArrayDestroyLength ) = 0; // TransferItemQuantity() is intended for use with items which are "stackable" (can have @@ -245,7 +245,7 @@ public: // // Deprecated. Calling this method is not required for proper playtime accounting. - METHOD_DESC( Deprecated method. Playtime accounting is performed on the Steam servers. ) + STEAM_METHOD_DESC( Deprecated method. Playtime accounting is performed on the Steam servers. ) virtual void SendItemDropHeartbeat() = 0; // Playtime credit must be consumed and turned into item drops by your game. Only item @@ -257,14 +257,14 @@ public: // to directly control rarity. // See your Steamworks configuration to set playtime drop rates for individual itemdefs. // The client library will suppress too-frequent calls to this method. - METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.) + STEAM_METHOD_DESC(Playtime credit must be consumed and turned into item drops by your game.) virtual bool TriggerItemDrop( SteamInventoryResult_t *pResultHandle, SteamItemDef_t dropListDefinition ) = 0; // Deprecated. This method is not supported. virtual bool TradeItems( SteamInventoryResult_t *pResultHandle, CSteamID steamIDTradePartner, - ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, - ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; + STEAM_ARRAY_COUNT(nArrayGiveLength) const SteamItemInstanceID_t *pArrayGive, STEAM_ARRAY_COUNT(nArrayGiveLength) const uint32 *pArrayGiveQuantity, uint32 nArrayGiveLength, + STEAM_ARRAY_COUNT(nArrayGetLength) const SteamItemInstanceID_t *pArrayGet, STEAM_ARRAY_COUNT(nArrayGetLength) const uint32 *pArrayGetQuantity, uint32 nArrayGetLength ) = 0; // ITEM DEFINITIONS @@ -281,7 +281,7 @@ public: // Every time new item definitions are available (eg, from the dynamic addition of new // item types while players are still in-game), a SteamInventoryDefinitionUpdate_t // callback will be fired. - METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.) + STEAM_METHOD_DESC(LoadItemDefinitions triggers the automatic load and refresh of item definitions.) virtual bool LoadItemDefinitions() = 0; // GetItemDefinitionIDs returns the set of all defined item definition IDs (which are @@ -290,8 +290,8 @@ public: // contain the total size necessary for a subsequent call. Otherwise, the call will // return false if and only if there is not enough space in the output array. virtual bool GetItemDefinitionIDs( - OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, - DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; // GetItemDefinitionProperty returns a string property from a given item definition. // Note that some properties (for example, "name") may be localized and will depend @@ -303,12 +303,12 @@ public: // to pchValueBuffer. If the results do not fit in the given buffer, partial // results may be copied. virtual bool GetItemDefinitionProperty( SteamItemDef_t iDefinition, const char *pchPropertyName, - OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; + STEAM_OUT_STRING_COUNT(punValueBufferSizeOut) char *pchValueBuffer, uint32 *punValueBufferSizeOut ) = 0; // Request the list of "eligible" promo items that can be manually granted to the given // user. These are promo items of type "manual" that won't be granted automatically. // An example usage of this is an item that becomes available every week. - CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t ) + STEAM_CALL_RESULT( SteamInventoryEligiblePromoItemDefIDs_t ) virtual SteamAPICall_t RequestEligiblePromoItemDefinitionsIDs( CSteamID steamID ) = 0; // After handling a SteamInventoryEligiblePromoItemDefIDs_t call result, use this @@ -316,19 +316,19 @@ public: // manually granted via the AddPromoItems() call. virtual bool GetEligiblePromoItemDefinitionIDs( CSteamID steamID, - OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, - DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; + STEAM_OUT_ARRAY_COUNT(punItemDefIDsArraySize,List of item definition IDs) SteamItemDef_t *pItemDefIDs, + STEAM_DESC(Size of array is passed in and actual size used is returned in this param) uint32 *punItemDefIDsArraySize ) = 0; // Starts the purchase process for the given item definitions. The callback SteamInventoryStartPurchaseResult_t // will be posted if Steam was able to initialize the transaction. // // Once the purchase has been authorized and completed by the user, the callback SteamInventoryResultReady_t // will be posted. - CALL_RESULT( SteamInventoryStartPurchaseResult_t ) - virtual SteamAPICall_t StartPurchase( ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; + STEAM_CALL_RESULT( SteamInventoryStartPurchaseResult_t ) + virtual SteamAPICall_t StartPurchase( STEAM_ARRAY_COUNT(unArrayLength) const SteamItemDef_t *pArrayItemDefs, STEAM_ARRAY_COUNT(unArrayLength) const uint32 *punArrayQuantity, uint32 unArrayLength ) = 0; // Request current prices for all applicable item definitions - CALL_RESULT( SteamInventoryRequestPricesResult_t ) + STEAM_CALL_RESULT( SteamInventoryRequestPricesResult_t ) virtual SteamAPICall_t RequestPrices() = 0; // Returns the number of items with prices. Need to call RequestPrices() first. @@ -336,13 +336,14 @@ public: // Returns item definition ids and their prices in the user's local currency. // Need to call RequestPrices() first. - virtual bool GetItemsWithPrices( ARRAY_COUNT(unArrayLength) OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, - ARRAY_COUNT(unArrayLength) OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pPrices, + virtual bool GetItemsWithPrices( STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pArrayItemDefs, Items with prices) SteamItemDef_t *pArrayItemDefs, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pCurrentPrices, + STEAM_ARRAY_COUNT(unArrayLength) STEAM_OUT_ARRAY_COUNT(pPrices, List of prices for the given item defs) uint64 *pBasePrices, uint32 unArrayLength ) = 0; // Retrieves the price for the item definition id // Returns false if there is no price stored for the item definition. - virtual bool GetItemPrice( SteamItemDef_t iDefinition, uint64 *pPrice ) = 0; + virtual bool GetItemPrice( SteamItemDef_t iDefinition, uint64 *pCurrentPrice, uint64 *pBasePrice ) = 0; // Create a request to update properties on items virtual SteamInventoryUpdateHandle_t StartUpdateProperties() = 0; @@ -358,8 +359,15 @@ public: }; -#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V002" +#define STEAMINVENTORY_INTERFACE_VERSION "STEAMINVENTORY_INTERFACE_V003" +// Global interface accessor +inline ISteamInventory *SteamInventory(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamInventory *, SteamInventory, STEAMINVENTORY_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamInventory *SteamGameServerInventory(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamInventory *, SteamGameServerInventory, STEAMINVENTORY_INTERFACE_VERSION ); // SteamInventoryResultReady_t callbacks are fired whenever asynchronous // results transition from "Pending" to "OK" or an error state. There will diff --git a/Generator/steam_sdk/isteammatchmaking.h b/Generator/steam_sdk/isteammatchmaking.h index 837d98b..d0c0cea 100644 --- a/Generator/steam_sdk/isteammatchmaking.h +++ b/Generator/steam_sdk/isteammatchmaking.h @@ -10,10 +10,8 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" +#include "steam_api_common.h" #include "matchmakingtypes.h" -#include "isteamclient.h" #include "isteamfriends.h" // lobby type description @@ -103,7 +101,7 @@ public: } */ // - CALL_RESULT( LobbyMatchList_t ) + STEAM_CALL_RESULT( LobbyMatchList_t ) virtual SteamAPICall_t RequestLobbyList() = 0; // filters for lobbies // this needs to be called before RequestLobbyList() to take effect @@ -134,14 +132,14 @@ public: // this is an asynchronous request // results will be returned by LobbyCreated_t callback and call result; lobby is joined & ready to use at this point // a LobbyEnter_t callback will also be received (since the local user is joining their own lobby) - CALL_RESULT( LobbyCreated_t ) + STEAM_CALL_RESULT( LobbyCreated_t ) virtual SteamAPICall_t CreateLobby( ELobbyType eLobbyType, int cMaxMembers ) = 0; // Joins an existing lobby // this is an asynchronous request // results will be returned by LobbyEnter_t callback & call result, check m_EChatRoomEnterResponse to see if was successful // lobby metadata is available to use immediately on this call completing - CALL_RESULT( LobbyEnter_t ) + STEAM_CALL_RESULT( LobbyEnter_t ) virtual SteamAPICall_t JoinLobby( CSteamID steamIDLobby ) = 0; // Leave a lobby; this will take effect immediately on the client side @@ -204,7 +202,7 @@ public: // *pSteamIDUser is filled in with the CSteamID of the member // *pvData is filled in with the message itself // return value is the number of bytes written into the buffer - virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; + virtual int GetLobbyChatEntry( CSteamID steamIDLobby, int iChatID, STEAM_OUT_STRUCT() CSteamID *pSteamIDUser, void *pvData, int cubData, EChatEntryType *peChatEntryType ) = 0; // Refreshes metadata for a lobby you're not necessarily in right now // you never do this for lobbies you're a member of, only if your @@ -220,7 +218,7 @@ public: // either the IP/Port or the steamID of the game server has to be valid, depending on how you want the clients to be able to connect virtual void SetLobbyGameServer( CSteamID steamIDLobby, uint32 unGameServerIP, uint16 unGameServerPort, CSteamID steamIDGameServer ) = 0; // returns the details of a game server set in a lobby - returns false if there is no game server set, or that lobby doesn't exist - virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; + virtual bool GetLobbyGameServer( CSteamID steamIDLobby, uint32 *punGameServerIP, uint16 *punGameServerPort, STEAM_OUT_STRUCT() CSteamID *psteamIDGameServer ) = 0; // set the limit on the # of users who can join the lobby virtual bool SetLobbyMemberLimit( CSteamID steamIDLobby, int cMaxMembers ) = 0; @@ -256,10 +254,13 @@ public: // after completion, the local user will no longer be the owner virtual void CheckForPSNGameBootInvite( unsigned int iGameBootAttributes ) = 0; #endif - CALL_BACK( LobbyChatUpdate_t ) + STEAM_CALL_BACK( LobbyChatUpdate_t ) }; #define STEAMMATCHMAKING_INTERFACE_VERSION "SteamMatchMaking009" +// Global interface accessor +inline ISteamMatchmaking *SteamMatchmaking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmaking *, SteamMatchmaking, STEAMMATCHMAKING_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Callback interfaces for server list functions (see ISteamMatchmakingServers below) @@ -391,12 +392,12 @@ public: // Request a new list of servers of a particular type. These calls each correspond to one of the EMatchMakingType values. // Each call allocates a new asynchronous request object. // Request object must be released by calling ReleaseRequest( hServerListRequest ) - virtual HServerListRequest RequestInternetServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestInternetServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; virtual HServerListRequest RequestLANServerList( AppId_t iApp, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; - virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFriendsServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestFavoritesServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestHistoryServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; + virtual HServerListRequest RequestSpectatorServerList( AppId_t iApp, STEAM_ARRAY_COUNT(nFilters) MatchMakingKeyValuePair_t **ppchFilters, uint32 nFilters, ISteamMatchmakingServerListResponse *pRequestServersResponse ) = 0; // Releases the asynchronous request object and cancels any pending query on it if there's a pending query in progress. // RefreshComplete callback is not posted when request is released. @@ -522,6 +523,10 @@ public: }; #define STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION "SteamMatchMakingServers002" +// Global interface accessor +inline ISteamMatchmakingServers *SteamMatchmakingServers(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMatchmakingServers *, SteamMatchmakingServers, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); + // game server flags const uint32 k_unFavoriteFlagNone = 0x00; const uint32 k_unFavoriteFlagFavorite = 0x01; // this game favorite entry is for the favorites list @@ -545,16 +550,181 @@ enum EChatMemberStateChange #define BChatMemberStateChangeRemoved( rgfChatMemberStateChangeFlags ) ( rgfChatMemberStateChangeFlags & ( k_EChatMemberStateChangeDisconnected | k_EChatMemberStateChangeLeft | k_EChatMemberStateChangeKicked | k_EChatMemberStateChangeBanned ) ) + //----------------------------------------------------------------------------- -// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) +// Purpose: Functions for match making services for clients to get to favorites +// and to operate on game lobbies. +//----------------------------------------------------------------------------- +class ISteamGameSearch +{ +public: + // ============================================================================================= + // Game Player APIs + + // a keyname and a list of comma separated values: one of which is must be found in order for the match to qualify + // fails if a search is currently in progress + virtual EGameSearchErrorCode_t AddGameSearchParams( const char *pchKeyToFind, const char *pchValuesToFind ) = 0; + + // all players in lobby enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // if not the owner of the lobby or search already in progress this call fails + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameWithLobby( CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax ) = 0; + + // user enter the queue and await a SearchForGameNotificationCallback_t callback. fails if another search is currently in progress + // periodic callbacks will be sent as queue time estimates change + virtual EGameSearchErrorCode_t SearchForGameSolo( int nPlayerMin, int nPlayerMax ) = 0; + + // after receiving SearchForGameResultCallback_t, accept or decline the game + // multiple SearchForGameResultCallback_t will follow as players accept game until the host starts or cancels the game + virtual EGameSearchErrorCode_t AcceptGame() = 0; + virtual EGameSearchErrorCode_t DeclineGame() = 0; + + // after receiving GameStartedByHostCallback_t get connection details to server + virtual EGameSearchErrorCode_t RetrieveConnectionDetails( CSteamID steamIDHost, char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // leaves queue if still waiting + virtual EGameSearchErrorCode_t EndGameSearch() = 0; + + // ============================================================================================= + // Game Host APIs + + // a keyname and a list of comma separated values: all the values you allow + virtual EGameSearchErrorCode_t SetGameHostParams( const char *pchKey, const char *pchValue ) = 0; + + // set connection details for players once game is found so they can connect to this server + virtual EGameSearchErrorCode_t SetConnectionDetails( const char *pchConnectionDetails, int cubConnectionDetails ) = 0; + + // mark server as available for more players with nPlayerMin,nPlayerMax desired + // accept no lobbies with playercount greater than nMaxTeamSize + // the set of lobbies returned must be partitionable into teams of no more than nMaxTeamSize + // RequestPlayersForGameNotificationCallback_t callback will be sent when the search has started + // multple RequestPlayersForGameResultCallback_t callbacks will follow when players are found + virtual EGameSearchErrorCode_t RequestPlayersForGame( int nPlayerMin, int nPlayerMax, int nMaxTeamSize ) = 0; + + // accept the player list and release connection details to players + // players will only be given connection details and host steamid when this is called + // ( allows host to accept after all players confirm, some confirm, or none confirm. decision is entirely up to the host ) + virtual EGameSearchErrorCode_t HostConfirmGameStart( uint64 ullUniqueGameID ) = 0; + + // cancel request and leave the pool of game hosts looking for players + // if a set of players has already been sent to host, all players will receive SearchForGameHostFailedToConfirm_t + virtual EGameSearchErrorCode_t CancelRequestPlayersForGame() = 0; + + // submit a result for one player. does not end the game. ullUniqueGameID continues to describe this game + virtual EGameSearchErrorCode_t SubmitPlayerResult( uint64 ullUniqueGameID, CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult ) = 0; + + // ends the game. no further SubmitPlayerResults for ullUniqueGameID will be accepted + // any future requests will provide a new ullUniqueGameID + virtual EGameSearchErrorCode_t EndGame( uint64 ullUniqueGameID ) = 0; + +}; +#define STEAMGAMESEARCH_INTERFACE_VERSION "SteamMatchGameSearch001" + +// Global interface accessor +inline ISteamGameSearch *SteamGameSearch(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamGameSearch *, SteamGameSearch, STEAMGAMESEARCH_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Purpose: Functions for quickly creating a Party with friends or acquaintances, +// EG from chat rooms. +//----------------------------------------------------------------------------- +enum ESteamPartyBeaconLocationType +{ + k_ESteamPartyBeaconLocationType_Invalid = 0, + k_ESteamPartyBeaconLocationType_ChatGroup = 1, + + k_ESteamPartyBeaconLocationType_Max, +}; + + #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif + +struct SteamPartyBeaconLocation_t +{ + ESteamPartyBeaconLocationType m_eType; + uint64 m_ulLocationID; +}; + +enum ESteamPartyBeaconLocationData +{ + k_ESteamPartyBeaconLocationDataInvalid = 0, + k_ESteamPartyBeaconLocationDataName = 1, + k_ESteamPartyBeaconLocationDataIconURLSmall = 2, + k_ESteamPartyBeaconLocationDataIconURLMedium = 3, + k_ESteamPartyBeaconLocationDataIconURLLarge = 4, +}; + +class ISteamParties +{ +public: + + // ============================================================================================= + // Party Client APIs + + // Enumerate any active beacons for parties you may wish to join + virtual uint32 GetNumActiveBeacons() = 0; + virtual PartyBeaconID_t GetBeaconByIndex( uint32 unIndex ) = 0; + virtual bool GetBeaconDetails( PartyBeaconID_t ulBeaconID, CSteamID *pSteamIDBeaconOwner, STEAM_OUT_STRUCT() SteamPartyBeaconLocation_t *pLocation, STEAM_OUT_STRING_COUNT(cchMetadata) char *pchMetadata, int cchMetadata ) = 0; + + // Join an open party. Steam will reserve one beacon slot for your SteamID, + // and return the necessary JoinGame string for you to use to connect + STEAM_CALL_RESULT( JoinPartyCallback_t ) + virtual SteamAPICall_t JoinParty( PartyBeaconID_t ulBeaconID ) = 0; + + // ============================================================================================= + // Party Host APIs + + // Get a list of possible beacon locations + virtual bool GetNumAvailableBeaconLocations( uint32 *puNumLocations ) = 0; + virtual bool GetAvailableBeaconLocations( SteamPartyBeaconLocation_t *pLocationList, uint32 uMaxNumLocations ) = 0; + + // Create a new party beacon and activate it in the selected location. + // unOpenSlots is the maximum number of users that Steam will send to you. + // When people begin responding to your beacon, Steam will send you + // PartyReservationCallback_t callbacks to let you know who is on the way. + STEAM_CALL_RESULT( CreateBeaconCallback_t ) + virtual SteamAPICall_t CreateBeacon( uint32 unOpenSlots, SteamPartyBeaconLocation_t *pBeaconLocation, const char *pchConnectString, const char *pchMetadata ) = 0; + + // Call this function when a user that had a reservation (see callback below) + // has successfully joined your party. + // Steam will manage the remaining open slots automatically. + virtual void OnReservationCompleted( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // To cancel a reservation (due to timeout or user input), call this. + // Steam will open a new reservation slot. + // Note: The user may already be in-flight to your game, so it's possible they will still connect and try to join your party. + virtual void CancelReservation( PartyBeaconID_t ulBeacon, CSteamID steamIDUser ) = 0; + + // Change the number of open beacon reservation slots. + // Call this if, for example, someone without a reservation joins your party (eg a friend, or via your own matchmaking system). + STEAM_CALL_RESULT( ChangeNumOpenSlotsCallback_t ) + virtual SteamAPICall_t ChangeNumOpenSlots( PartyBeaconID_t ulBeacon, uint32 unOpenSlots ) = 0; + + // Turn off the beacon. + virtual bool DestroyBeacon( PartyBeaconID_t ulBeacon ) = 0; + + // Utils + virtual bool GetBeaconLocationData( SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, STEAM_OUT_STRING_COUNT(cchDataStringOut) char *pchDataStringOut, int cchDataStringOut ) = 0; + +}; +#define STEAMPARTIES_INTERFACE_VERSION "SteamParties002" + +// Global interface accessor +inline ISteamParties *SteamParties(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParties *, SteamParties, STEAMPARTIES_INTERFACE_VERSION ); + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamMatchmaking (which go through the regular Steam callback registration system) + //----------------------------------------------------------------------------- // Purpose: a server was added/removed from the favorites list, you should refresh now //----------------------------------------------------------------------------- @@ -745,6 +915,171 @@ struct FavoritesListAccountsUpdated_t EResult m_eResult; }; + + +//----------------------------------------------------------------------------- +// Callbacks for ISteamGameSearch (which go through the regular Steam callback registration system) + +struct SearchForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 1 }; + + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID + + EResult m_eResult; // if search has started this result will be k_EResultOK, any other value indicates search has failed to start or has terminated + CSteamID m_lobbyID; // lobby ID if lobby search, invalid steamID otherwise + CSteamID m_steamIDEndedSearch; // if search was terminated, steamID that terminated search + + int32 m_nSecondsRemainingEstimate; + int32 m_cPlayersSearching; +}; + +// notification to all players searching that a game has been found +struct SearchForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 2 }; + + uint64 m_ullSearchID; + + EResult m_eResult; // if game/host was lost this will be an error value + + // if m_bGameFound is true the following are non-zero + int32 m_nCountPlayersInGame; + int32 m_nCountAcceptedGame; + // if m_steamIDHost is valid the host has started the game + CSteamID m_steamIDHost; + bool m_bFinalCallback; +}; + + +//----------------------------------------------------------------------------- +// ISteamGameSearch : Game Host API callbacks + +// callback from RequestPlayersForGame when the matchmaking service has started or ended search +// callback will also follow a call from CancelRequestPlayersForGame - m_bSearchInProgress will be false +struct RequestPlayersForGameProgressCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 11 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; // all future callbacks referencing this search will include this Search ID +}; + +// callback from RequestPlayersForGame +// one of these will be sent per player +// followed by additional callbacks when players accept or decline the game +struct RequestPlayersForGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 12 }; + + EResult m_eResult; // m_ullSearchID will be non-zero if this is k_EResultOK + uint64 m_ullSearchID; + + CSteamID m_SteamIDPlayerFound; // player steamID + CSteamID m_SteamIDLobby; // if the player is in a lobby, the lobby ID + enum PlayerAcceptState_t + { + k_EStateUnknown = 0, + k_EStatePlayerAccepted = 1, + k_EStatePlayerDeclined = 2, + }; + PlayerAcceptState_t m_ePlayerAcceptState; + int32 m_nPlayerIndex; + int32 m_nTotalPlayersFound; // expect this many callbacks at minimum + int32 m_nTotalPlayersAcceptedGame; + int32 m_nSuggestedTeamIndex; + uint64 m_ullUniqueGameID; +}; + + +struct RequestPlayersForGameFinalResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 13 }; + + EResult m_eResult; + uint64 m_ullSearchID; + uint64 m_ullUniqueGameID; +}; + + + +// this callback confirms that results were received by the matchmaking service for this player +struct SubmitPlayerResultResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 14 }; + + EResult m_eResult; + uint64 ullUniqueGameID; + CSteamID steamIDPlayer; +}; + + +// this callback confirms that the game is recorded as complete on the matchmaking service +// the next call to RequestPlayersForGame will generate a new unique game ID +struct EndGameResultCallback_t +{ + enum { k_iCallback = k_iSteamGameSearchCallbacks + 15 }; + + EResult m_eResult; + uint64 ullUniqueGameID; +}; + + +// Steam has responded to the user request to join a party via the given Beacon ID. +// If successful, the connect string contains game-specific instructions to connect +// to the game with that party. +struct JoinPartyCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 1 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; + CSteamID m_SteamIDBeaconOwner; + char m_rgchConnectString[256]; +}; + +// Response to CreateBeacon request. If successful, the beacon ID is provided. +struct CreateBeaconCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 2 }; + + EResult m_eResult; + PartyBeaconID_t m_ulBeaconID; +}; + +// Someone has used the beacon to join your party - they are in-flight now +// and we've reserved one of the open slots for them. +// You should confirm when they join your party by calling OnReservationCompleted(). +// Otherwise, Steam may timeout their reservation eventually. +struct ReservationNotificationCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 3 }; + + PartyBeaconID_t m_ulBeaconID; + CSteamID m_steamIDJoiner; +}; + +// Response to ChangeNumOpenSlots call +struct ChangeNumOpenSlotsCallback_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 4 }; + + EResult m_eResult; +}; + +// The list of possible Party beacon locations has changed +struct AvailableBeaconLocationsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 5 }; +}; + +// The list of active beacons may have changed +struct ActiveBeaconsUpdated_t +{ + enum { k_iCallback = k_iSteamPartiesCallbacks + 6 }; +}; + + #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteammusic.h b/Generator/steam_sdk/isteammusic.h index 779a4c2..ffa49a0 100644 --- a/Generator/steam_sdk/isteammusic.h +++ b/Generator/steam_sdk/isteammusic.h @@ -6,7 +6,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- // Purpose: @@ -44,22 +44,26 @@ public: #define STEAMMUSIC_INTERFACE_VERSION "STEAMMUSIC_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamMusic *SteamMusic(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusic *, SteamMusic, STEAMMUSIC_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif -DEFINE_CALLBACK( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( PlaybackStatusHasChanged_t, k_iSteamMusicCallbacks + 1 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) - CALLBACK_MEMBER( 0, float, m_flNewVolume ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( VolumeHasChanged_t, k_iSteamMusicCallbacks + 2 ) + STEAM_CALLBACK_MEMBER( 0, float, m_flNewVolume ) +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteammusicremote.h b/Generator/steam_sdk/isteammusicremote.h index ea29a7d..a36f4f8 100644 --- a/Generator/steam_sdk/isteammusicremote.h +++ b/Generator/steam_sdk/isteammusicremote.h @@ -6,7 +6,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "isteammusic.h" #define k_SteamMusicNameMaxLength 255 @@ -64,63 +64,67 @@ public: #define STEAMMUSICREMOTE_INTERFACE_VERSION "STEAMMUSICREMOTE_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamMusicRemote *SteamMusicRemote(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamMusicRemote *, SteamMusicRemote, STEAMMUSICREMOTE_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif -DEFINE_CALLBACK( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillActivate_t, k_iSteamMusicRemoteCallbacks + 1) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteWillDeactivate_t, k_iSteamMusicRemoteCallbacks + 2 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerRemoteToFront_t, k_iSteamMusicRemoteCallbacks + 3 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWillQuit_t, k_iSteamMusicRemoteCallbacks + 4 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlay_t, k_iSteamMusicRemoteCallbacks + 5 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPause_t, k_iSteamMusicRemoteCallbacks + 6 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayPrevious_t, k_iSteamMusicRemoteCallbacks + 7 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) -END_DEFINE_CALLBACK_0() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayNext_t, k_iSteamMusicRemoteCallbacks + 8 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) - CALLBACK_MEMBER( 0, bool, m_bShuffled ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsShuffled_t, k_iSteamMusicRemoteCallbacks + 9 ) + STEAM_CALLBACK_MEMBER( 0, bool, m_bShuffled ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) - CALLBACK_MEMBER(0, bool, m_bLooped ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsLooped_t, k_iSteamMusicRemoteCallbacks + 10 ) + STEAM_CALLBACK_MEMBER(0, bool, m_bLooped ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) - CALLBACK_MEMBER(0, float, m_flNewVolume) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsVolume_t, k_iSteamMusicCallbacks + 11 ) + STEAM_CALLBACK_MEMBER(0, float, m_flNewVolume) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) - CALLBACK_MEMBER(0, int, nID ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsQueueEntry_t, k_iSteamMusicCallbacks + 12 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) - CALLBACK_MEMBER(0, int, nID ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerSelectsPlaylistEntry_t, k_iSteamMusicCallbacks + 13 ) + STEAM_CALLBACK_MEMBER(0, int, nID ) +STEAM_CALLBACK_END(1) -DEFINE_CALLBACK( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) - CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( MusicPlayerWantsPlayingRepeatStatus_t, k_iSteamMusicRemoteCallbacks + 14 ) + STEAM_CALLBACK_MEMBER(0, int, m_nPlayingRepeatStatus ) +STEAM_CALLBACK_END(1) #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamnetworking.h b/Generator/steam_sdk/isteamnetworking.h index 8f70819..b1bf5fa 100644 --- a/Generator/steam_sdk/isteamnetworking.h +++ b/Generator/steam_sdk/isteamnetworking.h @@ -10,9 +10,7 @@ #pragma once #endif -#include "steamtypes.h" -#include "steamclientpublic.h" - +#include "steam_api_common.h" // list of possible errors returned by SendP2PPacket() API // these will be posted in the P2PSessionConnectFail_t callback @@ -63,7 +61,7 @@ enum EP2PSend #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct P2PSessionState_t { @@ -127,8 +125,14 @@ class ISteamNetworking { public: //////////////////////////////////////////////////////////////////////////////////////////// - // Session-less connection functions - // automatically establishes NAT-traversing or Relay server connections + // + // UDP-style (connectionless) networking interface. These functions send messages using + // an API organized around the destination. Reliable and unreliable messages are supported. + // + // For a more TCP-style interface (meaning you have a connection handle), see the functions below. + // Both interface styles can send both reliable and unreliable messages. + // + // Automatically establishes NAT-traversing or Relay server connections // Sends a P2P packet to the specified user // UDP-like, unreliable and a max packet size of 1200 bytes @@ -181,11 +185,18 @@ public: //////////////////////////////////////////////////////////////////////////////////////////// - // LISTEN / CONNECT style interface functions // - // This is an older set of functions designed around the Berkeley TCP sockets model - // it's preferential that you use the above P2P functions, they're more robust - // and these older functions will be removed eventually + // LISTEN / CONNECT connection-oriented interface functions + // + // These functions are more like a client-server TCP API. One side is the "server" + // and "listens" for incoming connections, which then must be "accepted." The "client" + // initiates a connection by "connecting." Sending and receiving is done through a + // connection handle. + // + // For a more UDP-style interface, where you do not track connection handles but + // simply send messages to a SteamID, use the UDP-style functions above. + // + // Both methods can send both reliable and unreliable methods. // //////////////////////////////////////////////////////////////////////////////////////////// @@ -261,13 +272,21 @@ public: }; #define STEAMNETWORKING_INTERFACE_VERSION "SteamNetworking005" +// Global interface accessor +inline ISteamNetworking *SteamNetworking(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamNetworking, STEAMNETWORKING_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamNetworking *SteamGameServerNetworking(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworking *, SteamGameServerNetworking, STEAMNETWORKING_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif // callback notification - a user wants to talk to us over the P2P channel via the SendP2PPacket() API diff --git a/Generator/steam_sdk/isteamnetworkingsockets.h b/Generator/steam_sdk/isteamnetworkingsockets.h new file mode 100644 index 0000000..e12e5e7 --- /dev/null +++ b/Generator/steam_sdk/isteamnetworkingsockets.h @@ -0,0 +1,489 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Networking API similar to Berkeley sockets, but for games. +// - connection-oriented API (like TCP, not UDP) +// - but unlike TCP, it's message-oriented, not stream-oriented +// - mix of reliable and unreliable messages +// - fragmentation and reassembly +// - Supports connectivity over plain UDPv4 +// - Also supports SDR ("Steam Datagram Relay") connections, which are +// addressed by SteamID. There is a "P2P" use case and also a "hosted +// dedicated server" use case. +// +//============================================================================= + +#ifndef ISTEAMNETWORKINGSOCKETS +#define ISTEAMNETWORKINGSOCKETS +#ifdef _WIN32 +#pragma once +#endif + +#include "steamnetworkingtypes.h" + +class ISteamNetworkingSocketsCallbacks; + +//----------------------------------------------------------------------------- +/// Lower level networking interface that more closely mirrors the standard +/// Berkeley sockets model. Sockets are hard! You should probably only use +/// this interface under the existing circumstances: +/// +/// - You have an existing socket-based codebase you want to port, or coexist with. +/// - You want to be able to connect based on IP address, rather than (just) Steam ID. +/// - You need low-level control of bandwidth utilization, when to drop packets, etc. +/// +/// Note that neither of the terms "connection" and "socket" will correspond +/// one-to-one with an underlying UDP socket. An attempt has been made to +/// keep the semantics as similar to the standard socket model when appropriate, +/// but some deviations do exist. +class ISteamNetworkingSockets +{ +public: + + /// Creates a "server" socket that listens for clients to connect to by + /// calling ConnectByIPAddress, over ordinary UDP (IPv4 or IPv6) + /// + /// You must select a specific local port to listen on and set it + /// the port field of the local address. + /// + /// Usually you wil set the IP portion of the address to zero, (SteamNetworkingIPAddr::Clear()). + /// This means that you will not bind to any particular local interface. In addition, + /// if possible the socket will be bound in "dual stack" mode, which means that it can + /// accept both IPv4 and IPv6 clients. If you wish to bind a particular interface, then + /// set the local address to the appropriate IPv4 or IPv6 IP. + /// + /// When a client attempts to connect, a SteamNetConnectionStatusChangedCallback_t + /// will be posted. The connection will be in the connecting state. + virtual HSteamListenSocket CreateListenSocketIP( const SteamNetworkingIPAddr &localAddress ) = 0; + + /// Creates a connection and begins talking to a "server" over UDP at the + /// given IPv4 or IPv6 address. The remote host must be listening with a + /// matching call to CreateListenSocketIP on the specified port. + /// + /// A SteamNetConnectionStatusChangedCallback_t callback will be triggered when we start + /// connecting, and then another one on either timeout or successful connection. + /// + /// If the server does not have any identity configured, then their network address + /// will be the only identity in use. Or, the network host may provide a platform-specific + /// identity with or without a valid certificate to authenticate that identity. (These + /// details will be contained in the SteamNetConnectionStatusChangedCallback_t.) It's + /// up to your application to decide whether to allow the connection. + /// + /// By default, all connections will get basic encryption sufficient to prevent + /// casual eavesdropping. But note that without certificates (or a shared secret + /// distributed through some other out-of-band mechanism), you don't have any + /// way of knowing who is actually on the other end, and thus are vulnerable to + /// man-in-the-middle attacks. + virtual HSteamNetConnection ConnectByIPAddress( const SteamNetworkingIPAddr &address ) = 0; + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + /// Like CreateListenSocketIP, but clients will connect using ConnectP2P + /// + /// nVirtualPort specifies how clients can connect to this socket using + /// ConnectP2P. It's very common for applications to only have one listening socket; + /// in that case, use zero. If you need to open multiple listen sockets and have clients + /// be able to connect to one or the other, then nVirtualPort should be a small integer (<1000) + /// unique to each listen socket you create. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamListenSocket CreateListenSocketP2P( int nVirtualPort ) = 0; + + /// Begin connecting to a server that is identified using a platform-specific identifier. + /// This requires some sort of third party rendezvous service, and will depend on the + /// platform and what other libraries and services you are integrating with. + /// + /// At the time of this writing, there is only one supported rendezvous service: Steam. + /// Set the SteamID (whether "user" or "gameserver") and Steam will determine if the + /// client is online and facilitate a relay connection. Note that all P2P connections on + /// Steam are currently relayed. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamNetConnection ConnectP2P( const SteamNetworkingIdentity &identityRemote, int nVirtualPort ) = 0; +#endif + + /// Accept an incoming connection that has been received on a listen socket. + /// + /// When a connection attempt is received (perhaps after a few basic handshake + /// packets have been exchanged to prevent trivial spoofing), a connection interface + /// object is created in the k_ESteamNetworkingConnectionState_Connecting state + /// and a SteamNetConnectionStatusChangedCallback_t is posted. At this point, your + /// application MUST either accept or close the connection. (It may not ignore it.) + /// Accepting the connection will transition it either into the connected state, + /// or the finding route state, depending on the connection type. + /// + /// You should take action within a second or two, because accepting the connection is + /// what actually sends the reply notifying the client that they are connected. If you + /// delay taking action, from the client's perspective it is the same as the network + /// being unresponsive, and the client may timeout the connection attempt. In other + /// words, the client cannot distinguish between a delay caused by network problems + /// and a delay caused by the application. + /// + /// This means that if your application goes for more than a few seconds without + /// processing callbacks (for example, while loading a map), then there is a chance + /// that a client may attempt to connect in that interval and fail due to timeout. + /// + /// If the application does not respond to the connection attempt in a timely manner, + /// and we stop receiving communication from the client, the connection attempt will + /// be timed out locally, transitioning the connection to the + /// k_ESteamNetworkingConnectionState_ProblemDetectedLocally state. The client may also + /// close the connection before it is accepted, and a transition to the + /// k_ESteamNetworkingConnectionState_ClosedByPeer is also possible depending the exact + /// sequence of events. + /// + /// Returns k_EResultInvalidParam if the handle is invalid. + /// Returns k_EResultInvalidState if the connection is not in the appropriate state. + /// (Remember that the connection state could change in between the time that the + /// notification being posted to the queue and when it is received by the application.) + virtual EResult AcceptConnection( HSteamNetConnection hConn ) = 0; + + /// Disconnects from the remote host and invalidates the connection handle. + /// Any unread data on the connection is discarded. + /// + /// nReason is an application defined code that will be received on the other + /// end and recorded (when possible) in backend analytics. The value should + /// come from a restricted range. (See ESteamNetConnectionEnd.) If you don't need + /// to communicate any information to the remote host, and do not want analytics to + /// be able to distinguish "normal" connection terminations from "exceptional" ones, + /// You may pass zero, in which case the generic value of + /// k_ESteamNetConnectionEnd_App_Generic will be used. + /// + /// pszDebug is an optional human-readable diagnostic string that will be received + /// by the remote host and recorded (when possible) in backend analytics. + /// + /// If you wish to put the socket into a "linger" state, where an attempt is made to + /// flush any remaining sent data, use bEnableLinger=true. Otherwise reliable data + /// is not flushed. + /// + /// If the connection has already ended and you are just freeing up the + /// connection interface, the reason code, debug string, and linger flag are + /// ignored. + virtual bool CloseConnection( HSteamNetConnection hPeer, int nReason, const char *pszDebug, bool bEnableLinger ) = 0; + + /// Destroy a listen socket. All the connections that were accepting on the listen + /// socket are closed ungracefully. + virtual bool CloseListenSocket( HSteamListenSocket hSocket ) = 0; + + /// Set connection user data. the data is returned in the following places + /// - You can query it using GetConnectionUserData. + /// - The SteamNetworkingmessage_t structure. + /// - The SteamNetConnectionInfo_t structure. (Which is a member of SteamNetConnectionStatusChangedCallback_t.) + /// + /// Returns false if the handle is invalid. + virtual bool SetConnectionUserData( HSteamNetConnection hPeer, int64 nUserData ) = 0; + + /// Fetch connection user data. Returns -1 if handle is invalid + /// or if you haven't set any userdata on the connection. + virtual int64 GetConnectionUserData( HSteamNetConnection hPeer ) = 0; + + /// Set a name for the connection, used mostly for debugging + virtual void SetConnectionName( HSteamNetConnection hPeer, const char *pszName ) = 0; + + /// Fetch connection name. Returns false if handle is invalid + virtual bool GetConnectionName( HSteamNetConnection hPeer, char *pszName, int nMaxLen ) = 0; + + /// Send a message to the remote host on the specified connection. + /// + /// nSendFlags determines the delivery guarantees that will be provided, + /// when data should be buffered, etc. E.g. k_nSteamNetworkingSend_Unreliable + /// + /// Note that the semantics we use for messages are not precisely + /// the same as the semantics of a standard "stream" socket. + /// (SOCK_STREAM) For an ordinary stream socket, the boundaries + /// between chunks are not considered relevant, and the sizes of + /// the chunks of data written will not necessarily match up to + /// the sizes of the chunks that are returned by the reads on + /// the other end. The remote host might read a partial chunk, + /// or chunks might be coalesced. For the message semantics + /// used here, however, the sizes WILL match. Each send call + /// will match a successful read call on the remote host + /// one-for-one. If you are porting existing stream-oriented + /// code to the semantics of reliable messages, your code should + /// work the same, since reliable message semantics are more + /// strict than stream semantics. The only caveat is related to + /// performance: there is per-message overhead to retain the + /// message sizes, and so if your code sends many small chunks + /// of data, performance will suffer. Any code based on stream + /// sockets that does not write excessively small chunks will + /// work without any changes. + /// + /// Returns: + /// - k_EResultInvalidParam: invalid connection handle, or the individual message is too big. + /// (See k_cbMaxSteamNetworkingSocketsMessageSizeSend) + /// - k_EResultInvalidState: connection is in an invalid state + /// - k_EResultNoConnection: connection has ended + /// - k_EResultIgnored: You used k_nSteamNetworkingSend_NoDelay, and the message was dropped because + /// we were not ready to send it. + /// - k_EResultLimitExceeded: there was already too much data queued to be sent. + /// (See k_ESteamNetworkingConfig_SendBufferSize) + virtual EResult SendMessageToConnection( HSteamNetConnection hConn, const void *pData, uint32 cbData, int nSendFlags ) = 0; + + /// Flush any messages waiting on the Nagle timer and send them + /// at the next transmission opportunity (often that means right now). + /// + /// If Nagle is enabled (it's on by default) then when calling + /// SendMessageToConnection the message will be buffered, up to the Nagle time + /// before being sent, to merge small messages into the same packet. + /// (See k_ESteamNetworkingConfig_NagleTime) + /// + /// Returns: + /// k_EResultInvalidParam: invalid connection handle + /// k_EResultInvalidState: connection is in an invalid state + /// k_EResultNoConnection: connection has ended + /// k_EResultIgnored: We weren't (yet) connected, so this operation has no effect. + virtual EResult FlushMessagesOnConnection( HSteamNetConnection hConn ) = 0; + + /// Fetch the next available message(s) from the connection, if any. + /// Returns the number of messages returned into your array, up to nMaxMessages. + /// If the connection handle is invalid, -1 is returned. + /// + /// The order of the messages returned in the array is relevant. + /// Reliable messages will be received in the order they were sent (and with the + /// same sizes --- see SendMessageToConnection for on this subtle difference from a stream socket). + /// + /// Unreliable messages may be dropped, or delivered out of order withrespect to + /// each other or with respect to reliable messages. The same unreliable message + /// may be received multiple times. + /// + /// If any messages are returned, you MUST call SteamNetworkingMessage_t::Release() on each + /// of them free up resources after you are done. It is safe to keep the object alive for + /// a little while (put it into some queue, etc), and you may call Release() from any thread. + virtual int ReceiveMessagesOnConnection( HSteamNetConnection hConn, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Same as ReceiveMessagesOnConnection, but will return the next message available + /// on any connection that was accepted through the specified listen socket. Examine + /// SteamNetworkingMessage_t::m_conn to know which client connection. + /// + /// Delivery order of messages among different clients is not defined. They may + /// be returned in an order different from what they were actually received. (Delivery + /// order of messages from the same client is well defined, and thus the order of the + /// messages is relevant!) + virtual int ReceiveMessagesOnListenSocket( HSteamListenSocket hSocket, SteamNetworkingMessage_t **ppOutMessages, int nMaxMessages ) = 0; + + /// Returns basic information about the high-level state of the connection. + virtual bool GetConnectionInfo( HSteamNetConnection hConn, SteamNetConnectionInfo_t *pInfo ) = 0; + + /// Returns a small set of information about the real-time state of the connection + /// Returns false if the connection handle is invalid, or the connection has ended. + virtual bool GetQuickConnectionStatus( HSteamNetConnection hConn, SteamNetworkingQuickConnectionStatus *pStats ) = 0; + + /// Returns detailed connection stats in text format. Useful + /// for dumping to a log, etc. + /// + /// Returns: + /// -1 failure (bad connection handle) + /// 0 OK, your buffer was filled in and '\0'-terminated + /// >0 Your buffer was either nullptr, or it was too small and the text got truncated. + /// Try again with a buffer of at least N bytes. + virtual int GetDetailedConnectionStatus( HSteamNetConnection hConn, char *pszBuf, int cbBuf ) = 0; + + /// Returns local IP and port that a listen socket created using CreateListenSocketIP is bound to. + /// + /// An IPv6 address of ::0 means "any IPv4 or IPv6" + /// An IPv6 address of ::ffff:0000:0000 means "any IPv4" + virtual bool GetListenSocketAddress( HSteamListenSocket hSocket, SteamNetworkingIPAddr *address ) = 0; + + /// Create a pair of connections that are talking to each other, e.g. a loopback connection. + /// This is very useful for testing, or so that your client/server code can work the same + /// even when you are running a local "server". + /// + /// The two connections will immediately be placed into the connected state, and no callbacks + /// will be posted immediately. After this, if you close either connection, the other connection + /// will receive a callback, exactly as if they were communicating over the network. You must + /// close *both* sides in order to fully clean up the resources! + /// + /// By default, internal buffers are used, completely bypassing the network, the chopping up of + /// messages into packets, encryption, copying the payload, etc. This means that loopback + /// packets, by default, will not simulate lag or loss. Passing true for bUseNetworkLoopback will + /// cause the socket pair to send packets through the local network loopback device (127.0.0.1) + /// on ephemeral ports. Fake lag and loss are supported in this case, and CPU time is expended + /// to encrypt and decrypt. + /// + /// If you wish to assign a specific identity to either connection, you may pass a particular + /// identity. Otherwise, if you pass nullptr, the respective connection will assume a generic + /// "localhost" identity. If you use real network loopback, this might be translated to the + /// actual bound loopback port. Otherwise, the port will be zero. + virtual bool CreateSocketPair( HSteamNetConnection *pOutConnection1, HSteamNetConnection *pOutConnection2, bool bUseNetworkLoopback, const SteamNetworkingIdentity *pIdentity1, const SteamNetworkingIdentity *pIdentity2 ) = 0; + + /// Get the identity assigned to this interface. + /// E.g. on Steam, this is the user's SteamID, or for the gameserver interface, the SteamID assigned + /// to the gameserver. Returns false and sets the result to an invalid identity if we don't know + /// our identity yet. (E.g. GameServer has not logged in. On Steam, the user will know their SteamID + /// even if they are not signed into Steam.) + virtual bool GetIdentity( SteamNetworkingIdentity *pIdentity ) = 0; + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Clients connecting to dedicated servers hosted in a data center, + // using central-authority-granted tickets. + // + + /// Call this when you receive a ticket from your backend / matchmaking system. Puts the + /// ticket into a persistent cache, and optionally returns the parsed ticket. + /// + /// See stamdatagram_ticketgen.h for more details. + virtual bool ReceivedRelayAuthTicket( const void *pvTicket, int cbTicket, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Search cache for a ticket to talk to the server on the specified virtual port. + /// If found, returns the number of seconds until the ticket expires, and optionally + /// the complete cracked ticket. Returns 0 if we don't have a ticket. + /// + /// Typically this is useful just to confirm that you have a ticket, before you + /// call ConnectToHostedDedicatedServer to connect to the server. + virtual int FindRelayAuthTicketForServer( const SteamNetworkingIdentity &identityGameServer, int nVirtualPort, SteamDatagramRelayAuthTicket *pOutParsedTicket ) = 0; + + /// Client call to connect to a server hosted in a Valve data center, on the specified virtual + /// port. You must have placed a ticket for this server into the cache, or else this connect attempt will fail! + /// + /// You may wonder why tickets are stored in a cache, instead of simply being passed as an argument + /// here. The reason is to make reconnection to a gameserver robust, even if the client computer loses + /// connection to Steam or the central backend, or the app is restarted or crashes, etc. + /// + /// If you use this, you probably want to call ISteamNetworkingUtils::InitializeRelayNetworkAccess() + /// when your app initializes + virtual HSteamNetConnection ConnectToHostedDedicatedServer( const SteamNetworkingIdentity &identityTarget, int nVirtualPort ) = 0; + + // + // Servers hosted in Valve data centers + // + + /// Returns the value of the SDR_LISTEN_PORT environment variable. This + /// is the UDP server your server will be listening on. This will + /// configured automatically for you in production environments. (You + /// should set it yourself for testing.) + virtual uint16 GetHostedDedicatedServerPort() = 0; + + /// If you are running in a production data center, this will return the data + /// center code. Returns 0 otherwise. + virtual SteamNetworkingPOPID GetHostedDedicatedServerPOPID() = 0; + + /// Return info about the hosted server. You will need to send this information to your + /// backend, and put it in tickets, so that the relays will know how to forward traffic from + /// clients to your server. See SteamDatagramRelayAuthTicket for more info. + /// + /// NOTE ABOUT DEVELOPMENT ENVIRONMENTS: + /// In production in our data centers, these parameters are configured via environment variables. + /// In development, the only one you need to set is SDR_LISTEN_PORT, which is the local port you + /// want to listen on. Furthermore, if you are running your server behind a corporate firewall, + /// you probably will not be able to put the routing information returned by this function into + /// tickets. Instead, it should be a public internet address that the relays can use to send + /// data to your server. So you might just end up hardcoding a public address and setup port + /// forwarding on your corporate firewall. In that case, the port you put into the ticket + /// needs to be the public-facing port opened on your firewall, if it is different from the + /// actual server port. + /// + /// This function will fail if SteamDatagramServer_Init has not been called. + /// + /// Returns false if the SDR_LISTEN_PORT environment variable is not set. + virtual bool GetHostedDedicatedServerAddress( SteamDatagramHostedAddress *pRouting ) = 0; + + /// Create a listen socket on the specified virtual port. The physical UDP port to use + /// will be determined by the SDR_LISTEN_PORT environment variable. If a UDP port is not + /// configured, this call will fail. + /// + /// Note that this call MUST be made through the SteamGameServerNetworkingSockets() interface + virtual HSteamListenSocket CreateHostedDedicatedServerListenSocket( int nVirtualPort ) = 0; + +#endif // #ifndef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // Invoke all callbacks queued for this interface. + // On Steam, callbacks are dispatched via the ordinary Steamworks callbacks mechanism. + // So if you have code that is also targeting Steam, you should call this at about the + // same time you would call SteamAPI_RunCallbacks and SteamGameServer_RunCallbacks. +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + virtual void RunCallbacks( ISteamNetworkingSocketsCallbacks *pCallbacks ) = 0; +#endif +protected: + ~ISteamNetworkingSockets(); // Silence some warnings +}; +#define STEAMNETWORKINGSOCKETS_INTERFACE_VERSION "SteamNetworkingSockets002" + +extern "C" { + +// Global accessor. +#if defined( STEAMNETWORKINGSOCKETS_PARTNER ) + + // Standalone lib. Use different symbol name, so that we can dynamically switch between steamclient.dll + // and the standalone lib + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets_Lib(); + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamGameServerNetworkingSockets_Lib(); + inline ISteamNetworkingSockets *SteamNetworkingSockets() { return SteamNetworkingSockets_Lib(); } + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets() { return SteamGameServerNetworkingSockets_Lib(); } + +#elif defined( STEAMNETWORKINGSOCKETS_OPENSOURCE ) + + // Opensource GameNetworkingSockets + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingSockets *SteamNetworkingSockets(); + +#else + + // Steamworks SDK + inline ISteamNetworkingSockets *SteamNetworkingSockets(); + STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamNetworkingSockets, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); + inline ISteamNetworkingSockets *SteamGameServerNetworkingSockets(); + STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamNetworkingSockets *, SteamGameServerNetworkingSockets, STEAMNETWORKINGSOCKETS_INTERFACE_VERSION ); +#endif + +/// Callback struct used to notify when a connection has changed state +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// This callback is posted whenever a connection is created, destroyed, or changes state. +/// The m_info field will contain a complete description of the connection at the time the +/// change occurred and the callback was posted. In particular, m_eState will have the +/// new connection state. +/// +/// You will usually need to listen for this callback to know when: +/// - A new connection arrives on a listen socket. +/// m_info.m_hListenSocket will be set, m_eOldState = k_ESteamNetworkingConnectionState_None, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_Connecting. +/// See ISteamNetworkigSockets::AcceptConnection. +/// - A connection you initiated has been accepted by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting, and +/// m_info.m_eState = k_ESteamNetworkingConnectionState_Connected. +/// Some connections might transition to k_ESteamNetworkingConnectionState_FindingRoute first. +/// - A connection has been actively rejected or closed by the remote host. +/// m_eOldState = k_ESteamNetworkingConnectionState_Connecting or k_ESteamNetworkingConnectionState_Connected, +/// and m_info.m_eState = k_ESteamNetworkingConnectionState_ClosedByPeer. m_info.m_eEndReason +/// and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// - A problem was detected with the connection, and it has been closed by the local host. +/// The most common failure is timeout, but other configuration or authentication failures +/// can cause this. m_eOldState = k_ESteamNetworkingConnectionState_Connecting or +/// k_ESteamNetworkingConnectionState_Connected, and m_info.m_eState = k_ESteamNetworkingConnectionState_ProblemDetectedLocally. +/// m_info.m_eEndReason and m_info.m_szEndDebug will have for more details. +/// NOTE: upon receiving this callback, you must still destroy the connection using +/// ISteamNetworkingSockets::CloseConnection to free up local resources. (The details +/// passed to the function are not used in this case, since the connection is already closed.) +/// +/// Remember that callbacks are posted to a queue, and networking connections can +/// change at any time. It is possible that the connection has already changed +/// state by the time you process this callback. +/// +/// Also note that callbacks will be posted when connections are created and destroyed by your own API calls. +struct SteamNetConnectionStatusChangedCallback_t +{ + enum { k_iCallback = k_iSteamNetworkingSocketsCallbacks + 1 }; + + /// Connection handle + HSteamNetConnection m_hConn; + + /// Full connection info + SteamNetConnectionInfo_t m_info; + + /// Previous state. (Current state is in m_info.m_eState) + ESteamNetworkingConnectionState m_eOldState; +}; +#pragma pack( pop ) + +} + +#endif // ISTEAMNETWORKINGSOCKETS diff --git a/Generator/steam_sdk/isteamnetworkingutils.h b/Generator/steam_sdk/isteamnetworkingutils.h new file mode 100644 index 0000000..5597be2 --- /dev/null +++ b/Generator/steam_sdk/isteamnetworkingutils.h @@ -0,0 +1,302 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef ISTEAMNETWORKINGUTILS +#define ISTEAMNETWORKINGUTILS +#ifdef _WIN32 +#pragma once +#endif + +#include + +#include "steamnetworkingtypes.h" +struct SteamDatagramRelayAuthTicket; + +//----------------------------------------------------------------------------- +/// Misc networking utilities for checking the local networking environment +/// and estimating pings. +class ISteamNetworkingUtils +{ +public: +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Initialization + // + + /// If you know that you are going to be using the relay network, call + /// this to initialize the relay network or check if that initialization + /// has completed. If you do not call this, the initialization will + /// happen the first time you use a feature that requires access to the + /// relay network, and that use will be delayed. + /// + /// Returns true if initialization has completed successfully. + /// (It will probably return false on the first call.) + /// + /// Typically initialization completes in a few seconds. + /// + /// Note: dedicated servers hosted with Valve do *not* need to call + /// this, since they do not make routing decisions. However, if the + /// dedicated server will be using P2P functionality, it will act as + /// a "client" and this should be called. + inline bool InitializeRelayNetworkAccess(); + + // + // "Ping location" functions + // + // We use the ping times to the valve relays deployed worldwide to + // generate a "marker" that describes the location of an Internet host. + // Given two such markers, we can estimate the network latency between + // two hosts, without sending any packets. The estimate is based on the + // optimal route that is found through the Valve network. If you are + // using the Valve network to carry the traffic, then this is precisely + // the ping you want. If you are not, then the ping time will probably + // still be a reasonable estimate. + // + // This is extremely useful to select peers for matchmaking! + // + // The markers can also be converted to a string, so they can be transmitted. + // We have a separate library you can use on your backend to manipulate + // these objects. (See steamdatagram_ticketgen.h) + + /// Return location info for the current host. Returns the approximate + /// age of the data, in seconds, or -1 if no data is available. + /// + /// It takes a few seconds to initialize access to the relay network. If + /// you call this very soon after calling InitializeRelayNetworkAccess, + /// the data may not be available yet. + /// + /// This always return the most up-to-date information we have available + /// right now, even if we are in the middle of re-calculating ping times. + virtual float GetLocalPingLocation( SteamNetworkPingLocation_t &result ) = 0; + + /// Estimate the round-trip latency between two arbitrary locations, in + /// milliseconds. This is a conservative estimate, based on routing through + /// the relay network. For most basic relayed connections, this ping time + /// will be pretty accurate, since it will be based on the route likely to + /// be actually used. + /// + /// If a direct IP route is used (perhaps via NAT traversal), then the route + /// will be different, and the ping time might be better. Or it might actually + /// be a bit worse! Standard IP routing is frequently suboptimal! + /// + /// But even in this case, the estimate obtained using this method is a + /// reasonable upper bound on the ping time. (Also it has the advantage + /// of returning immediately and not sending any packets.) + /// + /// In a few cases we might not able to estimate the route. In this case + /// a negative value is returned. k_nSteamNetworkingPing_Failed means + /// the reason was because of some networking difficulty. (Failure to + /// ping, etc) k_nSteamNetworkingPing_Unknown is returned if we cannot + /// currently answer the question for some other reason. + /// + /// Do you need to be able to do this from a backend/matchmaking server? + /// You are looking for the "ticketgen" library. + virtual int EstimatePingTimeBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ) = 0; + + /// Same as EstimatePingTime, but assumes that one location is the local host. + /// This is a bit faster, especially if you need to calculate a bunch of + /// these in a loop to find the fastest one. + /// + /// In rare cases this might return a slightly different estimate than combining + /// GetLocalPingLocation with EstimatePingTimeBetweenTwoLocations. That's because + /// this function uses a slightly more complete set of information about what + /// route would be taken. + virtual int EstimatePingTimeFromLocalHost( const SteamNetworkPingLocation_t &remoteLocation ) = 0; + + /// Convert a ping location into a text format suitable for sending over the wire. + /// The format is a compact and human readable. However, it is subject to change + /// so please do not parse it yourself. Your buffer must be at least + /// k_cchMaxSteamNetworkingPingLocationString bytes. + virtual void ConvertPingLocationToString( const SteamNetworkPingLocation_t &location, char *pszBuf, int cchBufSize ) = 0; + + /// Parse back SteamNetworkPingLocation_t string. Returns false if we couldn't understand + /// the string. + virtual bool ParsePingLocationString( const char *pszString, SteamNetworkPingLocation_t &result ) = 0; + + // + // Initialization / ping measurement status + // + + /// Check if the ping data of sufficient recency is available, and if + /// it's too old, start refreshing it. + /// + /// Please only call this function when you *really* do need to force an + /// immediate refresh of the data. (For example, in response to a specific + /// user input to refresh this information.) Don't call it "just in case", + /// before every connection, etc. That will cause extra traffic to be sent + /// for no benefit. The library will automatically refresh the information + /// as needed. + /// + /// Returns true if sufficiently recent data is already available. + /// + /// Returns false if sufficiently recent data is not available. In this + /// case, ping measurement is initiated, if it is not already active. + /// (You cannot restart a measurement already in progress.) + virtual bool CheckPingDataUpToDate( float flMaxAgeSeconds ) = 0; + + /// Return true if we are taking ping measurements to update our ping + /// location or select optimal routing. Ping measurement typically takes + /// a few seconds, perhaps up to 10 seconds. + virtual bool IsPingMeasurementInProgress() = 0; + + // + // List of Valve data centers, and ping times to them. This might + // be useful to you if you are use our hosting, or just need to measure + // latency to a cloud data center where we are running relays. + // + + /// Fetch ping time of best available relayed route from this host to + /// the specified data center. + virtual int GetPingToDataCenter( SteamNetworkingPOPID popID, SteamNetworkingPOPID *pViaRelayPoP ) = 0; + + /// Get *direct* ping time to the relays at the data center. + virtual int GetDirectPingToPOP( SteamNetworkingPOPID popID ) = 0; + + /// Get number of network points of presence in the config + virtual int GetPOPCount() = 0; + + /// Get list of all POP IDs. Returns the number of entries that were filled into + /// your list. + virtual int GetPOPList( SteamNetworkingPOPID *list, int nListSz ) = 0; +#endif // #ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR + + // + // Misc + // + + /// Fetch current timestamp. This timer has the following properties: + /// + /// - Monotonicity is guaranteed. + /// - The initial value will be at least 24*3600*30*1e6, i.e. about + /// 30 days worth of microseconds. In this way, the timestamp value of + /// 0 will always be at least "30 days ago". Also, negative numbers + /// will never be returned. + /// - Wraparound / overflow is not a practical concern. + /// + /// If you are running under the debugger and stop the process, the clock + /// might not advance the full wall clock time that has elapsed between + /// calls. If the process is not blocked from normal operation, the + /// timestamp values will track wall clock time, even if you don't call + /// the function frequently. + /// + /// The value is only meaningful for this run of the process. Don't compare + /// it to values obtained on another computer, or other runs of the same process. + virtual SteamNetworkingMicroseconds GetLocalTimestamp() = 0; + + /// Set a function to receive network-related information that is useful for debugging. + /// This can be very useful during development, but it can also be useful for troubleshooting + /// problems with tech savvy end users. If you have a console or other log that customers + /// can examine, these log messages can often be helpful to troubleshoot network issues. + /// (Especially any warning/error messages.) + /// + /// The detail level indicates what message to invoke your callback on. Lower numeric + /// value means more important, and the value you pass is the lowest priority (highest + /// numeric value) you wish to receive callbacks for. + /// + /// Except when debugging, you should only use k_ESteamNetworkingSocketsDebugOutputType_Msg + /// or k_ESteamNetworkingSocketsDebugOutputType_Warning. For best performance, do NOT + /// request a high detail level and then filter out messages in your callback. Instead, + /// call function function to adjust the desired level of detail. + /// + /// IMPORTANT: This may be called from a service thread, while we own a mutex, etc. + /// Your output function must be threadsafe and fast! Do not make any other + /// Steamworks calls from within the handler. + virtual void SetDebugOutputFunction( ESteamNetworkingSocketsDebugOutputType eDetailLevel, FSteamNetworkingSocketsDebugOutput pfnFunc ) = 0; + + // + // Set and get configuration values, see ESteamNetworkingConfigValue for individual descriptions. + // + + // Shortcuts for common cases. (Implemented as inline functions below) + bool SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ); + bool SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ); + bool SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ); + bool SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ); + bool SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ); + bool SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ); + + /// Set a configuration value. + /// - eValue: which value is being set + /// - eScope: Onto what type of object are you applying the setting? + /// - scopeArg: Which object you want to change? (Ignored for global scope). E.g. connection handle, listen socket handle, interface pointer, etc. + /// - eDataType: What type of data is in the buffer at pValue? This must match the type of the variable exactly! + /// - pArg: Value to set it to. You can pass NULL to remove a non-global sett at this scope, + /// causing the value for that object to use global defaults. Or at global scope, passing NULL + /// will reset any custom value and restore it to the system default. + /// NOTE: When setting callback functions, do not pass the function pointer directly. + /// Your argument should be a pointer to a function pointer. + virtual bool SetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType eDataType, const void *pArg ) = 0; + + /// Get a configuration value. + /// - eValue: which value to fetch + /// - eScopeType: query setting on what type of object + /// - eScopeArg: the object to query the setting for + /// - pOutDataType: If non-NULL, the data type of the value is returned. + /// - pResult: Where to put the result. Pass NULL to query the required buffer size. (k_ESteamNetworkingGetConfigValue_BufferTooSmall will be returned.) + /// - cbResult: IN: the size of your buffer. OUT: the number of bytes filled in or required. + virtual ESteamNetworkingGetConfigValueResult GetConfigValue( ESteamNetworkingConfigValue eValue, ESteamNetworkingConfigScope eScopeType, intptr_t scopeObj, + ESteamNetworkingConfigDataType *pOutDataType, void *pResult, size_t *cbResult ) = 0; + + /// Returns info about a configuration value. Returns false if the value does not exist. + /// pOutNextValue can be used to iterate through all of the known configuration values. + /// (Use GetFirstConfigValue() to begin the iteration, will be k_ESteamNetworkingConfig_Invalid on the last value) + /// Any of the output parameters can be NULL if you do not need that information. + virtual bool GetConfigValueInfo( ESteamNetworkingConfigValue eValue, const char **pOutName, ESteamNetworkingConfigDataType *pOutDataType, ESteamNetworkingConfigScope *pOutScope, ESteamNetworkingConfigValue *pOutNextValue ) = 0; + + /// Return the lowest numbered configuration value available in the current environment. + virtual ESteamNetworkingConfigValue GetFirstConfigValue() = 0; + + // String conversions. You'll usually access these using the respective + // inline methods. + virtual void SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr &addr, char *buf, size_t cbBuf, bool bWithPort ) = 0; + virtual bool SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ) = 0; + virtual void SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ) = 0; + virtual bool SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, const char *pszStr ) = 0; + +protected: + ~ISteamNetworkingUtils(); // Silence some warnings +}; +#define STEAMNETWORKINGUTILS_INTERFACE_VERSION "SteamNetworkingUtils001" + +// Global accessor. +#ifdef STEAMNETWORKINGSOCKETS_STANDALONELIB + + // Standalone lib + STEAMNETWORKINGSOCKETS_INTERFACE ISteamNetworkingUtils *SteamNetworkingUtils_Lib(); + inline ISteamNetworkingUtils *SteamNetworkingUtils() { return SteamNetworkingUtils_Lib(); } + +#else + + // Steamworks SDK + inline ISteamNetworkingUtils *SteamNetworkingUtils(); + STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamNetworkingUtils *, SteamNetworkingUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMNETWORKINGUTILS_INTERFACE_VERSION ) ); +#endif + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff + +#ifdef STEAMNETWORKINGSOCKETS_ENABLE_SDR +inline bool ISteamNetworkingUtils::InitializeRelayNetworkAccess() { return CheckPingDataUpToDate( 1e10f ); } +#endif + +inline bool ISteamNetworkingUtils::SetGlobalConfigValueInt32( ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueFloat( ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetGlobalConfigValueString( ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Global, 0, k_ESteamNetworkingConfig_String, val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueInt32( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, int32 val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Int32, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueFloat( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, float val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_Float, &val ); } +inline bool ISteamNetworkingUtils::SetConnectionConfigValueString( HSteamNetConnection hConn, ESteamNetworkingConfigValue eValue, const char *val ) { return SetConfigValue( eValue, k_ESteamNetworkingConfig_Connection, hConn, k_ESteamNetworkingConfig_String, val ); } + +#if !defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) && defined( STEAMNETWORKINGSOCKETS_STEAM ) +inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamNetworkingUtils()->SteamNetworkingIPAddr_ToString( *this, buf, cbBuf, bWithPort ); } +inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIPAddr_ParseString( this, pszStr ); } +inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamNetworkingUtils()->SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } +inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamNetworkingUtils()->SteamNetworkingIdentity_ParseString( this, pszStr ); } +#endif + +#endif // ISTEAMNETWORKINGUTILS diff --git a/Generator/steam_sdk/isteamparentalsettings.h b/Generator/steam_sdk/isteamparentalsettings.h index 1b6ba9f..c965e32 100644 --- a/Generator/steam_sdk/isteamparentalsettings.h +++ b/Generator/steam_sdk/isteamparentalsettings.h @@ -10,6 +10,8 @@ #pragma once #endif +#include "steam_api_common.h" + // Feature types for parental settings enum EParentalFeature { @@ -44,6 +46,9 @@ public: #define STEAMPARENTALSETTINGS_INTERFACE_VERSION "STEAMPARENTALSETTINGS_INTERFACE_VERSION001" +// Global interface accessor +inline ISteamParentalSettings *SteamParentalSettings(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamParentalSettings *, SteamParentalSettings, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC diff --git a/Generator/steam_sdk/isteamremotestorage.h b/Generator/steam_sdk/isteamremotestorage.h index 3ac2871..0fed2af 100644 --- a/Generator/steam_sdk/isteamremotestorage.h +++ b/Generator/steam_sdk/isteamremotestorage.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" //----------------------------------------------------------------------------- @@ -28,7 +28,7 @@ const uint32 k_unMaxCloudFileChunkSize = 100 * 1024 * 1024; #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct SteamParamStringArray_t { @@ -66,6 +66,7 @@ enum ERemoteStoragePlatform k_ERemoteStoragePlatformPS3 = (1 << 2), k_ERemoteStoragePlatformLinux = (1 << 3), k_ERemoteStoragePlatformReserved2 = (1 << 4), + k_ERemoteStoragePlatformAndroid = (1 << 5), k_ERemoteStoragePlatformAll = 0xffffffff }; @@ -171,16 +172,16 @@ class ISteamRemoteStorage virtual bool FileWrite( const char *pchFile, const void *pvData, int32 cubData ) = 0; virtual int32 FileRead( const char *pchFile, void *pvData, int32 cubDataToRead ) = 0; - CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t ) + STEAM_CALL_RESULT( RemoteStorageFileWriteAsyncComplete_t ) virtual SteamAPICall_t FileWriteAsync( const char *pchFile, const void *pvData, uint32 cubData ) = 0; - CALL_RESULT( RemoteStorageFileReadAsyncComplete_t ) + STEAM_CALL_RESULT( RemoteStorageFileReadAsyncComplete_t ) virtual SteamAPICall_t FileReadAsync( const char *pchFile, uint32 nOffset, uint32 cubToRead ) = 0; virtual bool FileReadAsyncComplete( SteamAPICall_t hReadCall, void *pvBuffer, uint32 cubToRead ) = 0; virtual bool FileForget( const char *pchFile ) = 0; virtual bool FileDelete( const char *pchFile ) = 0; - CALL_RESULT( RemoteStorageFileShareResult_t ) + STEAM_CALL_RESULT( RemoteStorageFileShareResult_t ) virtual SteamAPICall_t FileShare( const char *pchFile ) = 0; virtual bool SetSyncPlatforms( const char *pchFile, ERemoteStoragePlatform eRemoteStoragePlatform ) = 0; @@ -212,7 +213,7 @@ class ISteamRemoteStorage // Downloads a UGC file. A priority value of 0 will download the file immediately, // otherwise it will wait to download the file until all downloads with a lower priority // value are completed. Downloads with equal priority will occur simultaneously. - CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) virtual SteamAPICall_t UGCDownload( UGCHandle_t hContent, uint32 unPriority ) = 0; // Gets the amount of data downloaded so far for a piece of content. pnBytesExpected can be 0 if function returns false @@ -220,7 +221,7 @@ class ISteamRemoteStorage virtual bool GetUGCDownloadProgress( UGCHandle_t hContent, int32 *pnBytesDownloaded, int32 *pnBytesExpected ) = 0; // Gets metadata for a file after it has been downloaded. This is the same metadata given in the RemoteStorageDownloadUGCResult_t call result - virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; + virtual bool GetUGCDetails( UGCHandle_t hContent, AppId_t *pnAppID, STEAM_OUT_STRING() char **ppchName, int32 *pnFileSizeInBytes, STEAM_OUT_STRUCT() CSteamID *pSteamIDOwner ) = 0; // After download, gets the content of the file. // Small files can be read all at once by calling this function with an offset of 0 and cubDataToRead equal to the size of the file. @@ -253,7 +254,7 @@ class ISteamRemoteStorage #endif // publishing UGC - CALL_RESULT( RemoteStoragePublishFileProgress_t ) + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) virtual SteamAPICall_t PublishWorkshopFile( const char *pchFile, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags, EWorkshopFileType eWorkshopFileType ) = 0; virtual PublishedFileUpdateHandle_t CreatePublishedFileUpdateRequest( PublishedFileId_t unPublishedFileId ) = 0; virtual bool UpdatePublishedFileFile( PublishedFileUpdateHandle_t updateHandle, const char *pchFile ) = 0; @@ -262,49 +263,52 @@ class ISteamRemoteStorage virtual bool UpdatePublishedFileDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchDescription ) = 0; virtual bool UpdatePublishedFileVisibility( PublishedFileUpdateHandle_t updateHandle, ERemoteStoragePublishedFileVisibility eVisibility ) = 0; virtual bool UpdatePublishedFileTags( PublishedFileUpdateHandle_t updateHandle, SteamParamStringArray_t *pTags ) = 0; - CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUpdatePublishedFileResult_t ) virtual SteamAPICall_t CommitPublishedFileUpdate( PublishedFileUpdateHandle_t updateHandle ) = 0; // Gets published file details for the given publishedfileid. If unMaxSecondsOld is greater than 0, // cached data may be returned, depending on how long ago it was cached. A value of 0 will force a refresh. // A value of k_WorkshopForceLoadPublishedFileDetailsFromCache will use cached data if it exists, no matter how old it is. - CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedFileDetailsResult_t ) virtual SteamAPICall_t GetPublishedFileDetails( PublishedFileId_t unPublishedFileId, uint32 unMaxSecondsOld ) = 0; - CALL_RESULT( RemoteStorageDeletePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageDeletePublishedFileResult_t ) virtual SteamAPICall_t DeletePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; // enumerate the files that the current user published with this app - CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) virtual SteamAPICall_t EnumerateUserPublishedFiles( uint32 unStartIndex ) = 0; - CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) virtual SteamAPICall_t SubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserSubscribedFilesResult_t ) virtual SteamAPICall_t EnumerateUserSubscribedFiles( uint32 unStartIndex ) = 0; - CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) virtual SteamAPICall_t UnsubscribePublishedFile( PublishedFileId_t unPublishedFileId ) = 0; virtual bool UpdatePublishedFileSetChangeDescription( PublishedFileUpdateHandle_t updateHandle, const char *pchChangeDescription ) = 0; - CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) virtual SteamAPICall_t GetPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t ) + STEAM_CALL_RESULT( RemoteStorageUpdateUserPublishedItemVoteResult_t ) virtual SteamAPICall_t UpdateUserPublishedItemVote( PublishedFileId_t unPublishedFileId, bool bVoteUp ) = 0; - CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) + STEAM_CALL_RESULT( RemoteStorageGetPublishedItemVoteDetailsResult_t ) virtual SteamAPICall_t GetUserPublishedItemVoteDetails( PublishedFileId_t unPublishedFileId ) = 0; - CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateUserPublishedFilesResult_t ) virtual SteamAPICall_t EnumerateUserSharedWorkshopFiles( CSteamID steamId, uint32 unStartIndex, SteamParamStringArray_t *pRequiredTags, SteamParamStringArray_t *pExcludedTags ) = 0; - CALL_RESULT( RemoteStoragePublishFileProgress_t ) + STEAM_CALL_RESULT( RemoteStoragePublishFileProgress_t ) virtual SteamAPICall_t PublishVideo( EWorkshopVideoProvider eVideoProvider, const char *pchVideoAccount, const char *pchVideoIdentifier, const char *pchPreviewFile, AppId_t nConsumerAppId, const char *pchTitle, const char *pchDescription, ERemoteStoragePublishedFileVisibility eVisibility, SteamParamStringArray_t *pTags ) = 0; - CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t ) + STEAM_CALL_RESULT( RemoteStorageSetUserPublishedFileActionResult_t ) virtual SteamAPICall_t SetUserPublishedFileAction( PublishedFileId_t unPublishedFileId, EWorkshopFileAction eAction ) = 0; - CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumeratePublishedFilesByUserActionResult_t ) virtual SteamAPICall_t EnumeratePublishedFilesByUserAction( EWorkshopFileAction eAction, uint32 unStartIndex ) = 0; // this method enumerates the public view of workshop files - CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t ) + STEAM_CALL_RESULT( RemoteStorageEnumerateWorkshopFilesResult_t ) virtual SteamAPICall_t EnumeratePublishedWorkshopFiles( EWorkshopEnumerationType eEnumerationType, uint32 unStartIndex, uint32 unCount, uint32 unDays, SteamParamStringArray_t *pTags, SteamParamStringArray_t *pUserTags ) = 0; - CALL_RESULT( RemoteStorageDownloadUGCResult_t ) + STEAM_CALL_RESULT( RemoteStorageDownloadUGCResult_t ) virtual SteamAPICall_t UGCDownloadToLocation( UGCHandle_t hContent, const char *pchLocation, uint32 unPriority ) = 0; }; #define STEAMREMOTESTORAGE_INTERFACE_VERSION "STEAMREMOTESTORAGE_INTERFACE_VERSION014" +// Global interface accessor +inline ISteamRemoteStorage *SteamRemoteStorage(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamRemoteStorage *, SteamRemoteStorage, STEAMREMOTESTORAGE_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -312,7 +316,7 @@ class ISteamRemoteStorage #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -450,7 +454,7 @@ struct RemoteStorageEnumerateUserSubscribedFilesResult_t #elif defined(VALVE_CALLBACK_PACK_LARGE) VALVE_COMPILE_TIME_ASSERT( sizeof( RemoteStorageEnumerateUserSubscribedFilesResult_t ) == (1 + 1 + 1 + 50 + 100) * 4 + 4 ); #else -#warning You must first include isteamclient.h +#warning You must first include steam_api_common.h #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamscreenshots.h b/Generator/steam_sdk/isteamscreenshots.h index 6095705..1824268 100644 --- a/Generator/steam_sdk/isteamscreenshots.h +++ b/Generator/steam_sdk/isteamscreenshots.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" const uint32 k_nScreenshotMaxTaggedUsers = 32; const uint32 k_nScreenshotMaxTaggedPublishedFiles = 32; @@ -81,13 +81,17 @@ public: #define STEAMSCREENSHOTS_INTERFACE_VERSION "STEAMSCREENSHOTS_INTERFACE_VERSION003" +// Global interface accessor +inline ISteamScreenshots *SteamScreenshots(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamScreenshots *, SteamScreenshots, STEAMSCREENSHOTS_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- // Purpose: Screenshot successfully written or otherwise added to the library diff --git a/Generator/steam_sdk/isteamugc.h b/Generator/steam_sdk/isteamugc.h index 4a7d296..750706d 100644 --- a/Generator/steam_sdk/isteamugc.h +++ b/Generator/steam_sdk/isteamugc.h @@ -10,7 +10,8 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" +#include "isteamremotestorage.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +19,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -205,23 +206,26 @@ public: // Query for all matching UGC. Creator app id or consumer app id must be valid and be set to the current running app. unPage should start at 1. virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage ) = 0; + // Query for all matching UGC using the new deep paging interface. Creator app id or consumer app id must be valid and be set to the current running app. pchCursor should be set to NULL or "*" to get the first result set. + virtual UGCQueryHandle_t CreateQueryAllUGCRequest( EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char *pchCursor = NULL ) = 0; + // Query for the details of the given published file ids (the RequestUGCDetails call is deprecated and replaced with this) virtual UGCQueryHandle_t CreateQueryUGCDetailsRequest( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; // Send the query to Steam - CALL_RESULT( SteamUGCQueryCompleted_t ) + STEAM_CALL_RESULT( SteamUGCQueryCompleted_t ) virtual SteamAPICall_t SendQueryUGCRequest( UGCQueryHandle_t handle ) = 0; // Retrieve an individual result after receiving the callback for querying UGC virtual bool GetQueryUGCResult( UGCQueryHandle_t handle, uint32 index, SteamUGCDetails_t *pDetails ) = 0; - virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0; - virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0; + virtual bool GetQueryUGCPreviewURL( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURL, uint32 cchURLSize ) = 0; + virtual bool GetQueryUGCMetadata( UGCQueryHandle_t handle, uint32 index, STEAM_OUT_STRING_COUNT(cchMetadatasize) char *pchMetadata, uint32 cchMetadatasize ) = 0; virtual bool GetQueryUGCChildren( UGCQueryHandle_t handle, uint32 index, PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; virtual bool GetQueryUGCStatistic( UGCQueryHandle_t handle, uint32 index, EItemStatistic eStatType, uint64 *pStatValue ) = 0; virtual uint32 GetQueryUGCNumAdditionalPreviews( UGCQueryHandle_t handle, uint32 index ) = 0; - virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; + virtual bool GetQueryUGCAdditionalPreview( UGCQueryHandle_t handle, uint32 index, uint32 previewIndex, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchURLOrVideoID, uint32 cchURLSize, STEAM_OUT_STRING_COUNT(cchURLSize) char *pchOriginalFileName, uint32 cchOriginalFileNameSize, EItemPreviewType *pPreviewType ) = 0; virtual uint32 GetQueryUGCNumKeyValueTags( UGCQueryHandle_t handle, uint32 index ) = 0; - virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; + virtual bool GetQueryUGCKeyValueTag( UGCQueryHandle_t handle, uint32 index, uint32 keyValueTagIndex, STEAM_OUT_STRING_COUNT(cchKeySize) char *pchKey, uint32 cchKeySize, STEAM_OUT_STRING_COUNT(cchValueSize) char *pchValue, uint32 cchValueSize ) = 0; // Release the request to free up memory, after retrieving results virtual bool ReleaseQueryUGCRequest( UGCQueryHandle_t handle ) = 0; @@ -253,7 +257,7 @@ public: virtual SteamAPICall_t RequestUGCDetails( PublishedFileId_t nPublishedFileID, uint32 unMaxAgeSeconds ) = 0; // Steam Workshop Creator API - CALL_RESULT( CreateItemResult_t ) + STEAM_CALL_RESULT( CreateItemResult_t ) virtual SteamAPICall_t CreateItem( AppId_t nConsumerAppId, EWorkshopFileType eFileType ) = 0; // create new item for this app with no content attached yet virtual UGCUpdateHandle_t StartItemUpdate( AppId_t nConsumerAppId, PublishedFileId_t nPublishedFileID ) = 0; // start an UGC item update. Set changed properties before commiting update with CommitItemUpdate() @@ -266,6 +270,7 @@ public: virtual bool SetItemTags( UGCUpdateHandle_t updateHandle, const SteamParamStringArray_t *pTags ) = 0; // change the tags of an UGC item virtual bool SetItemContent( UGCUpdateHandle_t handle, const char *pszContentFolder ) = 0; // update item content from this local folder virtual bool SetItemPreview( UGCUpdateHandle_t handle, const char *pszPreviewFile ) = 0; // change preview image file for this item. pszPreviewFile points to local image file, which must be under 1MB in size + virtual bool SetAllowLegacyUpload( UGCUpdateHandle_t handle, bool bAllowLegacyUpload ) = 0; // use legacy upload for a single small file. The parameter to SetItemContent() should either be a directory with one file or the full path to the file. The file must also be less than 10MB in size. virtual bool RemoveItemKeyValueTags( UGCUpdateHandle_t handle, const char *pchKey ) = 0; // remove any existing key-value tags with the specified key virtual bool AddItemKeyValueTag( UGCUpdateHandle_t handle, const char *pchKey, const char *pchValue ) = 0; // add new key-value tags for the item. Note that there can be multiple values for a tag. virtual bool AddItemPreviewFile( UGCUpdateHandle_t handle, const char *pszPreviewFile, EItemPreviewType type ) = 0; // add preview file for this item. pszPreviewFile points to local file, which must be under 1MB in size @@ -274,22 +279,22 @@ public: virtual bool UpdateItemPreviewVideo( UGCUpdateHandle_t handle, uint32 index, const char *pszVideoID ) = 0; // updates an existing preview video for this item virtual bool RemoveItemPreview( UGCUpdateHandle_t handle, uint32 index ) = 0; // remove a preview by index starting at 0 (previews are sorted) - CALL_RESULT( SubmitItemUpdateResult_t ) + STEAM_CALL_RESULT( SubmitItemUpdateResult_t ) virtual SteamAPICall_t SubmitItemUpdate( UGCUpdateHandle_t handle, const char *pchChangeNote ) = 0; // commit update process started with StartItemUpdate() virtual EItemUpdateStatus GetItemUpdateProgress( UGCUpdateHandle_t handle, uint64 *punBytesProcessed, uint64* punBytesTotal ) = 0; // Steam Workshop Consumer API - CALL_RESULT( SetUserItemVoteResult_t ) + STEAM_CALL_RESULT( SetUserItemVoteResult_t ) virtual SteamAPICall_t SetUserItemVote( PublishedFileId_t nPublishedFileID, bool bVoteUp ) = 0; - CALL_RESULT( GetUserItemVoteResult_t ) + STEAM_CALL_RESULT( GetUserItemVoteResult_t ) virtual SteamAPICall_t GetUserItemVote( PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( UserFavoriteItemsListChanged_t ) + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) virtual SteamAPICall_t AddItemToFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( UserFavoriteItemsListChanged_t ) + STEAM_CALL_RESULT( UserFavoriteItemsListChanged_t ) virtual SteamAPICall_t RemoveItemFromFavorites( AppId_t nAppId, PublishedFileId_t nPublishedFileID ) = 0; - CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageSubscribePublishedFileResult_t ) virtual SteamAPICall_t SubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // subscribe to this item, will be installed ASAP - CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) + STEAM_CALL_RESULT( RemoteStorageUnsubscribePublishedFileResult_t ) virtual SteamAPICall_t UnsubscribeItem( PublishedFileId_t nPublishedFileID ) = 0; // unsubscribe from this item, will be uninstalled after game quits virtual uint32 GetNumSubscribedItems() = 0; // number of subscribed items virtual uint32 GetSubscribedItems( PublishedFileId_t* pvecPublishedFileID, uint32 cMaxEntries ) = 0; // all subscribed item PublishFileIDs @@ -299,7 +304,7 @@ public: // get info about currently installed content on disc for items that have k_EItemStateInstalled set // if k_EItemStateLegacyItem is set, pchFolder contains the path to the legacy file itself (not a folder) - virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; + virtual bool GetItemInstallInfo( PublishedFileId_t nPublishedFileID, uint64 *punSizeOnDisk, STEAM_OUT_STRING_COUNT( cchFolderSize ) char *pchFolder, uint32 cchFolderSize, uint32 *punTimeStamp ) = 0; // get info about pending update for items that have k_EItemStateNeedsUpdate set. punBytesTotal will be valid after download started once virtual bool GetItemDownloadInfo( PublishedFileId_t nPublishedFileID, uint64 *punBytesDownloaded, uint64 *punBytesTotal ) = 0; @@ -317,35 +322,43 @@ public: virtual void SuspendDownloads( bool bSuspend ) = 0; // usage tracking - CALL_RESULT( StartPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StartPlaytimeTrackingResult_t ) virtual SteamAPICall_t StartPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; - CALL_RESULT( StopPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) virtual SteamAPICall_t StopPlaytimeTracking( PublishedFileId_t *pvecPublishedFileID, uint32 unNumPublishedFileIDs ) = 0; - CALL_RESULT( StopPlaytimeTrackingResult_t ) + STEAM_CALL_RESULT( StopPlaytimeTrackingResult_t ) virtual SteamAPICall_t StopPlaytimeTrackingForAllItems() = 0; // parent-child relationship or dependency management - CALL_RESULT( AddUGCDependencyResult_t ) + STEAM_CALL_RESULT( AddUGCDependencyResult_t ) virtual SteamAPICall_t AddDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; - CALL_RESULT( RemoveUGCDependencyResult_t ) + STEAM_CALL_RESULT( RemoveUGCDependencyResult_t ) virtual SteamAPICall_t RemoveDependency( PublishedFileId_t nParentPublishedFileID, PublishedFileId_t nChildPublishedFileID ) = 0; // add/remove app dependence/requirements (usually DLC) - CALL_RESULT( AddAppDependencyResult_t ) + STEAM_CALL_RESULT( AddAppDependencyResult_t ) virtual SteamAPICall_t AddAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; - CALL_RESULT( RemoveAppDependencyResult_t ) + STEAM_CALL_RESULT( RemoveAppDependencyResult_t ) virtual SteamAPICall_t RemoveAppDependency( PublishedFileId_t nPublishedFileID, AppId_t nAppID ) = 0; // request app dependencies. note that whatever callback you register for GetAppDependenciesResult_t may be called multiple times // until all app dependencies have been returned - CALL_RESULT( GetAppDependenciesResult_t ) + STEAM_CALL_RESULT( GetAppDependenciesResult_t ) virtual SteamAPICall_t GetAppDependencies( PublishedFileId_t nPublishedFileID ) = 0; // delete the item without prompting the user - CALL_RESULT( DeleteItemResult_t ) + STEAM_CALL_RESULT( DeleteItemResult_t ) virtual SteamAPICall_t DeleteItem( PublishedFileId_t nPublishedFileID ) = 0; }; -#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION010" +#define STEAMUGC_INTERFACE_VERSION "STEAMUGC_INTERFACE_VERSION012" + +// Global interface accessor +inline ISteamUGC *SteamUGC(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUGC *, SteamUGC, STEAMUGC_INTERFACE_VERSION ); + +// Global accessor for the gameserver client +inline ISteamUGC *SteamGameServerUGC(); +STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( ISteamUGC *, SteamGameServerUGC, STEAMUGC_INTERFACE_VERSION ); //----------------------------------------------------------------------------- // Purpose: Callback for querying UGC @@ -358,6 +371,7 @@ struct SteamUGCQueryCompleted_t uint32 m_unNumResultsReturned; uint32 m_unTotalMatchingResults; bool m_bCachedData; // indicates whether this data was retrieved from the local on-disk cache + char m_rgchNextCursor[k_cchPublishedFileURLMax]; // If a paging cursor was used, then this will be the next cursor to get the next result set. }; diff --git a/Generator/steam_sdk/isteamuser.h b/Generator/steam_sdk/isteamuser.h index 0ea2bb8..7ed0fac 100644 --- a/Generator/steam_sdk/isteamuser.h +++ b/Generator/steam_sdk/isteamuser.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // structure that contains client callback data // see callbacks documentation for more details @@ -19,7 +19,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct CallbackMsg_t { @@ -165,7 +165,7 @@ public: // Requests a ticket encrypted with an app specific shared key // pDataToInclude, cbDataToInclude will be encrypted into the ticket // ( This is asynchronous, you must wait for the ticket to be completed by the server ) - CALL_RESULT( EncryptedAppTicketResponse_t ) + STEAM_CALL_RESULT( EncryptedAppTicketResponse_t ) virtual SteamAPICall_t RequestEncryptedAppTicket( void *pDataToInclude, int cbDataToInclude ) = 0; // retrieve a finished ticket @@ -189,7 +189,7 @@ public: // or else immediately navigate to the result URL using a hidden browser window. // NOTE 2: The resulting authorization cookie has an expiration time of one day, // so it would be a good idea to request and visit a new auth URL every 12 hours. - CALL_RESULT( StoreAuthURLResponse_t ) + STEAM_CALL_RESULT( StoreAuthURLResponse_t ) virtual SteamAPICall_t RequestStoreAuthURL( const char *pchRedirectURL ) = 0; // gets whether the users phone number is verified @@ -204,10 +204,15 @@ public: // gets whether the users phone number is awaiting (re)verification virtual bool BIsPhoneRequiringVerification() = 0; + STEAM_CALL_RESULT( MarketEligibilityResponse_t ) + virtual SteamAPICall_t GetMarketEligibility() = 0; }; -#define STEAMUSER_INTERFACE_VERSION "SteamUser019" +#define STEAMUSER_INTERFACE_VERSION "SteamUser020" +// Global interface accessor +inline ISteamUser *SteamUser(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUser *, SteamUser, STEAMUSER_INTERFACE_VERSION ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -215,7 +220,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- @@ -363,6 +368,21 @@ struct StoreAuthURLResponse_t }; +//----------------------------------------------------------------------------- +// Purpose: sent in response to ISteamUser::GetMarketEligibility +//----------------------------------------------------------------------------- +struct MarketEligibilityResponse_t +{ + enum { k_iCallback = k_iSteamUserCallbacks + 66 }; + bool m_bAllowed; + EMarketNotAllowedReasonFlags m_eNotAllowedReason; + RTime32 m_rtAllowedAtTime; + + int m_cdaySteamGuardRequiredDays; // The number of days any user is required to have had Steam Guard before they can use the market + int m_cdayNewDeviceCooldown; // The number of days after initial device authorization a user must wait before using the market on that device +}; + + #pragma pack( pop ) diff --git a/Generator/steam_sdk/isteamuserstats.h b/Generator/steam_sdk/isteamuserstats.h index 29ae38b..d8daa04 100644 --- a/Generator/steam_sdk/isteamuserstats.h +++ b/Generator/steam_sdk/isteamuserstats.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" #include "isteamremotestorage.h" // size limit on stat or achievement name (UTF-8 encoded) @@ -67,7 +67,7 @@ enum ELeaderboardUploadScoreMethod #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif struct LeaderboardEntry_t @@ -89,7 +89,7 @@ class ISteamUserStats { public: // Ask the server to send down this user's data and achievements for this game - CALL_BACK( UserStatsReceived_t ) + STEAM_CALL_BACK( UserStatsReceived_t ) virtual bool RequestCurrentStats() = 0; // Data accessors @@ -149,7 +149,7 @@ public: // returns a UserStatsReceived_t received when completed // if the other user has no stats, UserStatsReceived_t.m_eResult will be set to k_EResultFail // these stats won't be auto-updated; you'll need to call RequestUserStats() again to refresh any data - CALL_RESULT( UserStatsReceived_t ) + STEAM_CALL_RESULT( UserStatsReceived_t ) virtual SteamAPICall_t RequestUserStats( CSteamID steamIDUser ) = 0; // requests stat information for a user, usable after a successful call to RequestUserStats() @@ -166,12 +166,12 @@ public: // asks the Steam back-end for a leaderboard by name, and will create it if it's not yet // This call is asynchronous, with the result returned in LeaderboardFindResult_t - CALL_RESULT(LeaderboardFindResult_t) + STEAM_CALL_RESULT(LeaderboardFindResult_t) virtual SteamAPICall_t FindOrCreateLeaderboard( const char *pchLeaderboardName, ELeaderboardSortMethod eLeaderboardSortMethod, ELeaderboardDisplayType eLeaderboardDisplayType ) = 0; // as above, but won't create the leaderboard if it's not found // This call is asynchronous, with the result returned in LeaderboardFindResult_t - CALL_RESULT( LeaderboardFindResult_t ) + STEAM_CALL_RESULT( LeaderboardFindResult_t ) virtual SteamAPICall_t FindLeaderboard( const char *pchLeaderboardName ) = 0; // returns the name of a leaderboard @@ -194,15 +194,15 @@ public: // k_ELeaderboardDataRequestGlobalAroundUser requests rows around the current user, nRangeStart being negate // e.g. DownloadLeaderboardEntries( hLeaderboard, k_ELeaderboardDataRequestGlobalAroundUser, -3, 3 ) will return 7 rows, 3 before the user, 3 after // k_ELeaderboardDataRequestFriends requests all the rows for friends of the current user - CALL_RESULT( LeaderboardScoresDownloaded_t ) + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) virtual SteamAPICall_t DownloadLeaderboardEntries( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardDataRequest eLeaderboardDataRequest, int nRangeStart, int nRangeEnd ) = 0; // as above, but downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers // if a user doesn't have a leaderboard entry, they won't be included in the result // a max of 100 users can be downloaded at a time, with only one outstanding call at a time - METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) - CALL_RESULT( LeaderboardScoresDownloaded_t ) + STEAM_METHOD_DESC(Downloads leaderboard entries for an arbitrary set of users - ELeaderboardDataRequest is k_ELeaderboardDataRequestUsers) + STEAM_CALL_RESULT( LeaderboardScoresDownloaded_t ) virtual SteamAPICall_t DownloadLeaderboardEntriesForUsers( SteamLeaderboard_t hSteamLeaderboard, - ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; + STEAM_ARRAY_COUNT_D(cUsers, Array of users to retrieve) CSteamID *prgUsers, int cUsers ) = 0; // Returns data about a single leaderboard entry // use a for loop from 0 to LeaderboardScoresDownloaded_t::m_cEntryCount to get all the downloaded entries @@ -224,24 +224,24 @@ public: // This call is asynchronous, with the result returned in LeaderboardScoreUploaded_t // Details are extra game-defined information regarding how the user got that score // pScoreDetails points to an array of int32's, cScoreDetailsCount is the number of int32's in the list - CALL_RESULT( LeaderboardScoreUploaded_t ) + STEAM_CALL_RESULT( LeaderboardScoreUploaded_t ) virtual SteamAPICall_t UploadLeaderboardScore( SteamLeaderboard_t hSteamLeaderboard, ELeaderboardUploadScoreMethod eLeaderboardUploadScoreMethod, int32 nScore, const int32 *pScoreDetails, int cScoreDetailsCount ) = 0; // Attaches a piece of user generated content the user's entry on a leaderboard. // hContent is a handle to a piece of user generated content that was shared using ISteamUserRemoteStorage::FileShare(). // This call is asynchronous, with the result returned in LeaderboardUGCSet_t. - CALL_RESULT( LeaderboardUGCSet_t ) + STEAM_CALL_RESULT( LeaderboardUGCSet_t ) virtual SteamAPICall_t AttachLeaderboardUGC( SteamLeaderboard_t hSteamLeaderboard, UGCHandle_t hUGC ) = 0; // Retrieves the number of players currently playing your game (online + offline) // This call is asynchronous, with the result returned in NumberOfCurrentPlayers_t - CALL_RESULT( NumberOfCurrentPlayers_t ) + STEAM_CALL_RESULT( NumberOfCurrentPlayers_t ) virtual SteamAPICall_t GetNumberOfCurrentPlayers() = 0; // Requests that Steam fetch data on the percentage of players who have received each achievement // for the game globally. // This call is asynchronous, with the result returned in GlobalAchievementPercentagesReady_t. - CALL_RESULT( GlobalAchievementPercentagesReady_t ) + STEAM_CALL_RESULT( GlobalAchievementPercentagesReady_t ) virtual SteamAPICall_t RequestGlobalAchievementPercentages() = 0; // Get the info on the most achieved achievement for the game, returns an iterator index you can use to fetch @@ -261,7 +261,7 @@ public: // This call is asynchronous, with the results returned in GlobalStatsReceived_t. // nHistoryDays specifies how many days of day-by-day history to retrieve in addition // to the overall totals. The limit is 60. - CALL_RESULT( GlobalStatsReceived_t ) + STEAM_CALL_RESULT( GlobalStatsReceived_t ) virtual SteamAPICall_t RequestGlobalStats( int nHistoryDays ) = 0; // Gets the lifetime totals for an aggregated stat @@ -272,8 +272,8 @@ public: // So when called, pData[0] will be today, pData[1] will be yesterday, and pData[2] will be two days ago, // etc. cubData is the size in bytes of the pubData buffer. Returns the number of // elements actually set. - virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; - virtual int32 GetGlobalStatHistory( const char *pchStatName, ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) int64 *pData, uint32 cubData ) = 0; + virtual int32 GetGlobalStatHistory( const char *pchStatName, STEAM_ARRAY_COUNT(cubData) double *pData, uint32 cubData ) = 0; #ifdef _PS3 // Call to kick off installation of the PS3 trophies. This call is asynchronous, and the results will be returned in a PS3TrophiesInstalled_t @@ -298,13 +298,17 @@ public: #define STEAMUSERSTATS_INTERFACE_VERSION "STEAMUSERSTATS_INTERFACE_VERSION011" +// Global interface accessor +inline ISteamUserStats *SteamUserStats(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamUserStats *, SteamUserStats, STEAMUSERSTATS_INTERFACE_VERSION ); + // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) #pragma pack( push, 4 ) #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamutils.h b/Generator/steam_sdk/isteamutils.h index e331fa6..809682b 100644 --- a/Generator/steam_sdk/isteamutils.h +++ b/Generator/steam_sdk/isteamutils.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // Steam API call failure results @@ -133,7 +133,7 @@ public: // k_ECheckFileSignatureFileNotFound - The file does not exist on disk. // k_ECheckFileSignatureInvalidSignature - The file exists, and the signing tab has been set for this file, but the file is either not signed or the signature does not match. // k_ECheckFileSignatureValidSignature - The file is signed and the signature is valid. - CALL_RESULT( CheckFileSignature_t ) + STEAM_CALL_RESULT( CheckFileSignature_t ) virtual SteamAPICall_t CheckFileSignature( const char *szFileName ) = 0; // Activates the Big Picture text input dialog which only supports gamepad input @@ -173,6 +173,13 @@ public: #define STEAMUTILS_INTERFACE_VERSION "SteamUtils009" +// Global interface accessor +inline ISteamUtils *SteamUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamUtils, SteamInternal_FindOrCreateUserInterface( 0, STEAMUTILS_INTERFACE_VERSION ) ); + +// Global accessor for the gameserver client +inline ISteamUtils *SteamGameServerUtils(); +STEAM_DEFINE_INTERFACE_ACCESSOR( ISteamUtils *, SteamGameServerUtils, SteamInternal_FindOrCreateGameServerInterface( 0, STEAMUTILS_INTERFACE_VERSION ) ); // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -180,7 +187,7 @@ public: #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif //----------------------------------------------------------------------------- diff --git a/Generator/steam_sdk/isteamvideo.h b/Generator/steam_sdk/isteamvideo.h index 32eeb59..efd7740 100644 --- a/Generator/steam_sdk/isteamvideo.h +++ b/Generator/steam_sdk/isteamvideo.h @@ -10,7 +10,7 @@ #pragma once #endif -#include "isteamclient.h" +#include "steam_api_common.h" // callbacks #if defined( VALVE_CALLBACK_PACK_SMALL ) @@ -18,7 +18,7 @@ #elif defined( VALVE_CALLBACK_PACK_LARGE ) #pragma pack( push, 8 ) #else -#error isteamclient.h must be included +#error steam_api_common.h should define VALVE_CALLBACK_PACK_xxx #endif @@ -38,31 +38,35 @@ public: virtual bool IsBroadcasting( int *pnNumViewers ) = 0; // Get the OPF Details for 360 Video Playback - CALL_BACK( GetOPFSettingsResult_t ) + STEAM_CALL_BACK( GetOPFSettingsResult_t ) virtual void GetOPFSettings( AppId_t unVideoAppID ) = 0; virtual bool GetOPFStringForApp( AppId_t unVideoAppID, char *pchBuffer, int32 *pnBufferSize ) = 0; }; #define STEAMVIDEO_INTERFACE_VERSION "STEAMVIDEO_INTERFACE_V002" -DEFINE_CALLBACK( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 ) -END_DEFINE_CALLBACK_0() +// Global interface accessor +inline ISteamVideo *SteamVideo(); +STEAM_DEFINE_USER_INTERFACE_ACCESSOR( ISteamVideo *, SteamVideo, STEAMVIDEO_INTERFACE_VERSION ); -DEFINE_CALLBACK( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 ) - CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) -END_DEFINE_CALLBACK_1() +STEAM_CALLBACK_BEGIN( BroadcastUploadStart_t, k_iClientVideoCallbacks + 4 ) +STEAM_CALLBACK_END(0) -DEFINE_CALLBACK( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) - CALLBACK_MEMBER( 0, EResult, m_eResult ) - CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) - CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) -END_DEFINE_CALLBACK_3() +STEAM_CALLBACK_BEGIN( BroadcastUploadStop_t, k_iClientVideoCallbacks + 5 ) + STEAM_CALLBACK_MEMBER( 0, EBroadcastUploadResult, m_eResult ) +STEAM_CALLBACK_END(1) + +STEAM_CALLBACK_BEGIN( GetVideoURLResult_t, k_iClientVideoCallbacks + 11 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) + STEAM_CALLBACK_MEMBER( 2, char, m_rgchURL[256] ) +STEAM_CALLBACK_END(3) -DEFINE_CALLBACK( GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24 ) - CALLBACK_MEMBER( 0, EResult, m_eResult ) - CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) -END_DEFINE_CALLBACK_2() +STEAM_CALLBACK_BEGIN( GetOPFSettingsResult_t, k_iClientVideoCallbacks + 24 ) + STEAM_CALLBACK_MEMBER( 0, EResult, m_eResult ) + STEAM_CALLBACK_MEMBER( 1, AppId_t, m_unVideoAppID ) +STEAM_CALLBACK_END(2) #pragma pack( pop ) diff --git a/Generator/steam_sdk/steam_api.h b/Generator/steam_sdk/steam_api.h index 010a548..cb7e5dc 100644 --- a/Generator/steam_sdk/steam_api.h +++ b/Generator/steam_sdk/steam_api.h @@ -1,6 +1,13 @@ -//====== Copyright 1996-2008, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: +// This header includes *all* of the interfaces and callback structures +// in the Steamworks SDK, and some high level functions to control the SDK +// (init, shutdown, etc) that you probably only need in one or two files. +// +// To save your compile times, we recommend that you not include this file +// in header files. Instead, include the specific headers for the interfaces +// and callback structures you need. The one file you might consider including +// in your precompiled header (e.g. stdafx.h) is steam_api_common.h // //============================================================================= @@ -10,6 +17,10 @@ #pragma once #endif +// Basic stuff +#include "steam_api_common.h" + +// All of the interfaces #include "isteamclient.h" #include "isteamuser.h" #include "isteamfriends.h" @@ -30,31 +41,9 @@ #include "isteaminventory.h" #include "isteamvideo.h" #include "isteamparentalsettings.h" +#include "isteaminput.h" -// Steam API export macro -#if defined( _WIN32 ) && !defined( _X360 ) - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" __declspec( dllexport ) - #elif defined( STEAM_API_NODLL ) - #define S_API extern "C" - #else - #define S_API extern "C" __declspec( dllimport ) - #endif // STEAM_API_EXPORTS -#elif defined( GNUC ) - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" __attribute__ ((visibility("default"))) - #else - #define S_API extern "C" - #endif // STEAM_API_EXPORTS -#else // !WIN32 - #if defined( STEAM_API_EXPORTS ) - #define S_API extern "C" - #else - #define S_API extern "C" - #endif // STEAM_API_EXPORTS -#endif - //----------------------------------------------------------------------------------------------------------------------------------------------------------// // Steam API setup & shutdown // @@ -93,263 +82,6 @@ S_API void S_CALLTYPE SteamAPI_ReleaseCurrentThreadMemory(); S_API void S_CALLTYPE SteamAPI_WriteMiniDump( uint32 uStructuredExceptionCode, void* pvExceptionInfo, uint32 uBuildID ); S_API void S_CALLTYPE SteamAPI_SetMiniDumpComment( const char *pchMsg ); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// Global accessors for Steamworks C++ APIs. See individual isteam*.h files for details. -// You should not cache the results of these accessors or pass the result pointers across -// modules! Different modules may be compiled against different SDK header versions, and -// the interface pointers could therefore be different across modules. Every line of code -// which calls into a Steamworks API should retrieve the interface from a global accessor. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#if !defined( STEAM_API_EXPORTS ) -inline ISteamClient *SteamClient(); -inline ISteamUser *SteamUser(); -inline ISteamFriends *SteamFriends(); -inline ISteamUtils *SteamUtils(); -inline ISteamMatchmaking *SteamMatchmaking(); -inline ISteamUserStats *SteamUserStats(); -inline ISteamApps *SteamApps(); -inline ISteamNetworking *SteamNetworking(); -inline ISteamMatchmakingServers *SteamMatchmakingServers(); -inline ISteamRemoteStorage *SteamRemoteStorage(); -inline ISteamScreenshots *SteamScreenshots(); -inline ISteamHTTP *SteamHTTP(); -inline ISteamController *SteamController(); -inline ISteamUGC *SteamUGC(); -inline ISteamAppList *SteamAppList(); -inline ISteamMusic *SteamMusic(); -inline ISteamMusicRemote *SteamMusicRemote(); -inline ISteamHTMLSurface *SteamHTMLSurface(); -inline ISteamInventory *SteamInventory(); -inline ISteamVideo *SteamVideo(); -inline ISteamParentalSettings *SteamParentalSettings(); -#endif // VERSION_SAFE_STEAM_API_INTERFACES - - -// CSteamAPIContext encapsulates the Steamworks API global accessors into -// a single object. This is DEPRECATED and only remains for compatibility. -class CSteamAPIContext -{ -public: - // DEPRECATED - there is no benefit to using this over the global accessors - CSteamAPIContext() { Clear(); } - void Clear(); - bool Init(); - ISteamClient* SteamClient() const { return m_pSteamClient; } - ISteamUser* SteamUser() const { return m_pSteamUser; } - ISteamFriends* SteamFriends() const { return m_pSteamFriends; } - ISteamUtils* SteamUtils() const { return m_pSteamUtils; } - ISteamMatchmaking* SteamMatchmaking() const { return m_pSteamMatchmaking; } - ISteamUserStats* SteamUserStats() const { return m_pSteamUserStats; } - ISteamApps* SteamApps() const { return m_pSteamApps; } - ISteamMatchmakingServers* SteamMatchmakingServers() const { return m_pSteamMatchmakingServers; } - ISteamNetworking* SteamNetworking() const { return m_pSteamNetworking; } - ISteamRemoteStorage* SteamRemoteStorage() const { return m_pSteamRemoteStorage; } - ISteamScreenshots* SteamScreenshots() const { return m_pSteamScreenshots; } - ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; } - ISteamController* SteamController() const { return m_pController; } - ISteamUGC* SteamUGC() const { return m_pSteamUGC; } - ISteamAppList* SteamAppList() const { return m_pSteamAppList; } - ISteamMusic* SteamMusic() const { return m_pSteamMusic; } - ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; } - ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; } - ISteamInventory* SteamInventory() const { return m_pSteamInventory; } - ISteamVideo* SteamVideo() const { return m_pSteamVideo; } - ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; } - // DEPRECATED - there is no benefit to using this over the global accessors -private: - ISteamClient *m_pSteamClient; - ISteamUser *m_pSteamUser; - ISteamFriends *m_pSteamFriends; - ISteamUtils *m_pSteamUtils; - ISteamMatchmaking *m_pSteamMatchmaking; - ISteamUserStats *m_pSteamUserStats; - ISteamApps *m_pSteamApps; - ISteamMatchmakingServers *m_pSteamMatchmakingServers; - ISteamNetworking *m_pSteamNetworking; - ISteamRemoteStorage *m_pSteamRemoteStorage; - ISteamScreenshots *m_pSteamScreenshots; - ISteamHTTP *m_pSteamHTTP; - ISteamController *m_pController; - ISteamUGC *m_pSteamUGC; - ISteamAppList *m_pSteamAppList; - ISteamMusic *m_pSteamMusic; - ISteamMusicRemote *m_pSteamMusicRemote; - ISteamHTMLSurface *m_pSteamHTMLSurface; - ISteamInventory *m_pSteamInventory; - ISteamVideo *m_pSteamVideo; - ISteamParentalSettings *m_pSteamParentalSettings; -}; - - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steam callback and call-result helpers -// -// The following macros and classes are used to register your application for -// callbacks and call-results, which are delivered in a predictable manner. -// -// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. -// They map a Steam notification callback directly to a class member function -// which is automatically prototyped as "void func( callback_type *pParam )". -// -// CCallResult is used with specific Steam APIs that return "result handles". -// The handle can be passed to a CCallResult object's Set function, along with -// an object pointer and member-function pointer. The member function will -// be executed once the results of the Steam API call are available. -// -// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK -// macros if you require finer control over registration and unregistration. -// -// Callbacks and call-results are queued automatically and are only -// delivered/executed when your application calls SteamAPI_RunCallbacks(). -//----------------------------------------------------------------------------------------------------------------------------------------------------------// - -// SteamAPI_RunCallbacks is safe to call from multiple threads simultaneously, -// but if you choose to do this, callback code could be executed on any thread. -// One alternative is to call SteamAPI_RunCallbacks from the main thread only, -// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. -S_API void S_CALLTYPE SteamAPI_RunCallbacks(); - - -// Declares a callback member function plus a helper member variable which -// registers the callback on object creation and unregisters on destruction. -// The optional fourth 'var' param exists only for backwards-compatibility -// and can be ignored. -#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ - _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) - -// Declares a callback function and a named CCallbackManual variable which -// has Register and Unregister functions instead of automatic registration. -#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ - CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) - - -// Internal functions used by the utility CCallback objects to receive callbacks -S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); -S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); -// Internal functions used by the utility CCallResult objects to receive async call results -S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); -S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); - - -//----------------------------------------------------------------------------- -// Purpose: base for callbacks and call results - internal implementation detail -//----------------------------------------------------------------------------- -class CCallbackBase -{ -public: - CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } - // don't add a virtual destructor because we export this binary interface across dll's - virtual void Run( void *pvParam ) = 0; - virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; - int GetICallback() { return m_iCallback; } - virtual int GetCallbackSizeBytes() = 0; - -protected: - enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; - uint8 m_nCallbackFlags; - int m_iCallback; - friend class CCallbackMgr; - -private: - CCallbackBase( const CCallbackBase& ); - CCallbackBase& operator=( const CCallbackBase& ); -}; - -//----------------------------------------------------------------------------- -// Purpose: templated base for callbacks - internal implementation detail -//----------------------------------------------------------------------------- -template< int sizeof_P > -class CCallbackImpl : protected CCallbackBase -{ -public: - ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } - void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } - -protected: - virtual void Run( void *pvParam ) = 0; - virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } - virtual int GetCallbackSizeBytes() { return sizeof_P; } -}; - - -//----------------------------------------------------------------------------- -// Purpose: maps a steam async call result to a class member function -// template params: T = local class, P = parameter struct -//----------------------------------------------------------------------------- -template< class T, class P > -class CCallResult : private CCallbackBase -{ -public: - typedef void (T::*func_t)( P*, bool ); - - CCallResult(); - ~CCallResult(); - - void Set( SteamAPICall_t hAPICall, T *p, func_t func ); - bool IsActive() const; - void Cancel(); - - void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } -private: - virtual void Run( void *pvParam ); - virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); - virtual int GetCallbackSizeBytes() { return sizeof( P ); } - - SteamAPICall_t m_hAPICall; - T *m_pObj; - func_t m_Func; -}; - - - -//----------------------------------------------------------------------------- -// Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct, -// bGameserver = listen for gameserver callbacks instead of client callbacks -//----------------------------------------------------------------------------- -template< class T, class P, bool bGameserver = false > -class CCallback : public CCallbackImpl< sizeof( P ) > -{ -public: - typedef void (T::*func_t)(P*); - - // NOTE: If you can't provide the correct parameters at construction time, you should - // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. - CCallback( T *pObj, func_t func ); - - void Register( T *pObj, func_t func ); - void Unregister(); - -protected: - virtual void Run( void *pvParam ); - - T *m_pObj; - func_t m_Func; -}; - - -//----------------------------------------------------------------------------- -// Purpose: subclass of CCallback which allows default-construction in -// an unregistered state; you must call Register manually -//----------------------------------------------------------------------------- -template< class T, class P, bool bGameServer = false > -class CCallbackManual : public CCallback< T, P, bGameServer > -{ -public: - CCallbackManual() : CCallback< T, P, bGameServer >( NULL, NULL ) {} - - // Inherits public Register and Unregister functions from base class -}; - - - -#ifdef _WIN32 -// disable this warning; this pattern need for steam callback registration -#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list -#endif - - //----------------------------------------------------------------------------------------------------------------------------------------------------------// // steamclient.dll private wrapper functions // @@ -373,9 +105,6 @@ S_API HSteamUser Steam_GetHSteamUserCurrent(); // DEPRECATED - implementation is Windows only, and the path returned is a UTF-8 string which must be converted to UTF-16 for use with Win32 APIs S_API const char *SteamAPI_GetSteamInstallPath(); -// returns the pipe we are communicating to Steam with -S_API HSteamPipe SteamAPI_GetHSteamPipe(); - // sets whether or not Steam_RunCallbacks() should do a try {} catch (...) {} around calls to issuing callbacks S_API void SteamAPI_SetTryCatchCallbacks( bool bTryCatchCallbacks ); @@ -389,6 +118,126 @@ S_API HSteamUser GetHSteamUser(); S_API bool S_CALLTYPE SteamAPI_InitSafe(); #endif -#include "steam_api_internal.h" +#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) +// this should be called before the game initialized the steam APIs +// pchDate should be of the format "Mmm dd yyyy" (such as from the __ DATE __ macro ) +// pchTime should be of the format "hh:mm:ss" (such as from the __ TIME __ macro ) +// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder +// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback +// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. +S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); +S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#endif + + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// +// CSteamAPIContext +// +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +#ifndef STEAM_API_EXPORTS + +// Deprecated! Use the global accessors directly +inline bool CSteamAPIContext::Init() +{ + m_pSteamClient = ::SteamClient(); + if ( !m_pSteamClient ) + return false; + + m_pSteamUser = ::SteamUser(); + if ( !m_pSteamUser ) + return false; + + m_pSteamFriends = ::SteamFriends(); + if ( !m_pSteamFriends ) + return false; + + m_pSteamUtils = ::SteamUtils(); + if ( !m_pSteamUtils ) + return false; + + m_pSteamMatchmaking = ::SteamMatchmaking(); + if ( !m_pSteamMatchmaking ) + return false; + + m_pSteamGameSearch = ::SteamGameSearch(); + if ( !m_pSteamGameSearch ) + return false; + + m_pSteamMatchmakingServers = ::SteamMatchmakingServers(); + if ( !m_pSteamMatchmakingServers ) + return false; + + m_pSteamUserStats = ::SteamUserStats(); + if ( !m_pSteamUserStats ) + return false; + + m_pSteamApps = ::SteamApps(); + if ( !m_pSteamApps ) + return false; + + m_pSteamNetworking = ::SteamNetworking(); + if ( !m_pSteamNetworking ) + return false; + + m_pSteamRemoteStorage = ::SteamRemoteStorage(); + if ( !m_pSteamRemoteStorage ) + return false; + + m_pSteamScreenshots = ::SteamScreenshots(); + if ( !m_pSteamScreenshots ) + return false; + + m_pSteamHTTP = ::SteamHTTP(); + if ( !m_pSteamHTTP ) + return false; + + m_pController = ::SteamController(); + if ( !m_pController ) + return false; + + m_pSteamUGC = ::SteamUGC(); + if ( !m_pSteamUGC ) + return false; + + m_pSteamAppList = ::SteamAppList(); + if ( !m_pSteamAppList ) + return false; + + m_pSteamMusic = ::SteamMusic(); + if ( !m_pSteamMusic ) + return false; + + m_pSteamMusicRemote = ::SteamMusicRemote(); + if ( !m_pSteamMusicRemote ) + return false; + +#ifndef ANDROID // Not yet supported on Android + m_pSteamHTMLSurface = ::SteamHTMLSurface(); + if ( !m_pSteamHTMLSurface ) + return false; +#endif + + m_pSteamInventory = ::SteamInventory(); + if ( !m_pSteamInventory ) + return false; + + m_pSteamVideo = ::SteamVideo(); + if ( !m_pSteamVideo ) + return false; + + m_pSteamParentalSettings = ::SteamParentalSettings(); + if ( !m_pSteamParentalSettings ) + return false; + + m_pSteamInput = ::SteamInput(); + if ( !m_pSteamInput ) + return false; + + return true; +} + +#endif #endif // STEAM_API_H diff --git a/Generator/steam_sdk/steam_api.json b/Generator/steam_sdk/steam_api.json index 02bc811..163ad17 100644 --- a/Generator/steam_sdk/steam_api.json +++ b/Generator/steam_sdk/steam_api.json @@ -28,6 +28,7 @@ ,{"typedef": "PartnerId_t","type": "uint32"} ,{"typedef": "ManifestId_t","type": "uint64"} ,{"typedef": "SiteId_t","type": "uint64"} +,{"typedef": "PartyBeaconID_t","type": "uint64"} ,{"typedef": "HAuthTicket","type": "uint32"} ,{"typedef": "PFNLegacyKeyRegistration","type": "void (*)(const char *, const char *)"} ,{"typedef": "PFNLegacyKeyInstalled","type": "_Bool (*)(void)"} @@ -39,6 +40,8 @@ ,{"typedef": "HSteamUser","type": "int32"} ,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} ,{"typedef": "SteamAPI_CheckCallbackRegistered_t","type": "uint32 (*)(int)"} +,{"typedef": "CCallResult::func_t","type": "void (T::*)(P *, _Bool)"} +,{"typedef": "CCallback::func_t","type": "void (T::*)(P *)"} ,{"typedef": "FriendsGroupID_t","type": "int16"} ,{"typedef": "SteamAPIWarningMessageHook_t","type": "void (*)(int, const char *) __attribute__((cdecl))"} ,{"typedef": "HServerListRequest","type": "void *"} @@ -53,66 +56,23 @@ ,{"typedef": "SNetSocket_t","type": "uint32"} ,{"typedef": "SNetListenSocket_t","type": "uint32"} ,{"typedef": "ScreenshotHandle","type": "uint32"} -,{"typedef": "PlaybackStatusHasChanged_t::SteamCallback_t","type": "struct PlaybackStatusHasChanged_t"} -,{"typedef": "VolumeHasChanged_t::SteamCallback_t","type": "struct VolumeHasChanged_t"} -,{"typedef": "MusicPlayerRemoteWillActivate_t::SteamCallback_t","type": "struct MusicPlayerRemoteWillActivate_t"} -,{"typedef": "MusicPlayerRemoteWillDeactivate_t::SteamCallback_t","type": "struct MusicPlayerRemoteWillDeactivate_t"} -,{"typedef": "MusicPlayerRemoteToFront_t::SteamCallback_t","type": "struct MusicPlayerRemoteToFront_t"} -,{"typedef": "MusicPlayerWillQuit_t::SteamCallback_t","type": "struct MusicPlayerWillQuit_t"} -,{"typedef": "MusicPlayerWantsPlay_t::SteamCallback_t","type": "struct MusicPlayerWantsPlay_t"} -,{"typedef": "MusicPlayerWantsPause_t::SteamCallback_t","type": "struct MusicPlayerWantsPause_t"} -,{"typedef": "MusicPlayerWantsPlayPrevious_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayPrevious_t"} -,{"typedef": "MusicPlayerWantsPlayNext_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayNext_t"} -,{"typedef": "MusicPlayerWantsShuffled_t::SteamCallback_t","type": "struct MusicPlayerWantsShuffled_t"} -,{"typedef": "MusicPlayerWantsLooped_t::SteamCallback_t","type": "struct MusicPlayerWantsLooped_t"} -,{"typedef": "MusicPlayerWantsVolume_t::SteamCallback_t","type": "struct MusicPlayerWantsVolume_t"} -,{"typedef": "MusicPlayerSelectsQueueEntry_t::SteamCallback_t","type": "struct MusicPlayerSelectsQueueEntry_t"} -,{"typedef": "MusicPlayerSelectsPlaylistEntry_t::SteamCallback_t","type": "struct MusicPlayerSelectsPlaylistEntry_t"} -,{"typedef": "MusicPlayerWantsPlayingRepeatStatus_t::SteamCallback_t","type": "struct MusicPlayerWantsPlayingRepeatStatus_t"} ,{"typedef": "HTTPRequestHandle","type": "uint32"} ,{"typedef": "HTTPCookieContainerHandle","type": "uint32"} +,{"typedef": "InputHandle_t","type": "uint64"} +,{"typedef": "InputActionSetHandle_t","type": "uint64"} +,{"typedef": "InputDigitalActionHandle_t","type": "uint64"} +,{"typedef": "InputAnalogActionHandle_t","type": "uint64"} ,{"typedef": "ControllerHandle_t","type": "uint64"} ,{"typedef": "ControllerActionSetHandle_t","type": "uint64"} ,{"typedef": "ControllerDigitalActionHandle_t","type": "uint64"} ,{"typedef": "ControllerAnalogActionHandle_t","type": "uint64"} ,{"typedef": "UGCQueryHandle_t","type": "uint64"} ,{"typedef": "UGCUpdateHandle_t","type": "uint64"} -,{"typedef": "SteamAppInstalled_t::SteamCallback_t","type": "struct SteamAppInstalled_t"} -,{"typedef": "SteamAppUninstalled_t::SteamCallback_t","type": "struct SteamAppUninstalled_t"} ,{"typedef": "HHTMLBrowser","type": "uint32"} -,{"typedef": "HTML_BrowserReady_t::SteamCallback_t","type": "struct HTML_BrowserReady_t"} -,{"typedef": "HTML_NeedsPaint_t::SteamCallback_t","type": "struct HTML_NeedsPaint_t"} -,{"typedef": "HTML_StartRequest_t::SteamCallback_t","type": "struct HTML_StartRequest_t"} -,{"typedef": "HTML_CloseBrowser_t::SteamCallback_t","type": "struct HTML_CloseBrowser_t"} -,{"typedef": "HTML_URLChanged_t::SteamCallback_t","type": "struct HTML_URLChanged_t"} -,{"typedef": "HTML_FinishedRequest_t::SteamCallback_t","type": "struct HTML_FinishedRequest_t"} -,{"typedef": "HTML_OpenLinkInNewTab_t::SteamCallback_t","type": "struct HTML_OpenLinkInNewTab_t"} -,{"typedef": "HTML_ChangedTitle_t::SteamCallback_t","type": "struct HTML_ChangedTitle_t"} -,{"typedef": "HTML_SearchResults_t::SteamCallback_t","type": "struct HTML_SearchResults_t"} -,{"typedef": "HTML_CanGoBackAndForward_t::SteamCallback_t","type": "struct HTML_CanGoBackAndForward_t"} -,{"typedef": "HTML_HorizontalScroll_t::SteamCallback_t","type": "struct HTML_HorizontalScroll_t"} -,{"typedef": "HTML_VerticalScroll_t::SteamCallback_t","type": "struct HTML_VerticalScroll_t"} -,{"typedef": "HTML_LinkAtPosition_t::SteamCallback_t","type": "struct HTML_LinkAtPosition_t"} -,{"typedef": "HTML_JSAlert_t::SteamCallback_t","type": "struct HTML_JSAlert_t"} -,{"typedef": "HTML_JSConfirm_t::SteamCallback_t","type": "struct HTML_JSConfirm_t"} -,{"typedef": "HTML_FileOpenDialog_t::SteamCallback_t","type": "struct HTML_FileOpenDialog_t"} -,{"typedef": "HTML_NewWindow_t::SteamCallback_t","type": "struct HTML_NewWindow_t"} -,{"typedef": "HTML_SetCursor_t::SteamCallback_t","type": "struct HTML_SetCursor_t"} -,{"typedef": "HTML_StatusText_t::SteamCallback_t","type": "struct HTML_StatusText_t"} -,{"typedef": "HTML_ShowToolTip_t::SteamCallback_t","type": "struct HTML_ShowToolTip_t"} -,{"typedef": "HTML_UpdateToolTip_t::SteamCallback_t","type": "struct HTML_UpdateToolTip_t"} -,{"typedef": "HTML_HideToolTip_t::SteamCallback_t","type": "struct HTML_HideToolTip_t"} -,{"typedef": "HTML_BrowserRestarted_t::SteamCallback_t","type": "struct HTML_BrowserRestarted_t"} ,{"typedef": "SteamItemInstanceID_t","type": "uint64"} ,{"typedef": "SteamItemDef_t","type": "int32"} ,{"typedef": "SteamInventoryResult_t","type": "int32"} ,{"typedef": "SteamInventoryUpdateHandle_t","type": "uint64"} -,{"typedef": "BroadcastUploadStart_t::SteamCallback_t","type": "struct BroadcastUploadStart_t"} -,{"typedef": "BroadcastUploadStop_t::SteamCallback_t","type": "struct BroadcastUploadStop_t"} -,{"typedef": "GetVideoURLResult_t::SteamCallback_t","type": "struct GetVideoURLResult_t"} -,{"typedef": "GetOPFSettingsResult_t::SteamCallback_t","type": "struct GetOPFSettingsResult_t"} -,{"typedef": "CCallResult::func_t","type": "void (T::*)(P *, _Bool)"} -,{"typedef": "CCallback::func_t","type": "void (T::*)(P *)"} ], "enums":[ {"enumname": "EUniverse","values": [ @@ -235,6 +195,7 @@ ,{"name": "k_EResultWGNetworkSendExceeded","value": "110"} ,{"name": "k_EResultAccountNotFriends","value": "111"} ,{"name": "k_EResultLimitedUserAccount","value": "112"} + ,{"name": "k_EResultCantRemoveItem","value": "113"} ]} , {"enumname": "EVoiceResult","values": [ {"name": "k_EVoiceResultOK","value": "0"} @@ -427,6 +388,16 @@ ,{"name": "k_EBroadcastUploadResultMissingAudio","value": "11"} ,{"name": "k_EBroadcastUploadResultTooFarBehind","value": "12"} ,{"name": "k_EBroadcastUploadResultTranscodeBehind","value": "13"} + ,{"name": "k_EBroadcastUploadResultNotAllowedToPlay","value": "14"} + ,{"name": "k_EBroadcastUploadResultBusy","value": "15"} + ,{"name": "k_EBroadcastUploadResultBanned","value": "16"} + ,{"name": "k_EBroadcastUploadResultAlreadyActive","value": "17"} + ,{"name": "k_EBroadcastUploadResultForcedOff","value": "18"} + ,{"name": "k_EBroadcastUploadResultAudioBehind","value": "19"} + ,{"name": "k_EBroadcastUploadResultShutdown","value": "20"} + ,{"name": "k_EBroadcastUploadResultDisconnect","value": "21"} + ,{"name": "k_EBroadcastUploadResultVideoInitFailed","value": "22"} + ,{"name": "k_EBroadcastUploadResultAudioInitFailed","value": "23"} ]} , {"enumname": "ELaunchOptionType","values": [ {"name": "k_ELaunchOptionType_None","value": "0"} @@ -453,6 +424,7 @@ ,{"name": "k_eEVRHMDType_HTC_Dev","value": "1"} ,{"name": "k_eEVRHMDType_HTC_VivePre","value": "2"} ,{"name": "k_eEVRHMDType_HTC_Vive","value": "3"} + ,{"name": "k_eEVRHMDType_HTC_VivePro","value": "4"} ,{"name": "k_eEVRHMDType_HTC_Unknown","value": "20"} ,{"name": "k_eEVRHMDType_Oculus_DK1","value": "21"} ,{"name": "k_eEVRHMDType_Oculus_DK2","value": "22"} @@ -470,6 +442,29 @@ ,{"name": "k_eEVRHMDType_Samsung_Odyssey","value": "91"} ,{"name": "k_eEVRHMDType_Unannounced_Unknown","value": "100"} ,{"name": "k_eEVRHMDType_Unannounced_WindowsMR","value": "101"} + ,{"name": "k_eEVRHMDType_vridge","value": "110"} + ,{"name": "k_eEVRHMDType_Huawei_Unknown","value": "120"} + ,{"name": "k_eEVRHMDType_Huawei_VR2","value": "121"} + ,{"name": "k_eEVRHMDType_Huawei_Unannounced","value": "129"} +]} +, {"enumname": "EMarketNotAllowedReasonFlags","values": [ + {"name": "k_EMarketNotAllowedReason_None","value": "0"} + ,{"name": "k_EMarketNotAllowedReason_TemporaryFailure","value": "1"} + ,{"name": "k_EMarketNotAllowedReason_AccountDisabled","value": "2"} + ,{"name": "k_EMarketNotAllowedReason_AccountLockedDown","value": "4"} + ,{"name": "k_EMarketNotAllowedReason_AccountLimited","value": "8"} + ,{"name": "k_EMarketNotAllowedReason_TradeBanned","value": "16"} + ,{"name": "k_EMarketNotAllowedReason_AccountNotTrusted","value": "32"} + ,{"name": "k_EMarketNotAllowedReason_SteamGuardNotEnabled","value": "64"} + ,{"name": "k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled","value": "128"} + ,{"name": "k_EMarketNotAllowedReason_RecentPasswordReset","value": "256"} + ,{"name": "k_EMarketNotAllowedReason_NewPaymentMethod","value": "512"} + ,{"name": "k_EMarketNotAllowedReason_InvalidCookie","value": "1024"} + ,{"name": "k_EMarketNotAllowedReason_UsingNewDevice","value": "2048"} + ,{"name": "k_EMarketNotAllowedReason_RecentSelfRefund","value": "4096"} + ,{"name": "k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified","value": "8192"} + ,{"name": "k_EMarketNotAllowedReason_NoRecentPurchases","value": "16384"} + ,{"name": "k_EMarketNotAllowedReason_AcceptedWalletGift","value": "32768"} ]} , {"enumname": "CGameID::EGameIDType","values": [ {"name": "k_EGameIDTypeApp","value": "0"} @@ -477,6 +472,24 @@ ,{"name": "k_EGameIDTypeShortcut","value": "2"} ,{"name": "k_EGameIDTypeP2P","value": "3"} ]} +, {"enumname": "EGameSearchErrorCode_t","values": [ + {"name": "k_EGameSearchErrorCode_OK","value": "1"} + ,{"name": "k_EGameSearchErrorCode_Failed_Search_Already_In_Progress","value": "2"} + ,{"name": "k_EGameSearchErrorCode_Failed_No_Search_In_Progress","value": "3"} + ,{"name": "k_EGameSearchErrorCode_Failed_Not_Lobby_Leader","value": "4"} + ,{"name": "k_EGameSearchErrorCode_Failed_No_Host_Available","value": "5"} + ,{"name": "k_EGameSearchErrorCode_Failed_Search_Params_Invalid","value": "6"} + ,{"name": "k_EGameSearchErrorCode_Failed_Offline","value": "7"} + ,{"name": "k_EGameSearchErrorCode_Failed_NotAuthorized","value": "8"} + ,{"name": "k_EGameSearchErrorCode_Failed_Unknown_Error","value": "9"} +]} +, {"enumname": "EPlayerResult_t","values": [ + {"name": "k_EPlayerResultFailedToConnect","value": "1"} + ,{"name": "k_EPlayerResultAbandoned","value": "2"} + ,{"name": "k_EPlayerResultKicked","value": "3"} + ,{"name": "k_EPlayerResultIncomplete","value": "4"} + ,{"name": "k_EPlayerResultCompleted","value": "5"} +]} , {"enumname": "IPCFailure_t::EFailureType","values": [ {"name": "k_EFailureFlushedCallbackQueue","value": "0"} ,{"name": "k_EFailurePipeFail","value": "1"} @@ -500,7 +513,8 @@ ,{"name": "k_EPersonaStateSnooze","value": "4"} ,{"name": "k_EPersonaStateLookingToTrade","value": "5"} ,{"name": "k_EPersonaStateLookingToPlay","value": "6"} - ,{"name": "k_EPersonaStateMax","value": "7"} + ,{"name": "k_EPersonaStateInvisible","value": "7"} + ,{"name": "k_EPersonaStateMax","value": "8"} ]} , {"enumname": "EFriendFlags","values": [ {"name": "k_EFriendFlagNone","value": "0"} @@ -531,6 +545,10 @@ ,{"name": "k_EOverlayToStoreFlag_AddToCart","value": "1"} ,{"name": "k_EOverlayToStoreFlag_AddToCartAndShow","value": "2"} ]} +, {"enumname": "EActivateGameOverlayToWebPageMode","values": [ + {"name": "k_EActivateGameOverlayToWebPageMode_Default","value": "0"} + ,{"name": "k_EActivateGameOverlayToWebPageMode_Modal","value": "1"} +]} , {"enumname": "EPersonaChange","values": [ {"name": "k_EPersonaChangeName","value": "1"} ,{"name": "k_EPersonaChangeStatus","value": "2"} @@ -543,9 +561,10 @@ ,{"name": "k_EPersonaChangeLeftSource","value": "256"} ,{"name": "k_EPersonaChangeRelationshipChanged","value": "512"} ,{"name": "k_EPersonaChangeNameFirstSet","value": "1024"} - ,{"name": "k_EPersonaChangeFacebookInfo","value": "2048"} + ,{"name": "k_EPersonaChangeBroadcast","value": "2048"} ,{"name": "k_EPersonaChangeNickname","value": "4096"} ,{"name": "k_EPersonaChangeSteamLevel","value": "8192"} + ,{"name": "k_EPersonaChangeRichPresence","value": "16384"} ]} , {"enumname": "ESteamAPICallFailure","values": [ {"name": "k_ESteamAPICallFailureNone","value": "-1"} @@ -601,6 +620,23 @@ ,{"name": "k_EChatMemberStateChangeKicked","value": "8"} ,{"name": "k_EChatMemberStateChangeBanned","value": "16"} ]} +, {"enumname": "ESteamPartyBeaconLocationType","values": [ + {"name": "k_ESteamPartyBeaconLocationType_Invalid","value": "0"} + ,{"name": "k_ESteamPartyBeaconLocationType_ChatGroup","value": "1"} + ,{"name": "k_ESteamPartyBeaconLocationType_Max","value": "2"} +]} +, {"enumname": "ESteamPartyBeaconLocationData","values": [ + {"name": "k_ESteamPartyBeaconLocationDataInvalid","value": "0"} + ,{"name": "k_ESteamPartyBeaconLocationDataName","value": "1"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLSmall","value": "2"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLMedium","value": "3"} + ,{"name": "k_ESteamPartyBeaconLocationDataIconURLLarge","value": "4"} +]} +, {"enumname": "RequestPlayersForGameResultCallback_t::PlayerAcceptState_t","values": [ + {"name": "k_EStateUnknown","value": "0"} + ,{"name": "k_EStatePlayerAccepted","value": "1"} + ,{"name": "k_EStatePlayerDeclined","value": "2"} +]} , {"enumname": "ERemoteStoragePlatform","values": [ {"name": "k_ERemoteStoragePlatformNone","value": "0"} ,{"name": "k_ERemoteStoragePlatformWindows","value": "1"} @@ -608,6 +644,7 @@ ,{"name": "k_ERemoteStoragePlatformPS3","value": "4"} ,{"name": "k_ERemoteStoragePlatformLinux","value": "8"} ,{"name": "k_ERemoteStoragePlatformReserved2","value": "16"} + ,{"name": "k_ERemoteStoragePlatformAndroid","value": "32"} ,{"name": "k_ERemoteStoragePlatformAll","value": "-1"} ]} , {"enumname": "ERemoteStoragePublishedFileVisibility","values": [ @@ -794,10 +831,363 @@ ,{"name": "k_EHTTPStatusCode505HTTPVersionNotSupported","value": "505"} ,{"name": "k_EHTTPStatusCode5xxUnknown","value": "599"} ]} +, {"enumname": "EInputSource","values": [ + {"name": "k_EInputSource_None","value": "0"} + ,{"name": "k_EInputSource_LeftTrackpad","value": "1"} + ,{"name": "k_EInputSource_RightTrackpad","value": "2"} + ,{"name": "k_EInputSource_Joystick","value": "3"} + ,{"name": "k_EInputSource_ABXY","value": "4"} + ,{"name": "k_EInputSource_Switch","value": "5"} + ,{"name": "k_EInputSource_LeftTrigger","value": "6"} + ,{"name": "k_EInputSource_RightTrigger","value": "7"} + ,{"name": "k_EInputSource_LeftBumper","value": "8"} + ,{"name": "k_EInputSource_RightBumper","value": "9"} + ,{"name": "k_EInputSource_Gyro","value": "10"} + ,{"name": "k_EInputSource_CenterTrackpad","value": "11"} + ,{"name": "k_EInputSource_RightJoystick","value": "12"} + ,{"name": "k_EInputSource_DPad","value": "13"} + ,{"name": "k_EInputSource_Key","value": "14"} + ,{"name": "k_EInputSource_Mouse","value": "15"} + ,{"name": "k_EInputSource_LeftGyro","value": "16"} + ,{"name": "k_EInputSource_Count","value": "17"} +]} +, {"enumname": "EInputSourceMode","values": [ + {"name": "k_EInputSourceMode_None","value": "0"} + ,{"name": "k_EInputSourceMode_Dpad","value": "1"} + ,{"name": "k_EInputSourceMode_Buttons","value": "2"} + ,{"name": "k_EInputSourceMode_FourButtons","value": "3"} + ,{"name": "k_EInputSourceMode_AbsoluteMouse","value": "4"} + ,{"name": "k_EInputSourceMode_RelativeMouse","value": "5"} + ,{"name": "k_EInputSourceMode_JoystickMove","value": "6"} + ,{"name": "k_EInputSourceMode_JoystickMouse","value": "7"} + ,{"name": "k_EInputSourceMode_JoystickCamera","value": "8"} + ,{"name": "k_EInputSourceMode_ScrollWheel","value": "9"} + ,{"name": "k_EInputSourceMode_Trigger","value": "10"} + ,{"name": "k_EInputSourceMode_TouchMenu","value": "11"} + ,{"name": "k_EInputSourceMode_MouseJoystick","value": "12"} + ,{"name": "k_EInputSourceMode_MouseRegion","value": "13"} + ,{"name": "k_EInputSourceMode_RadialMenu","value": "14"} + ,{"name": "k_EInputSourceMode_SingleButton","value": "15"} + ,{"name": "k_EInputSourceMode_Switches","value": "16"} +]} +, {"enumname": "EInputActionOrigin","values": [ + {"name": "k_EInputActionOrigin_None","value": "0"} + ,{"name": "k_EInputActionOrigin_SteamController_A","value": "1"} + ,{"name": "k_EInputActionOrigin_SteamController_B","value": "2"} + ,{"name": "k_EInputActionOrigin_SteamController_X","value": "3"} + ,{"name": "k_EInputActionOrigin_SteamController_Y","value": "4"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftBumper","value": "5"} + ,{"name": "k_EInputActionOrigin_SteamController_RightBumper","value": "6"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftGrip","value": "7"} + ,{"name": "k_EInputActionOrigin_SteamController_RightGrip","value": "8"} + ,{"name": "k_EInputActionOrigin_SteamController_Start","value": "9"} + ,{"name": "k_EInputActionOrigin_SteamController_Back","value": "10"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Touch","value": "11"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Swipe","value": "12"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_Click","value": "13"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadNorth","value": "14"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadSouth","value": "15"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadWest","value": "16"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftPad_DPadEast","value": "17"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Touch","value": "18"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Swipe","value": "19"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_Click","value": "20"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadNorth","value": "21"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadSouth","value": "22"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadWest","value": "23"} + ,{"name": "k_EInputActionOrigin_SteamController_RightPad_DPadEast","value": "24"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftTrigger_Pull","value": "25"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftTrigger_Click","value": "26"} + ,{"name": "k_EInputActionOrigin_SteamController_RightTrigger_Pull","value": "27"} + ,{"name": "k_EInputActionOrigin_SteamController_RightTrigger_Click","value": "28"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_Move","value": "29"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_Click","value": "30"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadNorth","value": "31"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadSouth","value": "32"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadWest","value": "33"} + ,{"name": "k_EInputActionOrigin_SteamController_LeftStick_DPadEast","value": "34"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Move","value": "35"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Pitch","value": "36"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Yaw","value": "37"} + ,{"name": "k_EInputActionOrigin_SteamController_Gyro_Roll","value": "38"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved0","value": "39"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved1","value": "40"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved2","value": "41"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved3","value": "42"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved4","value": "43"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved5","value": "44"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved6","value": "45"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved7","value": "46"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved8","value": "47"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved9","value": "48"} + ,{"name": "k_EInputActionOrigin_SteamController_Reserved10","value": "49"} + ,{"name": "k_EInputActionOrigin_PS4_X","value": "50"} + ,{"name": "k_EInputActionOrigin_PS4_Circle","value": "51"} + ,{"name": "k_EInputActionOrigin_PS4_Triangle","value": "52"} + ,{"name": "k_EInputActionOrigin_PS4_Square","value": "53"} + ,{"name": "k_EInputActionOrigin_PS4_LeftBumper","value": "54"} + ,{"name": "k_EInputActionOrigin_PS4_RightBumper","value": "55"} + ,{"name": "k_EInputActionOrigin_PS4_Options","value": "56"} + ,{"name": "k_EInputActionOrigin_PS4_Share","value": "57"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Touch","value": "58"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Swipe","value": "59"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_Click","value": "60"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadNorth","value": "61"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadSouth","value": "62"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadWest","value": "63"} + ,{"name": "k_EInputActionOrigin_PS4_LeftPad_DPadEast","value": "64"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Touch","value": "65"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Swipe","value": "66"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_Click","value": "67"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadNorth","value": "68"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadSouth","value": "69"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadWest","value": "70"} + ,{"name": "k_EInputActionOrigin_PS4_RightPad_DPadEast","value": "71"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Touch","value": "72"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Swipe","value": "73"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_Click","value": "74"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadNorth","value": "75"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadSouth","value": "76"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadWest","value": "77"} + ,{"name": "k_EInputActionOrigin_PS4_CenterPad_DPadEast","value": "78"} + ,{"name": "k_EInputActionOrigin_PS4_LeftTrigger_Pull","value": "79"} + ,{"name": "k_EInputActionOrigin_PS4_LeftTrigger_Click","value": "80"} + ,{"name": "k_EInputActionOrigin_PS4_RightTrigger_Pull","value": "81"} + ,{"name": "k_EInputActionOrigin_PS4_RightTrigger_Click","value": "82"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_Move","value": "83"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_Click","value": "84"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadNorth","value": "85"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadSouth","value": "86"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadWest","value": "87"} + ,{"name": "k_EInputActionOrigin_PS4_LeftStick_DPadEast","value": "88"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_Move","value": "89"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_Click","value": "90"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadNorth","value": "91"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadSouth","value": "92"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadWest","value": "93"} + ,{"name": "k_EInputActionOrigin_PS4_RightStick_DPadEast","value": "94"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_North","value": "95"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_South","value": "96"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_West","value": "97"} + ,{"name": "k_EInputActionOrigin_PS4_DPad_East","value": "98"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Move","value": "99"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Pitch","value": "100"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Yaw","value": "101"} + ,{"name": "k_EInputActionOrigin_PS4_Gyro_Roll","value": "102"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved0","value": "103"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved1","value": "104"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved2","value": "105"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved3","value": "106"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved4","value": "107"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved5","value": "108"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved6","value": "109"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved7","value": "110"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved8","value": "111"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved9","value": "112"} + ,{"name": "k_EInputActionOrigin_PS4_Reserved10","value": "113"} + ,{"name": "k_EInputActionOrigin_XBoxOne_A","value": "114"} + ,{"name": "k_EInputActionOrigin_XBoxOne_B","value": "115"} + ,{"name": "k_EInputActionOrigin_XBoxOne_X","value": "116"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Y","value": "117"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftBumper","value": "118"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightBumper","value": "119"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Menu","value": "120"} + ,{"name": "k_EInputActionOrigin_XBoxOne_View","value": "121"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull","value": "122"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftTrigger_Click","value": "123"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightTrigger_Pull","value": "124"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightTrigger_Click","value": "125"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_Move","value": "126"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_Click","value": "127"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth","value": "128"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth","value": "129"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest","value": "130"} + ,{"name": "k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast","value": "131"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_Move","value": "132"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_Click","value": "133"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth","value": "134"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth","value": "135"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadWest","value": "136"} + ,{"name": "k_EInputActionOrigin_XBoxOne_RightStick_DPadEast","value": "137"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_North","value": "138"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_South","value": "139"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_West","value": "140"} + ,{"name": "k_EInputActionOrigin_XBoxOne_DPad_East","value": "141"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved0","value": "142"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved1","value": "143"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved2","value": "144"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved3","value": "145"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved4","value": "146"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved5","value": "147"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved6","value": "148"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved7","value": "149"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved8","value": "150"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved9","value": "151"} + ,{"name": "k_EInputActionOrigin_XBoxOne_Reserved10","value": "152"} + ,{"name": "k_EInputActionOrigin_XBox360_A","value": "153"} + ,{"name": "k_EInputActionOrigin_XBox360_B","value": "154"} + ,{"name": "k_EInputActionOrigin_XBox360_X","value": "155"} + ,{"name": "k_EInputActionOrigin_XBox360_Y","value": "156"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftBumper","value": "157"} + ,{"name": "k_EInputActionOrigin_XBox360_RightBumper","value": "158"} + ,{"name": "k_EInputActionOrigin_XBox360_Start","value": "159"} + ,{"name": "k_EInputActionOrigin_XBox360_Back","value": "160"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftTrigger_Pull","value": "161"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftTrigger_Click","value": "162"} + ,{"name": "k_EInputActionOrigin_XBox360_RightTrigger_Pull","value": "163"} + ,{"name": "k_EInputActionOrigin_XBox360_RightTrigger_Click","value": "164"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_Move","value": "165"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_Click","value": "166"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadNorth","value": "167"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadSouth","value": "168"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadWest","value": "169"} + ,{"name": "k_EInputActionOrigin_XBox360_LeftStick_DPadEast","value": "170"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_Move","value": "171"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_Click","value": "172"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadNorth","value": "173"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadSouth","value": "174"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadWest","value": "175"} + ,{"name": "k_EInputActionOrigin_XBox360_RightStick_DPadEast","value": "176"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_North","value": "177"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_South","value": "178"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_West","value": "179"} + ,{"name": "k_EInputActionOrigin_XBox360_DPad_East","value": "180"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved0","value": "181"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved1","value": "182"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved2","value": "183"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved3","value": "184"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved4","value": "185"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved5","value": "186"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved6","value": "187"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved7","value": "188"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved8","value": "189"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved9","value": "190"} + ,{"name": "k_EInputActionOrigin_XBox360_Reserved10","value": "191"} + ,{"name": "k_EInputActionOrigin_Switch_A","value": "192"} + ,{"name": "k_EInputActionOrigin_Switch_B","value": "193"} + ,{"name": "k_EInputActionOrigin_Switch_X","value": "194"} + ,{"name": "k_EInputActionOrigin_Switch_Y","value": "195"} + ,{"name": "k_EInputActionOrigin_Switch_LeftBumper","value": "196"} + ,{"name": "k_EInputActionOrigin_Switch_RightBumper","value": "197"} + ,{"name": "k_EInputActionOrigin_Switch_Plus","value": "198"} + ,{"name": "k_EInputActionOrigin_Switch_Minus","value": "199"} + ,{"name": "k_EInputActionOrigin_Switch_Capture","value": "200"} + ,{"name": "k_EInputActionOrigin_Switch_LeftTrigger_Pull","value": "201"} + ,{"name": "k_EInputActionOrigin_Switch_LeftTrigger_Click","value": "202"} + ,{"name": "k_EInputActionOrigin_Switch_RightTrigger_Pull","value": "203"} + ,{"name": "k_EInputActionOrigin_Switch_RightTrigger_Click","value": "204"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_Move","value": "205"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_Click","value": "206"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadNorth","value": "207"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadSouth","value": "208"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadWest","value": "209"} + ,{"name": "k_EInputActionOrigin_Switch_LeftStick_DPadEast","value": "210"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_Move","value": "211"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_Click","value": "212"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadNorth","value": "213"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadSouth","value": "214"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadWest","value": "215"} + ,{"name": "k_EInputActionOrigin_Switch_RightStick_DPadEast","value": "216"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_North","value": "217"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_South","value": "218"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_West","value": "219"} + ,{"name": "k_EInputActionOrigin_Switch_DPad_East","value": "220"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Move","value": "221"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Pitch","value": "222"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Yaw","value": "223"} + ,{"name": "k_EInputActionOrigin_Switch_ProGyro_Roll","value": "224"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved0","value": "225"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved1","value": "226"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved2","value": "227"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved3","value": "228"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved4","value": "229"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved5","value": "230"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved6","value": "231"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved7","value": "232"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved8","value": "233"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved9","value": "234"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved10","value": "235"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Move","value": "236"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Pitch","value": "237"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Yaw","value": "238"} + ,{"name": "k_EInputActionOrigin_Switch_RightGyro_Roll","value": "239"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Move","value": "240"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Pitch","value": "241"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Yaw","value": "242"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGyro_Roll","value": "243"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGrip_Lower","value": "244"} + ,{"name": "k_EInputActionOrigin_Switch_LeftGrip_Upper","value": "245"} + ,{"name": "k_EInputActionOrigin_Switch_RightGrip_Lower","value": "246"} + ,{"name": "k_EInputActionOrigin_Switch_RightGrip_Upper","value": "247"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved11","value": "248"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved12","value": "249"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved13","value": "250"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved14","value": "251"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved15","value": "252"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved16","value": "253"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved17","value": "254"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved18","value": "255"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved19","value": "256"} + ,{"name": "k_EInputActionOrigin_Switch_Reserved20","value": "257"} + ,{"name": "k_EInputActionOrigin_Count","value": "258"} + ,{"name": "k_EInputActionOrigin_MaximumPossibleValue","value": "32767"} +]} +, {"enumname": "EXboxOrigin","values": [ + {"name": "k_EXboxOrigin_A","value": "0"} + ,{"name": "k_EXboxOrigin_B","value": "1"} + ,{"name": "k_EXboxOrigin_X","value": "2"} + ,{"name": "k_EXboxOrigin_Y","value": "3"} + ,{"name": "k_EXboxOrigin_LeftBumper","value": "4"} + ,{"name": "k_EXboxOrigin_RightBumper","value": "5"} + ,{"name": "k_EXboxOrigin_Menu","value": "6"} + ,{"name": "k_EXboxOrigin_View","value": "7"} + ,{"name": "k_EXboxOrigin_LeftTrigger_Pull","value": "8"} + ,{"name": "k_EXboxOrigin_LeftTrigger_Click","value": "9"} + ,{"name": "k_EXboxOrigin_RightTrigger_Pull","value": "10"} + ,{"name": "k_EXboxOrigin_RightTrigger_Click","value": "11"} + ,{"name": "k_EXboxOrigin_LeftStick_Move","value": "12"} + ,{"name": "k_EXboxOrigin_LeftStick_Click","value": "13"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadNorth","value": "14"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadSouth","value": "15"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadWest","value": "16"} + ,{"name": "k_EXboxOrigin_LeftStick_DPadEast","value": "17"} + ,{"name": "k_EXboxOrigin_RightStick_Move","value": "18"} + ,{"name": "k_EXboxOrigin_RightStick_Click","value": "19"} + ,{"name": "k_EXboxOrigin_RightStick_DPadNorth","value": "20"} + ,{"name": "k_EXboxOrigin_RightStick_DPadSouth","value": "21"} + ,{"name": "k_EXboxOrigin_RightStick_DPadWest","value": "22"} + ,{"name": "k_EXboxOrigin_RightStick_DPadEast","value": "23"} + ,{"name": "k_EXboxOrigin_DPad_North","value": "24"} + ,{"name": "k_EXboxOrigin_DPad_South","value": "25"} + ,{"name": "k_EXboxOrigin_DPad_West","value": "26"} + ,{"name": "k_EXboxOrigin_DPad_East","value": "27"} + ,{"name": "k_EXboxOrigin_Count","value": "28"} +]} , {"enumname": "ESteamControllerPad","values": [ {"name": "k_ESteamControllerPad_Left","value": "0"} ,{"name": "k_ESteamControllerPad_Right","value": "1"} ]} +, {"enumname": "ESteamInputType","values": [ + {"name": "k_ESteamInputType_Unknown","value": "0"} + ,{"name": "k_ESteamInputType_SteamController","value": "1"} + ,{"name": "k_ESteamInputType_XBox360Controller","value": "2"} + ,{"name": "k_ESteamInputType_XBoxOneController","value": "3"} + ,{"name": "k_ESteamInputType_GenericGamepad","value": "4"} + ,{"name": "k_ESteamInputType_PS4Controller","value": "5"} + ,{"name": "k_ESteamInputType_AppleMFiController","value": "6"} + ,{"name": "k_ESteamInputType_AndroidController","value": "7"} + ,{"name": "k_ESteamInputType_SwitchJoyConPair","value": "8"} + ,{"name": "k_ESteamInputType_SwitchJoyConSingle","value": "9"} + ,{"name": "k_ESteamInputType_SwitchProController","value": "10"} + ,{"name": "k_ESteamInputType_MobileTouch","value": "11"} + ,{"name": "k_ESteamInputType_PS3Controller","value": "12"} + ,{"name": "k_ESteamInputType_Count","value": "13"} + ,{"name": "k_ESteamInputType_MaximumPossibleValue","value": "255"} +]} +, {"enumname": "ESteamInputLEDFlag","values": [ + {"name": "k_ESteamInputLEDFlag_SetColor","value": "0"} + ,{"name": "k_ESteamInputLEDFlag_RestoreUserDefault","value": "1"} +]} , {"enumname": "EControllerSource","values": [ {"name": "k_EControllerSource_None","value": "0"} ,{"name": "k_EControllerSource_LeftTrackpad","value": "1"} @@ -807,13 +1197,16 @@ ,{"name": "k_EControllerSource_Switch","value": "5"} ,{"name": "k_EControllerSource_LeftTrigger","value": "6"} ,{"name": "k_EControllerSource_RightTrigger","value": "7"} - ,{"name": "k_EControllerSource_Gyro","value": "8"} - ,{"name": "k_EControllerSource_CenterTrackpad","value": "9"} - ,{"name": "k_EControllerSource_RightJoystick","value": "10"} - ,{"name": "k_EControllerSource_DPad","value": "11"} - ,{"name": "k_EControllerSource_Key","value": "12"} - ,{"name": "k_EControllerSource_Mouse","value": "13"} - ,{"name": "k_EControllerSource_Count","value": "14"} + ,{"name": "k_EControllerSource_LeftBumper","value": "8"} + ,{"name": "k_EControllerSource_RightBumper","value": "9"} + ,{"name": "k_EControllerSource_Gyro","value": "10"} + ,{"name": "k_EControllerSource_CenterTrackpad","value": "11"} + ,{"name": "k_EControllerSource_RightJoystick","value": "12"} + ,{"name": "k_EControllerSource_DPad","value": "13"} + ,{"name": "k_EControllerSource_Key","value": "14"} + ,{"name": "k_EControllerSource_Mouse","value": "15"} + ,{"name": "k_EControllerSource_LeftGyro","value": "16"} + ,{"name": "k_EControllerSource_Count","value": "17"} ]} , {"enumname": "EControllerSourceMode","values": [ {"name": "k_EControllerSourceMode_None","value": "0"} @@ -989,9 +1382,9 @@ ,{"name": "k_EControllerActionOrigin_SteamV2_Y","value": "151"} ,{"name": "k_EControllerActionOrigin_SteamV2_LeftBumper","value": "152"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightBumper","value": "153"} - ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip","value": "154"} - ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip","value": "155"} - ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Upper","value": "156"} + ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Lower","value": "154"} + ,{"name": "k_EControllerActionOrigin_SteamV2_LeftGrip_Upper","value": "155"} + ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip_Lower","value": "156"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightGrip_Upper","value": "157"} ,{"name": "k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure","value": "158"} ,{"name": "k_EControllerActionOrigin_SteamV2_RightBumper_Pressure","value": "159"} @@ -1031,20 +1424,58 @@ ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Pitch","value": "193"} ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Yaw","value": "194"} ,{"name": "k_EControllerActionOrigin_SteamV2_Gyro_Roll","value": "195"} - ,{"name": "k_EControllerActionOrigin_Count","value": "196"} + ,{"name": "k_EControllerActionOrigin_Switch_A","value": "196"} + ,{"name": "k_EControllerActionOrigin_Switch_B","value": "197"} + ,{"name": "k_EControllerActionOrigin_Switch_X","value": "198"} + ,{"name": "k_EControllerActionOrigin_Switch_Y","value": "199"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftBumper","value": "200"} + ,{"name": "k_EControllerActionOrigin_Switch_RightBumper","value": "201"} + ,{"name": "k_EControllerActionOrigin_Switch_Plus","value": "202"} + ,{"name": "k_EControllerActionOrigin_Switch_Minus","value": "203"} + ,{"name": "k_EControllerActionOrigin_Switch_Capture","value": "204"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftTrigger_Pull","value": "205"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftTrigger_Click","value": "206"} + ,{"name": "k_EControllerActionOrigin_Switch_RightTrigger_Pull","value": "207"} + ,{"name": "k_EControllerActionOrigin_Switch_RightTrigger_Click","value": "208"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_Move","value": "209"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_Click","value": "210"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadNorth","value": "211"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadSouth","value": "212"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadWest","value": "213"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftStick_DPadEast","value": "214"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_Move","value": "215"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_Click","value": "216"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadNorth","value": "217"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadSouth","value": "218"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadWest","value": "219"} + ,{"name": "k_EControllerActionOrigin_Switch_RightStick_DPadEast","value": "220"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_North","value": "221"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_South","value": "222"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_West","value": "223"} + ,{"name": "k_EControllerActionOrigin_Switch_DPad_East","value": "224"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Move","value": "225"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Pitch","value": "226"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Yaw","value": "227"} + ,{"name": "k_EControllerActionOrigin_Switch_ProGyro_Roll","value": "228"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Move","value": "229"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Pitch","value": "230"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Yaw","value": "231"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGyro_Roll","value": "232"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Move","value": "233"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Pitch","value": "234"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Yaw","value": "235"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGyro_Roll","value": "236"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGrip_Lower","value": "237"} + ,{"name": "k_EControllerActionOrigin_Switch_LeftGrip_Upper","value": "238"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGrip_Lower","value": "239"} + ,{"name": "k_EControllerActionOrigin_Switch_RightGrip_Upper","value": "240"} + ,{"name": "k_EControllerActionOrigin_Count","value": "241"} + ,{"name": "k_EControllerActionOrigin_MaximumPossibleValue","value": "32767"} ]} , {"enumname": "ESteamControllerLEDFlag","values": [ {"name": "k_ESteamControllerLEDFlag_SetColor","value": "0"} ,{"name": "k_ESteamControllerLEDFlag_RestoreUserDefault","value": "1"} ]} -, {"enumname": "ESteamInputType","values": [ - {"name": "k_ESteamInputType_Unknown","value": "0"} - ,{"name": "k_ESteamInputType_SteamController","value": "1"} - ,{"name": "k_ESteamInputType_XBox360Controller","value": "2"} - ,{"name": "k_ESteamInputType_XBoxOneController","value": "3"} - ,{"name": "k_ESteamInputType_GenericXInput","value": "4"} - ,{"name": "k_ESteamInputType_PS4Controller","value": "5"} -]} , {"enumname": "EUGCMatchingUGCType","values": [ {"name": "k_EUGCMatchingUGCType_Items","value": "0"} ,{"name": "k_EUGCMatchingUGCType_Items_Mtx","value": "1"} @@ -1243,6 +1674,10 @@ "constname": "k_iSteamUserStatsCallbacks","consttype": "int", "constval": "1100"} ,{ "constname": "k_iSteamNetworkingCallbacks","consttype": "int", "constval": "1200"} +,{ + "constname": "k_iSteamNetworkingSocketsCallbacks","consttype": "int", "constval": "1220"} +,{ + "constname": "k_iSteamNetworkingMessagesCallbacks","consttype": "int", "constval": "1250"} ,{ "constname": "k_iClientRemoteStorageCallbacks","consttype": "int", "constval": "1300"} ,{ @@ -1321,12 +1756,18 @@ "constname": "k_ISteamParentalSettingsCallbacks","consttype": "int", "constval": "5000"} ,{ "constname": "k_iClientShaderCallbacks","consttype": "int", "constval": "5100"} +,{ + "constname": "k_iSteamGameSearchCallbacks","consttype": "int", "constval": "5200"} +,{ + "constname": "k_iSteamPartiesCallbacks","consttype": "int", "constval": "5300"} +,{ + "constname": "k_iClientPartiesCallbacks","consttype": "int", "constval": "5400"} ,{ "constname": "k_cchPersonaNameMax","consttype": "int", "constval": "128"} ,{ "constname": "k_cwchPersonaNameMax","consttype": "int", "constval": "32"} ,{ - "constname": "k_cchMaxRichPresenceKeys","consttype": "int", "constval": "20"} + "constname": "k_cchMaxRichPresenceKeys","consttype": "int", "constval": "30"} ,{ "constname": "k_cchMaxRichPresenceKeyLength","consttype": "int", "constval": "64"} ,{ @@ -1364,6 +1805,50 @@ { "fieldname": "m_u64", "fieldtype": "uint64"}, { "fieldname": "m_u16", "fieldtype": "uint16"}, { "fieldname": "m_d", "fieldtype": "double"}]} +,{"struct": "CCallbackBase","fields": [ +{ "fieldname": "m_nCallbackFlags", "fieldtype": "uint8"}, +{ "fieldname": "m_iCallback", "fieldtype": "int"}]} +,{"struct": "CCallResult","fields": [ +{ "fieldname": "m_hAPICall", "fieldtype": "SteamAPICall_t"}, +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CCallback","fields": [ +{ "fieldname": "m_pObj", "fieldtype": "T *"}, +{ "fieldname": "m_Func", "fieldtype": "func_t"}]} +,{"struct": "CSteamAPIContext","fields": [ +{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, +{ "fieldname": "m_pSteamUser", "fieldtype": "class ISteamUser *"}, +{ "fieldname": "m_pSteamFriends", "fieldtype": "class ISteamFriends *"}, +{ "fieldname": "m_pSteamUtils", "fieldtype": "class ISteamUtils *"}, +{ "fieldname": "m_pSteamMatchmaking", "fieldtype": "class ISteamMatchmaking *"}, +{ "fieldname": "m_pSteamGameSearch", "fieldtype": "class ISteamGameSearch *"}, +{ "fieldname": "m_pSteamUserStats", "fieldtype": "class ISteamUserStats *"}, +{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}, +{ "fieldname": "m_pSteamMatchmakingServers", "fieldtype": "class ISteamMatchmakingServers *"}, +{ "fieldname": "m_pSteamNetworking", "fieldtype": "class ISteamNetworking *"}, +{ "fieldname": "m_pSteamRemoteStorage", "fieldtype": "class ISteamRemoteStorage *"}, +{ "fieldname": "m_pSteamScreenshots", "fieldtype": "class ISteamScreenshots *"}, +{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, +{ "fieldname": "m_pController", "fieldtype": "class ISteamController *"}, +{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, +{ "fieldname": "m_pSteamAppList", "fieldtype": "class ISteamAppList *"}, +{ "fieldname": "m_pSteamMusic", "fieldtype": "class ISteamMusic *"}, +{ "fieldname": "m_pSteamMusicRemote", "fieldtype": "class ISteamMusicRemote *"}, +{ "fieldname": "m_pSteamHTMLSurface", "fieldtype": "class ISteamHTMLSurface *"}, +{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, +{ "fieldname": "m_pSteamVideo", "fieldtype": "class ISteamVideo *"}, +{ "fieldname": "m_pSteamParentalSettings", "fieldtype": "class ISteamParentalSettings *"}, +{ "fieldname": "m_pSteamInput", "fieldtype": "class ISteamInput *"}]} +,{"struct": "CSteamGameServerAPIContext","fields": [ +{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, +{ "fieldname": "m_pSteamGameServer", "fieldtype": "class ISteamGameServer *"}, +{ "fieldname": "m_pSteamGameServerUtils", "fieldtype": "class ISteamUtils *"}, +{ "fieldname": "m_pSteamGameServerNetworking", "fieldtype": "class ISteamNetworking *"}, +{ "fieldname": "m_pSteamGameServerStats", "fieldtype": "class ISteamGameServerStats *"}, +{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, +{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, +{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, +{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}]} ,{"struct": "CallbackMsg_t","fields": [ { "fieldname": "m_hSteamUser", "fieldtype": "HSteamUser"}, { "fieldname": "m_iCallback", "fieldtype": "int"}, @@ -1397,6 +1882,12 @@ { "fieldname": "m_szURL", "fieldtype": "char [256]"}]} ,{"struct": "StoreAuthURLResponse_t","fields": [ { "fieldname": "m_szURL", "fieldtype": "char [512]"}]} +,{"struct": "MarketEligibilityResponse_t","fields": [ +{ "fieldname": "m_bAllowed", "fieldtype": "_Bool"}, +{ "fieldname": "m_eNotAllowedReason", "fieldtype": "enum EMarketNotAllowedReasonFlags"}, +{ "fieldname": "m_rtAllowedAtTime", "fieldtype": "RTime32"}, +{ "fieldname": "m_cdaySteamGuardRequiredDays", "fieldtype": "int"}, +{ "fieldname": "m_cdayNewDeviceCooldown", "fieldtype": "int"}]} ,{"struct": "FriendGameInfo_t","fields": [ { "fieldname": "m_gameID", "fieldtype": "class CGameID"}, { "fieldname": "m_unGameIP", "fieldtype": "uint32"}, @@ -1506,6 +1997,9 @@ { "fieldname": "m_szServerName", "fieldtype": "char [64]"}, { "fieldname": "m_szGameTags", "fieldtype": "char [128]"}, { "fieldname": "m_steamID", "fieldtype": "class CSteamID"}]} +,{"struct": "SteamPartyBeaconLocation_t","fields": [ +{ "fieldname": "m_eType", "fieldtype": "enum ESteamPartyBeaconLocationType"}, +{ "fieldname": "m_ulLocationID", "fieldtype": "uint64"}]} ,{"struct": "FavoritesListChanged_t","fields": [ { "fieldname": "m_nIP", "fieldtype": "uint32"}, { "fieldname": "m_nQueryPort", "fieldtype": "uint32"}, @@ -1556,6 +2050,61 @@ { "fieldname": "m_steamIDLobby", "fieldtype": "class CSteamID"}]} ,{"struct": "FavoritesListAccountsUpdated_t","fields": [ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} +,{"struct": "SearchForGameProgressCallback_t","fields": [ +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_lobbyID", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_steamIDEndedSearch", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_nSecondsRemainingEstimate", "fieldtype": "int32"}, +{ "fieldname": "m_cPlayersSearching", "fieldtype": "int32"}]} +,{"struct": "SearchForGameResultCallback_t","fields": [ +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_nCountPlayersInGame", "fieldtype": "int32"}, +{ "fieldname": "m_nCountAcceptedGame", "fieldtype": "int32"}, +{ "fieldname": "m_steamIDHost", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_bFinalCallback", "fieldtype": "_Bool"}]} +,{"struct": "RequestPlayersForGameProgressCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}]} +,{"struct": "RequestPlayersForGameResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_SteamIDPlayerFound", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_SteamIDLobby", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_ePlayerAcceptState", "fieldtype": "PlayerAcceptState_t"}, + { + "fieldname": "m_nPlayerIndex", + "fieldtype": "int32" + }, +{ "fieldname": "m_nTotalPlayersFound", "fieldtype": "int32"}, +{ "fieldname": "m_nTotalPlayersAcceptedGame", "fieldtype": "int32"}, +{ "fieldname": "m_nSuggestedTeamIndex", "fieldtype": "int32"}, +{ "fieldname": "m_ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "RequestPlayersForGameFinalResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ullSearchID", "fieldtype": "uint64"}, +{ "fieldname": "m_ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "SubmitPlayerResultResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "ullUniqueGameID", "fieldtype": "uint64"}, +{ "fieldname": "steamIDPlayer", "fieldtype": "class CSteamID"}]} +,{"struct": "EndGameResultCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "ullUniqueGameID", "fieldtype": "uint64"}]} +,{"struct": "JoinPartyCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}, +{ "fieldname": "m_SteamIDBeaconOwner", "fieldtype": "class CSteamID"}, +{ "fieldname": "m_rgchConnectString", "fieldtype": "char [256]"}]} +,{"struct": "CreateBeaconCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}, +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}]} +,{"struct": "ReservationNotificationCallback_t","fields": [ +{ "fieldname": "m_ulBeaconID", "fieldtype": "PartyBeaconID_t"}, +{ "fieldname": "m_steamIDJoiner", "fieldtype": "class CSteamID"}]} +,{"struct": "ChangeNumOpenSlotsCallback_t","fields": [ +{ "fieldname": "m_eResult", "fieldtype": "enum EResult"}]} ,{"struct": "SteamParamStringArray_t","fields": [ { "fieldname": "m_ppStrings", "fieldtype": "const char **"}, { "fieldname": "m_nNumStrings", "fieldtype": "int32"}]} @@ -1819,25 +2368,6 @@ { "fieldname": "m_ulContextValue", "fieldtype": "uint64"}, { "fieldname": "m_cOffset", "fieldtype": "uint32"}, { "fieldname": "m_cBytesReceived", "fieldtype": "uint32"}]} -,{"struct": "ControllerAnalogActionData_t","fields": [ -{ "fieldname": "eMode", "fieldtype": "enum EControllerSourceMode"}, -{ "fieldname": "x", "fieldtype": "float"}, -{ "fieldname": "y", "fieldtype": "float"}, -{ "fieldname": "bActive", "fieldtype": "_Bool"}]} -,{"struct": "ControllerDigitalActionData_t","fields": [ -{ "fieldname": "bState", "fieldtype": "_Bool"}, -{ "fieldname": "bActive", "fieldtype": "_Bool"}]} -,{"struct": "ControllerMotionData_t","fields": [ -{ "fieldname": "rotQuatX", "fieldtype": "float"}, -{ "fieldname": "rotQuatY", "fieldtype": "float"}, -{ "fieldname": "rotQuatZ", "fieldtype": "float"}, -{ "fieldname": "rotQuatW", "fieldtype": "float"}, -{ "fieldname": "posAccelX", "fieldtype": "float"}, -{ "fieldname": "posAccelY", "fieldtype": "float"}, -{ "fieldname": "posAccelZ", "fieldtype": "float"}, -{ "fieldname": "rotVelX", "fieldtype": "float"}, -{ "fieldname": "rotVelY", "fieldtype": "float"}, -{ "fieldname": "rotVelZ", "fieldtype": "float"}]} ,{"struct": "SteamUGCDetails_t","fields": [ { "fieldname": "m_nPublishedFileId", "fieldtype": "PublishedFileId_t"}, { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, @@ -1870,7 +2400,8 @@ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, { "fieldname": "m_unNumResultsReturned", "fieldtype": "uint32"}, { "fieldname": "m_unTotalMatchingResults", "fieldtype": "uint32"}, -{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} +{ "fieldname": "m_bCachedData", "fieldtype": "_Bool"}, +{ "fieldname": "m_rgchNextCursor", "fieldtype": "char [256]"}]} ,{"struct": "SteamUGCRequestUGCDetailsResult_t","fields": [ { "fieldname": "m_details", "fieldtype": "struct SteamUGCDetails_t"}, { "fieldname": "m_bCachedData", "fieldtype": "_Bool"}]} @@ -2019,7 +2550,7 @@ { "fieldname": "unY", "fieldtype": "uint32"}, { "fieldname": "unWide", "fieldtype": "uint32"}, { "fieldname": "unTall", "fieldtype": "uint32"}, -{ "fieldname": "unNewWindow_BrowserHandle", "fieldtype": "HHTMLBrowser"}]} +{ "fieldname": "unNewWindow_BrowserHandle_IGNORE", "fieldtype": "HHTMLBrowser"}]} ,{"struct": "HTML_SetCursor_t","fields": [ { "fieldname": "unBrowserHandle", "fieldtype": "HHTMLBrowser"}, { "fieldname": "eMouseCursor", "fieldtype": "uint32"}]} @@ -2068,38 +2599,6 @@ ,{"struct": "GetOPFSettingsResult_t","fields": [ { "fieldname": "m_eResult", "fieldtype": "enum EResult"}, { "fieldname": "m_unVideoAppID", "fieldtype": "AppId_t"}]} -,{"struct": "CSteamAPIContext","fields": [ -{ "fieldname": "m_pSteamClient", "fieldtype": "class ISteamClient *"}, -{ "fieldname": "m_pSteamUser", "fieldtype": "class ISteamUser *"}, -{ "fieldname": "m_pSteamFriends", "fieldtype": "class ISteamFriends *"}, -{ "fieldname": "m_pSteamUtils", "fieldtype": "class ISteamUtils *"}, -{ "fieldname": "m_pSteamMatchmaking", "fieldtype": "class ISteamMatchmaking *"}, -{ "fieldname": "m_pSteamUserStats", "fieldtype": "class ISteamUserStats *"}, -{ "fieldname": "m_pSteamApps", "fieldtype": "class ISteamApps *"}, -{ "fieldname": "m_pSteamMatchmakingServers", "fieldtype": "class ISteamMatchmakingServers *"}, -{ "fieldname": "m_pSteamNetworking", "fieldtype": "class ISteamNetworking *"}, -{ "fieldname": "m_pSteamRemoteStorage", "fieldtype": "class ISteamRemoteStorage *"}, -{ "fieldname": "m_pSteamScreenshots", "fieldtype": "class ISteamScreenshots *"}, -{ "fieldname": "m_pSteamHTTP", "fieldtype": "class ISteamHTTP *"}, -{ "fieldname": "m_pController", "fieldtype": "class ISteamController *"}, -{ "fieldname": "m_pSteamUGC", "fieldtype": "class ISteamUGC *"}, -{ "fieldname": "m_pSteamAppList", "fieldtype": "class ISteamAppList *"}, -{ "fieldname": "m_pSteamMusic", "fieldtype": "class ISteamMusic *"}, -{ "fieldname": "m_pSteamMusicRemote", "fieldtype": "class ISteamMusicRemote *"}, -{ "fieldname": "m_pSteamHTMLSurface", "fieldtype": "class ISteamHTMLSurface *"}, -{ "fieldname": "m_pSteamInventory", "fieldtype": "class ISteamInventory *"}, -{ "fieldname": "m_pSteamVideo", "fieldtype": "class ISteamVideo *"}, -{ "fieldname": "m_pSteamParentalSettings", "fieldtype": "class ISteamParentalSettings *"}]} -,{"struct": "CCallbackBase","fields": [ -{ "fieldname": "m_nCallbackFlags", "fieldtype": "uint8"}, -{ "fieldname": "m_iCallback", "fieldtype": "int"}]} -,{"struct": "CCallResult","fields": [ -{ "fieldname": "m_hAPICall", "fieldtype": "SteamAPICall_t"}, -{ "fieldname": "m_pObj", "fieldtype": "T *"}, -{ "fieldname": "m_Func", "fieldtype": "func_t"}]} -,{"struct": "CCallback","fields": [ -{ "fieldname": "m_pObj", "fieldtype": "T *"}, -{ "fieldname": "m_Func", "fieldtype": "func_t"}]} ,{"struct": "GSClientApprove_t","fields": [ { "fieldname": "m_SteamID", "fieldtype": "class CSteamID"}, { "fieldname": "m_OwnerSteamID", "fieldtype": "class CSteamID"}]} @@ -2328,6 +2827,16 @@ { "paramname": "pchVersion" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamClient", + "methodname": "GetISteamGameSearch", + "returntype": "class ISteamGameSearch *", + "params": [ +{ "paramname": "hSteamuser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamClient", "methodname": "GetIPCCallCount", @@ -2446,6 +2955,26 @@ { "paramname": "pchVersion" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamClient", + "methodname": "GetISteamInput", + "returntype": "class ISteamInput *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamClient", + "methodname": "GetISteamParties", + "returntype": "class ISteamParties *", + "params": [ +{ "paramname": "hSteamUser" ,"paramtype": "HSteamUser"}, +{ "paramname": "hSteamPipe" ,"paramtype": "HSteamPipe"}, +{ "paramname": "pchVersion" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamUser", "methodname": "GetHSteamUser", @@ -2677,6 +3206,11 @@ "methodname": "BIsPhoneRequiringVerification", "returntype": "bool" } +,{ + "classname": "ISteamUser", + "methodname": "GetMarketEligibility", "callresult": "MarketEligibilityResponse_t", + "returntype": "SteamAPICall_t" +} ,{ "classname": "ISteamFriends", "methodname": "GetPersonaName", @@ -2924,7 +3458,8 @@ "methodname": "ActivateGameOverlayToWebPage", "returntype": "void", "params": [ -{ "paramname": "pchURL" ,"paramtype": "const char *"} +{ "paramname": "pchURL" ,"paramtype": "const char *"}, +{ "paramname": "eMode" ,"paramtype": "EActivateGameOverlayToWebPageMode"} ] } ,{ @@ -3266,6 +3801,11 @@ { "paramname": "steamIDClan" ,"paramtype": "class CSteamID"} ] } +,{ + "classname": "ISteamFriends", + "methodname": "GetNumChatsWithUnreadPriorityMessages", + "returntype": "int" +} ,{ "classname": "ISteamUtils", "methodname": "GetSecondsSinceAppActive", @@ -4057,6 +4597,225 @@ { "paramname": "hServerQuery" ,"paramtype": "HServerQuery"} ] } +,{ + "classname": "ISteamGameSearch", + "methodname": "AddGameSearchParams", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchKeyToFind" ,"paramtype": "const char *"}, +{ "paramname": "pchValuesToFind" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SearchForGameWithLobby", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "steamIDLobby" ,"paramtype": "class CSteamID"}, +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SearchForGameSolo", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "AcceptGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "DeclineGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "RetrieveConnectionDetails", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "steamIDHost" ,"paramtype": "class CSteamID"}, +{ "paramname": "pchConnectionDetails" ,"paramtype": "char *"}, +{ "paramname": "cubConnectionDetails" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "EndGameSearch", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SetGameHostParams", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchKey" ,"paramtype": "const char *"}, +{ "paramname": "pchValue" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SetConnectionDetails", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "pchConnectionDetails" ,"paramtype": "const char *"}, +{ "paramname": "cubConnectionDetails" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "RequestPlayersForGame", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "nPlayerMin" ,"paramtype": "int"}, +{ "paramname": "nPlayerMax" ,"paramtype": "int"}, +{ "paramname": "nMaxTeamSize" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "HostConfirmGameStart", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "CancelRequestPlayersForGame", + "returntype": "EGameSearchErrorCode_t" +} +,{ + "classname": "ISteamGameSearch", + "methodname": "SubmitPlayerResult", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"}, +{ "paramname": "steamIDPlayer" ,"paramtype": "class CSteamID"}, +{ "paramname": "EPlayerResult" ,"paramtype": "EPlayerResult_t"} + ] +} +,{ + "classname": "ISteamGameSearch", + "methodname": "EndGame", + "returntype": "EGameSearchErrorCode_t", + "params": [ +{ "paramname": "ullUniqueGameID" ,"paramtype": "uint64"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetNumActiveBeacons", + "returntype": "uint32" +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconByIndex", + "returntype": "PartyBeaconID_t", + "params": [ +{ "paramname": "unIndex" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconDetails", + "returntype": "bool", + "params": [ +{ "paramname": "ulBeaconID" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "pSteamIDBeaconOwner" ,"paramtype": "class CSteamID *"}, +{ "paramname": "pLocation" ,"out_struct": " " ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "pchMetadata" ,"out_string_count": "cchMetadata" ,"paramtype": "char *"}, +{ "paramname": "cchMetadata" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "JoinParty", "callresult": "JoinPartyCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "ulBeaconID" ,"paramtype": "PartyBeaconID_t"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetNumAvailableBeaconLocations", + "returntype": "bool", + "params": [ +{ "paramname": "puNumLocations" ,"paramtype": "uint32 *"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetAvailableBeaconLocations", + "returntype": "bool", + "params": [ +{ "paramname": "pLocationList" ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "uMaxNumLocations" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "CreateBeacon", "callresult": "CreateBeaconCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "unOpenSlots" ,"paramtype": "uint32"}, +{ "paramname": "pBeaconLocation" ,"paramtype": "struct SteamPartyBeaconLocation_t *"}, +{ "paramname": "pchConnectString" ,"paramtype": "const char *"}, +{ "paramname": "pchMetadata" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "OnReservationCompleted", + "returntype": "void", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "CancelReservation", + "returntype": "void", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "steamIDUser" ,"paramtype": "class CSteamID"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "ChangeNumOpenSlots", "callresult": "ChangeNumOpenSlotsCallback_t", + "returntype": "SteamAPICall_t", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"}, +{ "paramname": "unOpenSlots" ,"paramtype": "uint32"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "DestroyBeacon", + "returntype": "bool", + "params": [ +{ "paramname": "ulBeacon" ,"paramtype": "PartyBeaconID_t"} + ] +} +,{ + "classname": "ISteamParties", + "methodname": "GetBeaconLocationData", + "returntype": "bool", + "params": [ +{ "paramname": "BeaconLocation" ,"paramtype": "struct SteamPartyBeaconLocation_t"}, +{ "paramname": "eData" ,"paramtype": "ESteamPartyBeaconLocationData"}, +{ "paramname": "pchDataStringOut" ,"out_string_count": "cchDataStringOut" ,"paramtype": "char *"}, +{ "paramname": "cchDataStringOut" ,"paramtype": "int"} + ] +} ,{ "classname": "ISteamRemoteStorage", "methodname": "FileWrite", @@ -5113,6 +5872,20 @@ { "paramname": "pszFileName" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamApps", + "methodname": "GetLaunchCommandLine", + "returntype": "int", + "params": [ +{ "paramname": "pszCommandLine" ,"paramtype": "char *"}, +{ "paramname": "cubCommandLine" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamApps", + "methodname": "BIsSubscribedFromFamilySharing", + "returntype": "bool" +} ,{ "classname": "ISteamNetworking", "methodname": "SendP2PPacket", @@ -5918,6 +6691,289 @@ { "paramname": "pbWasTimedOut" ,"paramtype": "bool *"} ] } +,{ + "classname": "ISteamInput", + "methodname": "Init", + "returntype": "bool" +} +,{ + "classname": "ISteamInput", + "methodname": "Shutdown", + "returntype": "bool" +} +,{ + "classname": "ISteamInput", + "methodname": "RunFrame", + "returntype": "void" +} +,{ + "classname": "ISteamInput", + "methodname": "GetConnectedControllers", + "returntype": "int", + "params": [ +{ "paramname": "handlesOut" ,"paramtype": "InputHandle_t *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActionSetHandle", + "returntype": "InputActionSetHandle_t", + "params": [ +{ "paramname": "pszActionSetName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ActivateActionSet", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetCurrentActionSet", + "returntype": "InputActionSetHandle_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ActivateActionSetLayer", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetLayerHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "DeactivateActionSetLayer", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetLayerHandle" ,"paramtype": "InputActionSetHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "DeactivateAllActionSetLayers", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActiveActionSetLayers", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "handlesOut" ,"paramtype": "InputActionSetHandle_t *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionHandle", + "returntype": "InputDigitalActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionData", + "returntype": "struct InputDigitalActionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "InputDigitalActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetDigitalActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"}, +{ "paramname": "digitalActionHandle" ,"paramtype": "InputDigitalActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EInputActionOrigin *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionHandle", + "returntype": "InputAnalogActionHandle_t", + "params": [ +{ "paramname": "pszActionName" ,"paramtype": "const char *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionData", + "returntype": "struct InputAnalogActionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "InputAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetAnalogActionOrigins", + "returntype": "int", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "actionSetHandle" ,"paramtype": "InputActionSetHandle_t"}, +{ "paramname": "analogActionHandle" ,"paramtype": "InputAnalogActionHandle_t"}, +{ "paramname": "originsOut" ,"paramtype": "EInputActionOrigin *"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGlyphForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetStringForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "StopAnalogActionMomentum", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eAction" ,"paramtype": "InputAnalogActionHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetMotionData", + "returntype": "struct InputMotionData_t", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerVibration", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "usLeftSpeed" ,"paramtype": "unsigned short"}, +{ "paramname": "usRightSpeed" ,"paramtype": "unsigned short"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "SetLEDColor", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "nColorR" ,"paramtype": "uint8"}, +{ "paramname": "nColorG" ,"paramtype": "uint8"}, +{ "paramname": "nColorB" ,"paramtype": "uint8"}, +{ "paramname": "nFlags" ,"paramtype": "unsigned int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerHapticPulse", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eTargetPad" ,"paramtype": "ESteamControllerPad"}, +{ "paramname": "usDurationMicroSec" ,"paramtype": "unsigned short"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TriggerRepeatedHapticPulse", + "returntype": "void", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eTargetPad" ,"paramtype": "ESteamControllerPad"}, +{ "paramname": "usDurationMicroSec" ,"paramtype": "unsigned short"}, +{ "paramname": "usOffMicroSec" ,"paramtype": "unsigned short"}, +{ "paramname": "unRepeat" ,"paramtype": "unsigned short"}, +{ "paramname": "nFlags" ,"paramtype": "unsigned int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "ShowBindingPanel", + "returntype": "bool", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetInputTypeForHandle", + "returntype": "ESteamInputType", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetControllerForGamepadIndex", + "returntype": "InputHandle_t", + "params": [ +{ "paramname": "nIndex" ,"paramtype": "int"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGamepadIndexForController", + "returntype": "int", + "params": [ +{ "paramname": "ulinputHandle" ,"paramtype": "InputHandle_t"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetStringForXboxOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetGlyphForXboxOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "GetActionOriginFromXboxOrigin", + "returntype": "EInputActionOrigin", + "params": [ +{ "paramname": "inputHandle" ,"paramtype": "InputHandle_t"}, +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamInput", + "methodname": "TranslateActionOrigin", + "returntype": "EInputActionOrigin", + "params": [ +{ "paramname": "eDestinationInputType" ,"paramtype": "ESteamInputType"}, +{ "paramname": "eSourceOrigin" ,"paramtype": "EInputActionOrigin"} + ] +} ,{ "classname": "ISteamController", "methodname": "Init", @@ -5941,14 +6997,6 @@ { "paramname": "handlesOut" ,"paramtype": "ControllerHandle_t *"} ] } -,{ - "classname": "ISteamController", - "methodname": "ShowBindingPanel", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} - ] -} ,{ "classname": "ISteamController", "methodname": "GetActionSetHandle", @@ -6020,7 +7068,7 @@ ,{ "classname": "ISteamController", "methodname": "GetDigitalActionData", - "returntype": "struct ControllerDigitalActionData_t", + "returntype": "struct InputDigitalActionData_t", "params": [ { "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, { "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"} @@ -6048,7 +7096,7 @@ ,{ "classname": "ISteamController", "methodname": "GetAnalogActionData", - "returntype": "struct ControllerAnalogActionData_t", + "returntype": "struct InputAnalogActionData_t", "params": [ { "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, { "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"} @@ -6065,6 +7113,22 @@ { "paramname": "originsOut" ,"paramtype": "EControllerActionOrigin *"} ] } +,{ + "classname": "ISteamController", + "methodname": "GetGlyphForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetStringForActionOrigin", + "returntype": "const char *", + "params": [ +{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} + ] +} ,{ "classname": "ISteamController", "methodname": "StopAnalogActionMomentum", @@ -6074,6 +7138,14 @@ { "paramname": "eAction" ,"paramtype": "ControllerAnalogActionHandle_t"} ] } +,{ + "classname": "ISteamController", + "methodname": "GetMotionData", + "returntype": "struct InputMotionData_t", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} ,{ "classname": "ISteamController", "methodname": "TriggerHapticPulse", @@ -6121,10 +7193,18 @@ } ,{ "classname": "ISteamController", - "methodname": "GetGamepadIndexForController", - "returntype": "int", + "methodname": "ShowBindingPanel", + "returntype": "bool", "params": [ -{ "paramname": "ulControllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "GetInputTypeForHandle", + "returntype": "ESteamInputType", + "params": [ +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} ] } ,{ @@ -6137,58 +7217,44 @@ } ,{ "classname": "ISteamController", - "methodname": "GetMotionData", - "returntype": "struct ControllerMotionData_t", + "methodname": "GetGamepadIndexForController", + "returntype": "int", "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "ulControllerHandle" ,"paramtype": "ControllerHandle_t"} ] } ,{ "classname": "ISteamController", - "methodname": "ShowDigitalActionOrigins", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, -{ "paramname": "digitalActionHandle" ,"paramtype": "ControllerDigitalActionHandle_t"}, -{ "paramname": "flScale" ,"paramtype": "float"}, -{ "paramname": "flXPosition" ,"paramtype": "float"}, -{ "paramname": "flYPosition" ,"paramtype": "float"} - ] -} -,{ - "classname": "ISteamController", - "methodname": "ShowAnalogActionOrigins", - "returntype": "bool", - "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, -{ "paramname": "analogActionHandle" ,"paramtype": "ControllerAnalogActionHandle_t"}, -{ "paramname": "flScale" ,"paramtype": "float"}, -{ "paramname": "flXPosition" ,"paramtype": "float"}, -{ "paramname": "flYPosition" ,"paramtype": "float"} - ] -} -,{ - "classname": "ISteamController", - "methodname": "GetStringForActionOrigin", + "methodname": "GetStringForXboxOrigin", "returntype": "const char *", "params": [ -{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} ] } ,{ "classname": "ISteamController", - "methodname": "GetGlyphForActionOrigin", + "methodname": "GetGlyphForXboxOrigin", "returntype": "const char *", "params": [ -{ "paramname": "eOrigin" ,"paramtype": "EControllerActionOrigin"} +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} ] } ,{ "classname": "ISteamController", - "methodname": "GetInputTypeForHandle", - "returntype": "ESteamInputType", + "methodname": "GetActionOriginFromXboxOrigin", + "returntype": "EControllerActionOrigin", "params": [ -{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"} +{ "paramname": "controllerHandle" ,"paramtype": "ControllerHandle_t"}, +{ "paramname": "eOrigin" ,"paramtype": "EXboxOrigin"} + ] +} +,{ + "classname": "ISteamController", + "methodname": "TranslateActionOrigin", + "returntype": "EControllerActionOrigin", + "params": [ +{ "paramname": "eDestinationInputType" ,"paramtype": "ESteamInputType"}, +{ "paramname": "eSourceOrigin" ,"paramtype": "EControllerActionOrigin"} ] } ,{ @@ -6217,6 +7283,18 @@ { "paramname": "unPage" ,"paramtype": "uint32"} ] } +,{ + "classname": "ISteamUGC", + "methodname": "CreateQueryAllUGCRequest", + "returntype": "UGCQueryHandle_t", + "params": [ +{ "paramname": "eQueryType" ,"paramtype": "EUGCQuery"}, +{ "paramname": "eMatchingeMatchingUGCTypeFileType" ,"paramtype": "EUGCMatchingUGCType"}, +{ "paramname": "nCreatorAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "nConsumerAppID" ,"paramtype": "AppId_t"}, +{ "paramname": "pchCursor" ,"paramtype": "const char *"} + ] +} ,{ "classname": "ISteamUGC", "methodname": "CreateQueryUGCDetailsRequest", @@ -6596,6 +7674,15 @@ { "paramname": "pszPreviewFile" ,"paramtype": "const char *"} ] } +,{ + "classname": "ISteamUGC", + "methodname": "SetAllowLegacyUpload", + "returntype": "bool", + "params": [ +{ "paramname": "handle" ,"paramtype": "UGCUpdateHandle_t"}, +{ "paramname": "bAllowLegacyUpload" ,"paramtype": "bool"} + ] +} ,{ "classname": "ISteamUGC", "methodname": "RemoveItemKeyValueTags", @@ -7076,7 +8163,8 @@ "params": [ { "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"}, { "paramname": "nNativeKeyCode" ,"paramtype": "uint32"}, -{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"} +{ "paramname": "eHTMLKeyModifiers" ,"paramtype": "ISteamHTMLSurface::EHTMLKeyModifiers"}, +{ "paramname": "bIsSystemKey" ,"paramtype": "bool"} ] } ,{ @@ -7222,6 +8310,14 @@ { "paramname": "flDPIScaling" ,"paramtype": "float"} ] } +,{ + "classname": "ISteamHTMLSurface", + "methodname": "OpenDeveloperTools", + "returntype": "void", + "params": [ +{ "paramname": "unBrowserHandle" ,"paramtype": "HHTMLBrowser"} + ] +} ,{ "classname": "ISteamHTMLSurface", "methodname": "AllowStartRequest", @@ -7505,7 +8601,8 @@ "returntype": "bool", "params": [ { "paramname": "pArrayItemDefs" ,"out_array_count": "pArrayItemDefs" ,"desc": "Items with prices" ,"paramtype": "SteamItemDef_t *"}, -{ "paramname": "pPrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, +{ "paramname": "pCurrentPrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, +{ "paramname": "pBasePrices" ,"out_array_count": "pPrices" ,"desc": "List of prices for the given item defs" ,"paramtype": "uint64 *"}, { "paramname": "unArrayLength" ,"paramtype": "uint32"} ] } @@ -7515,7 +8612,8 @@ "returntype": "bool", "params": [ { "paramname": "iDefinition" ,"paramtype": "SteamItemDef_t"}, -{ "paramname": "pPrice" ,"paramtype": "uint64 *"} +{ "paramname": "pCurrentPrice" ,"paramtype": "uint64 *"}, +{ "paramname": "pBasePrice" ,"paramtype": "uint64 *"} ] } ,{ diff --git a/Generator/steam_sdk/steam_api_common.h b/Generator/steam_sdk/steam_api_common.h new file mode 100644 index 0000000..cc936de --- /dev/null +++ b/Generator/steam_sdk/steam_api_common.h @@ -0,0 +1,231 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Steamworks SDK minimal include +// +// Defines the minimal set of things we need to use any single interface +// or register for any callback. +// +//============================================================================= + +#ifndef STEAM_API_COMMON_H +#define STEAM_API_COMMON_H +#ifdef _WIN32 +#pragma once +#endif + +#include "steamtypes.h" +#include "steamclientpublic.h" + +// S_API defines the linkage and calling conventions for steam_api.dll exports +#if defined( _WIN32 ) && !defined( _X360 ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __declspec( dllexport ) + #elif defined( STEAM_API_NODLL ) + #define S_API extern "C" + #else + #define S_API extern "C" __declspec( dllimport ) + #endif // STEAM_API_EXPORTS +#elif defined( GNUC ) + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" __attribute__ ((visibility("default"))) + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#else // !WIN32 + #if defined( STEAM_API_EXPORTS ) + #define S_API extern "C" + #else + #define S_API extern "C" + #endif // STEAM_API_EXPORTS +#endif + +#if ( defined(STEAM_API_EXPORTS) || defined(STEAM_API_NODLL) ) && !defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) __VA_ARGS__ +#elif defined(STEAM_API_EXPORTS) && defined(API_GEN) +#define STEAM_PRIVATE_API( ... ) +#else +#define STEAM_PRIVATE_API( ... ) protected: __VA_ARGS__ public: +#endif + +// handle to a communication pipe to the Steam client +typedef int32 HSteamPipe; +// handle to single instance of a steam user +typedef int32 HSteamUser; +// function prototype +#if defined( POSIX ) +#define __cdecl +#endif +extern "C" typedef void (__cdecl *SteamAPIWarningMessageHook_t)(int, const char *); +extern "C" typedef uint32 ( *SteamAPI_CheckCallbackRegistered_t )( int iCallbackNum ); +#if defined( __SNC__ ) + #pragma diag_suppress=1700 // warning 1700: class "%s" has virtual functions but non-virtual destructor +#endif + +//----------------------------------------------------------------------------------------------------------------------------------------------------------// +// steam callback and call-result helpers +// +// The following macros and classes are used to register your application for +// callbacks and call-results, which are delivered in a predictable manner. +// +// STEAM_CALLBACK macros are meant for use inside of a C++ class definition. +// They map a Steam notification callback directly to a class member function +// which is automatically prototyped as "void func( callback_type *pParam )". +// +// CCallResult is used with specific Steam APIs that return "result handles". +// The handle can be passed to a CCallResult object's Set function, along with +// an object pointer and member-function pointer. The member function will +// be executed once the results of the Steam API call are available. +// +// CCallback and CCallbackManual classes can be used instead of STEAM_CALLBACK +// macros if you require finer control over registration and unregistration. +// +// Callbacks and call-results are queued automatically and are only +// delivered/executed when your application calls SteamAPI_RunCallbacks(). +//----------------------------------------------------------------------------------------------------------------------------------------------------------// + +// Dispatch all queued Steamworks callbacks. +// +// This is safe to call from multiple threads simultaneously, +// but if you choose to do this, callback code could be executed on any thread. +// One alternative is to call SteamAPI_RunCallbacks from the main thread only, +// and call SteamAPI_ReleaseCurrentThreadMemory regularly on other threads. +S_API void S_CALLTYPE SteamAPI_RunCallbacks(); + +// Declares a callback member function plus a helper member variable which +// registers the callback on object creation and unregisters on destruction. +// The optional fourth 'var' param exists only for backwards-compatibility +// and can be ignored. +#define STEAM_CALLBACK( thisclass, func, .../*callback_type, [deprecated] var*/ ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, 4, 3 ), ( /**/, thisclass, func, __VA_ARGS__ ) ) + +// Declares a callback function and a named CCallbackManual variable which +// has Register and Unregister functions instead of automatic registration. +#define STEAM_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type > var; void func( callback_type *pParam ) + +// Dispatch callbacks relevant to the gameserver client and interfaces. +// To register for these, you need to use STEAM_GAMESERVER_CALLBACK. +// (Or call SetGameserverFlag on your CCallbackBase object.) +S_API void S_CALLTYPE SteamGameServer_RunCallbacks(); + +// Same as STEAM_CALLBACK, but for callbacks on the gameserver interface. +// These will be dispatched during SteamGameServer_RunCallbacks +#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ + _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) +#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ + CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) + +//----------------------------------------------------------------------------- +// Purpose: base for callbacks and call results - internal implementation detail +//----------------------------------------------------------------------------- +class CCallbackBase +{ +public: + CCallbackBase() { m_nCallbackFlags = 0; m_iCallback = 0; } + // don't add a virtual destructor because we export this binary interface across dll's + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ) = 0; + int GetICallback() { return m_iCallback; } + virtual int GetCallbackSizeBytes() = 0; + +protected: + enum { k_ECallbackFlagsRegistered = 0x01, k_ECallbackFlagsGameServer = 0x02 }; + uint8 m_nCallbackFlags; + int m_iCallback; + friend class CCallbackMgr; + +private: + CCallbackBase( const CCallbackBase& ); + CCallbackBase& operator=( const CCallbackBase& ); +}; + +//----------------------------------------------------------------------------- +// Purpose: templated base for callbacks - internal implementation detail +//----------------------------------------------------------------------------- +template< int sizeof_P > +class CCallbackImpl : protected CCallbackBase +{ +public: + virtual ~CCallbackImpl() { if ( m_nCallbackFlags & k_ECallbackFlagsRegistered ) SteamAPI_UnregisterCallback( this ); } + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } + +protected: + virtual void Run( void *pvParam ) = 0; + virtual void Run( void *pvParam, bool /*bIOFailure*/, SteamAPICall_t /*hSteamAPICall*/ ) { Run( pvParam ); } + virtual int GetCallbackSizeBytes() { return sizeof_P; } +}; + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam async call result to a class member function +// template params: T = local class, P = parameter struct +//----------------------------------------------------------------------------- +template< class T, class P > +class CCallResult : private CCallbackBase +{ +public: + typedef void (T::*func_t)( P*, bool ); + + CCallResult(); + ~CCallResult(); + + void Set( SteamAPICall_t hAPICall, T *p, func_t func ); + bool IsActive() const; + void Cancel(); + + void SetGameserverFlag() { m_nCallbackFlags |= k_ECallbackFlagsGameServer; } +private: + virtual void Run( void *pvParam ); + virtual void Run( void *pvParam, bool bIOFailure, SteamAPICall_t hSteamAPICall ); + virtual int GetCallbackSizeBytes() { return sizeof( P ); } + + SteamAPICall_t m_hAPICall; + T *m_pObj; + func_t m_Func; +}; + + + +//----------------------------------------------------------------------------- +// Purpose: maps a steam callback to a class member function +// template params: T = local class, P = parameter struct, +// bGameserver = listen for gameserver callbacks instead of client callbacks +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameserver = false > +class CCallback : public CCallbackImpl< sizeof( P ) > +{ +public: + typedef void (T::*func_t)(P*); + + // NOTE: If you can't provide the correct parameters at construction time, you should + // use the CCallbackManual callback object (STEAM_CALLBACK_MANUAL macro) instead. + CCallback( T *pObj, func_t func ); + + void Register( T *pObj, func_t func ); + void Unregister(); + +protected: + virtual void Run( void *pvParam ); + + T *m_pObj; + func_t m_Func; +}; + + +//----------------------------------------------------------------------------- +// Purpose: subclass of CCallback which allows default-construction in +// an unregistered state; you must call Register manually +//----------------------------------------------------------------------------- +template< class T, class P, bool bGameServer = false > +class CCallbackManual : public CCallback< T, P, bGameServer > +{ +public: + CCallbackManual() : CCallback< T, P, bGameServer >( nullptr, nullptr ) {} + + // Inherits public Register and Unregister functions from base class +}; + +// Internal implementation details for all of the above +#include "steam_api_internal.h" + +#endif // STEAM_API_COMMON_H diff --git a/Generator/steam_sdk/steam_api_flat.h b/Generator/steam_sdk/steam_api_flat.h index 45ba7c3..b8c579e 100644 --- a/Generator/steam_sdk/steam_api_flat.h +++ b/Generator/steam_sdk/steam_api_flat.h @@ -42,6 +42,7 @@ typedef uint32 AccountID_t; typedef uint32 PartnerId_t; typedef uint64 ManifestId_t; typedef uint64 SiteId_t; +typedef uint64 PartyBeaconID_t; typedef uint32 HAuthTicket; typedef void * BREAKPAD_HANDLE; typedef char compile_time_assert_type[1]; @@ -62,6 +63,10 @@ typedef uint32 SNetListenSocket_t; typedef uint32 ScreenshotHandle; typedef uint32 HTTPRequestHandle; typedef uint32 HTTPCookieContainerHandle; +typedef uint64 InputHandle_t; +typedef uint64 InputActionSetHandle_t; +typedef uint64 InputDigitalActionHandle_t; +typedef uint64 InputAnalogActionHandle_t; typedef uint64 ControllerHandle_t; typedef uint64 ControllerActionSetHandle_t; typedef uint64 ControllerDigitalActionHandle_t; @@ -86,6 +91,8 @@ int const_k_iClientUserCallbacks = 900; int const_k_iSteamAppsCallbacks = 1000; int const_k_iSteamUserStatsCallbacks = 1100; int const_k_iSteamNetworkingCallbacks = 1200; +int const_k_iSteamNetworkingSocketsCallbacks = 1220; +int const_k_iSteamNetworkingMessagesCallbacks = 1250; int const_k_iClientRemoteStorageCallbacks = 1300; int const_k_iClientDepotBuilderCallbacks = 1400; int const_k_iSteamGameServerItemsCallbacks = 1500; @@ -125,9 +132,12 @@ int const_k_iClientBluetoothManagerCallbacks = 4800; int const_k_iClientSharedConnectionCallbacks = 4900; int const_k_ISteamParentalSettingsCallbacks = 5000; int const_k_iClientShaderCallbacks = 5100; +int const_k_iSteamGameSearchCallbacks = 5200; +int const_k_iSteamPartiesCallbacks = 5300; +int const_k_iClientPartiesCallbacks = 5400; int const_k_cchPersonaNameMax = 128; int const_k_cwchPersonaNameMax = 32; -int const_k_cchMaxRichPresenceKeys = 20; +int const_k_cchMaxRichPresenceKeys = 30; int const_k_cchMaxRichPresenceKeyLength = 64; int const_k_cchMaxRichPresenceValueLength = 256; int const_k_cchStatNameMax = 128; @@ -162,6 +172,7 @@ S_API class ISteamApps * SteamAPI_ISteamClient_GetISteamApps(intptr_t instancePt S_API class ISteamNetworking * SteamAPI_ISteamClient_GetISteamNetworking(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamRemoteStorage * SteamAPI_ISteamClient_GetISteamRemoteStorage(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamScreenshots * SteamAPI_ISteamClient_GetISteamScreenshots(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamGameSearch * SteamAPI_ISteamClient_GetISteamGameSearch(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API uint32 SteamAPI_ISteamClient_GetIPCCallCount(intptr_t instancePtr); S_API void SteamAPI_ISteamClient_SetWarningMessageHook(intptr_t instancePtr, SteamAPIWarningMessageHook_t pFunction); S_API bool SteamAPI_ISteamClient_BShutdownIfAllPipesClosed(intptr_t instancePtr); @@ -175,6 +186,8 @@ S_API class ISteamHTMLSurface * SteamAPI_ISteamClient_GetISteamHTMLSurface(intpt S_API class ISteamInventory * SteamAPI_ISteamClient_GetISteamInventory(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamVideo * SteamAPI_ISteamClient_GetISteamVideo(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); S_API class ISteamParentalSettings * SteamAPI_ISteamClient_GetISteamParentalSettings(intptr_t instancePtr, HSteamUser hSteamuser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamInput * SteamAPI_ISteamClient_GetISteamInput(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); +S_API class ISteamParties * SteamAPI_ISteamClient_GetISteamParties(intptr_t instancePtr, HSteamUser hSteamUser, HSteamPipe hSteamPipe, const char * pchVersion); S_API HSteamUser SteamAPI_ISteamUser_GetHSteamUser(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BLoggedOn(intptr_t instancePtr); S_API uint64 SteamAPI_ISteamUser_GetSteamID(intptr_t instancePtr); @@ -204,6 +217,7 @@ S_API bool SteamAPI_ISteamUser_BIsPhoneVerified(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsTwoFactorEnabled(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsPhoneIdentifying(intptr_t instancePtr); S_API bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification(intptr_t instancePtr); +S_API SteamAPICall_t SteamAPI_ISteamUser_GetMarketEligibility(intptr_t instancePtr); S_API const char * SteamAPI_ISteamFriends_GetPersonaName(intptr_t instancePtr); S_API SteamAPICall_t SteamAPI_ISteamFriends_SetPersonaName(intptr_t instancePtr, const char * pchPersonaName); S_API EPersonaState SteamAPI_ISteamFriends_GetPersonaState(intptr_t instancePtr); @@ -234,7 +248,7 @@ S_API bool SteamAPI_ISteamFriends_IsUserInSource(intptr_t instancePtr, class CSt S_API void SteamAPI_ISteamFriends_SetInGameVoiceSpeaking(intptr_t instancePtr, class CSteamID steamIDUser, bool bSpeaking); S_API void SteamAPI_ISteamFriends_ActivateGameOverlay(intptr_t instancePtr, const char * pchDialog); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(intptr_t instancePtr, const char * pchDialog, class CSteamID steamID); -S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(intptr_t instancePtr, const char * pchURL); +S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(intptr_t instancePtr, const char * pchURL, EActivateGameOverlayToWebPageMode eMode); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(intptr_t instancePtr, AppId_t nAppID, EOverlayToStoreFlag eFlag); S_API void SteamAPI_ISteamFriends_SetPlayedWith(intptr_t instancePtr, class CSteamID steamIDUserPlayedWith); S_API void SteamAPI_ISteamFriends_ActivateGameOverlayInviteDialog(intptr_t instancePtr, class CSteamID steamIDLobby); @@ -276,6 +290,7 @@ S_API SteamAPICall_t SteamAPI_ISteamFriends_IsFollowing(intptr_t instancePtr, cl S_API SteamAPICall_t SteamAPI_ISteamFriends_EnumerateFollowingList(intptr_t instancePtr, uint32 unStartIndex); S_API bool SteamAPI_ISteamFriends_IsClanPublic(intptr_t instancePtr, class CSteamID steamIDClan); S_API bool SteamAPI_ISteamFriends_IsClanOfficialGameGroup(intptr_t instancePtr, class CSteamID steamIDClan); +S_API int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceAppActive(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamUtils_GetSecondsSinceComputerActive(intptr_t instancePtr); S_API EUniverse SteamAPI_ISteamUtils_GetConnectedUniverse(intptr_t instancePtr); @@ -371,6 +386,32 @@ S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PingServer(intptr_t instanc S_API HServerQuery SteamAPI_ISteamMatchmakingServers_PlayerDetails(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingPlayersResponse * pRequestServersResponse); S_API HServerQuery SteamAPI_ISteamMatchmakingServers_ServerRules(intptr_t instancePtr, uint32 unIP, uint16 usPort, class ISteamMatchmakingRulesResponse * pRequestServersResponse); S_API void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(intptr_t instancePtr, HServerQuery hServerQuery); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AddGameSearchParams(intptr_t instancePtr, const char * pchKeyToFind, const char * pchValuesToFind); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameWithLobby(intptr_t instancePtr, class CSteamID steamIDLobby, int nPlayerMin, int nPlayerMax); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SearchForGameSolo(intptr_t instancePtr, int nPlayerMin, int nPlayerMax); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_AcceptGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_DeclineGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(intptr_t instancePtr, class CSteamID steamIDHost, char * pchConnectionDetails, int cubConnectionDetails); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGameSearch(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetGameHostParams(intptr_t instancePtr, const char * pchKey, const char * pchValue); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SetConnectionDetails(intptr_t instancePtr, const char * pchConnectionDetails, int cubConnectionDetails); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_RequestPlayersForGame(intptr_t instancePtr, int nPlayerMin, int nPlayerMax, int nMaxTeamSize); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_HostConfirmGameStart(intptr_t instancePtr, uint64 ullUniqueGameID); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(intptr_t instancePtr); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_SubmitPlayerResult(intptr_t instancePtr, uint64 ullUniqueGameID, class CSteamID steamIDPlayer, EPlayerResult_t EPlayerResult); +S_API EGameSearchErrorCode_t SteamAPI_ISteamGameSearch_EndGame(intptr_t instancePtr, uint64 ullUniqueGameID); +S_API uint32 SteamAPI_ISteamParties_GetNumActiveBeacons(intptr_t instancePtr); +S_API PartyBeaconID_t SteamAPI_ISteamParties_GetBeaconByIndex(intptr_t instancePtr, uint32 unIndex); +S_API bool SteamAPI_ISteamParties_GetBeaconDetails(intptr_t instancePtr, PartyBeaconID_t ulBeaconID, class CSteamID * pSteamIDBeaconOwner, struct SteamPartyBeaconLocation_t * pLocation, char * pchMetadata, int cchMetadata); +S_API SteamAPICall_t SteamAPI_ISteamParties_JoinParty(intptr_t instancePtr, PartyBeaconID_t ulBeaconID); +S_API bool SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(intptr_t instancePtr, uint32 * puNumLocations); +S_API bool SteamAPI_ISteamParties_GetAvailableBeaconLocations(intptr_t instancePtr, struct SteamPartyBeaconLocation_t * pLocationList, uint32 uMaxNumLocations); +S_API SteamAPICall_t SteamAPI_ISteamParties_CreateBeacon(intptr_t instancePtr, uint32 unOpenSlots, struct SteamPartyBeaconLocation_t * pBeaconLocation, const char * pchConnectString, const char * pchMetadata); +S_API void SteamAPI_ISteamParties_OnReservationCompleted(intptr_t instancePtr, PartyBeaconID_t ulBeacon, class CSteamID steamIDUser); +S_API void SteamAPI_ISteamParties_CancelReservation(intptr_t instancePtr, PartyBeaconID_t ulBeacon, class CSteamID steamIDUser); +S_API SteamAPICall_t SteamAPI_ISteamParties_ChangeNumOpenSlots(intptr_t instancePtr, PartyBeaconID_t ulBeacon, uint32 unOpenSlots); +S_API bool SteamAPI_ISteamParties_DestroyBeacon(intptr_t instancePtr, PartyBeaconID_t ulBeacon); +S_API bool SteamAPI_ISteamParties_GetBeaconLocationData(intptr_t instancePtr, struct SteamPartyBeaconLocation_t BeaconLocation, ESteamPartyBeaconLocationData eData, char * pchDataStringOut, int cchDataStringOut); S_API bool SteamAPI_ISteamRemoteStorage_FileWrite(intptr_t instancePtr, const char * pchFile, const void * pvData, int32 cubData); S_API int32 SteamAPI_ISteamRemoteStorage_FileRead(intptr_t instancePtr, const char * pchFile, void * pvData, int32 cubDataToRead); S_API SteamAPICall_t SteamAPI_ISteamRemoteStorage_FileWriteAsync(intptr_t instancePtr, const char * pchFile, const void * pvData, uint32 cubData); @@ -495,6 +536,8 @@ S_API bool SteamAPI_ISteamApps_GetDlcDownloadProgress(intptr_t instancePtr, AppI S_API int SteamAPI_ISteamApps_GetAppBuildId(intptr_t instancePtr); S_API void SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(intptr_t instancePtr); S_API SteamAPICall_t SteamAPI_ISteamApps_GetFileDetails(intptr_t instancePtr, const char * pszFileName); +S_API int SteamAPI_ISteamApps_GetLaunchCommandLine(intptr_t instancePtr, char * pszCommandLine, int cubCommandLine); +S_API bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(intptr_t instancePtr); S_API bool SteamAPI_ISteamNetworking_SendP2PPacket(intptr_t instancePtr, class CSteamID steamIDRemote, const void * pubData, uint32 cubData, EP2PSend eP2PSendType, int nChannel); S_API bool SteamAPI_ISteamNetworking_IsP2PPacketAvailable(intptr_t instancePtr, uint32 * pcubMsgSize, int nChannel); S_API bool SteamAPI_ISteamNetworking_ReadP2PPacket(intptr_t instancePtr, void * pubDest, uint32 cubDest, uint32 * pcubMsgSize, class CSteamID * psteamIDRemote, int nChannel); @@ -592,11 +635,43 @@ S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestUserAgentInfo(intptr_t instancePtr, S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCertificate(intptr_t instancePtr, HTTPRequestHandle hRequest, bool bRequireVerifiedCertificate); S_API bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(intptr_t instancePtr, HTTPRequestHandle hRequest, uint32 unMilliseconds); S_API bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(intptr_t instancePtr, HTTPRequestHandle hRequest, bool * pbWasTimedOut); +S_API bool SteamAPI_ISteamInput_Init(intptr_t instancePtr); +S_API bool SteamAPI_ISteamInput_Shutdown(intptr_t instancePtr); +S_API void SteamAPI_ISteamInput_RunFrame(intptr_t instancePtr); +S_API int SteamAPI_ISteamInput_GetConnectedControllers(intptr_t instancePtr, InputHandle_t * handlesOut); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetActionSetHandle(intptr_t instancePtr, const char * pszActionSetName); +S_API void SteamAPI_ISteamInput_ActivateActionSet(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle); +S_API InputActionSetHandle_t SteamAPI_ISteamInput_GetCurrentActionSet(intptr_t instancePtr, InputHandle_t inputHandle); +S_API void SteamAPI_ISteamInput_ActivateActionSetLayer(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); +S_API void SteamAPI_ISteamInput_DeactivateActionSetLayer(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetLayerHandle); +S_API void SteamAPI_ISteamInput_DeactivateAllActionSetLayers(intptr_t instancePtr, InputHandle_t inputHandle); +S_API int SteamAPI_ISteamInput_GetActiveActionSetLayers(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t * handlesOut); +S_API InputDigitalActionHandle_t SteamAPI_ISteamInput_GetDigitalActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct InputDigitalActionData_t SteamAPI_ISteamInput_GetDigitalActionData(intptr_t instancePtr, InputHandle_t inputHandle, InputDigitalActionHandle_t digitalActionHandle); +S_API int SteamAPI_ISteamInput_GetDigitalActionOrigins(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputDigitalActionHandle_t digitalActionHandle, EInputActionOrigin * originsOut); +S_API InputAnalogActionHandle_t SteamAPI_ISteamInput_GetAnalogActionHandle(intptr_t instancePtr, const char * pszActionName); +S_API struct InputAnalogActionData_t SteamAPI_ISteamInput_GetAnalogActionData(intptr_t instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t analogActionHandle); +S_API int SteamAPI_ISteamInput_GetAnalogActionOrigins(intptr_t instancePtr, InputHandle_t inputHandle, InputActionSetHandle_t actionSetHandle, InputAnalogActionHandle_t analogActionHandle, EInputActionOrigin * originsOut); +S_API const char * SteamAPI_ISteamInput_GetGlyphForActionOrigin(intptr_t instancePtr, EInputActionOrigin eOrigin); +S_API const char * SteamAPI_ISteamInput_GetStringForActionOrigin(intptr_t instancePtr, EInputActionOrigin eOrigin); +S_API void SteamAPI_ISteamInput_StopAnalogActionMomentum(intptr_t instancePtr, InputHandle_t inputHandle, InputAnalogActionHandle_t eAction); +S_API struct InputMotionData_t SteamAPI_ISteamInput_GetMotionData(intptr_t instancePtr, InputHandle_t inputHandle); +S_API void SteamAPI_ISteamInput_TriggerVibration(intptr_t instancePtr, InputHandle_t inputHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed); +S_API void SteamAPI_ISteamInput_SetLEDColor(intptr_t instancePtr, InputHandle_t inputHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags); +S_API void SteamAPI_ISteamInput_TriggerHapticPulse(intptr_t instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec); +S_API void SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(intptr_t instancePtr, InputHandle_t inputHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags); +S_API bool SteamAPI_ISteamInput_ShowBindingPanel(intptr_t instancePtr, InputHandle_t inputHandle); +S_API ESteamInputType SteamAPI_ISteamInput_GetInputTypeForHandle(intptr_t instancePtr, InputHandle_t inputHandle); +S_API InputHandle_t SteamAPI_ISteamInput_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); +S_API int SteamAPI_ISteamInput_GetGamepadIndexForController(intptr_t instancePtr, InputHandle_t ulinputHandle); +S_API const char * SteamAPI_ISteamInput_GetStringForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API const char * SteamAPI_ISteamInput_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API EInputActionOrigin SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(intptr_t instancePtr, InputHandle_t inputHandle, EXboxOrigin eOrigin); +S_API EInputActionOrigin SteamAPI_ISteamInput_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EInputActionOrigin eSourceOrigin); S_API bool SteamAPI_ISteamController_Init(intptr_t instancePtr); S_API bool SteamAPI_ISteamController_Shutdown(intptr_t instancePtr); S_API void SteamAPI_ISteamController_RunFrame(intptr_t instancePtr); S_API int SteamAPI_ISteamController_GetConnectedControllers(intptr_t instancePtr, ControllerHandle_t * handlesOut); -S_API bool SteamAPI_ISteamController_ShowBindingPanel(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetActionSetHandle(intptr_t instancePtr, const char * pszActionSetName); S_API void SteamAPI_ISteamController_ActivateActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle); S_API ControllerActionSetHandle_t SteamAPI_ISteamController_GetCurrentActionSet(intptr_t instancePtr, ControllerHandle_t controllerHandle); @@ -605,26 +680,30 @@ S_API void SteamAPI_ISteamController_DeactivateActionSetLayer(intptr_t instanceP S_API void SteamAPI_ISteamController_DeactivateAllActionSetLayers(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API int SteamAPI_ISteamController_GetActiveActionSetLayers(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t * handlesOut); S_API ControllerDigitalActionHandle_t SteamAPI_ISteamController_GetDigitalActionHandle(intptr_t instancePtr, const char * pszActionName); -S_API struct ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); +S_API struct InputDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle); S_API int SteamAPI_ISteamController_GetDigitalActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerDigitalActionHandle_t digitalActionHandle, EControllerActionOrigin * originsOut); S_API ControllerAnalogActionHandle_t SteamAPI_ISteamController_GetAnalogActionHandle(intptr_t instancePtr, const char * pszActionName); -S_API struct ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); +S_API struct InputAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle); S_API int SteamAPI_ISteamController_GetAnalogActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerActionSetHandle_t actionSetHandle, ControllerAnalogActionHandle_t analogActionHandle, EControllerActionOrigin * originsOut); +S_API const char * SteamAPI_ISteamController_GetGlyphForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); +S_API const char * SteamAPI_ISteamController_GetStringForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); S_API void SteamAPI_ISteamController_StopAnalogActionMomentum(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t eAction); +S_API struct InputMotionData_t SteamAPI_ISteamController_GetMotionData(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API void SteamAPI_ISteamController_TriggerHapticPulse(intptr_t instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec); S_API void SteamAPI_ISteamController_TriggerRepeatedHapticPulse(intptr_t instancePtr, ControllerHandle_t controllerHandle, ESteamControllerPad eTargetPad, unsigned short usDurationMicroSec, unsigned short usOffMicroSec, unsigned short unRepeat, unsigned int nFlags); S_API void SteamAPI_ISteamController_TriggerVibration(intptr_t instancePtr, ControllerHandle_t controllerHandle, unsigned short usLeftSpeed, unsigned short usRightSpeed); S_API void SteamAPI_ISteamController_SetLEDColor(intptr_t instancePtr, ControllerHandle_t controllerHandle, uint8 nColorR, uint8 nColorG, uint8 nColorB, unsigned int nFlags); -S_API int SteamAPI_ISteamController_GetGamepadIndexForController(intptr_t instancePtr, ControllerHandle_t ulControllerHandle); -S_API ControllerHandle_t SteamAPI_ISteamController_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); -S_API struct ControllerMotionData_t SteamAPI_ISteamController_GetMotionData(intptr_t instancePtr, ControllerHandle_t controllerHandle); -S_API bool SteamAPI_ISteamController_ShowDigitalActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerDigitalActionHandle_t digitalActionHandle, float flScale, float flXPosition, float flYPosition); -S_API bool SteamAPI_ISteamController_ShowAnalogActionOrigins(intptr_t instancePtr, ControllerHandle_t controllerHandle, ControllerAnalogActionHandle_t analogActionHandle, float flScale, float flXPosition, float flYPosition); -S_API const char * SteamAPI_ISteamController_GetStringForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); -S_API const char * SteamAPI_ISteamController_GetGlyphForActionOrigin(intptr_t instancePtr, EControllerActionOrigin eOrigin); +S_API bool SteamAPI_ISteamController_ShowBindingPanel(intptr_t instancePtr, ControllerHandle_t controllerHandle); S_API ESteamInputType SteamAPI_ISteamController_GetInputTypeForHandle(intptr_t instancePtr, ControllerHandle_t controllerHandle); +S_API ControllerHandle_t SteamAPI_ISteamController_GetControllerForGamepadIndex(intptr_t instancePtr, int nIndex); +S_API int SteamAPI_ISteamController_GetGamepadIndexForController(intptr_t instancePtr, ControllerHandle_t ulControllerHandle); +S_API const char * SteamAPI_ISteamController_GetStringForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API const char * SteamAPI_ISteamController_GetGlyphForXboxOrigin(intptr_t instancePtr, EXboxOrigin eOrigin); +S_API EControllerActionOrigin SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(intptr_t instancePtr, ControllerHandle_t controllerHandle, EXboxOrigin eOrigin); +S_API EControllerActionOrigin SteamAPI_ISteamController_TranslateActionOrigin(intptr_t instancePtr, ESteamInputType eDestinationInputType, EControllerActionOrigin eSourceOrigin); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(intptr_t instancePtr, AccountID_t unAccountID, EUserUGCList eListType, EUGCMatchingUGCType eMatchingUGCType, EUserUGCListSortOrder eSortOrder, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, uint32 unPage); +S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(intptr_t instancePtr, EUGCQuery eQueryType, EUGCMatchingUGCType eMatchingeMatchingUGCTypeFileType, AppId_t nCreatorAppID, AppId_t nConsumerAppID, const char * pchCursor); S_API UGCQueryHandle_t SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(intptr_t instancePtr, PublishedFileId_t * pvecPublishedFileID, uint32 unNumPublishedFileIDs); S_API SteamAPICall_t SteamAPI_ISteamUGC_SendQueryUGCRequest(intptr_t instancePtr, UGCQueryHandle_t handle); S_API bool SteamAPI_ISteamUGC_GetQueryUGCResult(intptr_t instancePtr, UGCQueryHandle_t handle, uint32 index, struct SteamUGCDetails_t * pDetails); @@ -665,6 +744,7 @@ S_API bool SteamAPI_ISteamUGC_SetItemVisibility(intptr_t instancePtr, UGCUpdateH S_API bool SteamAPI_ISteamUGC_SetItemTags(intptr_t instancePtr, UGCUpdateHandle_t updateHandle, const struct SteamParamStringArray_t * pTags); S_API bool SteamAPI_ISteamUGC_SetItemContent(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszContentFolder); S_API bool SteamAPI_ISteamUGC_SetItemPreview(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile); +S_API bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(intptr_t instancePtr, UGCUpdateHandle_t handle, bool bAllowLegacyUpload); S_API bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey); S_API bool SteamAPI_ISteamUGC_AddItemKeyValueTag(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pchKey, const char * pchValue); S_API bool SteamAPI_ISteamUGC_AddItemPreviewFile(intptr_t instancePtr, UGCUpdateHandle_t handle, const char * pszPreviewFile, EItemPreviewType type); @@ -720,7 +800,7 @@ S_API void SteamAPI_ISteamHTMLSurface_MouseDown(intptr_t instancePtr, HHTMLBrows S_API void SteamAPI_ISteamHTMLSurface_MouseDoubleClick(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, ISteamHTMLSurface::EHTMLMouseButton eMouseButton); S_API void SteamAPI_ISteamHTMLSurface_MouseMove(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int x, int y); S_API void SteamAPI_ISteamHTMLSurface_MouseWheel(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, int32 nDelta); -S_API void SteamAPI_ISteamHTMLSurface_KeyDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); +S_API void SteamAPI_ISteamHTMLSurface_KeyDown(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers, bool bIsSystemKey); S_API void SteamAPI_ISteamHTMLSurface_KeyUp(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nNativeKeyCode, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); S_API void SteamAPI_ISteamHTMLSurface_KeyChar(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 cUnicodeChar, ISteamHTMLSurface::EHTMLKeyModifiers eHTMLKeyModifiers); S_API void SteamAPI_ISteamHTMLSurface_SetHorizontalScroll(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, uint32 nAbsolutePixelScroll); @@ -736,6 +816,7 @@ S_API void SteamAPI_ISteamHTMLSurface_SetCookie(intptr_t instancePtr, const char S_API void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, float flZoom, int nPointX, int nPointY); S_API void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bBackgroundMode); S_API void SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, float flDPIScaling); +S_API void SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(intptr_t instancePtr, HHTMLBrowser unBrowserHandle); S_API void SteamAPI_ISteamHTMLSurface_AllowStartRequest(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bAllowed); S_API void SteamAPI_ISteamHTMLSurface_JSDialogResponse(intptr_t instancePtr, HHTMLBrowser unBrowserHandle, bool bResult); S_API EResult SteamAPI_ISteamInventory_GetResultStatus(intptr_t instancePtr, SteamInventoryResult_t resultHandle); @@ -766,8 +847,8 @@ S_API bool SteamAPI_ISteamInventory_GetEligiblePromoItemDefinitionIDs(intptr_t i S_API SteamAPICall_t SteamAPI_ISteamInventory_StartPurchase(intptr_t instancePtr, const SteamItemDef_t * pArrayItemDefs, const uint32 * punArrayQuantity, uint32 unArrayLength); S_API SteamAPICall_t SteamAPI_ISteamInventory_RequestPrices(intptr_t instancePtr); S_API uint32 SteamAPI_ISteamInventory_GetNumItemsWithPrices(intptr_t instancePtr); -S_API bool SteamAPI_ISteamInventory_GetItemsWithPrices(intptr_t instancePtr, SteamItemDef_t * pArrayItemDefs, uint64 * pPrices, uint32 unArrayLength); -S_API bool SteamAPI_ISteamInventory_GetItemPrice(intptr_t instancePtr, SteamItemDef_t iDefinition, uint64 * pPrice); +S_API bool SteamAPI_ISteamInventory_GetItemsWithPrices(intptr_t instancePtr, SteamItemDef_t * pArrayItemDefs, uint64 * pCurrentPrices, uint64 * pBasePrices, uint32 unArrayLength); +S_API bool SteamAPI_ISteamInventory_GetItemPrice(intptr_t instancePtr, SteamItemDef_t iDefinition, uint64 * pCurrentPrice, uint64 * pBasePrice); S_API SteamInventoryUpdateHandle_t SteamAPI_ISteamInventory_StartUpdateProperties(intptr_t instancePtr); S_API bool SteamAPI_ISteamInventory_RemoveProperty(intptr_t instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName); S_API bool SteamAPI_ISteamInventory_SetProperty(intptr_t instancePtr, SteamInventoryUpdateHandle_t handle, SteamItemInstanceID_t nItemID, const char * pchPropertyName, const char * pchPropertyValue); diff --git a/Generator/steam_sdk/steam_api_internal.h b/Generator/steam_sdk/steam_api_internal.h index f5e5721..6c98b25 100644 --- a/Generator/steam_sdk/steam_api_internal.h +++ b/Generator/steam_sdk/steam_api_internal.h @@ -1,188 +1,40 @@ -//====== Copyright 1996-2015, Valve Corporation, All rights reserved. ======= +//====== Copyright Valve Corporation, All rights reserved. ==================== // -// Purpose: Internal private Steamworks API declarations and definitions +// Internal implementation details of the steamworks SDK. // -//============================================================================= - -#ifndef STEAM_API_INTERNAL_H -#define STEAM_API_INTERNAL_H - -S_API HSteamUser SteamAPI_GetHSteamUser(); -S_API void * S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData ); -S_API void * S_CALLTYPE SteamInternal_CreateInterface( const char *ver ); - -#if !defined( STEAM_API_EXPORTS ) - -inline void S_CALLTYPE SteamInternal_OnContextInit( void* p ) -{ - ((CSteamAPIContext*)p)->Clear(); - if ( SteamAPI_GetHSteamPipe() ) - ((CSteamAPIContext*)p)->Init(); -} -inline CSteamAPIContext& SteamInternal_ModuleContext() -{ - // SteamInternal_ContextInit takes a base pointer for the equivalent of - // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } - // Do not change layout of 2 + sizeof... or add non-pointer aligned data! - // NOTE: declaring "static CSteamAPIConext" creates a large function - // which queries the initialization status of the object. We know that - // it is pointer-aligned and fully memset with zeros, so just alias a - // static buffer of the appropriate size and call it a CSteamAPIContext. - static void* s_CallbackCounterAndContext[ 2 + sizeof(CSteamAPIContext)/sizeof(void*) ] = { (void*)&SteamInternal_OnContextInit, 0 }; - return *(CSteamAPIContext*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); -} - -inline ISteamClient *SteamClient() { return SteamInternal_ModuleContext().SteamClient(); } -inline ISteamUser *SteamUser() { return SteamInternal_ModuleContext().SteamUser(); } -inline ISteamFriends *SteamFriends() { return SteamInternal_ModuleContext().SteamFriends(); } -inline ISteamUtils *SteamUtils() { return SteamInternal_ModuleContext().SteamUtils(); } -inline ISteamMatchmaking *SteamMatchmaking() { return SteamInternal_ModuleContext().SteamMatchmaking(); } -inline ISteamUserStats *SteamUserStats() { return SteamInternal_ModuleContext().SteamUserStats(); } -inline ISteamApps *SteamApps() { return SteamInternal_ModuleContext().SteamApps(); } -inline ISteamMatchmakingServers *SteamMatchmakingServers() { return SteamInternal_ModuleContext().SteamMatchmakingServers(); } -inline ISteamNetworking *SteamNetworking() { return SteamInternal_ModuleContext().SteamNetworking(); } -inline ISteamRemoteStorage *SteamRemoteStorage() { return SteamInternal_ModuleContext().SteamRemoteStorage(); } -inline ISteamScreenshots *SteamScreenshots() { return SteamInternal_ModuleContext().SteamScreenshots(); } -inline ISteamHTTP *SteamHTTP() { return SteamInternal_ModuleContext().SteamHTTP(); } -inline ISteamController *SteamController() { return SteamInternal_ModuleContext().SteamController(); } -inline ISteamUGC *SteamUGC() { return SteamInternal_ModuleContext().SteamUGC(); } -inline ISteamAppList *SteamAppList() { return SteamInternal_ModuleContext().SteamAppList(); } -inline ISteamMusic *SteamMusic() { return SteamInternal_ModuleContext().SteamMusic(); } -inline ISteamMusicRemote *SteamMusicRemote() { return SteamInternal_ModuleContext().SteamMusicRemote(); } -inline ISteamHTMLSurface *SteamHTMLSurface() { return SteamInternal_ModuleContext().SteamHTMLSurface(); } -inline ISteamInventory *SteamInventory() { return SteamInternal_ModuleContext().SteamInventory(); } -inline ISteamVideo *SteamVideo() { return SteamInternal_ModuleContext().SteamVideo(); } -inline ISteamParentalSettings *SteamParentalSettings() { return SteamInternal_ModuleContext().SteamParentalSettings(); } - -#endif // !defined( STEAM_API_EXPORTS ) - - -inline void CSteamAPIContext::Clear() -{ - m_pSteamClient = NULL; - m_pSteamUser = NULL; - m_pSteamFriends = NULL; - m_pSteamUtils = NULL; - m_pSteamMatchmaking = NULL; - m_pSteamUserStats = NULL; - m_pSteamApps = NULL; - m_pSteamMatchmakingServers = NULL; - m_pSteamNetworking = NULL; - m_pSteamRemoteStorage = NULL; - m_pSteamHTTP = NULL; - m_pSteamScreenshots = NULL; - m_pSteamMusic = NULL; - m_pController = NULL; - m_pSteamUGC = NULL; - m_pSteamAppList = NULL; - m_pSteamMusic = NULL; - m_pSteamMusicRemote = NULL; - m_pSteamHTMLSurface = NULL; - m_pSteamInventory = NULL; - m_pSteamVideo = NULL; - m_pSteamParentalSettings = NULL; -} - - -// This function must be declared inline in the header so the module using steam_api.dll gets the version names they want. -inline bool CSteamAPIContext::Init() -{ - HSteamUser hSteamUser = SteamAPI_GetHSteamUser(); - HSteamPipe hSteamPipe = SteamAPI_GetHSteamPipe(); - if ( !hSteamPipe ) - return false; - - m_pSteamClient = (ISteamClient*) SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ); - if ( !m_pSteamClient ) - return false; - - m_pSteamUser = m_pSteamClient->GetISteamUser( hSteamUser, hSteamPipe, STEAMUSER_INTERFACE_VERSION ); - if ( !m_pSteamUser ) - return false; - - m_pSteamFriends = m_pSteamClient->GetISteamFriends( hSteamUser, hSteamPipe, STEAMFRIENDS_INTERFACE_VERSION ); - if ( !m_pSteamFriends ) - return false; - - m_pSteamUtils = m_pSteamClient->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamUtils ) - return false; - - m_pSteamMatchmaking = m_pSteamClient->GetISteamMatchmaking( hSteamUser, hSteamPipe, STEAMMATCHMAKING_INTERFACE_VERSION ); - if ( !m_pSteamMatchmaking ) - return false; - - m_pSteamMatchmakingServers = m_pSteamClient->GetISteamMatchmakingServers( hSteamUser, hSteamPipe, STEAMMATCHMAKINGSERVERS_INTERFACE_VERSION ); - if ( !m_pSteamMatchmakingServers ) - return false; - - m_pSteamUserStats = m_pSteamClient->GetISteamUserStats( hSteamUser, hSteamPipe, STEAMUSERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamUserStats ) - return false; - - m_pSteamApps = m_pSteamClient->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); - if ( !m_pSteamApps ) - return false; - - m_pSteamNetworking = m_pSteamClient->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); - if ( !m_pSteamNetworking ) - return false; - - m_pSteamRemoteStorage = m_pSteamClient->GetISteamRemoteStorage( hSteamUser, hSteamPipe, STEAMREMOTESTORAGE_INTERFACE_VERSION ); - if ( !m_pSteamRemoteStorage ) - return false; - - m_pSteamScreenshots = m_pSteamClient->GetISteamScreenshots( hSteamUser, hSteamPipe, STEAMSCREENSHOTS_INTERFACE_VERSION ); - if ( !m_pSteamScreenshots ) - return false; - - m_pSteamHTTP = m_pSteamClient->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); - if ( !m_pSteamHTTP ) - return false; - - m_pController = m_pSteamClient->GetISteamController( hSteamUser, hSteamPipe, STEAMCONTROLLER_INTERFACE_VERSION ); - if ( !m_pController ) - return false; - - m_pSteamUGC = m_pSteamClient->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); - if ( !m_pSteamUGC ) - return false; - - m_pSteamAppList = m_pSteamClient->GetISteamAppList( hSteamUser, hSteamPipe, STEAMAPPLIST_INTERFACE_VERSION ); - if ( !m_pSteamAppList ) - return false; - - m_pSteamMusic = m_pSteamClient->GetISteamMusic( hSteamUser, hSteamPipe, STEAMMUSIC_INTERFACE_VERSION ); - if ( !m_pSteamMusic ) - return false; - - m_pSteamMusicRemote = m_pSteamClient->GetISteamMusicRemote( hSteamUser, hSteamPipe, STEAMMUSICREMOTE_INTERFACE_VERSION ); - if ( !m_pSteamMusicRemote ) - return false; - - m_pSteamHTMLSurface = m_pSteamClient->GetISteamHTMLSurface( hSteamUser, hSteamPipe, STEAMHTMLSURFACE_INTERFACE_VERSION ); - if ( !m_pSteamHTMLSurface ) - return false; - - m_pSteamInventory = m_pSteamClient->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); - if ( !m_pSteamInventory ) - return false; - - m_pSteamVideo = m_pSteamClient->GetISteamVideo( hSteamUser, hSteamPipe, STEAMVIDEO_INTERFACE_VERSION ); - if ( !m_pSteamVideo ) - return false; - - m_pSteamParentalSettings = m_pSteamClient->GetISteamParentalSettings( hSteamUser, hSteamPipe, STEAMPARENTALSETTINGS_INTERFACE_VERSION ); - if ( !m_pSteamParentalSettings ) - return false; - - return true; -} - - -//----------------------------------------------------------------------------- -// The following macros are implementation details, not intended for public use +// You should be able to figure out how to use the SDK by reading +// steam_api_common.h, and should not need to understand anything in here. +// //----------------------------------------------------------------------------- + +#ifdef STEAM_CALLBACK_BEGIN +#error "This file should only be included from steam_api_common.h" +#endif + +#include + +// Internal functions used by the utility CCallback objects to receive callbacks +S_API void S_CALLTYPE SteamAPI_RegisterCallback( class CCallbackBase *pCallback, int iCallback ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallback( class CCallbackBase *pCallback ); +// Internal functions used by the utility CCallResult objects to receive async call results +S_API void S_CALLTYPE SteamAPI_RegisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); +S_API void S_CALLTYPE SteamAPI_UnregisterCallResult( class CCallbackBase *pCallback, SteamAPICall_t hAPICall ); + +S_API HSteamPipe S_CALLTYPE SteamAPI_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamAPI_GetHSteamUser(); +S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe(); +S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser(); +S_API void *S_CALLTYPE SteamInternal_ContextInit( void *pContextInitData ); +S_API void *S_CALLTYPE SteamInternal_CreateInterface( const char *ver ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateUserInterface( HSteamUser hSteamUser, const char *pszVersion ); +S_API void *S_CALLTYPE SteamInternal_FindOrCreateGameServerInterface( HSteamUser hSteamUser, const char *pszVersion ); + +// disable this warning; this pattern need for steam callback registration +#ifdef _MSVC_VER +#pragma warning( push ) +#pragma warning( disable: 4355 ) // 'this' : used in base member initializer list +#endif + #define _STEAM_CALLBACK_AUTO_HOOK( thisclass, func, param ) #define _STEAM_CALLBACK_HELPER( _1, _2, SELECTED, ... ) _STEAM_CALLBACK_##SELECTED #define _STEAM_CALLBACK_SELECT( X, Y ) _STEAM_CALLBACK_HELPER X Y @@ -198,18 +50,15 @@ inline bool CSteamAPIContext::Init() } m_steamcallback_ ## func ; void func( param *pParam ) #define _STEAM_CALLBACK_4( _, thisclass, func, param, var ) \ CCallback< thisclass, param > var; void func( param *pParam ) +#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ + CCallback< thisclass, param, true > var; void func( param *pParam ) - -//----------------------------------------------------------------------------- -// Purpose: maps a steam async call result to a class member function -// template params: T = local class, P = parameter struct -//----------------------------------------------------------------------------- template< class T, class P > inline CCallResult::CCallResult() { m_hAPICall = k_uAPICallInvalid; - m_pObj = NULL; - m_Func = NULL; + m_pObj = nullptr; + m_Func = nullptr; m_iCallback = P::k_iCallback; } @@ -241,7 +90,6 @@ inline void CCallResult::Cancel() SteamAPI_UnregisterCallResult( this, m_hAPICall ); m_hAPICall = k_uAPICallInvalid; } - } template< class T, class P > @@ -267,15 +115,9 @@ inline void CCallResult::Run( void *pvParam, bool bIOFailure, SteamAPICall } } - -//----------------------------------------------------------------------------- -// Purpose: maps a steam callback to a class member function -// template params: T = local class, P = parameter struct, -// bGameserver = listen for gameserver callbacks instead of client callbacks -//----------------------------------------------------------------------------- template< class T, class P, bool bGameserver > inline CCallback< T, P, bGameserver >::CCallback( T *pObj, func_t func ) - : m_pObj( NULL ), m_Func( NULL ) + : m_pObj( nullptr ), m_Func( nullptr ) { if ( bGameserver ) { @@ -312,17 +154,232 @@ inline void CCallback< T, P, bGameserver >::Run( void *pvParam ) (m_pObj->*m_Func)((P *)pvParam); } +//----------------------------------------------------------------------------- +// Macros to define steam callback structures. Used internally for debugging +//----------------------------------------------------------------------------- -#if defined(USE_BREAKPAD_HANDLER) || defined(STEAM_API_EXPORTS) -// this should be called before the game initialized the steam APIs -// pchDate should be of the format "Mmm dd yyyy" (such as from the __ DATE __ macro ) -// pchTime should be of the format "hh:mm:ss" (such as from the __ TIME __ macro ) -// bFullMemoryDumps (Win32 only) -- writes out a uuid-full.dmp in the client/dumps folder -// pvContext-- can be NULL, will be the void * context passed into m_pfnPreMinidumpCallback -// PFNPreMinidumpCallback m_pfnPreMinidumpCallback -- optional callback which occurs just before a .dmp file is written during a crash. Applications can hook this to allow adding additional information into the .dmp comment stream. -S_API void S_CALLTYPE SteamAPI_UseBreakpadCrashHandler( char const *pchVersion, char const *pchDate, char const *pchTime, bool bFullMemoryDumps, void *pvContext, PFNPreMinidumpCallback m_pfnPreMinidumpCallback ); -S_API void S_CALLTYPE SteamAPI_SetBreakpadAppID( uint32 unAppID ); +#ifdef STEAM_CALLBACK_INSPECTION_ENABLED + #include "../../clientdll/steam_api_callback_inspection.h" +#else + #define STEAM_CALLBACK_BEGIN( callbackname, callbackid ) struct callbackname { enum { k_iCallback = callbackid }; + #define STEAM_CALLBACK_MEMBER( varidx, vartype, varname ) vartype varname ; + #define STEAM_CALLBACK_MEMBER_ARRAY( varidx, vartype, varname, varcount ) vartype varname [ varcount ]; + #define STEAM_CALLBACK_END(nArgs) }; #endif +// Forward declare all of the Steam interfaces. (Do we really need to do this?) +class ISteamClient; +class ISteamUser; +class ISteamGameServer; +class ISteamFriends; +class ISteamUtils; +class ISteamMatchmaking; +class ISteamContentServer; +class ISteamMatchmakingServers; +class ISteamUserStats; +class ISteamApps; +class ISteamNetworking; +class ISteamRemoteStorage; +class ISteamScreenshots; +class ISteamMusic; +class ISteamMusicRemote; +class ISteamGameServerStats; +class ISteamPS3OverlayRender; +class ISteamHTTP; +class ISteamController; +class ISteamUGC; +class ISteamAppList; +class ISteamHTMLSurface; +class ISteamInventory; +class ISteamVideo; +class ISteamParentalSettings; +class ISteamGameSearch; +class ISteamInput; +class ISteamParties; + +//----------------------------------------------------------------------------- +// Purpose: Base values for callback identifiers, each callback must +// have a unique ID. +//----------------------------------------------------------------------------- +enum { k_iSteamUserCallbacks = 100 }; +enum { k_iSteamGameServerCallbacks = 200 }; +enum { k_iSteamFriendsCallbacks = 300 }; +enum { k_iSteamBillingCallbacks = 400 }; +enum { k_iSteamMatchmakingCallbacks = 500 }; +enum { k_iSteamContentServerCallbacks = 600 }; +enum { k_iSteamUtilsCallbacks = 700 }; +enum { k_iClientFriendsCallbacks = 800 }; +enum { k_iClientUserCallbacks = 900 }; +enum { k_iSteamAppsCallbacks = 1000 }; +enum { k_iSteamUserStatsCallbacks = 1100 }; +enum { k_iSteamNetworkingCallbacks = 1200 }; +enum { k_iSteamNetworkingSocketsCallbacks = 1220 }; +enum { k_iSteamNetworkingMessagesCallbacks = 1250 }; +enum { k_iClientRemoteStorageCallbacks = 1300 }; +enum { k_iClientDepotBuilderCallbacks = 1400 }; +enum { k_iSteamGameServerItemsCallbacks = 1500 }; +enum { k_iClientUtilsCallbacks = 1600 }; +enum { k_iSteamGameCoordinatorCallbacks = 1700 }; +enum { k_iSteamGameServerStatsCallbacks = 1800 }; +enum { k_iSteam2AsyncCallbacks = 1900 }; +enum { k_iSteamGameStatsCallbacks = 2000 }; +enum { k_iClientHTTPCallbacks = 2100 }; +enum { k_iClientScreenshotsCallbacks = 2200 }; +enum { k_iSteamScreenshotsCallbacks = 2300 }; +enum { k_iClientAudioCallbacks = 2400 }; +enum { k_iClientUnifiedMessagesCallbacks = 2500 }; +enum { k_iSteamStreamLauncherCallbacks = 2600 }; +enum { k_iClientControllerCallbacks = 2700 }; +enum { k_iSteamControllerCallbacks = 2800 }; +enum { k_iClientParentalSettingsCallbacks = 2900 }; +enum { k_iClientDeviceAuthCallbacks = 3000 }; +enum { k_iClientNetworkDeviceManagerCallbacks = 3100 }; +enum { k_iClientMusicCallbacks = 3200 }; +enum { k_iClientRemoteClientManagerCallbacks = 3300 }; +enum { k_iClientUGCCallbacks = 3400 }; +enum { k_iSteamStreamClientCallbacks = 3500 }; +enum { k_IClientProductBuilderCallbacks = 3600 }; +enum { k_iClientShortcutsCallbacks = 3700 }; +enum { k_iClientRemoteControlManagerCallbacks = 3800 }; +enum { k_iSteamAppListCallbacks = 3900 }; +enum { k_iSteamMusicCallbacks = 4000 }; +enum { k_iSteamMusicRemoteCallbacks = 4100 }; +enum { k_iClientVRCallbacks = 4200 }; +enum { k_iClientGameNotificationCallbacks = 4300 }; +enum { k_iSteamGameNotificationCallbacks = 4400 }; +enum { k_iSteamHTMLSurfaceCallbacks = 4500 }; +enum { k_iClientVideoCallbacks = 4600 }; +enum { k_iClientInventoryCallbacks = 4700 }; +enum { k_iClientBluetoothManagerCallbacks = 4800 }; +enum { k_iClientSharedConnectionCallbacks = 4900 }; +enum { k_ISteamParentalSettingsCallbacks = 5000 }; +enum { k_iClientShaderCallbacks = 5100 }; +enum { k_iSteamGameSearchCallbacks = 5200 }; +enum { k_iSteamPartiesCallbacks = 5300 }; +enum { k_iClientPartiesCallbacks = 5400 }; + +// Macro used to define a type-safe accessor that will always return the version +// of the interface of the *header file* you are compiling with! We also bounce +// through a safety function that checks for interfaces being created or destroyed. +#ifndef STEAM_API_EXPORTS + // SteamInternal_ContextInit takes a base pointer for the equivalent of + // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } + // Do not change layout of 2 + sizeof... or add non-pointer aligned data! + // NOTE: declaring "static CSteamAPIConext" creates a large function + // which queries the initialization status of the object. We know that + // it is pointer-aligned and fully memset with zeros, so just alias a + // static buffer of the appropriate size and call it a CSteamAPIContext. + #define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) \ + inline void S_CALLTYPE SteamInternal_Init_ ## name( type *p ) { *p = (type)( expr ); } \ + inline type name() { \ + static void* s_CallbackCounterAndContext[ 3 ] = { (void*)&SteamInternal_Init_ ## name, 0, 0 }; \ + return *(type*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); \ + } + +#else + // Stub when we're compiling steam_api.dll itself. These are inline + // functions defined when the header is included. not functions exported + // by the lib! + #define STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, expr ) +#endif + +#define STEAM_DEFINE_USER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateUserInterface( SteamAPI_GetHSteamUser(), version ) ) +#define STEAM_DEFINE_GAMESERVER_INTERFACE_ACCESSOR( type, name, version ) \ + STEAM_DEFINE_INTERFACE_ACCESSOR( type, name, SteamInternal_FindOrCreateGameServerInterface( SteamGameServer_GetHSteamUser(), version ) ) + +#ifdef _MSVC_VER +#pragma warning( pop ) +#endif + +// CSteamAPIContext encapsulates the Steamworks API global accessors into +// a single object. +// +// DEPRECATED: Used the global interface accessors instead! +// +// This will be removed in a future iteration of the SDK +class CSteamAPIContext +{ +public: + CSteamAPIContext() { Clear(); } + inline void Clear() { memset( this, 0, sizeof(*this) ); } + inline bool Init(); // NOTE: This is defined in steam_api.h, to avoid this file having to include everything + ISteamClient* SteamClient() const { return m_pSteamClient; } + ISteamUser* SteamUser() const { return m_pSteamUser; } + ISteamFriends* SteamFriends() const { return m_pSteamFriends; } + ISteamUtils* SteamUtils() const { return m_pSteamUtils; } + ISteamMatchmaking* SteamMatchmaking() const { return m_pSteamMatchmaking; } + ISteamGameSearch* SteamGameSearch() const { return m_pSteamGameSearch; } + ISteamUserStats* SteamUserStats() const { return m_pSteamUserStats; } + ISteamApps* SteamApps() const { return m_pSteamApps; } + ISteamMatchmakingServers* SteamMatchmakingServers() const { return m_pSteamMatchmakingServers; } + ISteamNetworking* SteamNetworking() const { return m_pSteamNetworking; } + ISteamRemoteStorage* SteamRemoteStorage() const { return m_pSteamRemoteStorage; } + ISteamScreenshots* SteamScreenshots() const { return m_pSteamScreenshots; } + ISteamHTTP* SteamHTTP() const { return m_pSteamHTTP; } + ISteamController* SteamController() const { return m_pController; } + ISteamUGC* SteamUGC() const { return m_pSteamUGC; } + ISteamAppList* SteamAppList() const { return m_pSteamAppList; } + ISteamMusic* SteamMusic() const { return m_pSteamMusic; } + ISteamMusicRemote* SteamMusicRemote() const { return m_pSteamMusicRemote; } + ISteamHTMLSurface* SteamHTMLSurface() const { return m_pSteamHTMLSurface; } + ISteamInventory* SteamInventory() const { return m_pSteamInventory; } + ISteamVideo* SteamVideo() const { return m_pSteamVideo; } + ISteamParentalSettings* SteamParentalSettings() const { return m_pSteamParentalSettings; } + ISteamInput* SteamInput() const { return m_pSteamInput; } +private: + ISteamClient *m_pSteamClient; + ISteamUser *m_pSteamUser; + ISteamFriends *m_pSteamFriends; + ISteamUtils *m_pSteamUtils; + ISteamMatchmaking *m_pSteamMatchmaking; + ISteamGameSearch *m_pSteamGameSearch; + ISteamUserStats *m_pSteamUserStats; + ISteamApps *m_pSteamApps; + ISteamMatchmakingServers *m_pSteamMatchmakingServers; + ISteamNetworking *m_pSteamNetworking; + ISteamRemoteStorage *m_pSteamRemoteStorage; + ISteamScreenshots *m_pSteamScreenshots; + ISteamHTTP *m_pSteamHTTP; + ISteamController *m_pController; + ISteamUGC *m_pSteamUGC; + ISteamAppList *m_pSteamAppList; + ISteamMusic *m_pSteamMusic; + ISteamMusicRemote *m_pSteamMusicRemote; + ISteamHTMLSurface *m_pSteamHTMLSurface; + ISteamInventory *m_pSteamInventory; + ISteamVideo *m_pSteamVideo; + ISteamParentalSettings *m_pSteamParentalSettings; + ISteamInput *m_pSteamInput; +}; + +class CSteamGameServerAPIContext +{ +public: + CSteamGameServerAPIContext() { Clear(); } + inline void Clear() { memset( this, 0, sizeof(*this) ); } + inline bool Init(); // NOTE: This is defined in steam_gameserver.h, to avoid this file having to include everything + + ISteamClient *SteamClient() const { return m_pSteamClient; } + ISteamGameServer *SteamGameServer() const { return m_pSteamGameServer; } + ISteamUtils *SteamGameServerUtils() const { return m_pSteamGameServerUtils; } + ISteamNetworking *SteamGameServerNetworking() const { return m_pSteamGameServerNetworking; } + ISteamGameServerStats *SteamGameServerStats() const { return m_pSteamGameServerStats; } + ISteamHTTP *SteamHTTP() const { return m_pSteamHTTP; } + ISteamInventory *SteamInventory() const { return m_pSteamInventory; } + ISteamUGC *SteamUGC() const { return m_pSteamUGC; } + ISteamApps *SteamApps() const { return m_pSteamApps; } + +private: + ISteamClient *m_pSteamClient; + ISteamGameServer *m_pSteamGameServer; + ISteamUtils *m_pSteamGameServerUtils; + ISteamNetworking *m_pSteamGameServerNetworking; + ISteamGameServerStats *m_pSteamGameServerStats; + ISteamHTTP *m_pSteamHTTP; + ISteamInventory *m_pSteamInventory; + ISteamUGC *m_pSteamUGC; + ISteamApps *m_pSteamApps; +}; + -#endif // STEAM_API_INTERNAL_H diff --git a/Generator/steam_sdk/steam_api_interop.cs b/Generator/steam_sdk/steam_api_interop.cs index eb8721c..52bff12 100644 --- a/Generator/steam_sdk/steam_api_interop.cs +++ b/Generator/steam_sdk/steam_api_interop.cs @@ -55,6 +55,8 @@ internal static extern IntPtr SteamAPI_ISteamClient_GetISteamNetworking(IntPtr i internal static extern IntPtr SteamAPI_ISteamClient_GetISteamRemoteStorage(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamScreenshots")] internal static extern IntPtr SteamAPI_ISteamClient_GetISteamScreenshots(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamGameSearch")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamGameSearch(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetIPCCallCount")] internal static extern uint SteamAPI_ISteamClient_GetIPCCallCount(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_SetWarningMessageHook")] @@ -81,6 +83,10 @@ internal static extern IntPtr SteamAPI_ISteamClient_GetISteamInventory(IntPtr in internal static extern IntPtr SteamAPI_ISteamClient_GetISteamVideo(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamParentalSettings")] internal static extern IntPtr SteamAPI_ISteamClient_GetISteamParentalSettings(IntPtr instancePtr, uint hSteamuser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamInput")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamInput(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamClient_GetISteamParties")] +internal static extern IntPtr SteamAPI_ISteamClient_GetISteamParties(IntPtr instancePtr, uint hSteamUser, uint hSteamPipe, string pchVersion); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetHSteamUser")] internal static extern uint SteamAPI_ISteamUser_GetHSteamUser(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BLoggedOn")] @@ -139,6 +145,8 @@ internal static extern bool SteamAPI_ISteamUser_BIsTwoFactorEnabled(IntPtr insta internal static extern bool SteamAPI_ISteamUser_BIsPhoneIdentifying(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_BIsPhoneRequiringVerification")] internal static extern bool SteamAPI_ISteamUser_BIsPhoneRequiringVerification(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUser_GetMarketEligibility")] +internal static extern ulong SteamAPI_ISteamUser_GetMarketEligibility(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetPersonaName")] internal static extern IntPtr SteamAPI_ISteamFriends_GetPersonaName(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPersonaName")] @@ -200,7 +208,7 @@ internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlay(IntPtr in [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToUser")] internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToUser(IntPtr instancePtr, string pchDialog, ulong steamID); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage")] -internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, string pchURL); +internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(IntPtr instancePtr, string pchURL, uint eMode); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_ActivateGameOverlayToStore")] internal static extern void SteamAPI_ISteamFriends_ActivateGameOverlayToStore(IntPtr instancePtr, uint nAppID, char eFlag); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_SetPlayedWith")] @@ -283,6 +291,8 @@ internal static extern ulong SteamAPI_ISteamFriends_EnumerateFollowingList(IntPt internal static extern bool SteamAPI_ISteamFriends_IsClanPublic(IntPtr instancePtr, ulong steamIDClan); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_IsClanOfficialGameGroup")] internal static extern bool SteamAPI_ISteamFriends_IsClanOfficialGameGroup(IntPtr instancePtr, ulong steamIDClan); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages")] +internal static extern int SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceAppActive")] internal static extern uint SteamAPI_ISteamUtils_GetSecondsSinceAppActive(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUtils_GetSecondsSinceComputerActive")] @@ -473,6 +483,58 @@ internal static extern uint SteamAPI_ISteamMatchmakingServers_PlayerDetails(IntP internal static extern uint SteamAPI_ISteamMatchmakingServers_ServerRules(IntPtr instancePtr, uint unIP, char usPort, IntPtr pRequestServersResponse); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamMatchmakingServers_CancelServerQuery")] internal static extern void SteamAPI_ISteamMatchmakingServers_CancelServerQuery(IntPtr instancePtr, uint hServerQuery); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_AddGameSearchParams")] +internal static extern uint SteamAPI_ISteamGameSearch_AddGameSearchParams(IntPtr instancePtr, string pchKeyToFind, string pchValuesToFind); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameWithLobby")] +internal static extern uint SteamAPI_ISteamGameSearch_SearchForGameWithLobby(IntPtr instancePtr, ulong steamIDLobby, int nPlayerMin, int nPlayerMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SearchForGameSolo")] +internal static extern uint SteamAPI_ISteamGameSearch_SearchForGameSolo(IntPtr instancePtr, int nPlayerMin, int nPlayerMax); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_AcceptGame")] +internal static extern uint SteamAPI_ISteamGameSearch_AcceptGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_DeclineGame")] +internal static extern uint SteamAPI_ISteamGameSearch_DeclineGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_RetrieveConnectionDetails")] +internal static extern uint SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(IntPtr instancePtr, ulong steamIDHost, string pchConnectionDetails, int cubConnectionDetails); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_EndGameSearch")] +internal static extern uint SteamAPI_ISteamGameSearch_EndGameSearch(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SetGameHostParams")] +internal static extern uint SteamAPI_ISteamGameSearch_SetGameHostParams(IntPtr instancePtr, string pchKey, string pchValue); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SetConnectionDetails")] +internal static extern uint SteamAPI_ISteamGameSearch_SetConnectionDetails(IntPtr instancePtr, string pchConnectionDetails, int cubConnectionDetails); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_RequestPlayersForGame")] +internal static extern uint SteamAPI_ISteamGameSearch_RequestPlayersForGame(IntPtr instancePtr, int nPlayerMin, int nPlayerMax, int nMaxTeamSize); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_HostConfirmGameStart")] +internal static extern uint SteamAPI_ISteamGameSearch_HostConfirmGameStart(IntPtr instancePtr, ulong ullUniqueGameID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame")] +internal static extern uint SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_SubmitPlayerResult")] +internal static extern uint SteamAPI_ISteamGameSearch_SubmitPlayerResult(IntPtr instancePtr, ulong ullUniqueGameID, ulong steamIDPlayer, uint EPlayerResult); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamGameSearch_EndGame")] +internal static extern uint SteamAPI_ISteamGameSearch_EndGame(IntPtr instancePtr, ulong ullUniqueGameID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetNumActiveBeacons")] +internal static extern uint SteamAPI_ISteamParties_GetNumActiveBeacons(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconByIndex")] +internal static extern ulong SteamAPI_ISteamParties_GetBeaconByIndex(IntPtr instancePtr, uint unIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconDetails")] +internal static extern bool SteamAPI_ISteamParties_GetBeaconDetails(IntPtr instancePtr, ulong ulBeaconID, ref CSteamID pSteamIDBeaconOwner, ref SteamPartyBeaconLocation_t pLocation, System.Text.StringBuilder pchMetadata, int cchMetadata); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_JoinParty")] +internal static extern ulong SteamAPI_ISteamParties_JoinParty(IntPtr instancePtr, ulong ulBeaconID); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetNumAvailableBeaconLocations")] +internal static extern bool SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(IntPtr instancePtr, ref uint puNumLocations); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetAvailableBeaconLocations")] +internal static extern bool SteamAPI_ISteamParties_GetAvailableBeaconLocations(IntPtr instancePtr, ref SteamPartyBeaconLocation_t pLocationList, uint uMaxNumLocations); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_CreateBeacon")] +internal static extern ulong SteamAPI_ISteamParties_CreateBeacon(IntPtr instancePtr, uint unOpenSlots, ref SteamPartyBeaconLocation_t pBeaconLocation, string pchConnectString, string pchMetadata); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_OnReservationCompleted")] +internal static extern void SteamAPI_ISteamParties_OnReservationCompleted(IntPtr instancePtr, ulong ulBeacon, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_CancelReservation")] +internal static extern void SteamAPI_ISteamParties_CancelReservation(IntPtr instancePtr, ulong ulBeacon, ulong steamIDUser); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_ChangeNumOpenSlots")] +internal static extern ulong SteamAPI_ISteamParties_ChangeNumOpenSlots(IntPtr instancePtr, ulong ulBeacon, uint unOpenSlots); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_DestroyBeacon")] +internal static extern bool SteamAPI_ISteamParties_DestroyBeacon(IntPtr instancePtr, ulong ulBeacon); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamParties_GetBeaconLocationData")] +internal static extern bool SteamAPI_ISteamParties_GetBeaconLocationData(IntPtr instancePtr, SteamPartyBeaconLocation_t BeaconLocation, uint eData, System.Text.StringBuilder pchDataStringOut, int cchDataStringOut); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileWrite")] internal static extern bool SteamAPI_ISteamRemoteStorage_FileWrite(IntPtr instancePtr, string pchFile, IntPtr pvData, int cubData); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamRemoteStorage_FileRead")] @@ -721,6 +783,10 @@ internal static extern int SteamAPI_ISteamApps_GetAppBuildId(IntPtr instancePtr) internal static extern void SteamAPI_ISteamApps_RequestAllProofOfPurchaseKeys(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetFileDetails")] internal static extern ulong SteamAPI_ISteamApps_GetFileDetails(IntPtr instancePtr, string pszFileName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_GetLaunchCommandLine")] +internal static extern int SteamAPI_ISteamApps_GetLaunchCommandLine(IntPtr instancePtr, string pszCommandLine, int cubCommandLine); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing")] +internal static extern bool SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_SendP2PPacket")] internal static extern bool SteamAPI_ISteamNetworking_SendP2PPacket(IntPtr instancePtr, ulong steamIDRemote, IntPtr pubData, uint cubData, uint eP2PSendType, int nChannel); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamNetworking_IsP2PPacketAvailable")] @@ -915,6 +981,72 @@ internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestRequiresVerifiedCe internal static extern bool SteamAPI_ISteamHTTP_SetHTTPRequestAbsoluteTimeoutMS(IntPtr instancePtr, uint hRequest, uint unMilliseconds); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut")] internal static extern bool SteamAPI_ISteamHTTP_GetHTTPRequestWasTimedOut(IntPtr instancePtr, uint hRequest, ref bool pbWasTimedOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_Init")] +internal static extern bool SteamAPI_ISteamInput_Init(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_Shutdown")] +internal static extern bool SteamAPI_ISteamInput_Shutdown(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_RunFrame")] +internal static extern void SteamAPI_ISteamInput_RunFrame(IntPtr instancePtr); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetConnectedControllers")] +internal static extern int SteamAPI_ISteamInput_GetConnectedControllers(IntPtr instancePtr, ref ulong handlesOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActionSetHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetActionSetHandle(IntPtr instancePtr, string pszActionSetName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ActivateActionSet")] +internal static extern void SteamAPI_ISteamInput_ActivateActionSet(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetCurrentActionSet")] +internal static extern ulong SteamAPI_ISteamInput_GetCurrentActionSet(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ActivateActionSetLayer")] +internal static extern void SteamAPI_ISteamInput_ActivateActionSetLayer(IntPtr instancePtr, ulong inputHandle, ulong actionSetLayerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_DeactivateActionSetLayer")] +internal static extern void SteamAPI_ISteamInput_DeactivateActionSetLayer(IntPtr instancePtr, ulong inputHandle, ulong actionSetLayerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_DeactivateAllActionSetLayers")] +internal static extern void SteamAPI_ISteamInput_DeactivateAllActionSetLayers(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActiveActionSetLayers")] +internal static extern int SteamAPI_ISteamInput_GetActiveActionSetLayers(IntPtr instancePtr, ulong inputHandle, ref ulong handlesOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetDigitalActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionData")] +internal static extern InputDigitalActionData_t SteamAPI_ISteamInput_GetDigitalActionData(IntPtr instancePtr, ulong inputHandle, ulong digitalActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetDigitalActionOrigins")] +internal static extern int SteamAPI_ISteamInput_GetDigitalActionOrigins(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle, ulong digitalActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionHandle")] +internal static extern ulong SteamAPI_ISteamInput_GetAnalogActionHandle(IntPtr instancePtr, string pszActionName); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionData")] +internal static extern InputAnalogActionData_t SteamAPI_ISteamInput_GetAnalogActionData(IntPtr instancePtr, ulong inputHandle, ulong analogActionHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetAnalogActionOrigins")] +internal static extern int SteamAPI_ISteamInput_GetAnalogActionOrigins(IntPtr instancePtr, ulong inputHandle, ulong actionSetHandle, ulong analogActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGlyphForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetStringForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_StopAnalogActionMomentum")] +internal static extern void SteamAPI_ISteamInput_StopAnalogActionMomentum(IntPtr instancePtr, ulong inputHandle, ulong eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetMotionData")] +internal static extern InputMotionData_t SteamAPI_ISteamInput_GetMotionData(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerVibration")] +internal static extern void SteamAPI_ISteamInput_TriggerVibration(IntPtr instancePtr, ulong inputHandle, char usLeftSpeed, char usRightSpeed); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_SetLEDColor")] +internal static extern void SteamAPI_ISteamInput_SetLEDColor(IntPtr instancePtr, ulong inputHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerHapticPulse")] +internal static extern void SteamAPI_ISteamInput_TriggerHapticPulse(IntPtr instancePtr, ulong inputHandle, uint eTargetPad, char usDurationMicroSec); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TriggerRepeatedHapticPulse")] +internal static extern void SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(IntPtr instancePtr, ulong inputHandle, uint eTargetPad, char usDurationMicroSec, char usOffMicroSec, char unRepeat, uint nFlags); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_ShowBindingPanel")] +internal static extern bool SteamAPI_ISteamInput_ShowBindingPanel(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetInputTypeForHandle")] +internal static extern uint SteamAPI_ISteamInput_GetInputTypeForHandle(IntPtr instancePtr, ulong inputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetControllerForGamepadIndex")] +internal static extern ulong SteamAPI_ISteamInput_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGamepadIndexForController")] +internal static extern int SteamAPI_ISteamInput_GetGamepadIndexForController(IntPtr instancePtr, ulong ulinputHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetStringForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetStringForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetGlyphForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamInput_GetGlyphForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin")] +internal static extern uint SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(IntPtr instancePtr, ulong inputHandle, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInput_TranslateActionOrigin")] +internal static extern uint SteamAPI_ISteamInput_TranslateActionOrigin(IntPtr instancePtr, uint eDestinationInputType, uint eSourceOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Init")] internal static extern bool SteamAPI_ISteamController_Init(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_Shutdown")] @@ -923,8 +1055,6 @@ internal static extern bool SteamAPI_ISteamController_Shutdown(IntPtr instancePt internal static extern void SteamAPI_ISteamController_RunFrame(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetConnectedControllers")] internal static extern int SteamAPI_ISteamController_GetConnectedControllers(IntPtr instancePtr, ref ulong handlesOut); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] -internal static extern bool SteamAPI_ISteamController_ShowBindingPanel(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetActionSetHandle")] internal static extern ulong SteamAPI_ISteamController_GetActionSetHandle(IntPtr instancePtr, string pszActionSetName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ActivateActionSet")] @@ -942,17 +1072,23 @@ internal static extern int SteamAPI_ISteamController_GetActiveActionSetLayers(In [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionHandle")] internal static extern ulong SteamAPI_ISteamController_GetDigitalActionHandle(IntPtr instancePtr, string pszActionName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionData")] -internal static extern ControllerDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle); +internal static extern InputDigitalActionData_t SteamAPI_ISteamController_GetDigitalActionData(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetDigitalActionOrigins")] internal static extern int SteamAPI_ISteamController_GetDigitalActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong digitalActionHandle, ref uint originsOut); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionHandle")] internal static extern ulong SteamAPI_ISteamController_GetAnalogActionHandle(IntPtr instancePtr, string pszActionName); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionData")] -internal static extern ControllerAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle); +internal static extern InputAnalogActionData_t SteamAPI_ISteamController_GetAnalogActionData(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetAnalogActionOrigins")] internal static extern int SteamAPI_ISteamController_GetAnalogActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong actionSetHandle, ulong analogActionHandle, ref uint originsOut); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_StopAnalogActionMomentum")] internal static extern void SteamAPI_ISteamController_StopAnalogActionMomentum(IntPtr instancePtr, ulong controllerHandle, ulong eAction); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetMotionData")] +internal static extern InputMotionData_t SteamAPI_ISteamController_GetMotionData(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TriggerHapticPulse")] internal static extern void SteamAPI_ISteamController_TriggerHapticPulse(IntPtr instancePtr, ulong controllerHandle, uint eTargetPad, char usDurationMicroSec); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TriggerRepeatedHapticPulse")] @@ -961,26 +1097,28 @@ internal static extern void SteamAPI_ISteamController_TriggerRepeatedHapticPulse internal static extern void SteamAPI_ISteamController_TriggerVibration(IntPtr instancePtr, ulong controllerHandle, char usLeftSpeed, char usRightSpeed); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_SetLEDColor")] internal static extern void SteamAPI_ISteamController_SetLEDColor(IntPtr instancePtr, ulong controllerHandle, byte nColorR, byte nColorG, byte nColorB, uint nFlags); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController")] -internal static extern int SteamAPI_ISteamController_GetGamepadIndexForController(IntPtr instancePtr, ulong ulControllerHandle); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex")] -internal static extern ulong SteamAPI_ISteamController_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetMotionData")] -internal static extern ControllerMotionData_t SteamAPI_ISteamController_GetMotionData(IntPtr instancePtr, ulong controllerHandle); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowDigitalActionOrigins")] -internal static extern bool SteamAPI_ISteamController_ShowDigitalActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong digitalActionHandle, float flScale, float flXPosition, float flYPosition); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowAnalogActionOrigins")] -internal static extern bool SteamAPI_ISteamController_ShowAnalogActionOrigins(IntPtr instancePtr, ulong controllerHandle, ulong analogActionHandle, float flScale, float flXPosition, float flYPosition); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForActionOrigin")] -internal static extern IntPtr SteamAPI_ISteamController_GetStringForActionOrigin(IntPtr instancePtr, uint eOrigin); -[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForActionOrigin")] -internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForActionOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_ShowBindingPanel")] +internal static extern bool SteamAPI_ISteamController_ShowBindingPanel(IntPtr instancePtr, ulong controllerHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetInputTypeForHandle")] internal static extern uint SteamAPI_ISteamController_GetInputTypeForHandle(IntPtr instancePtr, ulong controllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetControllerForGamepadIndex")] +internal static extern ulong SteamAPI_ISteamController_GetControllerForGamepadIndex(IntPtr instancePtr, int nIndex); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGamepadIndexForController")] +internal static extern int SteamAPI_ISteamController_GetGamepadIndexForController(IntPtr instancePtr, ulong ulControllerHandle); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetStringForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetStringForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetGlyphForXboxOrigin")] +internal static extern IntPtr SteamAPI_ISteamController_GetGlyphForXboxOrigin(IntPtr instancePtr, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_GetActionOriginFromXboxOrigin")] +internal static extern uint SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(IntPtr instancePtr, ulong controllerHandle, uint eOrigin); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamController_TranslateActionOrigin")] +internal static extern uint SteamAPI_ISteamController_TranslateActionOrigin(IntPtr instancePtr, uint eDestinationInputType, uint eSourceOrigin); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUserUGCRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUserUGCRequest(IntPtr instancePtr, uint unAccountID, uint eListType, uint eMatchingUGCType, uint eSortOrder, uint nCreatorAppID, uint nConsumerAppID, uint unPage); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(IntPtr instancePtr, uint eQueryType, uint eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, uint unPage); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0")] +internal static extern ulong SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(IntPtr instancePtr, uint eQueryType, uint eMatchingeMatchingUGCTypeFileType, uint nCreatorAppID, uint nConsumerAppID, string pchCursor); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest")] internal static extern ulong SteamAPI_ISteamUGC_CreateQueryUGCDetailsRequest(IntPtr instancePtr, ref ulong pvecPublishedFileID, uint unNumPublishedFileIDs); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SendQueryUGCRequest")] @@ -1061,6 +1199,8 @@ internal static extern bool SteamAPI_ISteamUGC_SetItemTags(IntPtr instancePtr, u internal static extern bool SteamAPI_ISteamUGC_SetItemContent(IntPtr instancePtr, ulong handle, string pszContentFolder); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetItemPreview")] internal static extern bool SteamAPI_ISteamUGC_SetItemPreview(IntPtr instancePtr, ulong handle, string pszPreviewFile); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_SetAllowLegacyUpload")] +internal static extern bool SteamAPI_ISteamUGC_SetAllowLegacyUpload(IntPtr instancePtr, ulong handle, bool bAllowLegacyUpload); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_RemoveItemKeyValueTags")] internal static extern bool SteamAPI_ISteamUGC_RemoveItemKeyValueTags(IntPtr instancePtr, ulong handle, string pchKey); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamUGC_AddItemKeyValueTag")] @@ -1172,7 +1312,7 @@ internal static extern void SteamAPI_ISteamHTMLSurface_MouseMove(IntPtr instance [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_MouseWheel")] internal static extern void SteamAPI_ISteamHTMLSurface_MouseWheel(IntPtr instancePtr, uint unBrowserHandle, int nDelta); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyDown")] -internal static extern void SteamAPI_ISteamHTMLSurface_KeyDown(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); +internal static extern void SteamAPI_ISteamHTMLSurface_KeyDown(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers, bool bIsSystemKey); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyUp")] internal static extern void SteamAPI_ISteamHTMLSurface_KeyUp(IntPtr instancePtr, uint unBrowserHandle, uint nNativeKeyCode, uint eHTMLKeyModifiers); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_KeyChar")] @@ -1203,6 +1343,8 @@ internal static extern void SteamAPI_ISteamHTMLSurface_SetPageScaleFactor(IntPtr internal static extern void SteamAPI_ISteamHTMLSurface_SetBackgroundMode(IntPtr instancePtr, uint unBrowserHandle, bool bBackgroundMode); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor")] internal static extern void SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(IntPtr instancePtr, uint unBrowserHandle, float flDPIScaling); +[DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_OpenDeveloperTools")] +internal static extern void SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(IntPtr instancePtr, uint unBrowserHandle); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_AllowStartRequest")] internal static extern void SteamAPI_ISteamHTMLSurface_AllowStartRequest(IntPtr instancePtr, uint unBrowserHandle, bool bAllowed); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamHTMLSurface_JSDialogResponse")] @@ -1264,9 +1406,9 @@ internal static extern ulong SteamAPI_ISteamInventory_RequestPrices(IntPtr insta [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetNumItemsWithPrices")] internal static extern uint SteamAPI_ISteamInventory_GetNumItemsWithPrices(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemsWithPrices")] -internal static extern bool SteamAPI_ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In, Out] int[] pArrayItemDefs, [In, Out] ulong[] pPrices, uint unArrayLength); +internal static extern bool SteamAPI_ISteamInventory_GetItemsWithPrices(IntPtr instancePtr, [In, Out] int[] pArrayItemDefs, [In, Out] ulong[] pCurrentPrices, [In, Out] ulong[] pBasePrices, uint unArrayLength); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_GetItemPrice")] -internal static extern bool SteamAPI_ISteamInventory_GetItemPrice(IntPtr instancePtr, int iDefinition, ref ulong pPrice); +internal static extern bool SteamAPI_ISteamInventory_GetItemPrice(IntPtr instancePtr, int iDefinition, ref ulong pCurrentPrice, ref ulong pBasePrice); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_StartUpdateProperties")] internal static extern ulong SteamAPI_ISteamInventory_StartUpdateProperties(IntPtr instancePtr); [DllImportAttribute("Steam_api", EntryPoint = "SteamAPI_ISteamInventory_RemoveProperty")] @@ -1539,6 +1681,11 @@ public delegate void SteamAPI_HTML_BrowserReady_t_CallResult(HTML_BrowserReady_t public static extern ulong CHTML_BrowserReady_t_SetCallResult(ulong hAPICall, SteamAPI_HTML_BrowserReady_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CHTML_BrowserReady_t_RemoveCallResult")] public static extern ulong CHTML_BrowserReady_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_MarketEligibilityResponse_t_CallResult(MarketEligibilityResponse_t pMarketEligibilityResponse_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CMarketEligibilityResponse_t_SetCallResult")] +public static extern ulong CMarketEligibilityResponse_t_SetCallResult(ulong hAPICall, SteamAPI_MarketEligibilityResponse_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CMarketEligibilityResponse_t_RemoveCallResult")] +public static extern ulong CMarketEligibilityResponse_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_LeaderboardScoresDownloaded_t_CallResult(LeaderboardScoresDownloaded_t pLeaderboardScoresDownloaded_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CLeaderboardScoresDownloaded_t_SetCallResult")] public static extern ulong CLeaderboardScoresDownloaded_t_SetCallResult(ulong hAPICall, SteamAPI_LeaderboardScoresDownloaded_t_CallResult func); @@ -1549,11 +1696,11 @@ public delegate void SteamAPI_RemoteStorageUpdateUserPublishedItemVoteResult_t_C public static extern ulong CRemoteStorageUpdateUserPublishedItemVoteResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageUpdateUserPublishedItemVoteResult_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageUpdateUserPublishedItemVoteResult_t_RemoveCallResult")] public static extern ulong CRemoteStorageUpdateUserPublishedItemVoteResult_t_RemoveCallResult(ulong handle); -public delegate void SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult(RemoteStorageEnumerateUserSubscribedFilesResult_t pRemoteStorageEnumerateUserSubscribedFilesResult_t, bool bIOFailure); -[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult")] -public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func); -[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult")] -public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_CreateBeaconCallback_t_CallResult(CreateBeaconCallback_t pCreateBeaconCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CCreateBeaconCallback_t_SetCallResult")] +public static extern ulong CCreateBeaconCallback_t_SetCallResult(ulong hAPICall, SteamAPI_CreateBeaconCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CCreateBeaconCallback_t_RemoveCallResult")] +public static extern ulong CCreateBeaconCallback_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_CreateItemResult_t_CallResult(CreateItemResult_t pCreateItemResult_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CCreateItemResult_t_SetCallResult")] public static extern ulong CCreateItemResult_t_SetCallResult(ulong hAPICall, SteamAPI_CreateItemResult_t_CallResult func); @@ -1584,11 +1731,16 @@ public delegate void SteamAPI_LeaderboardScoreUploaded_t_CallResult(LeaderboardS public static extern ulong CLeaderboardScoreUploaded_t_SetCallResult(ulong hAPICall, SteamAPI_LeaderboardScoreUploaded_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CLeaderboardScoreUploaded_t_RemoveCallResult")] public static extern ulong CLeaderboardScoreUploaded_t_RemoveCallResult(ulong handle); -public delegate void SteamAPI_GlobalAchievementPercentagesReady_t_CallResult(GlobalAchievementPercentagesReady_t pGlobalAchievementPercentagesReady_t, bool bIOFailure); -[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_SetCallResult")] -public static extern ulong CGlobalAchievementPercentagesReady_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func); -[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_RemoveCallResult")] -public static extern ulong CGlobalAchievementPercentagesReady_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_JoinPartyCallback_t_CallResult(JoinPartyCallback_t pJoinPartyCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CJoinPartyCallback_t_SetCallResult")] +public static extern ulong CJoinPartyCallback_t_SetCallResult(ulong hAPICall, SteamAPI_JoinPartyCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CJoinPartyCallback_t_RemoveCallResult")] +public static extern ulong CJoinPartyCallback_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult(RemoteStorageEnumerateUserSubscribedFilesResult_t pRemoteStorageEnumerateUserSubscribedFilesResult_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult")] +public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult")] +public static extern ulong CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_GlobalStatsReceived_t_CallResult(GlobalStatsReceived_t pGlobalStatsReceived_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CGlobalStatsReceived_t_SetCallResult")] public static extern ulong CGlobalStatsReceived_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalStatsReceived_t_CallResult func); @@ -1624,6 +1776,11 @@ public delegate void SteamAPI_GSReputation_t_CallResult(GSReputation_t pGSReputa public static extern ulong CGSReputation_t_SetCallResult(ulong hAPICall, SteamAPI_GSReputation_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CGSReputation_t_RemoveCallResult")] public static extern ulong CGSReputation_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_GlobalAchievementPercentagesReady_t_CallResult(GlobalAchievementPercentagesReady_t pGlobalAchievementPercentagesReady_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_SetCallResult")] +public static extern ulong CGlobalAchievementPercentagesReady_t_SetCallResult(ulong hAPICall, SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CGlobalAchievementPercentagesReady_t_RemoveCallResult")] +public static extern ulong CGlobalAchievementPercentagesReady_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_UserFavoriteItemsListChanged_t_CallResult(UserFavoriteItemsListChanged_t pUserFavoriteItemsListChanged_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CUserFavoriteItemsListChanged_t_SetCallResult")] public static extern ulong CUserFavoriteItemsListChanged_t_SetCallResult(ulong hAPICall, SteamAPI_UserFavoriteItemsListChanged_t_CallResult func); @@ -1659,6 +1816,11 @@ public delegate void SteamAPI_FriendsEnumerateFollowingList_t_CallResult(Friends public static extern ulong CFriendsEnumerateFollowingList_t_SetCallResult(ulong hAPICall, SteamAPI_FriendsEnumerateFollowingList_t_CallResult func); [DllImportAttribute("Steam_api", EntryPoint = "CFriendsEnumerateFollowingList_t_RemoveCallResult")] public static extern ulong CFriendsEnumerateFollowingList_t_RemoveCallResult(ulong handle); +public delegate void SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult(ChangeNumOpenSlotsCallback_t pChangeNumOpenSlotsCallback_t, bool bIOFailure); +[DllImportAttribute("Steam_api", EntryPoint = "CChangeNumOpenSlotsCallback_t_SetCallResult")] +public static extern ulong CChangeNumOpenSlotsCallback_t_SetCallResult(ulong hAPICall, SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult func); +[DllImportAttribute("Steam_api", EntryPoint = "CChangeNumOpenSlotsCallback_t_RemoveCallResult")] +public static extern ulong CChangeNumOpenSlotsCallback_t_RemoveCallResult(ulong handle); public delegate void SteamAPI_RemoteStorageSubscribePublishedFileResult_t_CallResult(RemoteStorageSubscribePublishedFileResult_t pRemoteStorageSubscribePublishedFileResult_t, bool bIOFailure); [DllImportAttribute("Steam_api", EntryPoint = "CRemoteStorageSubscribePublishedFileResult_t_SetCallResult")] public static extern ulong CRemoteStorageSubscribePublishedFileResult_t_SetCallResult(ulong hAPICall, SteamAPI_RemoteStorageSubscribePublishedFileResult_t_CallResult func); @@ -1754,6 +1916,7 @@ namespace Valve.Steamworks public abstract ISteamNetworking GetISteamNetworking(uint hSteamUser,uint hSteamPipe,string pchVersion); public abstract ISteamRemoteStorage GetISteamRemoteStorage(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamGameSearch GetISteamGameSearch(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract uint GetIPCCallCount(); public abstract void SetWarningMessageHook(IntPtr pFunction); public abstract bool BShutdownIfAllPipesClosed(); @@ -1767,6 +1930,8 @@ namespace Valve.Steamworks public abstract ISteamInventory GetISteamInventory(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamVideo GetISteamVideo(uint hSteamuser,uint hSteamPipe,string pchVersion); public abstract ISteamParentalSettings GetISteamParentalSettings(uint hSteamuser,uint hSteamPipe,string pchVersion); + public abstract ISteamInput GetISteamInput(uint hSteamUser,uint hSteamPipe,string pchVersion); + public abstract ISteamParties GetISteamParties(uint hSteamUser,uint hSteamPipe,string pchVersion); } @@ -1802,6 +1967,7 @@ namespace Valve.Steamworks public abstract bool BIsTwoFactorEnabled(); public abstract bool BIsPhoneIdentifying(); public abstract bool BIsPhoneRequiringVerification(); + public abstract ulong GetMarketEligibility(); } @@ -1838,7 +2004,7 @@ namespace Valve.Steamworks public abstract void SetInGameVoiceSpeaking(ulong steamIDUser,bool bSpeaking); public abstract void ActivateGameOverlay(string pchDialog); public abstract void ActivateGameOverlayToUser(string pchDialog,ulong steamID); - public abstract void ActivateGameOverlayToWebPage(string pchURL); + public abstract void ActivateGameOverlayToWebPage(string pchURL,uint eMode); public abstract void ActivateGameOverlayToStore(uint nAppID,char eFlag); public abstract void SetPlayedWith(ulong steamIDUserPlayedWith); public abstract void ActivateGameOverlayInviteDialog(ulong steamIDLobby); @@ -1880,6 +2046,7 @@ namespace Valve.Steamworks public abstract ulong EnumerateFollowingList(uint unStartIndex); public abstract bool IsClanPublic(ulong steamIDClan); public abstract bool IsClanOfficialGameGroup(ulong steamIDClan); + public abstract int GetNumChatsWithUnreadPriorityMessages(); } @@ -2020,6 +2187,44 @@ namespace Valve.Steamworks } + public abstract class ISteamGameSearch + { + public abstract IntPtr GetIntPtr(); + public abstract uint AddGameSearchParams(string pchKeyToFind,string pchValuesToFind); + public abstract uint SearchForGameWithLobby(ulong steamIDLobby,int nPlayerMin,int nPlayerMax); + public abstract uint SearchForGameSolo(int nPlayerMin,int nPlayerMax); + public abstract uint AcceptGame(); + public abstract uint DeclineGame(); + public abstract uint RetrieveConnectionDetails(ulong steamIDHost,string pchConnectionDetails,int cubConnectionDetails); + public abstract uint EndGameSearch(); + public abstract uint SetGameHostParams(string pchKey,string pchValue); + public abstract uint SetConnectionDetails(string pchConnectionDetails,int cubConnectionDetails); + public abstract uint RequestPlayersForGame(int nPlayerMin,int nPlayerMax,int nMaxTeamSize); + public abstract uint HostConfirmGameStart(ulong ullUniqueGameID); + public abstract uint CancelRequestPlayersForGame(); + public abstract uint SubmitPlayerResult(ulong ullUniqueGameID,ulong steamIDPlayer,uint EPlayerResult); + public abstract uint EndGame(ulong ullUniqueGameID); + } + + + public abstract class ISteamParties + { + public abstract IntPtr GetIntPtr(); + public abstract uint GetNumActiveBeacons(); + public abstract ulong GetBeaconByIndex(uint unIndex); + public abstract bool GetBeaconDetails(ulong ulBeaconID,ref CSteamID pSteamIDBeaconOwner,out SteamPartyBeaconLocation_t pLocation,out string pchMetadata); + public abstract ulong JoinParty(ulong ulBeaconID); + public abstract bool GetNumAvailableBeaconLocations(ref uint puNumLocations); + public abstract bool GetAvailableBeaconLocations(ref SteamPartyBeaconLocation_t pLocationList,uint uMaxNumLocations); + public abstract ulong CreateBeacon(uint unOpenSlots,ref SteamPartyBeaconLocation_t pBeaconLocation,string pchConnectString,string pchMetadata); + public abstract void OnReservationCompleted(ulong ulBeacon,ulong steamIDUser); + public abstract void CancelReservation(ulong ulBeacon,ulong steamIDUser); + public abstract ulong ChangeNumOpenSlots(ulong ulBeacon,uint unOpenSlots); + public abstract bool DestroyBeacon(ulong ulBeacon); + public abstract bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation,uint eData,out string pchDataStringOut); + } + + public abstract class ISteamRemoteStorage { public abstract IntPtr GetIntPtr(); @@ -2159,6 +2364,8 @@ namespace Valve.Steamworks public abstract int GetAppBuildId(); public abstract void RequestAllProofOfPurchaseKeys(); public abstract ulong GetFileDetails(string pszFileName); + public abstract int GetLaunchCommandLine(string pszCommandLine,int cubCommandLine); + public abstract bool BIsSubscribedFromFamilySharing(); } @@ -2289,6 +2496,45 @@ namespace Valve.Steamworks } + public abstract class ISteamInput + { + public abstract IntPtr GetIntPtr(); + public abstract bool Init(); + public abstract bool Shutdown(); + public abstract void RunFrame(); + public abstract int GetConnectedControllers(ref ulong handlesOut); + public abstract ulong GetActionSetHandle(string pszActionSetName); + public abstract void ActivateActionSet(ulong inputHandle,ulong actionSetHandle); + public abstract ulong GetCurrentActionSet(ulong inputHandle); + public abstract void ActivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle); + public abstract void DeactivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle); + public abstract void DeactivateAllActionSetLayers(ulong inputHandle); + public abstract int GetActiveActionSetLayers(ulong inputHandle,ref ulong handlesOut); + public abstract ulong GetDigitalActionHandle(string pszActionName); + public abstract InputDigitalActionData_t GetDigitalActionData(ulong inputHandle,ulong digitalActionHandle); + public abstract int GetDigitalActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut); + public abstract ulong GetAnalogActionHandle(string pszActionName); + public abstract InputAnalogActionData_t GetAnalogActionData(ulong inputHandle,ulong analogActionHandle); + public abstract int GetAnalogActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut); + public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract string GetStringForActionOrigin(uint eOrigin); + public abstract void StopAnalogActionMomentum(ulong inputHandle,ulong eAction); + public abstract InputMotionData_t GetMotionData(ulong inputHandle); + public abstract void TriggerVibration(ulong inputHandle,char usLeftSpeed,char usRightSpeed); + public abstract void SetLEDColor(ulong inputHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags); + public abstract void TriggerHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec); + public abstract void TriggerRepeatedHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags); + public abstract bool ShowBindingPanel(ulong inputHandle); + public abstract uint GetInputTypeForHandle(ulong inputHandle); + public abstract ulong GetControllerForGamepadIndex(int nIndex); + public abstract int GetGamepadIndexForController(ulong ulinputHandle); + public abstract string GetStringForXboxOrigin(uint eOrigin); + public abstract string GetGlyphForXboxOrigin(uint eOrigin); + public abstract uint GetActionOriginFromXboxOrigin(ulong inputHandle,uint eOrigin); + public abstract uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin); + } + + public abstract class ISteamController { public abstract IntPtr GetIntPtr(); @@ -2296,7 +2542,6 @@ namespace Valve.Steamworks public abstract bool Shutdown(); public abstract void RunFrame(); public abstract int GetConnectedControllers(ref ulong handlesOut); - public abstract bool ShowBindingPanel(ulong controllerHandle); public abstract ulong GetActionSetHandle(string pszActionSetName); public abstract void ActivateActionSet(ulong controllerHandle,ulong actionSetHandle); public abstract ulong GetCurrentActionSet(ulong controllerHandle); @@ -2305,24 +2550,27 @@ namespace Valve.Steamworks public abstract void DeactivateAllActionSetLayers(ulong controllerHandle); public abstract int GetActiveActionSetLayers(ulong controllerHandle,ref ulong handlesOut); public abstract ulong GetDigitalActionHandle(string pszActionName); - public abstract ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle); + public abstract InputDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle); public abstract int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut); public abstract ulong GetAnalogActionHandle(string pszActionName); - public abstract ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle); + public abstract InputAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle); public abstract int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut); + public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract string GetStringForActionOrigin(uint eOrigin); public abstract void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction); + public abstract InputMotionData_t GetMotionData(ulong controllerHandle); public abstract void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec); public abstract void TriggerRepeatedHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags); public abstract void TriggerVibration(ulong controllerHandle,char usLeftSpeed,char usRightSpeed); public abstract void SetLEDColor(ulong controllerHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags); - public abstract int GetGamepadIndexForController(ulong ulControllerHandle); - public abstract ulong GetControllerForGamepadIndex(int nIndex); - public abstract ControllerMotionData_t GetMotionData(ulong controllerHandle); - public abstract bool ShowDigitalActionOrigins(ulong controllerHandle,ulong digitalActionHandle,float flScale,float flXPosition,float flYPosition); - public abstract bool ShowAnalogActionOrigins(ulong controllerHandle,ulong analogActionHandle,float flScale,float flXPosition,float flYPosition); - public abstract string GetStringForActionOrigin(uint eOrigin); - public abstract string GetGlyphForActionOrigin(uint eOrigin); + public abstract bool ShowBindingPanel(ulong controllerHandle); public abstract uint GetInputTypeForHandle(ulong controllerHandle); + public abstract ulong GetControllerForGamepadIndex(int nIndex); + public abstract int GetGamepadIndexForController(ulong ulControllerHandle); + public abstract string GetStringForXboxOrigin(uint eOrigin); + public abstract string GetGlyphForXboxOrigin(uint eOrigin); + public abstract uint GetActionOriginFromXboxOrigin(ulong controllerHandle,uint eOrigin); + public abstract uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin); } @@ -2331,6 +2579,7 @@ namespace Valve.Steamworks public abstract IntPtr GetIntPtr(); public abstract ulong CreateQueryUserUGCRequest(uint unAccountID,uint eListType,uint eMatchingUGCType,uint eSortOrder,uint nCreatorAppID,uint nConsumerAppID,uint unPage); public abstract ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,uint unPage); + public abstract ulong CreateQueryAllUGCRequest0(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,string pchCursor); public abstract ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs); public abstract ulong SendQueryUGCRequest(ulong handle); public abstract bool GetQueryUGCResult(ulong handle,uint index,ref SteamUGCDetails_t pDetails); @@ -2371,6 +2620,7 @@ namespace Valve.Steamworks public abstract bool SetItemTags(ulong updateHandle,ref SteamParamStringArray_t pTags); public abstract bool SetItemContent(ulong handle,string pszContentFolder); public abstract bool SetItemPreview(ulong handle,string pszPreviewFile); + public abstract bool SetAllowLegacyUpload(ulong handle,bool bAllowLegacyUpload); public abstract bool RemoveItemKeyValueTags(ulong handle,string pchKey); public abstract bool AddItemKeyValueTag(ulong handle,string pchKey,string pchValue); public abstract bool AddItemPreviewFile(ulong handle,string pszPreviewFile,uint type); @@ -2438,7 +2688,7 @@ namespace Valve.Steamworks public abstract void MouseDoubleClick(uint unBrowserHandle,uint eMouseButton); public abstract void MouseMove(uint unBrowserHandle,int x,int y); public abstract void MouseWheel(uint unBrowserHandle,int nDelta); - public abstract void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); + public abstract void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers,bool bIsSystemKey); public abstract void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers); public abstract void KeyChar(uint unBrowserHandle,uint cUnicodeChar,uint eHTMLKeyModifiers); public abstract void SetHorizontalScroll(uint unBrowserHandle,uint nAbsolutePixelScroll); @@ -2454,6 +2704,7 @@ namespace Valve.Steamworks public abstract void SetPageScaleFactor(uint unBrowserHandle,float flZoom,int nPointX,int nPointY); public abstract void SetBackgroundMode(uint unBrowserHandle,bool bBackgroundMode); public abstract void SetDPIScalingFactor(uint unBrowserHandle,float flDPIScaling); + public abstract void OpenDeveloperTools(uint unBrowserHandle); public abstract void AllowStartRequest(uint unBrowserHandle,bool bAllowed); public abstract void JSDialogResponse(uint unBrowserHandle,bool bResult); } @@ -2490,8 +2741,8 @@ namespace Valve.Steamworks public abstract ulong StartPurchase(int [] pArrayItemDefs,uint [] punArrayQuantity); public abstract ulong RequestPrices(); public abstract uint GetNumItemsWithPrices(); - public abstract bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pPrices,uint unArrayLength); - public abstract bool GetItemPrice(int iDefinition,ref ulong pPrice); + public abstract bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pCurrentPrices,out ulong [] pBasePrices,uint unArrayLength); + public abstract bool GetItemPrice(int iDefinition,ref ulong pCurrentPrice,ref ulong pBasePrice); public abstract ulong StartUpdateProperties(); public abstract bool RemoveProperty(ulong handle,ulong nItemID,string pchPropertyName); public abstract bool SetProperty(ulong handle,ulong nItemID,string pchPropertyName,string pchPropertyValue); @@ -2720,6 +2971,12 @@ public override ISteamScreenshots GetISteamScreenshots(uint hSteamuser,uint hSte IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamScreenshots(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); return (ISteamScreenshots) Marshal.PtrToStructure(result, typeof(ISteamScreenshots)); } +public override ISteamGameSearch GetISteamGameSearch(uint hSteamuser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamGameSearch(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); + return (ISteamGameSearch) Marshal.PtrToStructure(result, typeof(ISteamGameSearch)); +} public override uint GetIPCCallCount() { CheckIfUsable(); @@ -2797,6 +3054,18 @@ public override ISteamParentalSettings GetISteamParentalSettings(uint hSteamuser IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamParentalSettings(m_pSteamClient,hSteamuser,hSteamPipe,pchVersion); return (ISteamParentalSettings) Marshal.PtrToStructure(result, typeof(ISteamParentalSettings)); } +public override ISteamInput GetISteamInput(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamInput(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamInput) Marshal.PtrToStructure(result, typeof(ISteamInput)); +} +public override ISteamParties GetISteamParties(uint hSteamUser,uint hSteamPipe,string pchVersion) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamClient_GetISteamParties(m_pSteamClient,hSteamUser,hSteamPipe,pchVersion); + return (ISteamParties) Marshal.PtrToStructure(result, typeof(ISteamParties)); +} } @@ -2991,6 +3260,12 @@ public override bool BIsPhoneRequiringVerification() bool result = NativeEntrypoints.SteamAPI_ISteamUser_BIsPhoneRequiringVerification(m_pSteamUser); return result; } +public override ulong GetMarketEligibility() +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUser_GetMarketEligibility(m_pSteamUser); + return result; +} } @@ -3193,10 +3468,10 @@ public override void ActivateGameOverlayToUser(string pchDialog,ulong steamID) CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToUser(m_pSteamFriends,pchDialog,steamID); } -public override void ActivateGameOverlayToWebPage(string pchURL) +public override void ActivateGameOverlayToWebPage(string pchURL,uint eMode) { CheckIfUsable(); - NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(m_pSteamFriends,pchURL); + NativeEntrypoints.SteamAPI_ISteamFriends_ActivateGameOverlayToWebPage(m_pSteamFriends,pchURL,eMode); } public override void ActivateGameOverlayToStore(uint nAppID,char eFlag) { @@ -3442,6 +3717,12 @@ public override bool IsClanOfficialGameGroup(ulong steamIDClan) bool result = NativeEntrypoints.SteamAPI_ISteamFriends_IsClanOfficialGameGroup(m_pSteamFriends,steamIDClan); return result; } +public override int GetNumChatsWithUnreadPriorityMessages() +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamFriends_GetNumChatsWithUnreadPriorityMessages(m_pSteamFriends); + return result; +} } @@ -4141,6 +4422,210 @@ public override void CancelServerQuery(uint hServerQuery) } +public class CSteamGameSearch : ISteamGameSearch +{ +public CSteamGameSearch(IntPtr SteamGameSearch) +{ + m_pSteamGameSearch = SteamGameSearch; +} +IntPtr m_pSteamGameSearch; + +public override IntPtr GetIntPtr() { return m_pSteamGameSearch; } + +private void CheckIfUsable() +{ + if (m_pSteamGameSearch == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint AddGameSearchParams(string pchKeyToFind,string pchValuesToFind) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_AddGameSearchParams(m_pSteamGameSearch,pchKeyToFind,pchValuesToFind); + return result; +} +public override uint SearchForGameWithLobby(ulong steamIDLobby,int nPlayerMin,int nPlayerMax) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SearchForGameWithLobby(m_pSteamGameSearch,steamIDLobby,nPlayerMin,nPlayerMax); + return result; +} +public override uint SearchForGameSolo(int nPlayerMin,int nPlayerMax) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SearchForGameSolo(m_pSteamGameSearch,nPlayerMin,nPlayerMax); + return result; +} +public override uint AcceptGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_AcceptGame(m_pSteamGameSearch); + return result; +} +public override uint DeclineGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_DeclineGame(m_pSteamGameSearch); + return result; +} +public override uint RetrieveConnectionDetails(ulong steamIDHost,string pchConnectionDetails,int cubConnectionDetails) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_RetrieveConnectionDetails(m_pSteamGameSearch,steamIDHost,pchConnectionDetails,cubConnectionDetails); + return result; +} +public override uint EndGameSearch() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_EndGameSearch(m_pSteamGameSearch); + return result; +} +public override uint SetGameHostParams(string pchKey,string pchValue) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SetGameHostParams(m_pSteamGameSearch,pchKey,pchValue); + return result; +} +public override uint SetConnectionDetails(string pchConnectionDetails,int cubConnectionDetails) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SetConnectionDetails(m_pSteamGameSearch,pchConnectionDetails,cubConnectionDetails); + return result; +} +public override uint RequestPlayersForGame(int nPlayerMin,int nPlayerMax,int nMaxTeamSize) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_RequestPlayersForGame(m_pSteamGameSearch,nPlayerMin,nPlayerMax,nMaxTeamSize); + return result; +} +public override uint HostConfirmGameStart(ulong ullUniqueGameID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_HostConfirmGameStart(m_pSteamGameSearch,ullUniqueGameID); + return result; +} +public override uint CancelRequestPlayersForGame() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_CancelRequestPlayersForGame(m_pSteamGameSearch); + return result; +} +public override uint SubmitPlayerResult(ulong ullUniqueGameID,ulong steamIDPlayer,uint EPlayerResult) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_SubmitPlayerResult(m_pSteamGameSearch,ullUniqueGameID,steamIDPlayer,EPlayerResult); + return result; +} +public override uint EndGame(ulong ullUniqueGameID) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamGameSearch_EndGame(m_pSteamGameSearch,ullUniqueGameID); + return result; +} +} + + +public class CSteamParties : ISteamParties +{ +public CSteamParties(IntPtr SteamParties) +{ + m_pSteamParties = SteamParties; +} +IntPtr m_pSteamParties; + +public override IntPtr GetIntPtr() { return m_pSteamParties; } + +private void CheckIfUsable() +{ + if (m_pSteamParties == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override uint GetNumActiveBeacons() +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamParties_GetNumActiveBeacons(m_pSteamParties); + return result; +} +public override ulong GetBeaconByIndex(uint unIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconByIndex(m_pSteamParties,unIndex); + return result; +} +public override bool GetBeaconDetails(ulong ulBeaconID,ref CSteamID pSteamIDBeaconOwner,out SteamPartyBeaconLocation_t pLocation,out string pchMetadata) +{ + CheckIfUsable(); + pLocation = new SteamPartyBeaconLocation_t(); + int cchMetadata = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconDetails(m_pSteamParties,ulBeaconID,ref pSteamIDBeaconOwner,ref pLocation,null,ref cchMetadata); + System.Text.StringBuilder pStrBuffer1 = new System.Text.StringBuilder((int)cchMetadata); + result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconDetails(m_pSteamParties,ulBeaconID,ref pSteamIDBeaconOwner,ref pLocation,pStrBuffer1,ref cchMetadata); + pchMetadata = pStrBuffer1.ToString(); + return result; +} +public override ulong JoinParty(ulong ulBeaconID) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_JoinParty(m_pSteamParties,ulBeaconID); + return result; +} +public override bool GetNumAvailableBeaconLocations(ref uint puNumLocations) +{ + CheckIfUsable(); + puNumLocations = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetNumAvailableBeaconLocations(m_pSteamParties,ref puNumLocations); + return result; +} +public override bool GetAvailableBeaconLocations(ref SteamPartyBeaconLocation_t pLocationList,uint uMaxNumLocations) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetAvailableBeaconLocations(m_pSteamParties,ref pLocationList,uMaxNumLocations); + return result; +} +public override ulong CreateBeacon(uint unOpenSlots,ref SteamPartyBeaconLocation_t pBeaconLocation,string pchConnectString,string pchMetadata) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_CreateBeacon(m_pSteamParties,unOpenSlots,ref pBeaconLocation,pchConnectString,pchMetadata); + return result; +} +public override void OnReservationCompleted(ulong ulBeacon,ulong steamIDUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamParties_OnReservationCompleted(m_pSteamParties,ulBeacon,steamIDUser); +} +public override void CancelReservation(ulong ulBeacon,ulong steamIDUser) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamParties_CancelReservation(m_pSteamParties,ulBeacon,steamIDUser); +} +public override ulong ChangeNumOpenSlots(ulong ulBeacon,uint unOpenSlots) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamParties_ChangeNumOpenSlots(m_pSteamParties,ulBeacon,unOpenSlots); + return result; +} +public override bool DestroyBeacon(ulong ulBeacon) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamParties_DestroyBeacon(m_pSteamParties,ulBeacon); + return result; +} +public override bool GetBeaconLocationData(SteamPartyBeaconLocation_t BeaconLocation,uint eData,out string pchDataStringOut) +{ + CheckIfUsable(); + int cchDataStringOut = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconLocationData(m_pSteamParties,BeaconLocation,eData,null,ref cchDataStringOut); + System.Text.StringBuilder pStrBuffer1 = new System.Text.StringBuilder((int)cchDataStringOut); + result = NativeEntrypoints.SteamAPI_ISteamParties_GetBeaconLocationData(m_pSteamParties,BeaconLocation,eData,pStrBuffer1,ref cchDataStringOut); + pchDataStringOut = pStrBuffer1.ToString(); + return result; +} +} + + public class CSteamRemoteStorage : ISteamRemoteStorage { public CSteamRemoteStorage(IntPtr SteamRemoteStorage) @@ -4969,6 +5454,18 @@ public override ulong GetFileDetails(string pszFileName) ulong result = NativeEntrypoints.SteamAPI_ISteamApps_GetFileDetails(m_pSteamApps,pszFileName); return result; } +public override int GetLaunchCommandLine(string pszCommandLine,int cubCommandLine) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamApps_GetLaunchCommandLine(m_pSteamApps,pszCommandLine,cubCommandLine); + return result; +} +public override bool BIsSubscribedFromFamilySharing() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamApps_BIsSubscribedFromFamilySharing(m_pSteamApps); + return result; +} } @@ -5666,6 +6163,218 @@ public override bool GetHTTPRequestWasTimedOut(uint hRequest,ref bool pbWasTimed } +public class CSteamInput : ISteamInput +{ +public CSteamInput(IntPtr SteamInput) +{ + m_pSteamInput = SteamInput; +} +IntPtr m_pSteamInput; + +public override IntPtr GetIntPtr() { return m_pSteamInput; } + +private void CheckIfUsable() +{ + if (m_pSteamInput == IntPtr.Zero) + { + throw new Exception("Steam Pointer not configured"); + } +} +public override bool Init() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_Init(m_pSteamInput); + return result; +} +public override bool Shutdown() +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_Shutdown(m_pSteamInput); + return result; +} +public override void RunFrame() +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_RunFrame(m_pSteamInput); +} +public override int GetConnectedControllers(ref ulong handlesOut) +{ + CheckIfUsable(); + handlesOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetConnectedControllers(m_pSteamInput,ref handlesOut); + return result; +} +public override ulong GetActionSetHandle(string pszActionSetName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetActionSetHandle(m_pSteamInput,pszActionSetName); + return result; +} +public override void ActivateActionSet(ulong inputHandle,ulong actionSetHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_ActivateActionSet(m_pSteamInput,inputHandle,actionSetHandle); +} +public override ulong GetCurrentActionSet(ulong inputHandle) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetCurrentActionSet(m_pSteamInput,inputHandle); + return result; +} +public override void ActivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_ActivateActionSetLayer(m_pSteamInput,inputHandle,actionSetLayerHandle); +} +public override void DeactivateActionSetLayer(ulong inputHandle,ulong actionSetLayerHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_DeactivateActionSetLayer(m_pSteamInput,inputHandle,actionSetLayerHandle); +} +public override void DeactivateAllActionSetLayers(ulong inputHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_DeactivateAllActionSetLayers(m_pSteamInput,inputHandle); +} +public override int GetActiveActionSetLayers(ulong inputHandle,ref ulong handlesOut) +{ + CheckIfUsable(); + handlesOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetActiveActionSetLayers(m_pSteamInput,inputHandle,ref handlesOut); + return result; +} +public override ulong GetDigitalActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionHandle(m_pSteamInput,pszActionName); + return result; +} +public override InputDigitalActionData_t GetDigitalActionData(ulong inputHandle,ulong digitalActionHandle) +{ + CheckIfUsable(); + InputDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionData(m_pSteamInput,inputHandle,digitalActionHandle); + return result; +} +public override int GetDigitalActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetDigitalActionOrigins(m_pSteamInput,inputHandle,actionSetHandle,digitalActionHandle,ref originsOut); + return result; +} +public override ulong GetAnalogActionHandle(string pszActionName) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionHandle(m_pSteamInput,pszActionName); + return result; +} +public override InputAnalogActionData_t GetAnalogActionData(ulong inputHandle,ulong analogActionHandle) +{ + CheckIfUsable(); + InputAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionData(m_pSteamInput,inputHandle,analogActionHandle); + return result; +} +public override int GetAnalogActionOrigins(ulong inputHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut) +{ + CheckIfUsable(); + originsOut = 0; + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetAnalogActionOrigins(m_pSteamInput,inputHandle,actionSetHandle,analogActionHandle,ref originsOut); + return result; +} +public override string GetGlyphForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetGlyphForActionOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetStringForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetStringForActionOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override void StopAnalogActionMomentum(ulong inputHandle,ulong eAction) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_StopAnalogActionMomentum(m_pSteamInput,inputHandle,eAction); +} +public override InputMotionData_t GetMotionData(ulong inputHandle) +{ + CheckIfUsable(); + InputMotionData_t result = NativeEntrypoints.SteamAPI_ISteamInput_GetMotionData(m_pSteamInput,inputHandle); + return result; +} +public override void TriggerVibration(ulong inputHandle,char usLeftSpeed,char usRightSpeed) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerVibration(m_pSteamInput,inputHandle,usLeftSpeed,usRightSpeed); +} +public override void SetLEDColor(ulong inputHandle,byte nColorR,byte nColorG,byte nColorB,uint nFlags) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_SetLEDColor(m_pSteamInput,inputHandle,nColorR,nColorG,nColorB,nFlags); +} +public override void TriggerHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerHapticPulse(m_pSteamInput,inputHandle,eTargetPad,usDurationMicroSec); +} +public override void TriggerRepeatedHapticPulse(ulong inputHandle,uint eTargetPad,char usDurationMicroSec,char usOffMicroSec,char unRepeat,uint nFlags) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamInput_TriggerRepeatedHapticPulse(m_pSteamInput,inputHandle,eTargetPad,usDurationMicroSec,usOffMicroSec,unRepeat,nFlags); +} +public override bool ShowBindingPanel(ulong inputHandle) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamInput_ShowBindingPanel(m_pSteamInput,inputHandle); + return result; +} +public override uint GetInputTypeForHandle(ulong inputHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_GetInputTypeForHandle(m_pSteamInput,inputHandle); + return result; +} +public override ulong GetControllerForGamepadIndex(int nIndex) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamInput_GetControllerForGamepadIndex(m_pSteamInput,nIndex); + return result; +} +public override int GetGamepadIndexForController(ulong ulinputHandle) +{ + CheckIfUsable(); + int result = NativeEntrypoints.SteamAPI_ISteamInput_GetGamepadIndexForController(m_pSteamInput,ulinputHandle); + return result; +} +public override string GetStringForXboxOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetStringForXboxOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetGlyphForXboxOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamInput_GetGlyphForXboxOrigin(m_pSteamInput,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override uint GetActionOriginFromXboxOrigin(ulong inputHandle,uint eOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_GetActionOriginFromXboxOrigin(m_pSteamInput,inputHandle,eOrigin); + return result; +} +public override uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamInput_TranslateActionOrigin(m_pSteamInput,eDestinationInputType,eSourceOrigin); + return result; +} +} + + public class CSteamController : ISteamController { public CSteamController(IntPtr SteamController) @@ -5707,12 +6416,6 @@ public override int GetConnectedControllers(ref ulong handlesOut) int result = NativeEntrypoints.SteamAPI_ISteamController_GetConnectedControllers(m_pSteamController,ref handlesOut); return result; } -public override bool ShowBindingPanel(ulong controllerHandle) -{ - CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowBindingPanel(m_pSteamController,controllerHandle); - return result; -} public override ulong GetActionSetHandle(string pszActionSetName) { CheckIfUsable(); @@ -5758,10 +6461,10 @@ public override ulong GetDigitalActionHandle(string pszActionName) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionHandle(m_pSteamController,pszActionName); return result; } -public override ControllerDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle) +public override InputDigitalActionData_t GetDigitalActionData(ulong controllerHandle,ulong digitalActionHandle) { CheckIfUsable(); - ControllerDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionData(m_pSteamController,controllerHandle,digitalActionHandle); + InputDigitalActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetDigitalActionData(m_pSteamController,controllerHandle,digitalActionHandle); return result; } public override int GetDigitalActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong digitalActionHandle,ref uint originsOut) @@ -5777,10 +6480,10 @@ public override ulong GetAnalogActionHandle(string pszActionName) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionHandle(m_pSteamController,pszActionName); return result; } -public override ControllerAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle) +public override InputAnalogActionData_t GetAnalogActionData(ulong controllerHandle,ulong analogActionHandle) { CheckIfUsable(); - ControllerAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionData(m_pSteamController,controllerHandle,analogActionHandle); + InputAnalogActionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionData(m_pSteamController,controllerHandle,analogActionHandle); return result; } public override int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSetHandle,ulong analogActionHandle,ref uint originsOut) @@ -5790,11 +6493,29 @@ public override int GetAnalogActionOrigins(ulong controllerHandle,ulong actionSe int result = NativeEntrypoints.SteamAPI_ISteamController_GetAnalogActionOrigins(m_pSteamController,controllerHandle,actionSetHandle,analogActionHandle,ref originsOut); return result; } +public override string GetGlyphForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForActionOrigin(m_pSteamController,eOrigin); + return Marshal.PtrToStringAnsi(result); +} +public override string GetStringForActionOrigin(uint eOrigin) +{ + CheckIfUsable(); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForActionOrigin(m_pSteamController,eOrigin); + return Marshal.PtrToStringAnsi(result); +} public override void StopAnalogActionMomentum(ulong controllerHandle,ulong eAction) { CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamController_StopAnalogActionMomentum(m_pSteamController,controllerHandle,eAction); } +public override InputMotionData_t GetMotionData(ulong controllerHandle) +{ + CheckIfUsable(); + InputMotionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetMotionData(m_pSteamController,controllerHandle); + return result; +} public override void TriggerHapticPulse(ulong controllerHandle,uint eTargetPad,char usDurationMicroSec) { CheckIfUsable(); @@ -5815,10 +6536,16 @@ public override void SetLEDColor(ulong controllerHandle,byte nColorR,byte nColor CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamController_SetLEDColor(m_pSteamController,controllerHandle,nColorR,nColorG,nColorB,nFlags); } -public override int GetGamepadIndexForController(ulong ulControllerHandle) +public override bool ShowBindingPanel(ulong controllerHandle) { CheckIfUsable(); - int result = NativeEntrypoints.SteamAPI_ISteamController_GetGamepadIndexForController(m_pSteamController,ulControllerHandle); + bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowBindingPanel(m_pSteamController,controllerHandle); + return result; +} +public override uint GetInputTypeForHandle(ulong controllerHandle) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamController_GetInputTypeForHandle(m_pSteamController,controllerHandle); return result; } public override ulong GetControllerForGamepadIndex(int nIndex) @@ -5827,40 +6554,34 @@ public override ulong GetControllerForGamepadIndex(int nIndex) ulong result = NativeEntrypoints.SteamAPI_ISteamController_GetControllerForGamepadIndex(m_pSteamController,nIndex); return result; } -public override ControllerMotionData_t GetMotionData(ulong controllerHandle) +public override int GetGamepadIndexForController(ulong ulControllerHandle) { CheckIfUsable(); - ControllerMotionData_t result = NativeEntrypoints.SteamAPI_ISteamController_GetMotionData(m_pSteamController,controllerHandle); + int result = NativeEntrypoints.SteamAPI_ISteamController_GetGamepadIndexForController(m_pSteamController,ulControllerHandle); return result; } -public override bool ShowDigitalActionOrigins(ulong controllerHandle,ulong digitalActionHandle,float flScale,float flXPosition,float flYPosition) +public override string GetStringForXboxOrigin(uint eOrigin) { CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowDigitalActionOrigins(m_pSteamController,controllerHandle,digitalActionHandle,flScale,flXPosition,flYPosition); - return result; -} -public override bool ShowAnalogActionOrigins(ulong controllerHandle,ulong analogActionHandle,float flScale,float flXPosition,float flYPosition) -{ - CheckIfUsable(); - bool result = NativeEntrypoints.SteamAPI_ISteamController_ShowAnalogActionOrigins(m_pSteamController,controllerHandle,analogActionHandle,flScale,flXPosition,flYPosition); - return result; -} -public override string GetStringForActionOrigin(uint eOrigin) -{ - CheckIfUsable(); - IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForActionOrigin(m_pSteamController,eOrigin); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetStringForXboxOrigin(m_pSteamController,eOrigin); return Marshal.PtrToStringAnsi(result); } -public override string GetGlyphForActionOrigin(uint eOrigin) +public override string GetGlyphForXboxOrigin(uint eOrigin) { CheckIfUsable(); - IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForActionOrigin(m_pSteamController,eOrigin); + IntPtr result = NativeEntrypoints.SteamAPI_ISteamController_GetGlyphForXboxOrigin(m_pSteamController,eOrigin); return Marshal.PtrToStringAnsi(result); } -public override uint GetInputTypeForHandle(ulong controllerHandle) +public override uint GetActionOriginFromXboxOrigin(ulong controllerHandle,uint eOrigin) { CheckIfUsable(); - uint result = NativeEntrypoints.SteamAPI_ISteamController_GetInputTypeForHandle(m_pSteamController,controllerHandle); + uint result = NativeEntrypoints.SteamAPI_ISteamController_GetActionOriginFromXboxOrigin(m_pSteamController,controllerHandle,eOrigin); + return result; +} +public override uint TranslateActionOrigin(uint eDestinationInputType,uint eSourceOrigin) +{ + CheckIfUsable(); + uint result = NativeEntrypoints.SteamAPI_ISteamController_TranslateActionOrigin(m_pSteamController,eDestinationInputType,eSourceOrigin); return result; } } @@ -5895,6 +6616,12 @@ public override ulong CreateQueryAllUGCRequest(uint eQueryType,uint eMatchingeMa ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest(m_pSteamUGC,eQueryType,eMatchingeMatchingUGCTypeFileType,nCreatorAppID,nConsumerAppID,unPage); return result; } +public override ulong CreateQueryAllUGCRequest0(uint eQueryType,uint eMatchingeMatchingUGCTypeFileType,uint nCreatorAppID,uint nConsumerAppID,string pchCursor) +{ + CheckIfUsable(); + ulong result = NativeEntrypoints.SteamAPI_ISteamUGC_CreateQueryAllUGCRequest0(m_pSteamUGC,eQueryType,eMatchingeMatchingUGCTypeFileType,nCreatorAppID,nConsumerAppID,pchCursor); + return result; +} public override ulong CreateQueryUGCDetailsRequest(ref ulong pvecPublishedFileID,uint unNumPublishedFileIDs) { CheckIfUsable(); @@ -6151,6 +6878,12 @@ public override bool SetItemPreview(ulong handle,string pszPreviewFile) bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetItemPreview(m_pSteamUGC,handle,pszPreviewFile); return result; } +public override bool SetAllowLegacyUpload(ulong handle,bool bAllowLegacyUpload) +{ + CheckIfUsable(); + bool result = NativeEntrypoints.SteamAPI_ISteamUGC_SetAllowLegacyUpload(m_pSteamUGC,handle,bAllowLegacyUpload); + return result; +} public override bool RemoveItemKeyValueTags(ulong handle,string pchKey) { CheckIfUsable(); @@ -6517,10 +7250,10 @@ public override void MouseWheel(uint unBrowserHandle,int nDelta) CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamHTMLSurface_MouseWheel(m_pSteamHTMLSurface,unBrowserHandle,nDelta); } -public override void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) +public override void KeyDown(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers,bool bIsSystemKey) { CheckIfUsable(); - NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyDown(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_KeyDown(m_pSteamHTMLSurface,unBrowserHandle,nNativeKeyCode,eHTMLKeyModifiers,bIsSystemKey); } public override void KeyUp(uint unBrowserHandle,uint nNativeKeyCode,uint eHTMLKeyModifiers) { @@ -6597,6 +7330,11 @@ public override void SetDPIScalingFactor(uint unBrowserHandle,float flDPIScaling CheckIfUsable(); NativeEntrypoints.SteamAPI_ISteamHTMLSurface_SetDPIScalingFactor(m_pSteamHTMLSurface,unBrowserHandle,flDPIScaling); } +public override void OpenDeveloperTools(uint unBrowserHandle) +{ + CheckIfUsable(); + NativeEntrypoints.SteamAPI_ISteamHTMLSurface_OpenDeveloperTools(m_pSteamHTMLSurface,unBrowserHandle); +} public override void AllowStartRequest(uint unBrowserHandle,bool bAllowed) { CheckIfUsable(); @@ -6823,22 +7561,25 @@ public override uint GetNumItemsWithPrices() uint result = NativeEntrypoints.SteamAPI_ISteamInventory_GetNumItemsWithPrices(m_pSteamInventory); return result; } -public override bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pPrices,uint unArrayLength) +public override bool GetItemsWithPrices(out int [] pArrayItemDefs,out ulong [] pCurrentPrices,out ulong [] pBasePrices,uint unArrayLength) { CheckIfUsable(); pArrayItemDefs = 0; pPrices = 0; - bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,null,unArrayLength); + pBasePrices = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pCurrentPrices,null,unArrayLength); pArrayItemDefs= new int[pArrayItemDefs]; - pPrices= new ulong[pPrices]; - result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pPrices,unArrayLength); + pCurrentPrices= new ulong[pPrices]; + pBasePrices= new ulong[pPrices]; + result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemsWithPrices(m_pSteamInventory,pArrayItemDefs,pCurrentPrices,pBasePrices,unArrayLength); return result; } -public override bool GetItemPrice(int iDefinition,ref ulong pPrice) +public override bool GetItemPrice(int iDefinition,ref ulong pCurrentPrice,ref ulong pBasePrice) { CheckIfUsable(); - pPrice = 0; - bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemPrice(m_pSteamInventory,iDefinition,ref pPrice); + pCurrentPrice = 0; + pBasePrice = 0; + bool result = NativeEntrypoints.SteamAPI_ISteamInventory_GetItemPrice(m_pSteamInventory,iDefinition,ref pCurrentPrice,ref pBasePrice); return result; } public override ulong StartUpdateProperties() @@ -7851,6 +8592,26 @@ public class CHTML_BrowserReady_t_CallResult m_Handle = Valve.Interop.NativeEntrypoints.CHTML_BrowserReady_t_SetCallResult(hAPICall, func); } } +public class CMarketEligibilityResponse_t_CallResult +{ + public CMarketEligibilityResponse_t_CallResult() { } + ~CMarketEligibilityResponse_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_MarketEligibilityResponse_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CMarketEligibilityResponse_t_SetCallResult(hAPICall, func); + } +} public class CLeaderboardScoresDownloaded_t_CallResult { public CLeaderboardScoresDownloaded_t_CallResult() { } @@ -7891,24 +8652,24 @@ public class CRemoteStorageUpdateUserPublishedItemVoteResult_t_CallResult m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageUpdateUserPublishedItemVoteResult_t_SetCallResult(hAPICall, func); } } -public class CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult +public class CCreateBeaconCallback_t_CallResult { - public CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() { } - ~CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() + public CCreateBeaconCallback_t_CallResult() { } + ~CCreateBeaconCallback_t_CallResult() { if(m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_RemoveCallResult(m_Handle); } } ulong m_Handle = 0; - public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func) + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_CreateBeaconCallback_t_CallResult func) { if (m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_RemoveCallResult(m_Handle); } - m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(hAPICall, func); + m_Handle = Valve.Interop.NativeEntrypoints.CCreateBeaconCallback_t_SetCallResult(hAPICall, func); } } public class CCreateItemResult_t_CallResult @@ -8031,24 +8792,44 @@ public class CLeaderboardScoreUploaded_t_CallResult m_Handle = Valve.Interop.NativeEntrypoints.CLeaderboardScoreUploaded_t_SetCallResult(hAPICall, func); } } -public class CGlobalAchievementPercentagesReady_t_CallResult +public class CJoinPartyCallback_t_CallResult { - public CGlobalAchievementPercentagesReady_t_CallResult() { } - ~CGlobalAchievementPercentagesReady_t_CallResult() + public CJoinPartyCallback_t_CallResult() { } + ~CJoinPartyCallback_t_CallResult() { if(m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_RemoveCallResult(m_Handle); } } ulong m_Handle = 0; - public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func) + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_JoinPartyCallback_t_CallResult func) { if (m_Handle != 0) { - Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_RemoveCallResult(m_Handle); } - m_Handle = Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_SetCallResult(hAPICall, func); + m_Handle = Valve.Interop.NativeEntrypoints.CJoinPartyCallback_t_SetCallResult(hAPICall, func); + } +} +public class CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult +{ + public CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() { } + ~CRemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_RemoteStorageEnumerateUserSubscribedFilesResult_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CRemoteStorageEnumerateUserSubscribedFilesResult_t_SetCallResult(hAPICall, func); } } public class CGlobalStatsReceived_t_CallResult @@ -8191,6 +8972,26 @@ public class CGSReputation_t_CallResult m_Handle = Valve.Interop.NativeEntrypoints.CGSReputation_t_SetCallResult(hAPICall, func); } } +public class CGlobalAchievementPercentagesReady_t_CallResult +{ + public CGlobalAchievementPercentagesReady_t_CallResult() { } + ~CGlobalAchievementPercentagesReady_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_GlobalAchievementPercentagesReady_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CGlobalAchievementPercentagesReady_t_SetCallResult(hAPICall, func); + } +} public class CUserFavoriteItemsListChanged_t_CallResult { public CUserFavoriteItemsListChanged_t_CallResult() { } @@ -8331,6 +9132,26 @@ public class CFriendsEnumerateFollowingList_t_CallResult m_Handle = Valve.Interop.NativeEntrypoints.CFriendsEnumerateFollowingList_t_SetCallResult(hAPICall, func); } } +public class CChangeNumOpenSlotsCallback_t_CallResult +{ + public CChangeNumOpenSlotsCallback_t_CallResult() { } + ~CChangeNumOpenSlotsCallback_t_CallResult() + { + if(m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_RemoveCallResult(m_Handle); + } + } + ulong m_Handle = 0; + public void Set(ulong hAPICall, Valve.Interop.NativeEntrypoints.SteamAPI_ChangeNumOpenSlotsCallback_t_CallResult func) + { + if (m_Handle != 0) + { + Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_RemoveCallResult(m_Handle); + } + m_Handle = Valve.Interop.NativeEntrypoints.CChangeNumOpenSlotsCallback_t_SetCallResult(hAPICall, func); + } +} public class CRemoteStorageSubscribePublishedFileResult_t_CallResult { public CRemoteStorageSubscribePublishedFileResult_t_CallResult() { } @@ -8623,6 +9444,10 @@ internal static extern IntPtr SteamMatchmakingPlayersResponse(); internal static extern IntPtr SteamMatchmakingRulesResponse(); [DllImportAttribute("Steam_api", EntryPoint = "SteamMatchmakingServers")] internal static extern IntPtr SteamMatchmakingServers(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamGameSearch")] +internal static extern IntPtr SteamGameSearch(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamParties")] +internal static extern IntPtr SteamParties(); [DllImportAttribute("Steam_api", EntryPoint = "SteamRemoteStorage")] internal static extern IntPtr SteamRemoteStorage(); [DllImportAttribute("Steam_api", EntryPoint = "SteamUserStats")] @@ -8639,6 +9464,8 @@ internal static extern IntPtr SteamMusic(); internal static extern IntPtr SteamMusicRemote(); [DllImportAttribute("Steam_api", EntryPoint = "SteamHTTP")] internal static extern IntPtr SteamHTTP(); +[DllImportAttribute("Steam_api", EntryPoint = "SteamInput")] +internal static extern IntPtr SteamInput(); [DllImportAttribute("Steam_api", EntryPoint = "SteamController")] internal static extern IntPtr SteamController(); [DllImportAttribute("Steam_api", EntryPoint = "SteamUGC")] @@ -8782,6 +9609,7 @@ public enum EResult k_EResultWGNetworkSendExceeded = 110, k_EResultAccountNotFriends = 111, k_EResultLimitedUserAccount = 112, + k_EResultCantRemoveItem = 113, } public enum EVoiceResult { @@ -8990,6 +9818,16 @@ public enum EBroadcastUploadResult k_EBroadcastUploadResultMissingAudio = 11, k_EBroadcastUploadResultTooFarBehind = 12, k_EBroadcastUploadResultTranscodeBehind = 13, + k_EBroadcastUploadResultNotAllowedToPlay = 14, + k_EBroadcastUploadResultBusy = 15, + k_EBroadcastUploadResultBanned = 16, + k_EBroadcastUploadResultAlreadyActive = 17, + k_EBroadcastUploadResultForcedOff = 18, + k_EBroadcastUploadResultAudioBehind = 19, + k_EBroadcastUploadResultShutdown = 20, + k_EBroadcastUploadResultDisconnect = 21, + k_EBroadcastUploadResultVideoInitFailed = 22, + k_EBroadcastUploadResultAudioInitFailed = 23, } public enum ELaunchOptionType { @@ -9018,6 +9856,7 @@ public enum EVRHMDType k_eEVRHMDType_HTC_Dev = 1, k_eEVRHMDType_HTC_VivePre = 2, k_eEVRHMDType_HTC_Vive = 3, + k_eEVRHMDType_HTC_VivePro = 4, k_eEVRHMDType_HTC_Unknown = 20, k_eEVRHMDType_Oculus_DK1 = 21, k_eEVRHMDType_Oculus_DK2 = 22, @@ -9035,6 +9874,50 @@ public enum EVRHMDType k_eEVRHMDType_Samsung_Odyssey = 91, k_eEVRHMDType_Unannounced_Unknown = 100, k_eEVRHMDType_Unannounced_WindowsMR = 101, + k_eEVRHMDType_vridge = 110, + k_eEVRHMDType_Huawei_Unknown = 120, + k_eEVRHMDType_Huawei_VR2 = 121, + k_eEVRHMDType_Huawei_Unannounced = 129, +} +public enum EMarketNotAllowedReasonFlags +{ + k_EMarketNotAllowedReason_None = 0, + k_EMarketNotAllowedReason_TemporaryFailure = 1, + k_EMarketNotAllowedReason_AccountDisabled = 2, + k_EMarketNotAllowedReason_AccountLockedDown = 4, + k_EMarketNotAllowedReason_AccountLimited = 8, + k_EMarketNotAllowedReason_TradeBanned = 16, + k_EMarketNotAllowedReason_AccountNotTrusted = 32, + k_EMarketNotAllowedReason_SteamGuardNotEnabled = 64, + k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = 128, + k_EMarketNotAllowedReason_RecentPasswordReset = 256, + k_EMarketNotAllowedReason_NewPaymentMethod = 512, + k_EMarketNotAllowedReason_InvalidCookie = 1024, + k_EMarketNotAllowedReason_UsingNewDevice = 2048, + k_EMarketNotAllowedReason_RecentSelfRefund = 4096, + k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = 8192, + k_EMarketNotAllowedReason_NoRecentPurchases = 16384, + k_EMarketNotAllowedReason_AcceptedWalletGift = 32768, +} +public enum EGameSearchErrorCode_t +{ + k_EGameSearchErrorCode_OK = 1, + k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, + k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, + k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, + k_EGameSearchErrorCode_Failed_No_Host_Available = 5, + k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, + k_EGameSearchErrorCode_Failed_Offline = 7, + k_EGameSearchErrorCode_Failed_NotAuthorized = 8, + k_EGameSearchErrorCode_Failed_Unknown_Error = 9, +} +public enum EPlayerResult_t +{ + k_EPlayerResultFailedToConnect = 1, + k_EPlayerResultAbandoned = 2, + k_EPlayerResultKicked = 3, + k_EPlayerResultIncomplete = 4, + k_EPlayerResultCompleted = 5, } public enum EFailureType { @@ -9062,7 +9945,8 @@ public enum EPersonaState k_EPersonaStateSnooze = 4, k_EPersonaStateLookingToTrade = 5, k_EPersonaStateLookingToPlay = 6, - k_EPersonaStateMax = 7, + k_EPersonaStateInvisible = 7, + k_EPersonaStateMax = 8, } public enum EFriendFlags { @@ -9096,6 +9980,11 @@ public enum EOverlayToStoreFlag k_EOverlayToStoreFlag_AddToCart = 1, k_EOverlayToStoreFlag_AddToCartAndShow = 2, } +public enum EActivateGameOverlayToWebPageMode +{ + k_EActivateGameOverlayToWebPageMode_Default = 0, + k_EActivateGameOverlayToWebPageMode_Modal = 1, +} public enum EPersonaChange { k_EPersonaChangeName = 1, @@ -9109,9 +9998,10 @@ public enum EPersonaChange k_EPersonaChangeLeftSource = 256, k_EPersonaChangeRelationshipChanged = 512, k_EPersonaChangeNameFirstSet = 1024, - k_EPersonaChangeFacebookInfo = 2048, + k_EPersonaChangeBroadcast = 2048, k_EPersonaChangeNickname = 4096, k_EPersonaChangeSteamLevel = 8192, + k_EPersonaChangeRichPresence = 16384, } public enum ESteamAPICallFailure { @@ -9176,6 +10066,20 @@ public enum EChatMemberStateChange k_EChatMemberStateChangeKicked = 8, k_EChatMemberStateChangeBanned = 16, } +public enum ESteamPartyBeaconLocationType +{ + k_ESteamPartyBeaconLocationType_Invalid = 0, + k_ESteamPartyBeaconLocationType_ChatGroup = 1, + k_ESteamPartyBeaconLocationType_Max = 2, +} +public enum ESteamPartyBeaconLocationData +{ + k_ESteamPartyBeaconLocationDataInvalid = 0, + k_ESteamPartyBeaconLocationDataName = 1, + k_ESteamPartyBeaconLocationDataIconURLSmall = 2, + k_ESteamPartyBeaconLocationDataIconURLMedium = 3, + k_ESteamPartyBeaconLocationDataIconURLLarge = 4, +} public enum ERemoteStoragePlatform { k_ERemoteStoragePlatformNone = 0, @@ -9184,6 +10088,7 @@ public enum ERemoteStoragePlatform k_ERemoteStoragePlatformPS3 = 4, k_ERemoteStoragePlatformLinux = 8, k_ERemoteStoragePlatformReserved2 = 16, + k_ERemoteStoragePlatformAndroid = 32, k_ERemoteStoragePlatformAll = -1, } public enum ERemoteStoragePublishedFileVisibility @@ -9390,11 +10295,370 @@ public enum EHTTPStatusCode k_EHTTPStatusCode505HTTPVersionNotSupported = 505, k_EHTTPStatusCode5xxUnknown = 599, } +public enum EInputSource +{ + k_EInputSource_None = 0, + k_EInputSource_LeftTrackpad = 1, + k_EInputSource_RightTrackpad = 2, + k_EInputSource_Joystick = 3, + k_EInputSource_ABXY = 4, + k_EInputSource_Switch = 5, + k_EInputSource_LeftTrigger = 6, + k_EInputSource_RightTrigger = 7, + k_EInputSource_LeftBumper = 8, + k_EInputSource_RightBumper = 9, + k_EInputSource_Gyro = 10, + k_EInputSource_CenterTrackpad = 11, + k_EInputSource_RightJoystick = 12, + k_EInputSource_DPad = 13, + k_EInputSource_Key = 14, + k_EInputSource_Mouse = 15, + k_EInputSource_LeftGyro = 16, + k_EInputSource_Count = 17, +} +public enum EInputSourceMode +{ + k_EInputSourceMode_None = 0, + k_EInputSourceMode_Dpad = 1, + k_EInputSourceMode_Buttons = 2, + k_EInputSourceMode_FourButtons = 3, + k_EInputSourceMode_AbsoluteMouse = 4, + k_EInputSourceMode_RelativeMouse = 5, + k_EInputSourceMode_JoystickMove = 6, + k_EInputSourceMode_JoystickMouse = 7, + k_EInputSourceMode_JoystickCamera = 8, + k_EInputSourceMode_ScrollWheel = 9, + k_EInputSourceMode_Trigger = 10, + k_EInputSourceMode_TouchMenu = 11, + k_EInputSourceMode_MouseJoystick = 12, + k_EInputSourceMode_MouseRegion = 13, + k_EInputSourceMode_RadialMenu = 14, + k_EInputSourceMode_SingleButton = 15, + k_EInputSourceMode_Switches = 16, +} +public enum EInputActionOrigin +{ + k_EInputActionOrigin_None = 0, + k_EInputActionOrigin_SteamController_A = 1, + k_EInputActionOrigin_SteamController_B = 2, + k_EInputActionOrigin_SteamController_X = 3, + k_EInputActionOrigin_SteamController_Y = 4, + k_EInputActionOrigin_SteamController_LeftBumper = 5, + k_EInputActionOrigin_SteamController_RightBumper = 6, + k_EInputActionOrigin_SteamController_LeftGrip = 7, + k_EInputActionOrigin_SteamController_RightGrip = 8, + k_EInputActionOrigin_SteamController_Start = 9, + k_EInputActionOrigin_SteamController_Back = 10, + k_EInputActionOrigin_SteamController_LeftPad_Touch = 11, + k_EInputActionOrigin_SteamController_LeftPad_Swipe = 12, + k_EInputActionOrigin_SteamController_LeftPad_Click = 13, + k_EInputActionOrigin_SteamController_LeftPad_DPadNorth = 14, + k_EInputActionOrigin_SteamController_LeftPad_DPadSouth = 15, + k_EInputActionOrigin_SteamController_LeftPad_DPadWest = 16, + k_EInputActionOrigin_SteamController_LeftPad_DPadEast = 17, + k_EInputActionOrigin_SteamController_RightPad_Touch = 18, + k_EInputActionOrigin_SteamController_RightPad_Swipe = 19, + k_EInputActionOrigin_SteamController_RightPad_Click = 20, + k_EInputActionOrigin_SteamController_RightPad_DPadNorth = 21, + k_EInputActionOrigin_SteamController_RightPad_DPadSouth = 22, + k_EInputActionOrigin_SteamController_RightPad_DPadWest = 23, + k_EInputActionOrigin_SteamController_RightPad_DPadEast = 24, + k_EInputActionOrigin_SteamController_LeftTrigger_Pull = 25, + k_EInputActionOrigin_SteamController_LeftTrigger_Click = 26, + k_EInputActionOrigin_SteamController_RightTrigger_Pull = 27, + k_EInputActionOrigin_SteamController_RightTrigger_Click = 28, + k_EInputActionOrigin_SteamController_LeftStick_Move = 29, + k_EInputActionOrigin_SteamController_LeftStick_Click = 30, + k_EInputActionOrigin_SteamController_LeftStick_DPadNorth = 31, + k_EInputActionOrigin_SteamController_LeftStick_DPadSouth = 32, + k_EInputActionOrigin_SteamController_LeftStick_DPadWest = 33, + k_EInputActionOrigin_SteamController_LeftStick_DPadEast = 34, + k_EInputActionOrigin_SteamController_Gyro_Move = 35, + k_EInputActionOrigin_SteamController_Gyro_Pitch = 36, + k_EInputActionOrigin_SteamController_Gyro_Yaw = 37, + k_EInputActionOrigin_SteamController_Gyro_Roll = 38, + k_EInputActionOrigin_SteamController_Reserved0 = 39, + k_EInputActionOrigin_SteamController_Reserved1 = 40, + k_EInputActionOrigin_SteamController_Reserved2 = 41, + k_EInputActionOrigin_SteamController_Reserved3 = 42, + k_EInputActionOrigin_SteamController_Reserved4 = 43, + k_EInputActionOrigin_SteamController_Reserved5 = 44, + k_EInputActionOrigin_SteamController_Reserved6 = 45, + k_EInputActionOrigin_SteamController_Reserved7 = 46, + k_EInputActionOrigin_SteamController_Reserved8 = 47, + k_EInputActionOrigin_SteamController_Reserved9 = 48, + k_EInputActionOrigin_SteamController_Reserved10 = 49, + k_EInputActionOrigin_PS4_X = 50, + k_EInputActionOrigin_PS4_Circle = 51, + k_EInputActionOrigin_PS4_Triangle = 52, + k_EInputActionOrigin_PS4_Square = 53, + k_EInputActionOrigin_PS4_LeftBumper = 54, + k_EInputActionOrigin_PS4_RightBumper = 55, + k_EInputActionOrigin_PS4_Options = 56, + k_EInputActionOrigin_PS4_Share = 57, + k_EInputActionOrigin_PS4_LeftPad_Touch = 58, + k_EInputActionOrigin_PS4_LeftPad_Swipe = 59, + k_EInputActionOrigin_PS4_LeftPad_Click = 60, + k_EInputActionOrigin_PS4_LeftPad_DPadNorth = 61, + k_EInputActionOrigin_PS4_LeftPad_DPadSouth = 62, + k_EInputActionOrigin_PS4_LeftPad_DPadWest = 63, + k_EInputActionOrigin_PS4_LeftPad_DPadEast = 64, + k_EInputActionOrigin_PS4_RightPad_Touch = 65, + k_EInputActionOrigin_PS4_RightPad_Swipe = 66, + k_EInputActionOrigin_PS4_RightPad_Click = 67, + k_EInputActionOrigin_PS4_RightPad_DPadNorth = 68, + k_EInputActionOrigin_PS4_RightPad_DPadSouth = 69, + k_EInputActionOrigin_PS4_RightPad_DPadWest = 70, + k_EInputActionOrigin_PS4_RightPad_DPadEast = 71, + k_EInputActionOrigin_PS4_CenterPad_Touch = 72, + k_EInputActionOrigin_PS4_CenterPad_Swipe = 73, + k_EInputActionOrigin_PS4_CenterPad_Click = 74, + k_EInputActionOrigin_PS4_CenterPad_DPadNorth = 75, + k_EInputActionOrigin_PS4_CenterPad_DPadSouth = 76, + k_EInputActionOrigin_PS4_CenterPad_DPadWest = 77, + k_EInputActionOrigin_PS4_CenterPad_DPadEast = 78, + k_EInputActionOrigin_PS4_LeftTrigger_Pull = 79, + k_EInputActionOrigin_PS4_LeftTrigger_Click = 80, + k_EInputActionOrigin_PS4_RightTrigger_Pull = 81, + k_EInputActionOrigin_PS4_RightTrigger_Click = 82, + k_EInputActionOrigin_PS4_LeftStick_Move = 83, + k_EInputActionOrigin_PS4_LeftStick_Click = 84, + k_EInputActionOrigin_PS4_LeftStick_DPadNorth = 85, + k_EInputActionOrigin_PS4_LeftStick_DPadSouth = 86, + k_EInputActionOrigin_PS4_LeftStick_DPadWest = 87, + k_EInputActionOrigin_PS4_LeftStick_DPadEast = 88, + k_EInputActionOrigin_PS4_RightStick_Move = 89, + k_EInputActionOrigin_PS4_RightStick_Click = 90, + k_EInputActionOrigin_PS4_RightStick_DPadNorth = 91, + k_EInputActionOrigin_PS4_RightStick_DPadSouth = 92, + k_EInputActionOrigin_PS4_RightStick_DPadWest = 93, + k_EInputActionOrigin_PS4_RightStick_DPadEast = 94, + k_EInputActionOrigin_PS4_DPad_North = 95, + k_EInputActionOrigin_PS4_DPad_South = 96, + k_EInputActionOrigin_PS4_DPad_West = 97, + k_EInputActionOrigin_PS4_DPad_East = 98, + k_EInputActionOrigin_PS4_Gyro_Move = 99, + k_EInputActionOrigin_PS4_Gyro_Pitch = 100, + k_EInputActionOrigin_PS4_Gyro_Yaw = 101, + k_EInputActionOrigin_PS4_Gyro_Roll = 102, + k_EInputActionOrigin_PS4_Reserved0 = 103, + k_EInputActionOrigin_PS4_Reserved1 = 104, + k_EInputActionOrigin_PS4_Reserved2 = 105, + k_EInputActionOrigin_PS4_Reserved3 = 106, + k_EInputActionOrigin_PS4_Reserved4 = 107, + k_EInputActionOrigin_PS4_Reserved5 = 108, + k_EInputActionOrigin_PS4_Reserved6 = 109, + k_EInputActionOrigin_PS4_Reserved7 = 110, + k_EInputActionOrigin_PS4_Reserved8 = 111, + k_EInputActionOrigin_PS4_Reserved9 = 112, + k_EInputActionOrigin_PS4_Reserved10 = 113, + k_EInputActionOrigin_XBoxOne_A = 114, + k_EInputActionOrigin_XBoxOne_B = 115, + k_EInputActionOrigin_XBoxOne_X = 116, + k_EInputActionOrigin_XBoxOne_Y = 117, + k_EInputActionOrigin_XBoxOne_LeftBumper = 118, + k_EInputActionOrigin_XBoxOne_RightBumper = 119, + k_EInputActionOrigin_XBoxOne_Menu = 120, + k_EInputActionOrigin_XBoxOne_View = 121, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Pull = 122, + k_EInputActionOrigin_XBoxOne_LeftTrigger_Click = 123, + k_EInputActionOrigin_XBoxOne_RightTrigger_Pull = 124, + k_EInputActionOrigin_XBoxOne_RightTrigger_Click = 125, + k_EInputActionOrigin_XBoxOne_LeftStick_Move = 126, + k_EInputActionOrigin_XBoxOne_LeftStick_Click = 127, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadNorth = 128, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadSouth = 129, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadWest = 130, + k_EInputActionOrigin_XBoxOne_LeftStick_DPadEast = 131, + k_EInputActionOrigin_XBoxOne_RightStick_Move = 132, + k_EInputActionOrigin_XBoxOne_RightStick_Click = 133, + k_EInputActionOrigin_XBoxOne_RightStick_DPadNorth = 134, + k_EInputActionOrigin_XBoxOne_RightStick_DPadSouth = 135, + k_EInputActionOrigin_XBoxOne_RightStick_DPadWest = 136, + k_EInputActionOrigin_XBoxOne_RightStick_DPadEast = 137, + k_EInputActionOrigin_XBoxOne_DPad_North = 138, + k_EInputActionOrigin_XBoxOne_DPad_South = 139, + k_EInputActionOrigin_XBoxOne_DPad_West = 140, + k_EInputActionOrigin_XBoxOne_DPad_East = 141, + k_EInputActionOrigin_XBoxOne_Reserved0 = 142, + k_EInputActionOrigin_XBoxOne_Reserved1 = 143, + k_EInputActionOrigin_XBoxOne_Reserved2 = 144, + k_EInputActionOrigin_XBoxOne_Reserved3 = 145, + k_EInputActionOrigin_XBoxOne_Reserved4 = 146, + k_EInputActionOrigin_XBoxOne_Reserved5 = 147, + k_EInputActionOrigin_XBoxOne_Reserved6 = 148, + k_EInputActionOrigin_XBoxOne_Reserved7 = 149, + k_EInputActionOrigin_XBoxOne_Reserved8 = 150, + k_EInputActionOrigin_XBoxOne_Reserved9 = 151, + k_EInputActionOrigin_XBoxOne_Reserved10 = 152, + k_EInputActionOrigin_XBox360_A = 153, + k_EInputActionOrigin_XBox360_B = 154, + k_EInputActionOrigin_XBox360_X = 155, + k_EInputActionOrigin_XBox360_Y = 156, + k_EInputActionOrigin_XBox360_LeftBumper = 157, + k_EInputActionOrigin_XBox360_RightBumper = 158, + k_EInputActionOrigin_XBox360_Start = 159, + k_EInputActionOrigin_XBox360_Back = 160, + k_EInputActionOrigin_XBox360_LeftTrigger_Pull = 161, + k_EInputActionOrigin_XBox360_LeftTrigger_Click = 162, + k_EInputActionOrigin_XBox360_RightTrigger_Pull = 163, + k_EInputActionOrigin_XBox360_RightTrigger_Click = 164, + k_EInputActionOrigin_XBox360_LeftStick_Move = 165, + k_EInputActionOrigin_XBox360_LeftStick_Click = 166, + k_EInputActionOrigin_XBox360_LeftStick_DPadNorth = 167, + k_EInputActionOrigin_XBox360_LeftStick_DPadSouth = 168, + k_EInputActionOrigin_XBox360_LeftStick_DPadWest = 169, + k_EInputActionOrigin_XBox360_LeftStick_DPadEast = 170, + k_EInputActionOrigin_XBox360_RightStick_Move = 171, + k_EInputActionOrigin_XBox360_RightStick_Click = 172, + k_EInputActionOrigin_XBox360_RightStick_DPadNorth = 173, + k_EInputActionOrigin_XBox360_RightStick_DPadSouth = 174, + k_EInputActionOrigin_XBox360_RightStick_DPadWest = 175, + k_EInputActionOrigin_XBox360_RightStick_DPadEast = 176, + k_EInputActionOrigin_XBox360_DPad_North = 177, + k_EInputActionOrigin_XBox360_DPad_South = 178, + k_EInputActionOrigin_XBox360_DPad_West = 179, + k_EInputActionOrigin_XBox360_DPad_East = 180, + k_EInputActionOrigin_XBox360_Reserved0 = 181, + k_EInputActionOrigin_XBox360_Reserved1 = 182, + k_EInputActionOrigin_XBox360_Reserved2 = 183, + k_EInputActionOrigin_XBox360_Reserved3 = 184, + k_EInputActionOrigin_XBox360_Reserved4 = 185, + k_EInputActionOrigin_XBox360_Reserved5 = 186, + k_EInputActionOrigin_XBox360_Reserved6 = 187, + k_EInputActionOrigin_XBox360_Reserved7 = 188, + k_EInputActionOrigin_XBox360_Reserved8 = 189, + k_EInputActionOrigin_XBox360_Reserved9 = 190, + k_EInputActionOrigin_XBox360_Reserved10 = 191, + k_EInputActionOrigin_Switch_A = 192, + k_EInputActionOrigin_Switch_B = 193, + k_EInputActionOrigin_Switch_X = 194, + k_EInputActionOrigin_Switch_Y = 195, + k_EInputActionOrigin_Switch_LeftBumper = 196, + k_EInputActionOrigin_Switch_RightBumper = 197, + k_EInputActionOrigin_Switch_Plus = 198, + k_EInputActionOrigin_Switch_Minus = 199, + k_EInputActionOrigin_Switch_Capture = 200, + k_EInputActionOrigin_Switch_LeftTrigger_Pull = 201, + k_EInputActionOrigin_Switch_LeftTrigger_Click = 202, + k_EInputActionOrigin_Switch_RightTrigger_Pull = 203, + k_EInputActionOrigin_Switch_RightTrigger_Click = 204, + k_EInputActionOrigin_Switch_LeftStick_Move = 205, + k_EInputActionOrigin_Switch_LeftStick_Click = 206, + k_EInputActionOrigin_Switch_LeftStick_DPadNorth = 207, + k_EInputActionOrigin_Switch_LeftStick_DPadSouth = 208, + k_EInputActionOrigin_Switch_LeftStick_DPadWest = 209, + k_EInputActionOrigin_Switch_LeftStick_DPadEast = 210, + k_EInputActionOrigin_Switch_RightStick_Move = 211, + k_EInputActionOrigin_Switch_RightStick_Click = 212, + k_EInputActionOrigin_Switch_RightStick_DPadNorth = 213, + k_EInputActionOrigin_Switch_RightStick_DPadSouth = 214, + k_EInputActionOrigin_Switch_RightStick_DPadWest = 215, + k_EInputActionOrigin_Switch_RightStick_DPadEast = 216, + k_EInputActionOrigin_Switch_DPad_North = 217, + k_EInputActionOrigin_Switch_DPad_South = 218, + k_EInputActionOrigin_Switch_DPad_West = 219, + k_EInputActionOrigin_Switch_DPad_East = 220, + k_EInputActionOrigin_Switch_ProGyro_Move = 221, + k_EInputActionOrigin_Switch_ProGyro_Pitch = 222, + k_EInputActionOrigin_Switch_ProGyro_Yaw = 223, + k_EInputActionOrigin_Switch_ProGyro_Roll = 224, + k_EInputActionOrigin_Switch_Reserved0 = 225, + k_EInputActionOrigin_Switch_Reserved1 = 226, + k_EInputActionOrigin_Switch_Reserved2 = 227, + k_EInputActionOrigin_Switch_Reserved3 = 228, + k_EInputActionOrigin_Switch_Reserved4 = 229, + k_EInputActionOrigin_Switch_Reserved5 = 230, + k_EInputActionOrigin_Switch_Reserved6 = 231, + k_EInputActionOrigin_Switch_Reserved7 = 232, + k_EInputActionOrigin_Switch_Reserved8 = 233, + k_EInputActionOrigin_Switch_Reserved9 = 234, + k_EInputActionOrigin_Switch_Reserved10 = 235, + k_EInputActionOrigin_Switch_RightGyro_Move = 236, + k_EInputActionOrigin_Switch_RightGyro_Pitch = 237, + k_EInputActionOrigin_Switch_RightGyro_Yaw = 238, + k_EInputActionOrigin_Switch_RightGyro_Roll = 239, + k_EInputActionOrigin_Switch_LeftGyro_Move = 240, + k_EInputActionOrigin_Switch_LeftGyro_Pitch = 241, + k_EInputActionOrigin_Switch_LeftGyro_Yaw = 242, + k_EInputActionOrigin_Switch_LeftGyro_Roll = 243, + k_EInputActionOrigin_Switch_LeftGrip_Lower = 244, + k_EInputActionOrigin_Switch_LeftGrip_Upper = 245, + k_EInputActionOrigin_Switch_RightGrip_Lower = 246, + k_EInputActionOrigin_Switch_RightGrip_Upper = 247, + k_EInputActionOrigin_Switch_Reserved11 = 248, + k_EInputActionOrigin_Switch_Reserved12 = 249, + k_EInputActionOrigin_Switch_Reserved13 = 250, + k_EInputActionOrigin_Switch_Reserved14 = 251, + k_EInputActionOrigin_Switch_Reserved15 = 252, + k_EInputActionOrigin_Switch_Reserved16 = 253, + k_EInputActionOrigin_Switch_Reserved17 = 254, + k_EInputActionOrigin_Switch_Reserved18 = 255, + k_EInputActionOrigin_Switch_Reserved19 = 256, + k_EInputActionOrigin_Switch_Reserved20 = 257, + k_EInputActionOrigin_Count = 258, + k_EInputActionOrigin_MaximumPossibleValue = 32767, +} +public enum EXboxOrigin +{ + k_EXboxOrigin_A = 0, + k_EXboxOrigin_B = 1, + k_EXboxOrigin_X = 2, + k_EXboxOrigin_Y = 3, + k_EXboxOrigin_LeftBumper = 4, + k_EXboxOrigin_RightBumper = 5, + k_EXboxOrigin_Menu = 6, + k_EXboxOrigin_View = 7, + k_EXboxOrigin_LeftTrigger_Pull = 8, + k_EXboxOrigin_LeftTrigger_Click = 9, + k_EXboxOrigin_RightTrigger_Pull = 10, + k_EXboxOrigin_RightTrigger_Click = 11, + k_EXboxOrigin_LeftStick_Move = 12, + k_EXboxOrigin_LeftStick_Click = 13, + k_EXboxOrigin_LeftStick_DPadNorth = 14, + k_EXboxOrigin_LeftStick_DPadSouth = 15, + k_EXboxOrigin_LeftStick_DPadWest = 16, + k_EXboxOrigin_LeftStick_DPadEast = 17, + k_EXboxOrigin_RightStick_Move = 18, + k_EXboxOrigin_RightStick_Click = 19, + k_EXboxOrigin_RightStick_DPadNorth = 20, + k_EXboxOrigin_RightStick_DPadSouth = 21, + k_EXboxOrigin_RightStick_DPadWest = 22, + k_EXboxOrigin_RightStick_DPadEast = 23, + k_EXboxOrigin_DPad_North = 24, + k_EXboxOrigin_DPad_South = 25, + k_EXboxOrigin_DPad_West = 26, + k_EXboxOrigin_DPad_East = 27, + k_EXboxOrigin_Count = 28, +} public enum ESteamControllerPad { k_ESteamControllerPad_Left = 0, k_ESteamControllerPad_Right = 1, } +public enum ESteamInputType +{ + k_ESteamInputType_Unknown = 0, + k_ESteamInputType_SteamController = 1, + k_ESteamInputType_XBox360Controller = 2, + k_ESteamInputType_XBoxOneController = 3, + k_ESteamInputType_GenericGamepad = 4, + k_ESteamInputType_PS4Controller = 5, + k_ESteamInputType_AppleMFiController = 6, + k_ESteamInputType_AndroidController = 7, + k_ESteamInputType_SwitchJoyConPair = 8, + k_ESteamInputType_SwitchJoyConSingle = 9, + k_ESteamInputType_SwitchProController = 10, + k_ESteamInputType_MobileTouch = 11, + k_ESteamInputType_PS3Controller = 12, + k_ESteamInputType_Count = 13, + k_ESteamInputType_MaximumPossibleValue = 255, +} +public enum ESteamInputLEDFlag +{ + k_ESteamInputLEDFlag_SetColor = 0, + k_ESteamInputLEDFlag_RestoreUserDefault = 1, +} public enum EControllerSource { k_EControllerSource_None = 0, @@ -9405,13 +10669,16 @@ public enum EControllerSource k_EControllerSource_Switch = 5, k_EControllerSource_LeftTrigger = 6, k_EControllerSource_RightTrigger = 7, - k_EControllerSource_Gyro = 8, - k_EControllerSource_CenterTrackpad = 9, - k_EControllerSource_RightJoystick = 10, - k_EControllerSource_DPad = 11, - k_EControllerSource_Key = 12, - k_EControllerSource_Mouse = 13, - k_EControllerSource_Count = 14, + k_EControllerSource_LeftBumper = 8, + k_EControllerSource_RightBumper = 9, + k_EControllerSource_Gyro = 10, + k_EControllerSource_CenterTrackpad = 11, + k_EControllerSource_RightJoystick = 12, + k_EControllerSource_DPad = 13, + k_EControllerSource_Key = 14, + k_EControllerSource_Mouse = 15, + k_EControllerSource_LeftGyro = 16, + k_EControllerSource_Count = 17, } public enum EControllerSourceMode { @@ -9589,9 +10856,9 @@ public enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Y = 151, k_EControllerActionOrigin_SteamV2_LeftBumper = 152, k_EControllerActionOrigin_SteamV2_RightBumper = 153, - k_EControllerActionOrigin_SteamV2_LeftGrip = 154, - k_EControllerActionOrigin_SteamV2_RightGrip = 155, - k_EControllerActionOrigin_SteamV2_LeftGrip_Upper = 156, + k_EControllerActionOrigin_SteamV2_LeftGrip_Lower = 154, + k_EControllerActionOrigin_SteamV2_LeftGrip_Upper = 155, + k_EControllerActionOrigin_SteamV2_RightGrip_Lower = 156, k_EControllerActionOrigin_SteamV2_RightGrip_Upper = 157, k_EControllerActionOrigin_SteamV2_LeftBumper_Pressure = 158, k_EControllerActionOrigin_SteamV2_RightBumper_Pressure = 159, @@ -9631,22 +10898,59 @@ public enum EControllerActionOrigin k_EControllerActionOrigin_SteamV2_Gyro_Pitch = 193, k_EControllerActionOrigin_SteamV2_Gyro_Yaw = 194, k_EControllerActionOrigin_SteamV2_Gyro_Roll = 195, - k_EControllerActionOrigin_Count = 196, + k_EControllerActionOrigin_Switch_A = 196, + k_EControllerActionOrigin_Switch_B = 197, + k_EControllerActionOrigin_Switch_X = 198, + k_EControllerActionOrigin_Switch_Y = 199, + k_EControllerActionOrigin_Switch_LeftBumper = 200, + k_EControllerActionOrigin_Switch_RightBumper = 201, + k_EControllerActionOrigin_Switch_Plus = 202, + k_EControllerActionOrigin_Switch_Minus = 203, + k_EControllerActionOrigin_Switch_Capture = 204, + k_EControllerActionOrigin_Switch_LeftTrigger_Pull = 205, + k_EControllerActionOrigin_Switch_LeftTrigger_Click = 206, + k_EControllerActionOrigin_Switch_RightTrigger_Pull = 207, + k_EControllerActionOrigin_Switch_RightTrigger_Click = 208, + k_EControllerActionOrigin_Switch_LeftStick_Move = 209, + k_EControllerActionOrigin_Switch_LeftStick_Click = 210, + k_EControllerActionOrigin_Switch_LeftStick_DPadNorth = 211, + k_EControllerActionOrigin_Switch_LeftStick_DPadSouth = 212, + k_EControllerActionOrigin_Switch_LeftStick_DPadWest = 213, + k_EControllerActionOrigin_Switch_LeftStick_DPadEast = 214, + k_EControllerActionOrigin_Switch_RightStick_Move = 215, + k_EControllerActionOrigin_Switch_RightStick_Click = 216, + k_EControllerActionOrigin_Switch_RightStick_DPadNorth = 217, + k_EControllerActionOrigin_Switch_RightStick_DPadSouth = 218, + k_EControllerActionOrigin_Switch_RightStick_DPadWest = 219, + k_EControllerActionOrigin_Switch_RightStick_DPadEast = 220, + k_EControllerActionOrigin_Switch_DPad_North = 221, + k_EControllerActionOrigin_Switch_DPad_South = 222, + k_EControllerActionOrigin_Switch_DPad_West = 223, + k_EControllerActionOrigin_Switch_DPad_East = 224, + k_EControllerActionOrigin_Switch_ProGyro_Move = 225, + k_EControllerActionOrigin_Switch_ProGyro_Pitch = 226, + k_EControllerActionOrigin_Switch_ProGyro_Yaw = 227, + k_EControllerActionOrigin_Switch_ProGyro_Roll = 228, + k_EControllerActionOrigin_Switch_RightGyro_Move = 229, + k_EControllerActionOrigin_Switch_RightGyro_Pitch = 230, + k_EControllerActionOrigin_Switch_RightGyro_Yaw = 231, + k_EControllerActionOrigin_Switch_RightGyro_Roll = 232, + k_EControllerActionOrigin_Switch_LeftGyro_Move = 233, + k_EControllerActionOrigin_Switch_LeftGyro_Pitch = 234, + k_EControllerActionOrigin_Switch_LeftGyro_Yaw = 235, + k_EControllerActionOrigin_Switch_LeftGyro_Roll = 236, + k_EControllerActionOrigin_Switch_LeftGrip_Lower = 237, + k_EControllerActionOrigin_Switch_LeftGrip_Upper = 238, + k_EControllerActionOrigin_Switch_RightGrip_Lower = 239, + k_EControllerActionOrigin_Switch_RightGrip_Upper = 240, + k_EControllerActionOrigin_Count = 241, + k_EControllerActionOrigin_MaximumPossibleValue = 32767, } public enum ESteamControllerLEDFlag { k_ESteamControllerLEDFlag_SetColor = 0, k_ESteamControllerLEDFlag_RestoreUserDefault = 1, } -public enum ESteamInputType -{ - k_ESteamInputType_Unknown = 0, - k_ESteamInputType_SteamController = 1, - k_ESteamInputType_XBox360Controller = 2, - k_ESteamInputType_XBoxOneController = 3, - k_ESteamInputType_GenericXInput = 4, - k_ESteamInputType_PS4Controller = 5, -} public enum EUGCMatchingUGCType { k_EUGCMatchingUGCType_Items = 0, @@ -9862,6 +11166,60 @@ public enum EParentalFeature public char m_u16; public double m_d; } +[StructLayout(LayoutKind.Sequential)] public struct CCallbackBase +{ + public byte m_nCallbackFlags; + public int m_iCallback; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallResult +{ + public ulong m_hAPICall; + public IntPtr m_pObj; // T * + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CCallback +{ + public IntPtr m_pObj; // T * + public IntPtr m_Func; +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamAPIContext +{ + public IntPtr m_pSteamClient; // class ISteamClient * + public IntPtr m_pSteamUser; // class ISteamUser * + public IntPtr m_pSteamFriends; // class ISteamFriends * + public IntPtr m_pSteamUtils; // class ISteamUtils * + public IntPtr m_pSteamMatchmaking; // class ISteamMatchmaking * + public IntPtr m_pSteamGameSearch; // class ISteamGameSearch * + public IntPtr m_pSteamUserStats; // class ISteamUserStats * + public IntPtr m_pSteamApps; // class ISteamApps * + public IntPtr m_pSteamMatchmakingServers; // class ISteamMatchmakingServers * + public IntPtr m_pSteamNetworking; // class ISteamNetworking * + public IntPtr m_pSteamRemoteStorage; // class ISteamRemoteStorage * + public IntPtr m_pSteamScreenshots; // class ISteamScreenshots * + public IntPtr m_pSteamHTTP; // class ISteamHTTP * + public IntPtr m_pController; // class ISteamController * + public IntPtr m_pSteamUGC; // class ISteamUGC * + public IntPtr m_pSteamAppList; // class ISteamAppList * + public IntPtr m_pSteamMusic; // class ISteamMusic * + public IntPtr m_pSteamMusicRemote; // class ISteamMusicRemote * + public IntPtr m_pSteamHTMLSurface; // class ISteamHTMLSurface * + public IntPtr m_pSteamInventory; // class ISteamInventory * + public IntPtr m_pSteamVideo; // class ISteamVideo * + public IntPtr m_pSteamParentalSettings; // class ISteamParentalSettings * + public IntPtr m_pSteamInput; // class ISteamInput * +} +[StructLayout(LayoutKind.Sequential)] public struct CSteamGameServerAPIContext +{ + public IntPtr m_pSteamClient; // class ISteamClient * + public IntPtr m_pSteamGameServer; // class ISteamGameServer * + public IntPtr m_pSteamGameServerUtils; // class ISteamUtils * + public IntPtr m_pSteamGameServerNetworking; // class ISteamNetworking * + public IntPtr m_pSteamGameServerStats; // class ISteamGameServerStats * + public IntPtr m_pSteamHTTP; // class ISteamHTTP * + public IntPtr m_pSteamInventory; // class ISteamInventory * + public IntPtr m_pSteamUGC; // class ISteamUGC * + public IntPtr m_pSteamApps; // class ISteamApps * +} [StructLayout(LayoutKind.Sequential)] public struct CallbackMsg_t { public uint m_hSteamUser; @@ -9918,6 +11276,15 @@ public enum EParentalFeature [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 512)] public string m_szURL; //char[512] } +[StructLayout(LayoutKind.Sequential)] public struct MarketEligibilityResponse_t +{ + [MarshalAs(UnmanagedType.I1)] + public bool m_bAllowed; + public EMarketNotAllowedReasonFlags m_eNotAllowedReason; + public ulong m_rtAllowedAtTime; + public int m_cdaySteamGuardRequiredDays; + public int m_cdayNewDeviceCooldown; +} [StructLayout(LayoutKind.Sequential)] public struct FriendGameInfo_t { public ulong m_gameID; @@ -10103,6 +11470,11 @@ public enum EParentalFeature public string m_szGameTags; //char[128] public ulong m_steamID; } +[StructLayout(LayoutKind.Sequential)] public struct SteamPartyBeaconLocation_t +{ + public ESteamPartyBeaconLocationType m_eType; + public ulong m_ulLocationID; +} [StructLayout(LayoutKind.Sequential)] public struct FavoritesListChanged_t { public uint m_nIP; @@ -10180,6 +11552,82 @@ public enum EParentalFeature { public EResult m_eResult; } +[StructLayout(LayoutKind.Sequential)] public struct SearchForGameProgressCallback_t +{ + public ulong m_ullSearchID; + public EResult m_eResult; + public ulong m_lobbyID; + public ulong m_steamIDEndedSearch; + public int m_nSecondsRemainingEstimate; + public int m_cPlayersSearching; +} +[StructLayout(LayoutKind.Sequential)] public struct SearchForGameResultCallback_t +{ + public ulong m_ullSearchID; + public EResult m_eResult; + public int m_nCountPlayersInGame; + public int m_nCountAcceptedGame; + public ulong m_steamIDHost; + [MarshalAs(UnmanagedType.I1)] + public bool m_bFinalCallback; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameProgressCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameResultCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; + public ulong m_SteamIDPlayerFound; + public ulong m_SteamIDLobby; + public PlayerAcceptState_t m_ePlayerAcceptState; + public int m_nPlayerIndex; + public int m_nTotalPlayersFound; + public int m_nTotalPlayersAcceptedGame; + public int m_nSuggestedTeamIndex; + public ulong m_ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct RequestPlayersForGameFinalResultCallback_t +{ + public EResult m_eResult; + public ulong m_ullSearchID; + public ulong m_ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct SubmitPlayerResultResultCallback_t +{ + public EResult m_eResult; + public ulong ullUniqueGameID; + public ulong steamIDPlayer; +} +[StructLayout(LayoutKind.Sequential)] public struct EndGameResultCallback_t +{ + public EResult m_eResult; + public ulong ullUniqueGameID; +} +[StructLayout(LayoutKind.Sequential)] public struct JoinPartyCallback_t +{ + public EResult m_eResult; + public ulong m_ulBeaconID; + public ulong m_SteamIDBeaconOwner; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string m_rgchConnectString; //char[256] +} +[StructLayout(LayoutKind.Sequential)] public struct CreateBeaconCallback_t +{ + public EResult m_eResult; + public ulong m_ulBeaconID; +} +[StructLayout(LayoutKind.Sequential)] public struct ReservationNotificationCallback_t +{ + public ulong m_ulBeaconID; + public ulong m_steamIDJoiner; +} +[StructLayout(LayoutKind.Sequential)] public struct ChangeNumOpenSlotsCallback_t +{ + public EResult m_eResult; +} [StructLayout(LayoutKind.Sequential)] public struct SteamParamStringArray_t { public IntPtr m_ppStrings; // const char ** @@ -10548,33 +11996,33 @@ public enum EParentalFeature public uint m_hLocal; public EResult m_eResult; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct VolumeHasChanged_t { public float m_flNewVolume; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsShuffled_t { [MarshalAs(UnmanagedType.I1)] public bool m_bShuffled; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsLooped_t { [MarshalAs(UnmanagedType.I1)] public bool m_bLooped; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsVolume_t { public float m_flNewVolume; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsQueueEntry_t { public int nID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerSelectsPlaylistEntry_t { public int nID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct MusicPlayerWantsPlayingRepeatStatus_t { public int m_nPlayingRepeatStatus; } @@ -10599,34 +12047,6 @@ public enum EParentalFeature public uint m_cOffset; public uint m_cBytesReceived; } -[StructLayout(LayoutKind.Sequential)] public struct ControllerAnalogActionData_t -{ - public EControllerSourceMode eMode; - public float x; - public float y; - [MarshalAs(UnmanagedType.I1)] - public bool bActive; -} -[StructLayout(LayoutKind.Sequential)] public struct ControllerDigitalActionData_t -{ - [MarshalAs(UnmanagedType.I1)] - public bool bState; - [MarshalAs(UnmanagedType.I1)] - public bool bActive; -} -[StructLayout(LayoutKind.Sequential)] public struct ControllerMotionData_t -{ - public float rotQuatX; - public float rotQuatY; - public float rotQuatZ; - public float rotQuatW; - public float posAccelX; - public float posAccelY; - public float posAccelZ; - public float rotVelX; - public float rotVelY; - public float rotVelZ; -} [StructLayout(LayoutKind.Sequential)] public struct SteamUGCDetails_t { public ulong m_nPublishedFileId; @@ -10672,6 +12092,8 @@ public enum EParentalFeature public uint m_unTotalMatchingResults; [MarshalAs(UnmanagedType.I1)] public bool m_bCachedData; + [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] + public string m_rgchNextCursor; //char[256] } [StructLayout(LayoutKind.Sequential)] public struct SteamUGCRequestUGCDetailsResult_t { @@ -10770,11 +12192,11 @@ public enum EParentalFeature public EResult m_eResult; public ulong m_nPublishedFileId; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct SteamAppInstalled_t { public uint m_nAppID; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct SteamAppUninstalled_t { public uint m_nAppID; } @@ -10906,7 +12328,7 @@ public enum EParentalFeature public uint unY; public uint unWide; public uint unTall; - public uint unNewWindow_BrowserHandle; + public uint unNewWindow_BrowserHandle_IGNORE; } [StructLayout(LayoutKind.Sequential)] public struct HTML_SetCursor_t { @@ -10973,62 +12395,22 @@ public enum EParentalFeature [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] public string m_rgchCurrency; //char[4] } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct BroadcastUploadStop_t { public EBroadcastUploadResult m_eResult; } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct GetVideoURLResult_t { public EResult m_eResult; public uint m_unVideoAppID; [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string m_rgchURL; //char[256] } -[StructLayout(LayoutKind.Sequential)] public struct SteamCallback_t +[StructLayout(LayoutKind.Sequential)] public struct GetOPFSettingsResult_t { public EResult m_eResult; public uint m_unVideoAppID; } -[StructLayout(LayoutKind.Sequential)] public struct CSteamAPIContext -{ - public IntPtr m_pSteamClient; // class ISteamClient * - public IntPtr m_pSteamUser; // class ISteamUser * - public IntPtr m_pSteamFriends; // class ISteamFriends * - public IntPtr m_pSteamUtils; // class ISteamUtils * - public IntPtr m_pSteamMatchmaking; // class ISteamMatchmaking * - public IntPtr m_pSteamUserStats; // class ISteamUserStats * - public IntPtr m_pSteamApps; // class ISteamApps * - public IntPtr m_pSteamMatchmakingServers; // class ISteamMatchmakingServers * - public IntPtr m_pSteamNetworking; // class ISteamNetworking * - public IntPtr m_pSteamRemoteStorage; // class ISteamRemoteStorage * - public IntPtr m_pSteamScreenshots; // class ISteamScreenshots * - public IntPtr m_pSteamHTTP; // class ISteamHTTP * - public IntPtr m_pController; // class ISteamController * - public IntPtr m_pSteamUGC; // class ISteamUGC * - public IntPtr m_pSteamAppList; // class ISteamAppList * - public IntPtr m_pSteamMusic; // class ISteamMusic * - public IntPtr m_pSteamMusicRemote; // class ISteamMusicRemote * - public IntPtr m_pSteamHTMLSurface; // class ISteamHTMLSurface * - public IntPtr m_pSteamInventory; // class ISteamInventory * - public IntPtr m_pSteamVideo; // class ISteamVideo * - public IntPtr m_pSteamParentalSettings; // class ISteamParentalSettings * -} -[StructLayout(LayoutKind.Sequential)] public struct CCallbackBase -{ - public byte m_nCallbackFlags; - public int m_iCallback; -} -[StructLayout(LayoutKind.Sequential)] public struct CCallResult -{ - public ulong m_hAPICall; - public IntPtr m_pObj; // T * - public IntPtr m_Func; -} -[StructLayout(LayoutKind.Sequential)] public struct CCallback -{ - public IntPtr m_pObj; // T * - public IntPtr m_Func; -} [StructLayout(LayoutKind.Sequential)] public struct GSClientApprove_t { public ulong m_SteamID; @@ -11147,6 +12529,8 @@ public const int k_iClientUserCallbacks = 900; public const int k_iSteamAppsCallbacks = 1000; public const int k_iSteamUserStatsCallbacks = 1100; public const int k_iSteamNetworkingCallbacks = 1200; +public const int k_iSteamNetworkingSocketsCallbacks = 1220; +public const int k_iSteamNetworkingMessagesCallbacks = 1250; public const int k_iClientRemoteStorageCallbacks = 1300; public const int k_iClientDepotBuilderCallbacks = 1400; public const int k_iSteamGameServerItemsCallbacks = 1500; @@ -11186,9 +12570,12 @@ public const int k_iClientBluetoothManagerCallbacks = 4800; public const int k_iClientSharedConnectionCallbacks = 4900; public const int k_ISteamParentalSettingsCallbacks = 5000; public const int k_iClientShaderCallbacks = 5100; +public const int k_iSteamGameSearchCallbacks = 5200; +public const int k_iSteamPartiesCallbacks = 5300; +public const int k_iClientPartiesCallbacks = 5400; public const int k_cchPersonaNameMax = 128; public const int k_cwchPersonaNameMax = 32; -public const int k_cchMaxRichPresenceKeys = 20; +public const int k_cchMaxRichPresenceKeys = 30; public const int k_cchMaxRichPresenceKeyLength = 64; public const int k_cchMaxRichPresenceValueLength = 256; public const int k_cchStatNameMax = 128; @@ -11246,6 +12633,16 @@ public static ISteamMatchmakingServers SteamMatchmakingServers() return new CSteamMatchmakingServers(SteamAPIInterop.SteamMatchmakingServers()); } +public static ISteamGameSearch SteamGameSearch() +{ +return new CSteamGameSearch(SteamAPIInterop.SteamGameSearch()); +} + +public static ISteamParties SteamParties() +{ +return new CSteamParties(SteamAPIInterop.SteamParties()); +} + public static ISteamRemoteStorage SteamRemoteStorage() { return new CSteamRemoteStorage(SteamAPIInterop.SteamRemoteStorage()); @@ -11286,6 +12683,11 @@ public static ISteamHTTP SteamHTTP() return new CSteamHTTP(SteamAPIInterop.SteamHTTP()); } +public static ISteamInput SteamInput() +{ +return new CSteamInput(SteamAPIInterop.SteamInput()); +} + public static ISteamController SteamController() { return new CSteamController(SteamAPIInterop.SteamController()); diff --git a/Generator/steam_sdk/steam_gameserver.h b/Generator/steam_sdk/steam_gameserver.h index c6bdd52..bec600d 100644 --- a/Generator/steam_sdk/steam_gameserver.h +++ b/Generator/steam_sdk/steam_gameserver.h @@ -22,12 +22,17 @@ enum EServerMode eServerModeAuthenticationAndSecure = 3, // Authenticate users, list on the server list and VAC protect clients }; -// Initialize ISteamGameServer interface object, and set server properties which may not be changed. +// Initialize SteamGameServer client and interface objects, and set server properties which may not be changed. // // After calling this function, you should set any additional server parameters, and then // call ISteamGameServer::LogOnAnonymous() or ISteamGameServer::LogOn() // // - usSteamPort is the local port used to communicate with the steam servers. +// NOTE: unless you are using ver old Steam client binaries, this parameter is ignored, and +// you should pass 0. Gameservers now always use WebSockets to talk to Steam. +// This protocol is TCP-based and thus always uses an ephemeral local port. +// Older steam client binaries used UDP to talk to Steam, and this argument was useful. +// A future version of the SDK will remove this argument. // - usGamePort is the port that clients will connect to for gameplay. // - usQueryPort is the port that will manage server browser related duties and info // pings from clients. If you pass MASTERSERVERUPDATERPORT_USEGAMESOCKETSHARE for usQueryPort, then it @@ -35,11 +40,10 @@ enum EServerMode // UDP packets for the master server updater. See references to GameSocketShare in isteamgameserver.h. // - The version string is usually in the form x.x.x.x, and is used by the master server to detect when the // server is out of date. (Only servers with the latest version will be listed.) - inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); +// Shutdown SteamGameSeverXxx interfaces, log out, and free resources. S_API void SteamGameServer_Shutdown(); -S_API void SteamGameServer_RunCallbacks(); // Most Steam API functions allocate some amount of thread-local memory for // parameter storage. Calling SteamGameServer_ReleaseCurrentThreadMemory() @@ -51,56 +55,6 @@ inline void SteamGameServer_ReleaseCurrentThreadMemory(); S_API bool SteamGameServer_BSecure(); S_API uint64 SteamGameServer_GetSteamID(); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// Global accessors for game server C++ APIs. See individual isteam*.h files for details. -// You should not cache the results of these accessors or pass the result pointers across -// modules! Different modules may be compiled against different SDK header versions, and -// the interface pointers could therefore be different across modules. Every line of code -// which calls into a Steamworks API should retrieve the interface from a global accessor. -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#if !defined( STEAM_API_EXPORTS ) -inline ISteamClient *SteamGameServerClient(); -inline ISteamGameServer *SteamGameServer(); -inline ISteamUtils *SteamGameServerUtils(); -inline ISteamNetworking *SteamGameServerNetworking(); -inline ISteamGameServerStats *SteamGameServerStats(); -inline ISteamHTTP *SteamGameServerHTTP(); -inline ISteamInventory *SteamGameServerInventory(); -inline ISteamUGC *SteamGameServerUGC(); -inline ISteamApps *SteamGameServerApps(); -#endif - -class CSteamGameServerAPIContext -{ -public: - CSteamGameServerAPIContext() { Clear(); } - inline void Clear(); - inline bool Init(); - - ISteamClient *SteamClient() const { return m_pSteamClient; } - ISteamGameServer *SteamGameServer() const { return m_pSteamGameServer; } - ISteamUtils *SteamGameServerUtils() const { return m_pSteamGameServerUtils; } - ISteamNetworking *SteamGameServerNetworking() const { return m_pSteamGameServerNetworking; } - ISteamGameServerStats *SteamGameServerStats() const { return m_pSteamGameServerStats; } - ISteamHTTP *SteamHTTP() const { return m_pSteamHTTP; } - ISteamInventory *SteamInventory() const { return m_pSteamInventory; } - ISteamUGC *SteamUGC() const { return m_pSteamUGC; } - ISteamApps *SteamApps() const { return m_pSteamApps; } - -private: - ISteamClient *m_pSteamClient; - ISteamGameServer *m_pSteamGameServer; - ISteamUtils *m_pSteamGameServerUtils; - ISteamNetworking *m_pSteamGameServerNetworking; - ISteamGameServerStats *m_pSteamGameServerStats; - ISteamHTTP *m_pSteamHTTP; - ISteamInventory *m_pSteamInventory; - ISteamUGC *m_pSteamUGC; - ISteamApps *m_pSteamApps; -}; - - // Older SDKs exported this global pointer, but it is no longer supported. // You should use SteamGameServerClient() or CSteamGameServerAPIContext to // safely access the ISteamClient APIs from your game server application. @@ -110,122 +64,37 @@ private: // is no longer supported. Use SteamGameServer_Init instead. //S_API void S_CALLTYPE SteamGameServer_InitSafe(); - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// These macros are similar to the STEAM_CALLBACK_* macros in steam_api.h, but only trigger for gameserver callbacks -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -#define STEAM_GAMESERVER_CALLBACK( thisclass, func, /*callback_type, [deprecated] var*/... ) \ - _STEAM_CALLBACK_SELECT( ( __VA_ARGS__, GS, 3 ), ( this->SetGameserverFlag();, thisclass, func, __VA_ARGS__ ) ) - -#define STEAM_GAMESERVER_CALLBACK_MANUAL( thisclass, func, callback_type, var ) \ - CCallbackManual< thisclass, callback_type, true > var; void func( callback_type *pParam ) - - -#define _STEAM_CALLBACK_GS( _, thisclass, func, param, var ) \ - CCallback< thisclass, param, true > var; void func( param *pParam ) - -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -// steamclient.dll private wrapper functions +//============================================================================= // -// The following functions are part of abstracting API access to the steamclient.dll, but should only be used in very specific cases -//----------------------------------------------------------------------------------------------------------------------------------------------------------// -S_API HSteamPipe S_CALLTYPE SteamGameServer_GetHSteamPipe(); -S_API HSteamUser S_CALLTYPE SteamGameServer_GetHSteamUser(); -S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); - - -#if !defined( STEAM_API_EXPORTS ) -inline void S_CALLTYPE SteamGameServerInternal_OnContextInit( void* p ) -{ - ((CSteamGameServerAPIContext*)p)->Clear(); - if ( SteamGameServer_GetHSteamPipe() ) - ((CSteamGameServerAPIContext*)p)->Init(); -} -inline CSteamGameServerAPIContext& SteamGameServerInternal_ModuleContext() -{ - // SteamInternal_ContextInit takes a base pointer for the equivalent of - // struct { void (*pFn)(void* pCtx); uintp counter; CSteamAPIContext ctx; } - // Do not change layout of 2 + sizeof... or add non-pointer aligned data! - // NOTE: declaring "static CSteamAPIConext" creates a large function - // which queries the initialization status of the object. We know that - // it is pointer-aligned and fully memset with zeros, so just alias a - // static buffer of the appropriate size and call it a CSteamAPIContext. - static void* s_CallbackCounterAndContext[2 + sizeof( CSteamGameServerAPIContext ) / sizeof( void* )] = { (void*)&SteamGameServerInternal_OnContextInit, 0 }; - return *(CSteamGameServerAPIContext*)SteamInternal_ContextInit( s_CallbackCounterAndContext ); -} -inline ISteamClient *SteamGameServerClient() { return SteamGameServerInternal_ModuleContext().SteamClient(); } -inline ISteamGameServer *SteamGameServer() { return SteamGameServerInternal_ModuleContext().SteamGameServer(); } -inline ISteamUtils *SteamGameServerUtils() { return SteamGameServerInternal_ModuleContext().SteamGameServerUtils(); } -inline ISteamNetworking *SteamGameServerNetworking() { return SteamGameServerInternal_ModuleContext().SteamGameServerNetworking(); } -inline ISteamGameServerStats *SteamGameServerStats() { return SteamGameServerInternal_ModuleContext().SteamGameServerStats(); } -inline ISteamHTTP *SteamGameServerHTTP() { return SteamGameServerInternal_ModuleContext().SteamHTTP(); } -inline ISteamInventory *SteamGameServerInventory() { return SteamGameServerInternal_ModuleContext().SteamInventory(); } -inline ISteamUGC *SteamGameServerUGC() { return SteamGameServerInternal_ModuleContext().SteamUGC(); } -inline ISteamApps *SteamGameServerApps() { return SteamGameServerInternal_ModuleContext().SteamApps(); } -#endif // !defined( STEAM_API_EXPORTS ) - - -inline void CSteamGameServerAPIContext::Clear() -{ - m_pSteamClient = NULL; - m_pSteamGameServer = NULL; - m_pSteamGameServerUtils = NULL; - m_pSteamGameServerNetworking = NULL; - m_pSteamGameServerStats = NULL; - m_pSteamHTTP = NULL; - m_pSteamInventory = NULL; - m_pSteamUGC = NULL; - m_pSteamApps = NULL; -} +// Internal implementation details below +// +//============================================================================= +#ifndef STEAM_API_EXPORTS // This function must be declared inline in the header so the module using steam_api.dll gets the version names they want. inline bool CSteamGameServerAPIContext::Init() { - HSteamUser hSteamUser = SteamGameServer_GetHSteamUser(); - HSteamPipe hSteamPipe = SteamGameServer_GetHSteamPipe(); - if ( !hSteamPipe ) - return false; - - m_pSteamClient = (ISteamClient*) SteamInternal_CreateInterface( STEAMCLIENT_INTERFACE_VERSION ); + m_pSteamClient = ::SteamGameServerClient(); if ( !m_pSteamClient ) return false; - - m_pSteamGameServer = m_pSteamClient->GetISteamGameServer( hSteamUser, hSteamPipe, STEAMGAMESERVER_INTERFACE_VERSION ); - if ( !m_pSteamGameServer ) - return false; - m_pSteamGameServerUtils = m_pSteamClient->GetISteamUtils( hSteamPipe, STEAMUTILS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerUtils ) - return false; - - m_pSteamGameServerNetworking = m_pSteamClient->GetISteamNetworking( hSteamUser, hSteamPipe, STEAMNETWORKING_INTERFACE_VERSION ); - if ( !m_pSteamGameServerNetworking ) - return false; - - m_pSteamGameServerStats = m_pSteamClient->GetISteamGameServerStats( hSteamUser, hSteamPipe, STEAMGAMESERVERSTATS_INTERFACE_VERSION ); - if ( !m_pSteamGameServerStats ) - return false; - - m_pSteamHTTP = m_pSteamClient->GetISteamHTTP( hSteamUser, hSteamPipe, STEAMHTTP_INTERFACE_VERSION ); - if ( !m_pSteamHTTP ) - return false; - - m_pSteamInventory = m_pSteamClient->GetISteamInventory( hSteamUser, hSteamPipe, STEAMINVENTORY_INTERFACE_VERSION ); - if ( !m_pSteamInventory ) - return false; - - m_pSteamUGC = m_pSteamClient->GetISteamUGC( hSteamUser, hSteamPipe, STEAMUGC_INTERFACE_VERSION ); - if ( !m_pSteamUGC ) - return false; - - m_pSteamApps = m_pSteamClient->GetISteamApps( hSteamUser, hSteamPipe, STEAMAPPS_INTERFACE_VERSION ); - if ( !m_pSteamApps ) + m_pSteamGameServer = ::SteamGameServer(); + m_pSteamGameServerUtils = ::SteamGameServerUtils(); + m_pSteamGameServerNetworking = ::SteamGameServerNetworking(); + m_pSteamGameServerStats = ::SteamGameServerStats(); + m_pSteamHTTP = ::SteamGameServerHTTP(); + m_pSteamInventory = ::SteamGameServerInventory(); + m_pSteamUGC = ::SteamGameServerUGC(); + m_pSteamApps = ::SteamGameServerApps(); + if ( !m_pSteamGameServer || !m_pSteamGameServerUtils || !m_pSteamGameServerNetworking || !m_pSteamGameServerStats + || !m_pSteamHTTP || !m_pSteamInventory || !m_pSteamUGC || !m_pSteamApps ) return false; return true; } +#endif - +S_API bool S_CALLTYPE SteamInternal_GameServer_Init( uint32 unIP, uint16 usPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ); inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGamePort, uint16 usQueryPort, EServerMode eServerMode, const char *pchVersionString ) { if ( !SteamInternal_GameServer_Init( unIP, usSteamPort, usGamePort, usQueryPort, eServerMode, pchVersionString ) ) @@ -233,8 +102,6 @@ inline bool SteamGameServer_Init( uint32 unIP, uint16 usSteamPort, uint16 usGame return true; } - - inline void SteamGameServer_ReleaseCurrentThreadMemory() { SteamAPI_ReleaseCurrentThreadMemory(); diff --git a/Generator/steam_sdk/steamclientpublic.h b/Generator/steam_sdk/steamclientpublic.h index 7b89ba2..a03f172 100644 --- a/Generator/steam_sdk/steamclientpublic.h +++ b/Generator/steam_sdk/steamclientpublic.h @@ -137,6 +137,7 @@ enum EResult k_EResultWGNetworkSendExceeded = 110, // the WG couldn't send a response because we exceeded max network send size k_EResultAccountNotFriends = 111, // the user is not mutually friends k_EResultLimitedUserAccount = 112, // the user is limited + k_EResultCantRemoveItem = 113, // item can't be removed }; // Error codes for use with the voice functions @@ -448,6 +449,16 @@ enum EBroadcastUploadResult k_EBroadcastUploadResultMissingAudio = 11, // client failed to send audio data k_EBroadcastUploadResultTooFarBehind = 12, // clients was too slow uploading k_EBroadcastUploadResultTranscodeBehind = 13, // server failed to keep up with transcode + k_EBroadcastUploadResultNotAllowedToPlay = 14, // Broadcast does not have permissions to play game + k_EBroadcastUploadResultBusy = 15, // RTMP host to busy to take new broadcast stream, choose another + k_EBroadcastUploadResultBanned = 16, // Account banned from community broadcast + k_EBroadcastUploadResultAlreadyActive = 17, // We already already have an stream running. + k_EBroadcastUploadResultForcedOff = 18, // We explicitly shutting down a broadcast + k_EBroadcastUploadResultAudioBehind = 19, // Audio stream was too far behind video + k_EBroadcastUploadResultShutdown = 20, // Broadcast Server was shut down + k_EBroadcastUploadResultDisconnect = 21, // broadcast uploader TCP disconnected + k_EBroadcastUploadResultVideoInitFailed = 22, // invalid video settings + k_EBroadcastUploadResultAudioInitFailed = 23, // invalid audio settings }; @@ -503,6 +514,7 @@ enum EVRHMDType k_eEVRHMDType_HTC_Dev = 1, // original HTC dev kits k_eEVRHMDType_HTC_VivePre = 2, // htc vive pre k_eEVRHMDType_HTC_Vive = 3, // htc vive consumer release + k_eEVRHMDType_HTC_VivePro = 4, // htc vive pro release k_eEVRHMDType_HTC_Unknown = 20, // unknown htc hmd @@ -530,6 +542,12 @@ enum EVRHMDType k_eEVRHMDType_Unannounced_Unknown = 100, // Unannounced unknown HMD k_eEVRHMDType_Unannounced_WindowsMR = 101, // Unannounced Windows MR headset + k_eEVRHMDType_vridge = 110, // VRIDGE tool + + k_eEVRHMDType_Huawei_Unknown = 120, // Huawei unknown HMD + k_eEVRHMDType_Huawei_VR2 = 121, // Huawei VR2 3DOF headset + k_eEVRHMDType_Huawei_EndOfRange = 129, // end of Huawei HMD range + }; @@ -551,15 +569,84 @@ static inline bool BIsWindowsMRHeadset( EVRHMDType eType ) } +//----------------------------------------------------------------------------- +// Purpose: true if this is from a Hauwei HMD +//----------------------------------------------------------------------------- +static inline bool BIsHuaweiHeadset( EVRHMDType eType ) +{ + return eType >= k_eEVRHMDType_Huawei_Unknown && eType <= k_eEVRHMDType_Huawei_EndOfRange; +} + + //----------------------------------------------------------------------------- // Purpose: true if this is from an Vive HMD //----------------------------------------------------------------------------- static inline bool BIsViveHMD( EVRHMDType eType ) { - return eType == k_eEVRHMDType_HTC_Dev || eType == k_eEVRHMDType_HTC_VivePre || eType == k_eEVRHMDType_HTC_Vive || eType == k_eEVRHMDType_HTC_Unknown; + return eType == k_eEVRHMDType_HTC_Dev || eType == k_eEVRHMDType_HTC_VivePre || eType == k_eEVRHMDType_HTC_Vive || eType == k_eEVRHMDType_HTC_Unknown || eType == k_eEVRHMDType_HTC_VivePro; } +//----------------------------------------------------------------------------- +// Purpose: Reasons a user may not use the Community Market. +// Used in MarketEligibilityResponse_t. +//----------------------------------------------------------------------------- +enum EMarketNotAllowedReasonFlags +{ + k_EMarketNotAllowedReason_None = 0, + + // A back-end call failed or something that might work again on retry + k_EMarketNotAllowedReason_TemporaryFailure = (1 << 0), + + // Disabled account + k_EMarketNotAllowedReason_AccountDisabled = (1 << 1), + + // Locked account + k_EMarketNotAllowedReason_AccountLockedDown = (1 << 2), + + // Limited account (no purchases) + k_EMarketNotAllowedReason_AccountLimited = (1 << 3), + + // The account is banned from trading items + k_EMarketNotAllowedReason_TradeBanned = (1 << 4), + + // Wallet funds aren't tradable because the user has had no purchase + // activity in the last year or has had no purchases prior to last month + k_EMarketNotAllowedReason_AccountNotTrusted = (1 << 5), + + // The user doesn't have Steam Guard enabled + k_EMarketNotAllowedReason_SteamGuardNotEnabled = (1 << 6), + + // The user has Steam Guard, but it hasn't been enabled for the required + // number of days + k_EMarketNotAllowedReason_SteamGuardOnlyRecentlyEnabled = (1 << 7), + + // The user has recently forgotten their password and reset it + k_EMarketNotAllowedReason_RecentPasswordReset = (1 << 8), + + // The user has recently funded his or her wallet with a new payment method + k_EMarketNotAllowedReason_NewPaymentMethod = (1 << 9), + + // An invalid cookie was sent by the user + k_EMarketNotAllowedReason_InvalidCookie = (1 << 10), + + // The user has Steam Guard, but is using a new computer or web browser + k_EMarketNotAllowedReason_UsingNewDevice = (1 << 11), + + // The user has recently refunded a store purchase by his or herself + k_EMarketNotAllowedReason_RecentSelfRefund = (1 << 12), + + // The user has recently funded his or her wallet with a new payment method that cannot be verified + k_EMarketNotAllowedReason_NewPaymentMethodCannotBeVerified = (1 << 13), + + // Not only is the account not trusted, but they have no recent purchases at all + k_EMarketNotAllowedReason_NoRecentPurchases = (1 << 14), + + // User accepted a wallet gift that was recently purchased + k_EMarketNotAllowedReason_AcceptedWalletGift = (1 << 15), +}; + + #pragma pack( push, 1 ) #define CSTEAMID_DEFINED @@ -1197,9 +1284,6 @@ public: return m_gameID.m_nAppID == k_uAppIdInvalid && m_gameID.m_nModID & 0x80000000; default: -#if defined(Assert) - Assert(false); -#endif return false; } @@ -1267,4 +1351,67 @@ typedef void (*PFNPreMinidumpCallback)(void *context); typedef void *BREAKPAD_HANDLE; #define BREAKPAD_INVALID_HANDLE (BREAKPAD_HANDLE)0 +enum EGameSearchErrorCode_t +{ + k_EGameSearchErrorCode_OK = 1, + k_EGameSearchErrorCode_Failed_Search_Already_In_Progress = 2, + k_EGameSearchErrorCode_Failed_No_Search_In_Progress = 3, + k_EGameSearchErrorCode_Failed_Not_Lobby_Leader = 4, // if not the lobby leader can not call SearchForGameWithLobby + k_EGameSearchErrorCode_Failed_No_Host_Available = 5, // no host is available that matches those search params + k_EGameSearchErrorCode_Failed_Search_Params_Invalid = 6, // search params are invalid + k_EGameSearchErrorCode_Failed_Offline = 7, // offline, could not communicate with server + k_EGameSearchErrorCode_Failed_NotAuthorized = 8, // either the user or the application does not have priveledges to do this + k_EGameSearchErrorCode_Failed_Unknown_Error = 9, // unknown error +}; + +enum EPlayerResult_t +{ + k_EPlayerResultFailedToConnect = 1, // failed to connect after confirming + k_EPlayerResultAbandoned = 2, // quit game without completing it + k_EPlayerResultKicked = 3, // kicked by other players/moderator/server rules + k_EPlayerResultIncomplete = 4, // player stayed to end but game did not conclude successfully ( nofault to player ) + k_EPlayerResultCompleted = 5, // player completed game +}; + +// Define compile time assert macros to let us validate the structure sizes. +#define VALVE_COMPILE_TIME_ASSERT( pred ) typedef char compile_time_assert_type[(pred) ? 1 : -1]; + +#if defined(__linux__) || defined(__APPLE__) +// The 32-bit version of gcc has the alignment requirement for uint64 and double set to +// 4 meaning that even with #pragma pack(8) these types will only be four-byte aligned. +// The 64-bit version of gcc has the alignment requirement for these types set to +// 8 meaning that unless we use #pragma pack(4) our structures will get bigger. +// The 64-bit structure packing has to match the 32-bit structure packing for each platform. +#define VALVE_CALLBACK_PACK_SMALL +#else +#define VALVE_CALLBACK_PACK_LARGE +#endif + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error ??? +#endif + +typedef struct ValvePackingSentinel_t +{ + uint32 m_u32; + uint64 m_u64; + uint16 m_u16; + double m_d; +} ValvePackingSentinel_t; + +#pragma pack( pop ) + + +#if defined(VALVE_CALLBACK_PACK_SMALL) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 24 ) +#elif defined(VALVE_CALLBACK_PACK_LARGE) +VALVE_COMPILE_TIME_ASSERT( sizeof(ValvePackingSentinel_t) == 32 ) +#else +#error ??? +#endif + #endif // STEAMCLIENTPUBLIC_H diff --git a/Generator/steam_sdk/steamdatagram_ticketgen.h b/Generator/steam_sdk/steamdatagram_ticketgen.h new file mode 100644 index 0000000..5518a9d --- /dev/null +++ b/Generator/steam_sdk/steamdatagram_ticketgen.h @@ -0,0 +1,69 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Backend functions to generate authorization tickets for steam datagram +// +//============================================================================= + +#ifndef STEAMDATAGRAM_TICKETGEN_H +#define STEAMDATAGRAM_TICKETGEN_H +#ifdef _WIN32 +#pragma once +#endif + +// Import some common stuff that is useful by both the client +// and the backend ticket-generating authority. +#include "steamdatagram_tickets.h" + +#if defined( STEAMDATAGRAM_TICKETGEN_FOREXPORT ) + #define STEAMDATAGRAM_TICKET_INTERFACE DLL_EXPORT +#elif defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) + #define STEAMDATAGRAM_TICKET_INTERFACE extern "C" +#else + #define STEAMDATAGRAM_TICKET_INTERFACE DLL_IMPORT +#endif + +struct SteamDatagramSignedTicketBlob +{ + int m_sz; + uint8 m_blob[ k_cbSteamDatagramMaxSerializedTicket ]; +}; + +/// Initialize ticket generation with an Ed25519 private key. +/// See: https://ed25519.cr.yp.to/ +/// +/// Input buffer will be securely wiped. +/// +/// You can generate an Ed25519 key using OpenSSH: ssh-keygen -t ed25519 +/// Or with our cert tool: steamnetworkingsockets_certtool gen_keypair +/// +/// The private key should be a PEM-like block of text +/// ("-----BEGIN OPENSSH PRIVATE KEY-----"). +/// Private keys encrypted with a password are not supported. +/// +/// In order for signatures using this key to be accepted by the relay network, +/// you need to send your public key to Valve. This key should be on a single line +/// of text that begins with "ssh-ed25519". (The format used in the .ssh/authorized_keys +/// file.) +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_InitTicketGenerator_Ed25519( void *pvPrivateKey, size_t cbPrivateKey ); + +/// Serialize the specified auth ticket and attach a signature. +/// Returns false if you did something stupid like forgot to load a key. +/// Will also fail if your ticket is too big. (Probably because you +/// added too many extra fields.) +/// +/// The resulting blob should be sent to the client, who will put it in +/// their ticket cache using ISteamNetworkingSockets::ReceivedRelayAuthTicket +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_SerializeAndSignTicket( const SteamDatagramRelayAuthTicket &ticket, SteamDatagramSignedTicketBlob &outBlob, SteamNetworkingErrMsg &errMsg ); + +// +// Some ping-related tools that don't have anything to do with tickets. +// But it's something that a backend might find useful, so we're putting it in this library for now. +// + +/// Parse location string. Returns true on success +STEAMDATAGRAM_TICKET_INTERFACE bool SteamDatagram_ParsePingLocation( const char *pszString, SteamNetworkPingLocation_t &outLocation ); + +/// Estimate ping time between two locations. +STEAMDATAGRAM_TICKET_INTERFACE int SteamDatagram_EstimatePingBetweenTwoLocations( const SteamNetworkPingLocation_t &location1, const SteamNetworkPingLocation_t &location2 ); + +#endif // STEAMDATAGRAM_TICKETGEN_H diff --git a/Generator/steam_sdk/steamdatagram_tickets.h b/Generator/steam_sdk/steamdatagram_tickets.h new file mode 100644 index 0000000..a72e517 --- /dev/null +++ b/Generator/steam_sdk/steamdatagram_tickets.h @@ -0,0 +1,247 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Types and utilities for handling steam datagram tickets. These are +// useful for both the client and the backend ticket generating authority. +// +//============================================================================= + +#ifndef STEAMDATAGRAM_TICKETS_H +#define STEAMDATAGRAM_TICKETS_H +#ifdef _WIN32 +#pragma once +#endif + +#ifndef assert + #include +#endif + +#include +#include "steamnetworkingtypes.h" + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +/// Max length of serialized auth ticket. This is important so that we +/// can ensure that we always fit into a single UDP datagram (along with +/// other certs and signatures) and keep the implementation simple. +const size_t k_cbSteamDatagramMaxSerializedTicket = 512; + +/// Network-routable identifier for a service. This is an intentionally +/// opaque byte blob. The relays know how to use this to forward it on +/// to the intended destination, but otherwise clients really should not +/// need to know what's inside. (Indeed, we don't really want them to +/// know, as it could reveal information useful to an attacker.) +#ifndef IS_STEAMDATAGRAMROUTER +struct SteamDatagramHostedAddress +{ + + // Size of data blob. + int m_cbSize; + + // Opaque data + char m_data[ 128 ]; + + // Reset to empty state + void Clear() { memset( this, 0, sizeof(*this) ); } + + // Parse the data center out of the blob. + SteamNetworkingPOPID GetPopID() const { return CalculateSteamNetworkingPOPIDFromString( m_data ); } + + /// Set a dummy routing blob with a hardcoded IP:port. You should only use + /// this in a dev environment, since the address is in plaintext! + /// In production this information should come from the server, + /// using ISteamNetworkingSockets::GetHostedDedicatedServerAddress + void SetDevAddress( uint32 nIP, uint16 nPort, SteamNetworkingPOPID popid = 0 ) + { + GetSteamNetworkingLocationPOPStringFromID( popid, m_data ); + m_cbSize = 4; + m_data[m_cbSize++] = 1; + m_data[m_cbSize++] = 1; + m_data[m_cbSize++] = char(nPort); + m_data[m_cbSize++] = char(nPort>>8); + m_data[m_cbSize++] = char(nIP); + m_data[m_cbSize++] = char(nIP>>8); + m_data[m_cbSize++] = char(nIP>>16); + m_data[m_cbSize++] = char(nIP>>24); + } + + /// Convert to/from std::string (or anything that acts like it). + /// Useful for interfacing with google protobuf. It's a template + /// mainly so that we don't have to include in the header. + /// Note: by "string", we don't mean that it's text. Ut's a binary + /// blob, and it might have zeros in it. (std::string can handle that.) + template bool SetFromStdString( const T &str ) + { + if ( str.length() >= sizeof(m_data) ) + { + m_cbSize = 0; + return false; + } + m_cbSize = (int)str.length(); + memcpy( m_data, str.c_str(), m_cbSize ); + return true; + } + template void GetAsStdString( T *str ) const + { + str->assign( m_data, m_cbSize ); + } + +}; +#endif + +/// Ticket used to gain access to the relay network. +struct SteamDatagramRelayAuthTicket +{ + SteamDatagramRelayAuthTicket() { Clear(); } + + /// Reset all fields + void Clear() { memset( this, 0, sizeof(*this) ); m_nRestrictToVirtualPort = -1; } + + /// Identity of the gameserver we want to talk to. This is required. + SteamNetworkingIdentity m_identityGameserver; + + /// Identity of the person who was authorized. This is required. + SteamNetworkingIdentity m_identityAuthorizedClient; + + /// SteamID is authorized to send from a particular public IP. If this + /// is 0, then the sender is not restricted to a particular IP. + /// + /// Recommend to leave this set to zero. + uint32 m_unPublicIP; + + /// Time when the ticket expires. Recommended: take the current + /// time and add 6 hours, or maybe a bit longer if your gameplay + /// sessions are longer. + /// + /// NOTE: relays may reject tickets with expiry times excessively + /// far in the future, so contact us if you wish to use an expiry + /// longer than, say, 24 hours. + RTime32 m_rtimeTicketExpiry; + + /// Routing information where the gameserver is listening for + /// relayed traffic. You should fill this in when generating + /// a ticket. + /// + /// When generating tickets on your backend: + /// - In production: The gameserver knows the proper routing + /// information, so you need to call + /// ISteamNetworkingSockets::GetHostedDedicatedServerAddress + /// and send the info to your backend. + /// - In development, you will need to provide public IP + /// of the server using SteamDatagramServiceNetID::SetDevAddress. + /// Relays need to be able to send UDP + /// packets to this server. Since it's very likely that + /// your server is behind a firewall/NAT, make sure that + /// the address is the one that the outside world can use. + /// The traffic from the relays will be "unsolicited", so + /// stateful firewalls won't work -- you will probably have + /// to set up an explicit port forward. + /// On the client: + /// - this field will always be blank. + SteamDatagramHostedAddress m_routing; + + /// App ID this is for. This is required, and should be the + /// App ID the client is running. (Even if your gameserver + /// uses a different App ID.) + uint32 m_nAppID; + + /// Restrict this ticket to be used for a particular virtual port? + /// Set to -1 to allow any virtual port. + /// + /// This is useful as a security measure, and also so the client will + /// use the right ticket (which might have extra fields that are useful + /// for proper analytics), if the client happens to have more than one + /// appropriate ticket. + /// + /// Note: if a client has more that one acceptable ticket, they will + /// always use the one expiring the latest. + int m_nRestrictToVirtualPort; + + // + // Extra fields. + // + // These are collected for backend analytics. For example, you might + // send a MatchID so that all of the records for a particular match can + // be located. Or send a game mode field so that you can compare + // the network characteristics of different game modes. + // + // (At the time of this writing we don't have a way to expose the data + // we collect to partners, but we hope to in the future so that you can + // get visibility into network conditions.) + // + + struct ExtraField + { + enum EType + { + k_EType_String, + k_EType_Int, // For most small integral values. Uses google protobuf sint64, so it's small on the wire. WARNING: In some places this value may be transmitted in JSON, in which case precision may be lost in backend analytics. Don't use this for an "identifier", use it for a scalar quantity. + k_EType_Fixed64, // 64 arbitrary bits. This value is treated as an "identifier". In places where JSON format is used, it will be serialized as a string. No aggregation / analytics can be performed on this value. + }; + int /* EType */ m_eType; + char m_szName[28]; + + union { + char m_szStringValue[128]; + int64 m_nIntValue; + uint64 m_nFixed64Value; + }; + }; + enum { k_nMaxExtraFields = 16 }; + int m_nExtraFields; + ExtraField m_vecExtraFields[ k_nMaxExtraFields ]; + + /// Helper to add an extra field in a single call + void AddExtraField_Int( const char *pszName, int64 val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Int ); + if ( p ) + p->m_nIntValue = val; + } + void AddExtraField_Fixed64( const char *pszName, uint64 val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_Fixed64 ); + if ( p ) + p->m_nFixed64Value = val; + } + void AddExtraField_String( const char *pszName, const char *val ) + { + ExtraField *p = AddExtraField( pszName, ExtraField::k_EType_String ); + if ( p ) + { + size_t l = strlen( val ); + if ( l > sizeof(p->m_szStringValue)-1 ) + l = sizeof(p->m_szStringValue)-1; + memcpy( p->m_szStringValue, val, l ); + p->m_szStringValue[l] = '\0'; + } + } + +private: + ExtraField *AddExtraField( const char *pszName, ExtraField::EType eType ) + { + if ( m_nExtraFields >= k_nMaxExtraFields ) + { + assert( false ); + return nullptr; + } + ExtraField *p = &m_vecExtraFields[ m_nExtraFields++ ]; + p->m_eType = eType; + + size_t l = strlen( pszName ); + if ( l > sizeof(p->m_szName)-1 ) + l = sizeof(p->m_szName)-1; + memcpy( p->m_szName, pszName, l ); + p->m_szName[l] = '\0'; + return p; + } +}; + +#pragma pack(pop) + +#endif // STEAMDATAGRAM_TICKETS_H diff --git a/Generator/steam_sdk/steamnetworkingtypes.h b/Generator/steam_sdk/steamnetworkingtypes.h new file mode 100644 index 0000000..f244c64 --- /dev/null +++ b/Generator/steam_sdk/steamnetworkingtypes.h @@ -0,0 +1,1114 @@ +//====== Copyright Valve Corporation, All rights reserved. ==================== +// +// Purpose: misc networking utilities +// +//============================================================================= + +#ifndef STEAMNETWORKINGTYPES +#define STEAMNETWORKINGTYPES +#ifdef _WIN32 +#pragma once +#endif + +#include + +//---------------------------------------- +// SteamNetworkingSockets library config +// Compiling in Steam public branch. +#define STEAMNETWORKINGSOCKETS_STEAM +#ifdef STEAMNETWORKINGSOCKETS_STATIC_LINK + #define STEAMNETWORKINGSOCKETS_INTERFACE extern +#endif +#define STEAMNETWORKINGSOCKETS_ENABLE_SDR +#include +// +//---------------------------------------- + + +#if defined( VALVE_CALLBACK_PACK_SMALL ) +#pragma pack( push, 4 ) +#elif defined( VALVE_CALLBACK_PACK_LARGE ) +#pragma pack( push, 8 ) +#else +#error "Must define VALVE_CALLBACK_PACK_SMALL or VALVE_CALLBACK_PACK_LARGE" +#endif + +struct SteamDatagramRelayAuthTicket; +struct SteamDatagramHostedAddress; +struct SteamNetConnectionStatusChangedCallback_t; + +/// Handle used to identify a connection to a remote host. +typedef uint32 HSteamNetConnection; +const HSteamNetConnection k_HSteamNetConnection_Invalid = 0; + +/// Handle used to identify a "listen socket". +typedef uint32 HSteamListenSocket; +const HSteamListenSocket k_HSteamListenSocket_Invalid = 0; + +/// Max length of diagnostic error message +const int k_cchMaxSteamNetworkingErrMsg = 1024; + +/// Used to return English-language diagnostic error messages to caller. +/// (For debugging or spewing to a console, etc. Not intended for UI.) +typedef char SteamNetworkingErrMsg[ k_cchMaxSteamNetworkingErrMsg ]; + +/// Identifier used for a network location point of presence. (E.g. a Valve data center.) +/// Typically you won't need to directly manipulate these. +typedef uint32 SteamNetworkingPOPID; + +/// A local timestamp. You can subtract two timestamps to get the number of elapsed +/// microseconds. This is guaranteed to increase over time during the lifetime +/// of a process, but not globally across runs. You don't need to worry about +/// the value wrapping around. Note that the underlying clock might not actually have +/// microsecond *resolution*. +typedef int64 SteamNetworkingMicroseconds; + +// +// Describing network hosts +// + +/// Different methods of describing the identity of a network host +enum ESteamNetworkingIdentityType +{ + // Dummy/unknown/invalid + k_ESteamNetworkingIdentityType_Invalid = 0, + + // + // Basic platform-specific identifiers. + // + k_ESteamNetworkingIdentityType_SteamID = 16, // 64-bit CSteamID + k_ESteamNetworkingIdentityType_XboxPairwiseID = 17, // Publisher-specific user identity, as string + //k_ESteamNetworkingIdentityType_PlaystationSomething = 18, + + // + // Special identifiers. + // + + // Use their IP address (and port) as their "identity". + // These types of identities are always unauthenticated. + // They are useful for porting plain sockets code, and other + // situations where you don't care about authentication. In this + // case, the local identity will be "localhost", + // and the remote address will be their network address. + // + // We use the same type for either IPv4 or IPv6, and + // the address is always store as IPv6. We use IPv4 + // mapped addresses to handle IPv4. + k_ESteamNetworkingIdentityType_IPAddress = 1, + + // Generic string/binary blobs. It's up to your app to interpret this. + // This library can tell you if the remote host presented a certificate + // signed by somebody you have chosen to trust, with this identity on it. + // It's up to you to ultimately decide what this identity means. + k_ESteamNetworkingIdentityType_GenericString = 2, + k_ESteamNetworkingIdentityType_GenericBytes = 3, + + // Make sure this enum is stored in an int. + k_ESteamNetworkingIdentityType__Force32bit = 0x7fffffff, +}; + +#pragma pack(push,1) + +/// Store an IP and port. IPv6 is always used; IPv4 is represented using +/// "IPv4-mapped" addresses: IPv4 aa.bb.cc.dd => IPv6 ::ffff:aabb:ccdd +/// (RFC 4291 section 2.5.5.2.) +struct SteamNetworkingIPAddr +{ + void Clear(); // Set everything to zero. E.g. [::]:0 + bool IsIPv6AllZeros() const; // Return true if the IP is ::0. (Doesn't check port.) + void SetIPv6( const uint8 *ipv6, uint16 nPort ); // Set IPv6 address. IP is interpreted as bytes, so there are no endian issues. (Same as inaddr_in6.) The IP can be a mapped IPv4 address + void SetIPv4( uint32 nIP, uint16 nPort ); // Sets to IPv4 mapped address. IP and port are in host byte order. + bool IsIPv4() const; // Return true if IP is mapped IPv4 + uint32 GetIPv4() const; // Returns IP in host byte order (e.g. aa.bb.cc.dd as 0xaabbccdd). Returns 0 if IP is not mapped IPv4. + void SetIPv6LocalHost( uint16 nPort = 0); // Set to the IPv6 localhost address ::1, and the specified port. + bool IsLocalHost() const; // Return true if this identity is localhost. (Either IPv6 ::1, or IPv4 127.0.0.1) + + // Max length of the buffer needed to hold IP formatted using ToString, including '\0' + // ([0123:4567:89ab:cdef:0123:4567:89ab:cdef]:12345) + enum { k_cchMaxString = 48 }; + + /// Print to a string, with or without the port. Mapped IPv4 addresses are printed + /// as dotted decimal (12.34.56.78), otherwise this will print the canonical + /// form according to RFC5952. If you include the port, IPv6 will be surrounded by + /// brackets, e.g. [::1:2]:80. Your buffer should be at least k_cchMaxString bytes + /// to avoid truncation + inline void ToString( char *buf, size_t cbBuf, bool bWithPort ) const; + + /// Parse an IP address and optional port. If a port is not present, it is set to 0. + /// (This means that you cannot tell if a zero port was explicitly specified.) + inline bool ParseString( const char *pszStr ); + + union + { + uint8 m_ipv6[ 16 ]; + struct // IPv4 "mapped address" (rfc4038 section 4.2) + { + uint64 m_8zeros; + uint16 m_0000; + uint16 m_ffff; + uint8 m_ip[ 4 ]; // NOTE: As bytes, i.e. network byte order + } m_ipv4; + }; + uint16 m_port; // Host byte order + + /// See if two addresses are identical + bool operator==(const SteamNetworkingIPAddr &x ) const; +}; + +/// An abstract way to represent the identity of a network host +struct SteamNetworkingIdentity +{ + /// Type of identity. + ESteamNetworkingIdentityType m_eType; + + // + // Get/Set in various formats. + // + + void Clear(); + bool IsInvalid() const; // Return true if we are the invalid type. Does not make any other validity checks (e.g. is SteamID actually valid) + + void SetSteamID( CSteamID steamID ); + CSteamID GetSteamID() const; // Return black CSteamID (!IsValid()) if identity is not a SteamID + void SetSteamID64( uint64 steamID ); // Takes SteamID as raw 64-bit number + uint64 GetSteamID64() const; // Returns 0 if identity is not SteamID + + bool SetXboxPairwiseID( const char *pszString ); // Returns false if invalid length + const char *GetXboxPairwiseID() const; // Returns nullptr if not Xbox ID + + void SetIPAddr( const SteamNetworkingIPAddr &addr ); // Set to specified IP:port + const SteamNetworkingIPAddr *GetIPAddr() const; // returns null if we are not an IP address. + + // "localhost" is equivalent for many purposes to "anonymous." Our remote + // will identify us by the network address we use. + void SetLocalHost(); // Set to localhost. (We always use IPv6 ::1 for this, not 127.0.0.1) + bool IsLocalHost() const; // Return true if this identity is localhost. + + bool SetGenericString( const char *pszString ); // Returns false if invalid length + const char *GetGenericString() const; // Returns nullptr if not generic string type + + bool SetGenericBytes( const void *data, size_t cbLen ); // Returns false if invalid size. + const uint8 *GetGenericBytes( int &cbLen ) const; // Returns null if not generic bytes type + + /// See if two identities are identical + bool operator==(const SteamNetworkingIdentity &x ) const; + + /// Print to a human-readable string. This is suitable for debug messages + /// or any other time you need to encode the identity as a string. It has a + /// URL-like format (type:). Your buffer should be at least + /// k_cchMaxString bytes big to avoid truncation. + void ToString( char *buf, size_t cbBuf ) const; + + /// Parse back a string that was generated using ToString + bool ParseString( const char *pszStr ); + + // Max sizes + enum { + k_cchMaxString = 128, // Max length of the buffer needed to hold any identity, formatted in string format by ToString + k_cchMaxGenericString = 32, // Max length of the string for generic string identities. Including terminating '\0' + k_cchMaxXboxPairwiseID = 32, // Including terminating '\0' + k_cbMaxGenericBytes = 32, + }; + + // + // Internal representation. Don't access this directly, use the accessors! + // + // Number of bytes that are relevant below. This MUST ALWAYS be + // set. (Use the accessors!) This is important to enable old code to work + // with new identity types. + int m_cbSize; + union { + uint64 m_steamID64; + char m_szGenericString[ k_cchMaxGenericString ]; + char m_szXboxPairwiseID[ k_cchMaxXboxPairwiseID ]; + uint8 m_genericBytes[ k_cbMaxGenericBytes ]; + SteamNetworkingIPAddr m_ip; + uint32 m_reserved[ 32 ]; // Pad structure to leave easy room for future expansion + }; +}; +#pragma pack(pop) + +// +// Connection status +// + +/// High level connection status +enum ESteamNetworkingConnectionState +{ + + /// Dummy value used to indicate an error condition in the API. + /// Specified connection doesn't exist or has already been closed. + k_ESteamNetworkingConnectionState_None = 0, + + /// We are trying to establish whether peers can talk to each other, + /// whether they WANT to talk to each other, perform basic auth, + /// and exchange crypt keys. + /// + /// - For connections on the "client" side (initiated locally): + /// We're in the process of trying to establish a connection. + /// Depending on the connection type, we might not know who they are. + /// Note that it is not possible to tell if we are waiting on the + /// network to complete handshake packets, or for the application layer + /// to accept the connection. + /// + /// - For connections on the "server" side (accepted through listen socket): + /// We have completed some basic handshake and the client has presented + /// some proof of identity. The connection is ready to be accepted + /// using AcceptConnection(). + /// + /// In either case, any unreliable packets sent now are almost certain + /// to be dropped. Attempts to receive packets are guaranteed to fail. + /// You may send messages if the send mode allows for them to be queued. + /// but if you close the connection before the connection is actually + /// established, any queued messages will be discarded immediately. + /// (We will not attempt to flush the queue and confirm delivery to the + /// remote host, which ordinarily happens when a connection is closed.) + k_ESteamNetworkingConnectionState_Connecting = 1, + + /// Some connection types use a back channel or trusted 3rd party + /// for earliest communication. If the server accepts the connection, + /// then these connections switch into the rendezvous state. During this + /// state, we still have not yet established an end-to-end route (through + /// the relay network), and so if you send any messages unreliable, they + /// are going to be discarded. + k_ESteamNetworkingConnectionState_FindingRoute = 2, + + /// We've received communications from our peer (and we know + /// who they are) and are all good. If you close the connection now, + /// we will make our best effort to flush out any reliable sent data that + /// has not been acknowledged by the peer. (But note that this happens + /// from within the application process, so unlike a TCP connection, you are + /// not totally handing it off to the operating system to deal with it.) + k_ESteamNetworkingConnectionState_Connected = 3, + + /// Connection has been closed by our peer, but not closed locally. + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. If there are any messages in the inbound queue, + /// you may retrieve them. Otherwise, nothing may be done with the connection + /// except to close it. + /// + /// This stats is similar to CLOSE_WAIT in the TCP state machine. + k_ESteamNetworkingConnectionState_ClosedByPeer = 4, + + /// A disruption in the connection has been detected locally. (E.g. timeout, + /// local internet connection disrupted, etc.) + /// + /// The connection still exists from an API perspective. You must close the + /// handle to free up resources. + /// + /// Attempts to send further messages will fail. Any remaining received messages + /// in the queue are available. + k_ESteamNetworkingConnectionState_ProblemDetectedLocally = 5, + +// +// The following values are used internally and will not be returned by any API. +// We document them here to provide a little insight into the state machine that is used +// under the hood. +// + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. All reliable data has been flushed, or else + /// we've given up and discarded it. We do not yet know for sure that the peer knows + /// the connection has been closed, however, so we're just hanging around so that if we do + /// get a packet from them, we can send them the appropriate packets so that they can + /// know why the connection was closed (and not have to rely on a timeout, which makes + /// it appear as if something is wrong). + k_ESteamNetworkingConnectionState_FinWait = -1, + + /// We've disconnected on our side, and from an API perspective the connection is closed. + /// No more data may be sent or received. From a network perspective, however, on the wire, + /// we have not yet given any indication to the peer that the connection is closed. + /// We are in the process of flushing out the last bit of reliable data. Once that is done, + /// we will inform the peer that the connection has been closed, and transition to the + /// FinWait state. + /// + /// Note that no indication is given to the remote host that we have closed the connection, + /// until the data has been flushed. If the remote host attempts to send us data, we will + /// do whatever is necessary to keep the connection alive until it can be closed properly. + /// But in fact the data will be discarded, since there is no way for the application to + /// read it back. Typically this is not a problem, as application protocols that utilize + /// the lingering functionality are designed for the remote host to wait for the response + /// before sending any more data. + k_ESteamNetworkingConnectionState_Linger = -2, + + /// Connection is completely inactive and ready to be destroyed + k_ESteamNetworkingConnectionState_Dead = -3, + + k_ESteamNetworkingConnectionState__Force32Bit = 0x7fffffff +}; + +/// Enumerate various causes of connection termination. These are designed to work similar +/// to HTTP error codes: the numeric range gives you a rough classification as to the source +/// of the problem. +enum ESteamNetConnectionEnd +{ + // Invalid/sentinel value + k_ESteamNetConnectionEnd_Invalid = 0, + + // + // Application codes. These are the values you will pass to + // ISteamNetworkingSockets::CloseConnection. You can use these codes if + // you want to plumb through application-specific reason codes. If you don't + // need this facility, feel free to always pass + // k_ESteamNetConnectionEnd_App_Generic. + // + // The distinction between "normal" and "exceptional" termination is + // one you may use if you find useful, but it's not necessary for you + // to do so. The only place where we distinguish between normal and + // exceptional is in connection analytics. If a significant + // proportion of connections terminates in an exceptional manner, + // this can trigger an alert. + // + + // 1xxx: Application ended the connection in a "usual" manner. + // E.g.: user intentionally disconnected from the server, + // gameplay ended normally, etc + k_ESteamNetConnectionEnd_App_Min = 1000, + k_ESteamNetConnectionEnd_App_Generic = k_ESteamNetConnectionEnd_App_Min, + // Use codes in this range for "normal" disconnection + k_ESteamNetConnectionEnd_App_Max = 1999, + + // 2xxx: Application ended the connection in some sort of exceptional + // or unusual manner that might indicate a bug or configuration + // issue. + // + k_ESteamNetConnectionEnd_AppException_Min = 2000, + k_ESteamNetConnectionEnd_AppException_Generic = k_ESteamNetConnectionEnd_AppException_Min, + // Use codes in this range for "unusual" disconnection + k_ESteamNetConnectionEnd_AppException_Max = 2999, + + // + // System codes. These will be returned by the system when + // the connection state is k_ESteamNetworkingConnectionState_ClosedByPeer + // or k_ESteamNetworkingConnectionState_ProblemDetectedLocally. It is + // illegal to pass a code in this range to ISteamNetworkingSockets::CloseConnection + // + + // 3xxx: Connection failed or ended because of problem with the + // local host or their connection to the Internet. + k_ESteamNetConnectionEnd_Local_Min = 3000, + + // You cannot do what you want to do because you're running in offline mode. + k_ESteamNetConnectionEnd_Local_OfflineMode = 3001, + + // We're having trouble contacting many (perhaps all) relays. + // Since it's unlikely that they all went offline at once, the best + // explanation is that we have a problem on our end. Note that we don't + // bother distinguishing between "many" and "all", because in practice, + // it takes time to detect a connection problem, and by the time + // the connection has timed out, we might not have been able to + // actively probe all of the relay clusters, even if we were able to + // contact them at one time. So this code just means that: + // + // * We don't have any recent successful communication with any relay. + // * We have evidence of recent failures to communicate with multiple relays. + k_ESteamNetConnectionEnd_Local_ManyRelayConnectivity = 3002, + + // A hosted server is having trouble talking to the relay + // that the client was using, so the problem is most likely + // on our end + k_ESteamNetConnectionEnd_Local_HostedServerPrimaryRelay = 3003, + + // We're not able to get the network config. This is + // *almost* always a local issue, since the network config + // comes from the CDN, which is pretty darn reliable. + k_ESteamNetConnectionEnd_Local_NetworkConfig = 3004, + + // Steam rejected our request because we don't have rights + // to do this. + k_ESteamNetConnectionEnd_Local_Rights = 3005, + + k_ESteamNetConnectionEnd_Local_Max = 3999, + + // 4xxx: Connection failed or ended, and it appears that the + // cause does NOT have to do with the local host or their + // connection to the Internet. It could be caused by the + // remote host, or it could be somewhere in between. + k_ESteamNetConnectionEnd_Remote_Min = 4000, + + // The connection was lost, and as far as we can tell our connection + // to relevant services (relays) has not been disrupted. This doesn't + // mean that the problem is "their fault", it just means that it doesn't + // appear that we are having network issues on our end. + k_ESteamNetConnectionEnd_Remote_Timeout = 4001, + + // Something was invalid with the cert or crypt handshake + // info you gave me, I don't understand or like your key types, + // etc. + k_ESteamNetConnectionEnd_Remote_BadCrypt = 4002, + + // You presented me with a cert that was I was able to parse + // and *technically* we could use encrypted communication. + // But there was a problem that prevents me from checking your identity + // or ensuring that somebody int he middle can't observe our communication. + // E.g.: - the CA key was missing (and I don't accept unsigned certs) + // - The CA key isn't one that I trust, + // - The cert doesn't was appropriately restricted by app, user, time, data center, etc. + // - The cert wasn't issued to you. + // - etc + k_ESteamNetConnectionEnd_Remote_BadCert = 4003, + + // We couldn't rendezvous with the remote host because + // they aren't logged into Steam + k_ESteamNetConnectionEnd_Remote_NotLoggedIn = 4004, + + // We couldn't rendezvous with the remote host because + // they aren't running the right application. + k_ESteamNetConnectionEnd_Remote_NotRunningApp = 4005, + + // Something wrong with the protocol version you are using. + // (Probably the code you are running is too old.) + k_ESteamNetConnectionEnd_Remote_BadProtocolVersion = 4006, + + k_ESteamNetConnectionEnd_Remote_Max = 4999, + + // 5xxx: Connection failed for some other reason. + k_ESteamNetConnectionEnd_Misc_Min = 5000, + + // A failure that isn't necessarily the result of a software bug, + // but that should happen rarely enough that it isn't worth specifically + // writing UI or making a localized message for. + // The debug string should contain further details. + k_ESteamNetConnectionEnd_Misc_Generic = 5001, + + // Generic failure that is most likely a software bug. + k_ESteamNetConnectionEnd_Misc_InternalError = 5002, + + // The connection to the remote host timed out, but we + // don't know if the problem is on our end, in the middle, + // or on their end. + k_ESteamNetConnectionEnd_Misc_Timeout = 5003, + + // We're having trouble talking to the relevant relay. + // We don't have enough information to say whether the + // problem is on our end or not. + k_ESteamNetConnectionEnd_Misc_RelayConnectivity = 5004, + + // There's some trouble talking to Steam. + k_ESteamNetConnectionEnd_Misc_SteamConnectivity = 5005, + + // A server in a dedicated hosting situation has no relay sessions + // active with which to talk back to a client. (It's the client's + // job to open and maintain those sessions.) + k_ESteamNetConnectionEnd_Misc_NoRelaySessionsToClient = 5006, + + k_ESteamNetConnectionEnd_Misc_Max = 5999, + + k_ESteamNetConnectionEnd__Force32Bit = 0x7fffffff +}; + +/// Max length, in bytes (including null terminator) of the reason string +/// when a connection is closed. +const int k_cchSteamNetworkingMaxConnectionCloseReason = 128; + +/// Max length, in bytes (include null terminator) of debug description +/// of a connection. +const int k_cchSteamNetworkingMaxConnectionDescription = 128; + +/// Describe the state of a connection. +struct SteamNetConnectionInfo_t +{ + + /// Who is on the other end? Depending on the connection type and phase of the connection, we might not know + SteamNetworkingIdentity m_identityRemote; + + /// Arbitrary user data set by the local application code + int64 m_nUserData; + + /// Handle to listen socket this was connected on, or k_HSteamListenSocket_Invalid if we initiated the connection + HSteamListenSocket m_hListenSocket; + + /// Remote address. Might be all 0's if we don't know it, or if this is N/A. + /// (E.g. Basically everything except direct UDP connection.) + SteamNetworkingIPAddr m_addrRemote; + uint16 m__pad1; + + /// What data center is the remote host in? (0 if we don't know.) + SteamNetworkingPOPID m_idPOPRemote; + + /// What relay are we using to communicate with the remote host? + /// (0 if not applicable.) + SteamNetworkingPOPID m_idPOPRelay; + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Basic cause of the connection termination or problem. + /// See ESteamNetConnectionEnd for the values used + int m_eEndReason; + + /// Human-readable, but non-localized explanation for connection + /// termination or problem. This is intended for debugging / + /// diagnostic purposes only, not to display to users. It might + /// have some details specific to the issue. + char m_szEndDebug[ k_cchSteamNetworkingMaxConnectionCloseReason ]; + + /// Debug description. This includes the connection handle, + /// connection type (and peer information), and the app name. + /// This string is used in various internal logging messages + char m_szConnectionDescription[ k_cchSteamNetworkingMaxConnectionDescription ]; + + /// Internal stuff, room to change API easily + uint32 reserved[64]; +}; + +/// Quick connection state, pared down to something you could call +/// more frequently without it being too big of a perf hit. +struct SteamNetworkingQuickConnectionStatus +{ + + /// High level state of the connection + ESteamNetworkingConnectionState m_eState; + + /// Current ping (ms) + int m_nPing; + + /// Connection quality measured locally, 0...1. (Percentage of packets delivered + /// end-to-end in order). + float m_flConnectionQualityLocal; + + /// Packet delivery success rate as observed from remote host + float m_flConnectionQualityRemote; + + /// Current data rates from recent history. + float m_flOutPacketsPerSec; + float m_flOutBytesPerSec; + float m_flInPacketsPerSec; + float m_flInBytesPerSec; + + /// Estimate rate that we believe that we can send data to our peer. + /// Note that this could be significantly higher than m_flOutBytesPerSec, + /// meaning the capacity of the channel is higher than you are sending data. + /// (That's OK!) + int m_nSendRateBytesPerSecond; + + /// Number of bytes pending to be sent. This is data that you have recently + /// requested to be sent but has not yet actually been put on the wire. The + /// reliable number ALSO includes data that was previously placed on the wire, + /// but has now been scheduled for re-transmission. Thus, it's possible to + /// observe m_cbPendingReliable increasing between two checks, even if no + /// calls were made to send reliable data between the checks. Data that is + /// awaiting the nagle delay will appear in these numbers. + int m_cbPendingUnreliable; + int m_cbPendingReliable; + + /// Number of bytes of reliable data that has been placed the wire, but + /// for which we have not yet received an acknowledgment, and thus we may + /// have to re-transmit. + int m_cbSentUnackedReliable; + + /// If you asked us to send a message right now, how long would that message + /// sit in the queue before we actually started putting packets on the wire? + /// (And assuming Nagle does not cause any packets to be delayed.) + /// + /// In general, data that is sent by the application is limited by the + /// bandwidth of the channel. If you send data faster than this, it must + /// be queued and put on the wire at a metered rate. Even sending a small amount + /// of data (e.g. a few MTU, say ~3k) will require some of the data to be delayed + /// a bit. + /// + /// In general, the estimated delay will be approximately equal to + /// + /// ( m_cbPendingUnreliable+m_cbPendingReliable ) / m_nSendRateBytesPerSecond + /// + /// plus or minus one MTU. It depends on how much time has elapsed since the last + /// packet was put on the wire. For example, the queue might have *just* been emptied, + /// and the last packet placed on the wire, and we are exactly up against the send + /// rate limit. In that case we might need to wait for one packet's worth of time to + /// elapse before we can send again. On the other extreme, the queue might have data + /// in it waiting for Nagle. (This will always be less than one packet, because as soon + /// as we have a complete packet we would send it.) In that case, we might be ready + /// to send data now, and this value will be 0. + SteamNetworkingMicroseconds m_usecQueueTime; + + /// Internal stuff, room to change API easily + uint32 reserved[16]; +}; + +#pragma pack( pop ) + +// +// Network messages +// + +/// Max size of a single message that we can SEND. +/// Note: We might be wiling to receive larger messages, +/// and our peer might, too. +const int k_cbMaxSteamNetworkingSocketsMessageSizeSend = 512 * 1024; + +/// A message that has been received +struct SteamNetworkingMessage_t +{ + + /// Message payload + void *m_pData; + + /// Size of the payload. + uint32 m_cbSize; + + /// The connection this came from. (Not used when using the ISteamMessages interface) + HSteamNetConnection m_conn; + + /// Who sent this to us? + SteamNetworkingIdentity m_sender; + + /// The user data associated with the connection. + /// + /// This is *usually* the same as calling GetConnection() and then + /// fetching the user data associated with that connection, but for + /// the following subtle differences: + /// + /// - This user data will match the connection's user data at the time + /// is captured at the time the message is returned by the API. + /// If you subsequently change the userdata on the connection, + /// this won't be updated. + /// - This is an inline call, so it's *much* faster. + /// - You might have closed the connection, so fetching the user data + /// would not be possible. + int64 m_nConnUserData; + + /// Local timestamps when it was received + SteamNetworkingMicroseconds m_usecTimeReceived; + + /// Message number assigned by the sender + int64 m_nMessageNumber; + + /// Function used to free up m_pData. This mechanism exists so that + /// apps can create messages with buffers allocated from their own + /// heap, and pass them into the library. This function will + /// usually be something like: + /// + /// free( pMsg->m_pData ); + void (*m_pfnFreeData)( SteamNetworkingMessage_t *pMsg ); + + /// Function to used to decrement reference count and, if it's zero, release + /// the message. You should not normally need to access this directly. + /// (Use Release(), and don't set this.) + void (*m_pfnRelease)( SteamNetworkingMessage_t *pMsg ); + + /// The channel number the message was received on. + /// (Not used for messages received on "connections") + int m_nChannel; + + /// Pad to multiple of 8 bytes + int m___nPadDummy; + + #ifdef __cplusplus + + /// You MUST call this when you're done with the object, + /// to free up memory, etc. + inline void Release(); + + // For code compatibility, some accessors + inline uint32 GetSize() const { return m_cbSize; } + inline const void *GetData() const { return m_pData; } + inline int GetChannel() const { return m_nChannel; } + inline HSteamNetConnection GetConnection() const { return m_conn; } + inline int64 GetConnectionUserData() const { return m_nConnUserData; } + inline SteamNetworkingMicroseconds GetTimeReceived() const { return m_usecTimeReceived; } + inline int64 GetMessageNumber() const { return m_nMessageNumber; } + #endif +}; + +// +// Flags used to set options for message sending +// + +// Send the message unreliably. Can be lost. Messages *can* be larger than a +// single MTU (UDP packet), but there is no retransmission, so if any piece +// of the message is lost, the entire message will be dropped. +// +// The sending API does have some knowledge of the underlying connection, so +// if there is no NAT-traversal accomplished or there is a recognized adjustment +// happening on the connection, the packet will be batched until the connection +// is open again. +// +// Migration note: This is not exactly the same as k_EP2PSendUnreliable! You +// probably want k_ESteamNetworkingSendType_UnreliableNoNagle +const int k_nSteamNetworkingSend_Unreliable = 0; + +// Disable Nagle's algorithm. +// By default, Nagle's algorithm is applied to all outbound messages. This means +// that the message will NOT be sent immediately, in case further messages are +// sent soon after you send this, which can be grouped together. Any time there +// is enough buffered data to fill a packet, the packets will be pushed out immediately, +// but partially-full packets not be sent until the Nagle timer expires. See +// ISteamNetworkingSockets::FlushMessagesOnConnection, ISteamNetworkingMessages::FlushMessagesToUser +// +// NOTE: Don't just send every message without Nagle because you want packets to get there +// quicker. Make sure you understand the problem that Nagle is solving before disabling it. +// If you are sending small messages, often many at the same time, then it is very likely that +// it will be more efficient to leave Nagle enabled. A typical proper use of this flag is +// when you are sending what you know will be the last message sent for a while (e.g. the last +// in the server simulation tick to a particular client), and you use this flag to flush all +// messages. +const int k_nSteamNetworkingSend_NoNagle = 1; + +// Send a message unreliably, bypassing Nagle's algorithm for this message and any messages +// currently pending on the Nagle timer. This is equivalent to using k_ESteamNetworkingSend_Unreliable +// and then immediately flushing the messages using ISteamNetworkingSockets::FlushMessagesOnConnection +// or ISteamNetworkingMessages::FlushMessagesToUser. (But using this flag is more efficient since you +// only make one API call.) +const int k_nSteamNetworkingSend_UnreliableNoNagle = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoNagle; + +// If the message cannot be sent very soon (because the connection is still doing some initial +// handshaking, route negotiations, etc), then just drop it. This is only applicable for unreliable +// messages. Using this flag on reliable messages is invalid. +const int k_nSteamNetworkingSend_NoDelay = 4; + +// Send an unreliable message, but if it cannot be sent relatively quickly, just drop it instead of queuing it. +// This is useful for messages that are not useful if they are excessively delayed, such as voice data. +// NOTE: The Nagle algorithm is not used, and if the message is not dropped, any messages waiting on the +// Nagle timer are immediately flushed. +// +// A message will be dropped under the following circumstances: +// - the connection is not fully connected. (E.g. the "Connecting" or "FindingRoute" states) +// - there is a sufficiently large number of messages queued up already such that the current message +// will not be placed on the wire in the next ~200ms or so. +// +// if a message is dropped for these reasons, k_EResultIgnored will be returned. +const int k_nSteamNetworkingSend_UnreliableNoDelay = k_nSteamNetworkingSend_Unreliable|k_nSteamNetworkingSend_NoDelay|k_nSteamNetworkingSend_NoNagle; + +// Reliable message send. Can send up to k_cbMaxSteamNetworkingSocketsMessageSizeSend bytes in a single message. +// Does fragmentation/re-assembly of messages under the hood, as well as a sliding window for +// efficient sends of large chunks of data. +// +// The Nagle algorithm is used. See notes on k_ESteamNetworkingSendType_Unreliable for more details. +// See k_ESteamNetworkingSendType_ReliableNoNagle, ISteamNetworkingSockets::FlushMessagesOnConnection, +// ISteamNetworkingMessages::FlushMessagesToUser +// +// Migration note: This is NOT the same as k_EP2PSendReliable, it's more like k_EP2PSendReliableWithBuffering +const int k_nSteamNetworkingSend_Reliable = 8; + +// Send a message reliably, but bypass Nagle's algorithm. +// +// Migration note: This is equivalent to k_EP2PSendReliable +const int k_nSteamNetworkingSend_ReliableNoNagle = k_nSteamNetworkingSend_Reliable|k_nSteamNetworkingSend_NoNagle; + +// +// Ping location / measurement +// + +/// Object that describes a "location" on the Internet with sufficient +/// detail that we can reasonably estimate an upper bound on the ping between +/// the two hosts, even if a direct route between the hosts is not possible, +/// and the connection must be routed through the Steam Datagram Relay network. +/// This does not contain any information that identifies the host. Indeed, +/// if two hosts are in the same building or otherwise have nearly identical +/// networking characteristics, then it's valid to use the same location +/// object for both of them. +/// +/// NOTE: This object should only be used in the same process! Do not serialize it, +/// send it over the wire, or persist it in a file or database! If you need +/// to do that, convert it to a string representation using the methods in +/// ISteamNetworkingUtils(). +struct SteamNetworkPingLocation_t +{ + uint8 m_data[ 512 ]; +}; + +/// Max possible length of a ping location, in string format. This is +/// an extremely conservative worst case value which leaves room for future +/// syntax enhancements. Most strings in practice are a lot shorter. +/// If you are storing many of these, you will very likely benefit from +/// using dynamic memory. +const int k_cchMaxSteamNetworkingPingLocationString = 1024; + +/// Special values that are returned by some functions that return a ping. +const int k_nSteamNetworkingPing_Failed = -1; +const int k_nSteamNetworkingPing_Unknown = -2; + +// +// Configuration values +// + +/// Configuration values can be applied to different types of objects. +enum ESteamNetworkingConfigScope +{ + + /// Get/set global option, or defaults. Even options that apply to more specific scopes + /// have global scope, and you may be able to just change the global defaults. If you + /// need different settings per connection (for example), then you will need to set those + /// options at the more specific scope. + k_ESteamNetworkingConfig_Global = 1, + + /// Some options are specific to a particular interface. Note that all connection + /// and listen socket settings can also be set at the interface level, and they will + /// apply to objects created through those interfaces. + k_ESteamNetworkingConfig_SocketsInterface = 2, + + /// Options for a listen socket. Listen socket options can be set at the interface layer, + /// if you have multiple listen sockets and they all use the same options. + /// You can also set connection options on a listen socket, and they set the defaults + /// for all connections accepted through this listen socket. (They will be used if you don't + /// set a connection option.) + k_ESteamNetworkingConfig_ListenSocket = 3, + + /// Options for a specific connection. + k_ESteamNetworkingConfig_Connection = 4, + + k_ESteamNetworkingConfigScope__Force32Bit = 0x7fffffff +}; + +// Different configuration values have different data types +enum ESteamNetworkingConfigDataType +{ + k_ESteamNetworkingConfig_Int32 = 1, + k_ESteamNetworkingConfig_Int64 = 2, + k_ESteamNetworkingConfig_Float = 3, + k_ESteamNetworkingConfig_String = 4, + k_ESteamNetworkingConfig_FunctionPtr = 5, // NOTE: When setting callbacks, you should put the pointer into a variable and pass a pointer to that variable. + + k_ESteamNetworkingConfigDataType__Force32Bit = 0x7fffffff +}; + +/// Configuration options +enum ESteamNetworkingConfigValue +{ + k_ESteamNetworkingConfig_Invalid = 0, + + /// [global float, 0--100] Randomly discard N pct of packets instead of sending/recv + /// This is a global option only, since it is applied at a low level + /// where we don't have much context + k_ESteamNetworkingConfig_FakePacketLoss_Send = 2, + k_ESteamNetworkingConfig_FakePacketLoss_Recv = 3, + + /// [global int32]. Delay all outbound/inbound packets by N ms + k_ESteamNetworkingConfig_FakePacketLag_Send = 4, + k_ESteamNetworkingConfig_FakePacketLag_Recv = 5, + + /// [global float] 0-100 Percentage of packets we will add additional delay + /// to (causing them to be reordered) + k_ESteamNetworkingConfig_FakePacketReorder_Send = 6, + k_ESteamNetworkingConfig_FakePacketReorder_Recv = 7, + + /// [global int32] Extra delay, in ms, to apply to reordered packets. + k_ESteamNetworkingConfig_FakePacketReorder_Time = 8, + + /// [global float 0--100] Globally duplicate some percentage of packets we send + k_ESteamNetworkingConfig_FakePacketDup_Send = 26, + k_ESteamNetworkingConfig_FakePacketDup_Recv = 27, + + /// [global int32] Amount of delay, in ms, to delay duplicated packets. + /// (We chose a random delay between 0 and this value) + k_ESteamNetworkingConfig_FakePacketDup_TimeMax = 28, + + /// [connection int32] Timeout value (in ms) to use when first connecting + k_ESteamNetworkingConfig_TimeoutInitial = 24, + + /// [connection int32] Timeout value (in ms) to use after connection is established + k_ESteamNetworkingConfig_TimeoutConnected = 25, + + /// [connection int32] Upper limit of buffered pending bytes to be sent, + /// if this is reached SendMessage will return k_EResultLimitExceeded + /// Default is 512k (524288 bytes) + k_ESteamNetworkingConfig_SendBufferSize = 9, + + /// [connection int32] Minimum/maximum send rate clamp, 0 is no limit. + /// This value will control the min/max allowed sending rate that + /// bandwidth estimation is allowed to reach. Default is 0 (no-limit) + k_ESteamNetworkingConfig_SendRateMin = 10, + k_ESteamNetworkingConfig_SendRateMax = 11, + + /// [connection int32] Nagle time, in microseconds. When SendMessage is called, if + /// the outgoing message is less than the size of the MTU, it will be + /// queued for a delay equal to the Nagle timer value. This is to ensure + /// that if the application sends several small messages rapidly, they are + /// coalesced into a single packet. + /// See historical RFC 896. Value is in microseconds. + /// Default is 5000us (5ms). + k_ESteamNetworkingConfig_NagleTime = 12, + + /// [connection int32] Don't automatically fail IP connections that don't have + /// strong auth. On clients, this means we will attempt the connection even if + /// we don't know our identity or can't get a cert. On the server, it means that + /// we won't automatically reject a connection due to a failure to authenticate. + /// (You can examine the incoming connection and decide whether to accept it.) + k_ESteamNetworkingConfig_IP_AllowWithoutAuth = 23, + + // + // Settings for SDR relayed connections + // + + /// [int32 global] If the first N pings to a port all fail, mark that port as unavailable for + /// a while, and try a different one. Some ISPs and routers may drop the first + /// packet, so setting this to 1 may greatly disrupt communications. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFailInitial = 19, + + /// [int32 global] If N consecutive pings to a port fail, after having received successful + /// communication, mark that port as unavailable for a while, and try a + /// different one. + k_ESteamNetworkingConfig_SDRClient_ConsecutitivePingTimeoutsFail = 20, + + /// [int32 global] Minimum number of lifetime pings we need to send, before we think our estimate + /// is solid. The first ping to each cluster is very often delayed because of NAT, + /// routers not having the best route, etc. Until we've sent a sufficient number + /// of pings, our estimate is often inaccurate. Keep pinging until we get this + /// many pings. + k_ESteamNetworkingConfig_SDRClient_MinPingsBeforePingAccurate = 21, + + /// [int32 global] Set all steam datagram traffic to originate from the same + /// local port. By default, we open up a new UDP socket (on a different local + /// port) for each relay. This is slightly less optimal, but it works around + /// some routers that don't implement NAT properly. If you have intermittent + /// problems talking to relays that might be NAT related, try toggling + /// this flag + k_ESteamNetworkingConfig_SDRClient_SingleSocket = 22, + + /// [global string] Code of relay cluster to force use. If not empty, we will + /// only use relays in that cluster. E.g. 'iad' + k_ESteamNetworkingConfig_SDRClient_ForceRelayCluster = 29, + + /// [connection string] For debugging, generate our own (unsigned) ticket, using + /// the specified gameserver address. Router must be configured to accept unsigned + /// tickets. + k_ESteamNetworkingConfig_SDRClient_DebugTicketAddress = 30, + + /// [global string] For debugging. Override list of relays from the config with + /// this set (maybe just one). Comma-separated list. + k_ESteamNetworkingConfig_SDRClient_ForceProxyAddr = 31, + + // + // Log levels for debuging information. A higher priority + // (lower numeric value) will cause more stuff to be printed. + // + k_ESteamNetworkingConfig_LogLevel_AckRTT = 13, // [connection int32] RTT calculations for inline pings and replies + k_ESteamNetworkingConfig_LogLevel_PacketDecode = 14, // [connection int32] log SNP packets send + k_ESteamNetworkingConfig_LogLevel_Message = 15, // [connection int32] log each message send/recv + k_ESteamNetworkingConfig_LogLevel_PacketGaps = 16, // [connection int32] dropped packets + k_ESteamNetworkingConfig_LogLevel_P2PRendezvous = 17, // [connection int32] P2P rendezvous messages + k_ESteamNetworkingConfig_LogLevel_SDRRelayPings = 18, // [global int32] Ping relays + + k_ESteamNetworkingConfigValue__Force32Bit = 0x7fffffff +}; + +/// Return value of ISteamNetworkintgUtils::GetConfigValue +enum ESteamNetworkingGetConfigValueResult +{ + k_ESteamNetworkingGetConfigValue_BadValue = -1, // No such configuration value + k_ESteamNetworkingGetConfigValue_BadScopeObj = -2, // Bad connection handle, etc + k_ESteamNetworkingGetConfigValue_BufferTooSmall = -3, // Couldn't fit the result in your buffer + k_ESteamNetworkingGetConfigValue_OK = 1, + k_ESteamNetworkingGetConfigValue_OKInherited = 2, // A value was not set at this level, but the effective (inherited) value was returned. + + k_ESteamNetworkingGetConfigValueResult__Force32Bit = 0x7fffffff +}; + +// +// Debug output +// + +/// Detail level for diagnostic output callback. +/// See ISteamNetworkingUtils::SetDebugOutputFunction +enum ESteamNetworkingSocketsDebugOutputType +{ + k_ESteamNetworkingSocketsDebugOutputType_None = 0, + k_ESteamNetworkingSocketsDebugOutputType_Bug = 1, // You used the API incorrectly, or an internal error happened + k_ESteamNetworkingSocketsDebugOutputType_Error = 2, // Run-time error condition that isn't the result of a bug. (E.g. we are offline, cannot bind a port, etc) + k_ESteamNetworkingSocketsDebugOutputType_Important = 3, // Nothing is wrong, but this is an important notification + k_ESteamNetworkingSocketsDebugOutputType_Warning = 4, + k_ESteamNetworkingSocketsDebugOutputType_Msg = 5, // Recommended amount + k_ESteamNetworkingSocketsDebugOutputType_Verbose = 6, // Quite a bit + k_ESteamNetworkingSocketsDebugOutputType_Debug = 7, // Practically everything + k_ESteamNetworkingSocketsDebugOutputType_Everything = 8, // Wall of text, detailed packet contents breakdown, etc + + k_ESteamNetworkingSocketsDebugOutputType__Force32Bit = 0x7fffffff +}; + +/// Setup callback for debug output, and the desired verbosity you want. +typedef void (*FSteamNetworkingSocketsDebugOutput)( ESteamNetworkingSocketsDebugOutputType nType, const char *pszMsg ); + +// +// Valve data centers +// + +/// Convert 3- or 4-character ID to 32-bit int. +inline SteamNetworkingPOPID CalculateSteamNetworkingPOPIDFromString( const char *pszCode ) +{ + // OK we made a bad decision when we decided how to pack 3-character codes into a uint32. We'd like to support + // 4-character codes, but we don't want to break compatibility. The migration path has some subtleties that make + // this nontrivial, and there are already some IDs stored in SQL. Ug, so the 4 character code "abcd" will + // be encoded with the digits like "0xddaabbcc". + // + // Also: we don't currently use 1- or 2-character codes, but if ever do in the future, let's make sure don't read + // past the end of the string and access uninitialized memory. (And if the string is empty, we always want + // to return 0 and not read bytes past the '\0'.) + // + // There is also extra paranoia to make sure the bytes are not treated as signed. + SteamNetworkingPOPID result = (uint32)(uint8)pszCode[0] << 16U; + if ( pszCode[1] ) + { + result |= ( (uint32)(uint8)pszCode[1] << 8U ); + if ( pszCode[2] ) + { + result |= (uint32)(uint8)pszCode[2] | ( (uint32)(uint8)pszCode[3] << 24U ); + } + } + return result; +} + +/// Unpack integer to string representation, including terminating '\0' +template +inline void GetSteamNetworkingLocationPOPStringFromID( SteamNetworkingPOPID id, char (&szCode)[N] ) +{ + static_assert( N >= 5, "Fixed-size buffer not big enough to hold SDR POP ID" ); + szCode[0] = char( id >> 16U ); + szCode[1] = char( id >> 8U ); + szCode[2] = char( id ); + szCode[3] = char( id >> 24U ); // See comment above about deep regret and sadness + szCode[4] = 0; +} + +/////////////////////////////////////////////////////////////////////////////// +// +// Internal stuff + +// For code compatibility +typedef SteamNetworkingMessage_t ISteamNetworkingMessage; +typedef SteamNetworkingErrMsg SteamDatagramErrMsg; + +inline void SteamNetworkingIPAddr::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIPAddr::IsIPv6AllZeros() const { const uint64 *q = (const uint64 *)m_ipv6; return q[0] == 0 && q[1] == 0; } +inline void SteamNetworkingIPAddr::SetIPv6( const uint8 *ipv6, uint16 nPort ) { memcpy( m_ipv6, ipv6, 16 ); m_port = nPort; } +inline void SteamNetworkingIPAddr::SetIPv4( uint32 nIP, uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0xffff; m_ipv4.m_ip[0] = uint8(nIP>>24); m_ipv4.m_ip[1] = uint8(nIP>>16); m_ipv4.m_ip[2] = uint8(nIP>>8); m_ipv4.m_ip[3] = uint8(nIP); m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsIPv4() const { return m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0xffff; } +inline uint32 SteamNetworkingIPAddr::GetIPv4() const { return IsIPv4() ? ( (uint32(m_ipv4.m_ip[0])<<24) | (uint32(m_ipv4.m_ip[1])<<16) | (uint32(m_ipv4.m_ip[2])<<8) | uint32(m_ipv4.m_ip[3]) ) : 0; } +inline void SteamNetworkingIPAddr::SetIPv6LocalHost( uint16 nPort ) { m_ipv4.m_8zeros = 0; m_ipv4.m_0000 = 0; m_ipv4.m_ffff = 0; m_ipv6[12] = 0; m_ipv6[13] = 0; m_ipv6[14] = 0; m_ipv6[15] = 1; m_port = nPort; } +inline bool SteamNetworkingIPAddr::IsLocalHost() const { return ( m_ipv4.m_8zeros == 0 && m_ipv4.m_0000 == 0 && m_ipv4.m_ffff == 0 && m_ipv6[12] == 0 && m_ipv6[13] == 0 && m_ipv6[14] == 0 && m_ipv6[15] == 1 ) || ( GetIPv4() == 0x7f000001 ); } +inline bool SteamNetworkingIPAddr::operator==(const SteamNetworkingIPAddr &x ) const { return memcmp( this, &x, sizeof(SteamNetworkingIPAddr) ) == 0; } + +inline void SteamNetworkingIdentity::Clear() { memset( this, 0, sizeof(*this) ); } +inline bool SteamNetworkingIdentity::IsInvalid() const { return m_eType == k_ESteamNetworkingIdentityType_Invalid; } +inline void SteamNetworkingIdentity::SetSteamID( CSteamID steamID ) { SetSteamID64( steamID.ConvertToUint64() ); } +inline CSteamID SteamNetworkingIdentity::GetSteamID() const { return CSteamID( GetSteamID64() ); } +inline void SteamNetworkingIdentity::SetSteamID64( uint64 steamID ) { m_eType = k_ESteamNetworkingIdentityType_SteamID; m_cbSize = sizeof( m_steamID64 ); m_steamID64 = steamID; } +inline uint64 SteamNetworkingIdentity::GetSteamID64() const { return m_eType == k_ESteamNetworkingIdentityType_SteamID ? m_steamID64 : 0; } +inline bool SteamNetworkingIdentity::SetXboxPairwiseID( const char *pszString ) { size_t l = strlen( pszString ); if ( l < 1 || l >= sizeof(m_szXboxPairwiseID) ) return false; + m_eType = k_ESteamNetworkingIdentityType_XboxPairwiseID; m_cbSize = int(l+1); memcpy( m_szXboxPairwiseID, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetXboxPairwiseID() const { return m_eType == k_ESteamNetworkingIdentityType_XboxPairwiseID ? m_szXboxPairwiseID : nullptr; } +inline void SteamNetworkingIdentity::SetIPAddr( const SteamNetworkingIPAddr &addr ) { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip = addr; } +inline const SteamNetworkingIPAddr *SteamNetworkingIdentity::GetIPAddr() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress ? &m_ip : nullptr; } +inline void SteamNetworkingIdentity::SetLocalHost() { m_eType = k_ESteamNetworkingIdentityType_IPAddress; m_cbSize = (int)sizeof(m_ip); m_ip.SetIPv6LocalHost(); } +inline bool SteamNetworkingIdentity::IsLocalHost() const { return m_eType == k_ESteamNetworkingIdentityType_IPAddress && m_ip.IsLocalHost(); } +inline bool SteamNetworkingIdentity::SetGenericString( const char *pszString ) { size_t l = strlen( pszString ); if ( l >= sizeof(m_szGenericString) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericString; m_cbSize = int(l+1); memcpy( m_szGenericString, pszString, m_cbSize ); return true; } +inline const char *SteamNetworkingIdentity::GetGenericString() const { return m_eType == k_ESteamNetworkingIdentityType_GenericString ? m_szGenericString : nullptr; } +inline bool SteamNetworkingIdentity::SetGenericBytes( const void *data, size_t cbLen ) { if ( cbLen > sizeof(m_genericBytes) ) return false; + m_eType = k_ESteamNetworkingIdentityType_GenericBytes; m_cbSize = int(cbLen); memcpy( m_genericBytes, data, m_cbSize ); return true; } +inline const uint8 *SteamNetworkingIdentity::GetGenericBytes( int &cbLen ) const { if ( m_eType != k_ESteamNetworkingIdentityType_GenericBytes ) return nullptr; + cbLen = m_cbSize; return m_genericBytes; } +inline bool SteamNetworkingIdentity::operator==(const SteamNetworkingIdentity &x ) const { return m_eType == x.m_eType && m_cbSize == x.m_cbSize && memcmp( m_genericBytes, x.m_genericBytes, m_cbSize ) == 0; } +inline void SteamNetworkingMessage_t::Release() { (*m_pfnRelease)( this ); } + +#if defined( STEAMNETWORKINGSOCKETS_STATIC_LINK ) || !defined( STEAMNETWORKINGSOCKETS_STEAM ) +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIPAddr_ToString( const SteamNetworkingIPAddr *pAddr, char *buf, size_t cbBuf, bool bWithPort ); +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIPAddr_ParseString( SteamNetworkingIPAddr *pAddr, const char *pszStr ); +STEAMNETWORKINGSOCKETS_INTERFACE void SteamAPI_SteamNetworkingIdentity_ToString( const SteamNetworkingIdentity &identity, char *buf, size_t cbBuf ); +STEAMNETWORKINGSOCKETS_INTERFACE bool SteamAPI_SteamNetworkingIdentity_ParseString( SteamNetworkingIdentity *pIdentity, size_t sizeofIdentity, const char *pszStr ); +inline void SteamNetworkingIPAddr::ToString( char *buf, size_t cbBuf, bool bWithPort ) const { SteamAPI_SteamNetworkingIPAddr_ToString( this, buf, cbBuf, bWithPort ); } +inline bool SteamNetworkingIPAddr::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIPAddr_ParseString( this, pszStr ); } +inline void SteamNetworkingIdentity::ToString( char *buf, size_t cbBuf ) const { SteamAPI_SteamNetworkingIdentity_ToString( *this, buf, cbBuf ); } +inline bool SteamNetworkingIdentity::ParseString( const char *pszStr ) { return SteamAPI_SteamNetworkingIdentity_ParseString( this, sizeof(*this), pszStr ); } +#endif + +#endif // #ifndef STEAMNETWORKINGTYPES diff --git a/Generator/steam_sdk/steamtypes.h b/Generator/steam_sdk/steamtypes.h index 45c195e..72d2d17 100644 --- a/Generator/steam_sdk/steamtypes.h +++ b/Generator/steam_sdk/steamtypes.h @@ -85,25 +85,25 @@ typedef unsigned int uintp; #endif // else _WIN32 #ifdef API_GEN -# define CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) +# define STEAM_CLANG_ATTR(ATTR) __attribute__((annotate( ATTR ))) #else -# define CLANG_ATTR(ATTR) +# define STEAM_CLANG_ATTR(ATTR) #endif -#define METHOD_DESC(DESC) CLANG_ATTR( "desc:" #DESC ";" ) -#define IGNOREATTR() CLANG_ATTR( "ignore" ) -#define OUT_STRUCT() CLANG_ATTR( "out_struct: ;" ) -#define OUT_STRING() CLANG_ATTR( "out_string: ;" ) -#define OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) -#define OUT_ARRAY_COUNT(COUNTER, DESC) CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) -#define ARRAY_COUNT(COUNTER) CLANG_ATTR( "array_count:" #COUNTER ";" ) -#define ARRAY_COUNT_D(COUNTER, DESC) CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) -#define BUFFER_COUNT(COUNTER) CLANG_ATTR( "buffer_count:" #COUNTER ";" ) -#define OUT_BUFFER_COUNT(COUNTER) CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) -#define OUT_STRING_COUNT(COUNTER) CLANG_ATTR( "out_string_count:" #COUNTER ";" ) -#define DESC(DESC) CLANG_ATTR("desc:" #DESC ";") -#define CALL_RESULT(RESULT_TYPE) CLANG_ATTR("callresult:" #RESULT_TYPE ";") -#define CALL_BACK(RESULT_TYPE) CLANG_ATTR("callback:" #RESULT_TYPE ";") +#define STEAM_METHOD_DESC(DESC) STEAM_CLANG_ATTR( "desc:" #DESC ";" ) +#define STEAM_IGNOREATTR() STEAM_CLANG_ATTR( "ignore" ) +#define STEAM_OUT_STRUCT() STEAM_CLANG_ATTR( "out_struct: ;" ) +#define STEAM_OUT_STRING() STEAM_CLANG_ATTR( "out_string: ;" ) +#define STEAM_OUT_ARRAY_CALL(COUNTER,FUNCTION,PARAMS) STEAM_CLANG_ATTR( "out_array_call:" #COUNTER "," #FUNCTION "," #PARAMS ";" ) +#define STEAM_OUT_ARRAY_COUNT(COUNTER, DESC) STEAM_CLANG_ATTR( "out_array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_ARRAY_COUNT(COUNTER) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";" ) +#define STEAM_ARRAY_COUNT_D(COUNTER, DESC) STEAM_CLANG_ATTR( "array_count:" #COUNTER ";desc:" #DESC ) +#define STEAM_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_BUFFER_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_buffer_count:" #COUNTER ";" ) +#define STEAM_OUT_STRING_COUNT(COUNTER) STEAM_CLANG_ATTR( "out_string_count:" #COUNTER ";" ) +#define STEAM_DESC(DESC) STEAM_CLANG_ATTR("desc:" #DESC ";") +#define STEAM_CALL_RESULT(RESULT_TYPE) STEAM_CLANG_ATTR("callresult:" #RESULT_TYPE ";") +#define STEAM_CALL_BACK(RESULT_TYPE) STEAM_CLANG_ATTR("callback:" #RESULT_TYPE ";") const int k_cubSaltSize = 8; typedef uint8 Salt_t[ k_cubSaltSize ]; @@ -180,5 +180,8 @@ const ManifestId_t k_uManifestIdInvalid = 0; typedef uint64 SiteId_t; const SiteId_t k_ulSiteIdInvalid = 0; +// Party Beacon ID +typedef uint64 PartyBeaconID_t; +const PartyBeaconID_t k_ulPartyBeaconIdInvalid = 0; #endif // STEAMTYPES_H diff --git a/Jenkinsfile b/Jenkinsfile index 3095d5d..3aa7ccc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,17 +1,46 @@ node ( 'vs2017' ) { - stage 'Checkout' - checkout scm + try + { + stage 'Checkout' + checkout scm - stage 'Restore' - bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.csproj" - - stage 'Build Release' - bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.csproj --configuration Release" - - stage 'Build Debug' - bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.csproj --configuration Debug" + stage 'Restore' + bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj" + bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj" + bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj" + bat "dotnet restore Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj" + + stage 'Build Release' + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj --configuration Release" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj --configuration Release" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj --configuration Release" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj --configuration Release" + + stage 'Build Debug' + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Win32.csproj --configuration Debug" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Win64.csproj --configuration Debug" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Posix32.csproj --configuration Debug" + bat "dotnet build Facepunch.Steamworks/Facepunch.Steamworks.Posix64.csproj --configuration Debug" - stage 'Archive' - archiveArtifacts artifacts: 'Facepunch.Steamworks/bin/**/*' + stage 'Archive' + archiveArtifacts artifacts: 'Facepunch.Steamworks/bin/**/*' + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win32.dll UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win32.pdb UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win32.xml UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win64.dll UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win64.pdb UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Win64.xml UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix32.dll UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix32.pdb UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix32.xml UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix64.dll UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix64.pdb UnityPlugin\\" ) + bat( "copy /Y Facepunch.Steamworks\\bin\\Debug\\netstandard2.0\\Facepunch.Steamworks.Posix64.xml UnityPlugin\\" ) + archiveArtifacts artifacts: 'UnityPlugin/**/*' + } + finally + { + cleanWs() + } } \ No newline at end of file diff --git a/README.md b/README.md index a2edc9f..7a9ed0a 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,22 @@ Another fucking c# Steamworks implementation [![Build Status](http://build.facepunch.com/buildStatus/icon?job=Facepunch/Facepunch.Steamworks/master)](http://build.facepunch.com/job/Facepunch/job/Facepunch.Steamworks/job/master/) +## Features + +| Feature | Supported | +|----------|------------ | +| Windows | ✔ | +| Linux | ✔ | +| MacOS | ✔ | +| Unity Support | ✔ | +| Unity IL2CPP Support | ✔ | +| Async Callbacks (steam callresults) | ✔ | +| Events (steam callbacks) | ✔ | +| Single C# dll (no native requirements apart from Steam) | ✔ | +| Open Source | ✔ | +| MIT license | ✔ | +| Any 32bit OS | ❌ | + ## Why The Steamworks C# implementations I found that were compatible with Unity have worked for a long time. But I hate them all. For a number of different reasons. @@ -11,109 +27,322 @@ The Steamworks C# implementations I found that were compatible with Unity have w * They're not up to date. * They require a 3rd party native dll. * They can't be compiled into a standalone dll (in Unity). -* They have a license. +* They're not free +* They have a restrictive license. C# is meant to make things easier. So lets try to wrap it up in a way that makes it all easier. ## What -So say you want to print a list of your friends? +### Get your own information ```csharp -foreach ( var friend in client.Friends.All ) + SteamClient.SteamId // Your SteamId + SteamClient.Name // Your Name +``` + +### View your friends list + +```csharp +foreach ( var friend in SteamFriends.GetFriends() ) { - Console.WriteLine( "{0}: {1}", friend.Id, friend.Name ); + Console.WriteLine( "{friend.Id}: {friend.Name}" ); + Console.WriteLine( "{friend.IsOnline} / {friend.SteamLevel}" ); + + friend.SendMessage( "Hello Friend" ); } ``` -But what if you want to get a list of friends playing the same game that we're playing? + +### App Info ```csharp -foreach ( var friend in client.Friends.All.Where( x => x.IsPlayingThisGame ) ) + Console.WriteLine( SteamApps.GameLanguage ); // Print the current game language + var installDir = SteamApps.AppInstallDir( 4000 ); // Get the path to the Garry's Mod install folder + + var fileinfo = await SteamApps.GetFileDetailsAsync( "hl2.exe" ); // async get file details + DoSomething( fileinfo.SizeInBytes, fileinfo.Sha1 ); +``` + +### Get Avatars + +```csharp + var image = await SteamFriends.GetLargeAvatarAsync( steamid ); + if ( !image.HasValue ) return DefaultImage; + + return MakeTextureFromRGBA( image.Data, image.Width, image.Height ); +``` + +### Get a list of servers + +```csharp +using ( var list = new ServerList.Internet() ) { - Console.WriteLine( "{0}: {1}", friend.Id, friend.Name ); + list.AddFilter( "map", "de_dust" ); + await list.RunQueryAsync(); + + foreach ( var server in list.Responsive ) + { + Console.WriteLine( $"{server.Address} {server.Name}" ); + } } ``` -You can view examples of everything in the Facepunch.Steamworks.Test project. +### Achievements -# Usage +List them + +```csharp + foreach ( var a in SteamUserStats.Achievements ) + { + Console.WriteLine( $"{a.Name} ({a.State}})" ); + } +``` + +Unlock them + +```csharp + var ach = new Achievement( "GM_PLAYED_WITH_GARRY" ); + ach.Trigger(); +``` + +### Voice + +```csharp + SteamUser.VoiceRecord = KeyDown( "V" ); + + if ( SteamUser.HasVoiceData ) + { + var bytesrwritten = SteamUser.ReadVoiceData( stream ); + // Send Stream Data To Server or Something + } +``` + + +### Auth + +```csharp + // Client sends ticket data to server somehow + var ticket = SteamUser.GetAuthSessionTicket(); + + // server listens to event + SteamServer.OnValidateAuthTicketResponse += ( steamid, ownerid, rsponse ) => + { + if ( rsponse == AuthResponse.OK ) + TellUserTheyCanBeOnServer( steamid ); + else + KickUser( steamid ); + }; + + // server gets ticket data from client, calls this function.. which either returns + // false straight away, or will issue a TicketResponse. + if ( !SteamServer.BeginAuthSession( ticketData, clientSteamId ) ) + { + KickUser( clientSteamId ); + } + + // + // Client is leaving, cancels their ticket OnValidateAuth is called on the server again + // this time with AuthResponse.AuthTicketCanceled + // + ticket.Cancel(); +``` + +### Utils + +```csharp + SteamUtils.SecondsSinceAppActive; + SteamUtils.SecondsSinceComputerActive; + SteamUtils.IpCountry; + SteamUtils.UsingBatteryPower; + SteamUtils.CurrentBatteryPower; + SteamUtils.AppId; + SteamUtils.IsOverlayEnabled; + SteamUtils.IsSteamRunningInVR; + SteamUtils.IsSteamInBigPictureMode; +``` + +### Workshop + +Download a workshop item by ID + +```csharp + SteamUGC.Download( 1717844711 ); +``` + +Get a workshop item information + +```csharp + var itemInfo = await Ugc.Item.Get( 1720164672 ); + + Console.WriteLine( $"Title: {itemInfo?.Title}" ); + Console.WriteLine( $"IsInstalled: {itemInfo?.IsInstalled}" ); + Console.WriteLine( $"IsDownloading: {itemInfo?.IsDownloading}" ); + Console.WriteLine( $"IsDownloadPending: {itemInfo?.IsDownloadPending}" ); + Console.WriteLine( $"IsSubscribed: {itemInfo?.IsSubscribed}" ); + Console.WriteLine( $"NeedsUpdate: {itemInfo?.NeedsUpdate}" ); + Console.WriteLine( $"Description: {itemInfo?.Description}" ); +``` + +Query a list of workshop items + +```csharp + var q = Ugc.Query.All + .WithTag( "Fun" ) + .WithTag( "Movie" ) + .MatchAllTags(); + + var result = await q.GetPageAsync( 1 ); + + Console.WriteLine( $"ResultCount: {result?.ResultCount}" ); + Console.WriteLine( $"TotalCount: {result?.TotalCount}" ); + + foreach ( Ugc.Item entry in result.Value.Entries ) + { + Console.WriteLine( $" {entry.Title}" ); + } +``` + +Query items created by friends + +```csharp + var q = Ugc.UserQuery.All + .CreatedByFriends(); +``` + +Query items created by yourself + +```csharp + var q = Ugc.UserQuery.All + .FromSelf(); +``` + +Publish your own file + +```csharp + var result = await Ugc.Editor.NewCommunityFile + .WithTitle( "My New FIle" ) + .WithDescription( "This is a description" ) + .WithContent( "c:/folder/addon/location" ) + .WithTag( "awesome" ) + .WithTag( "small" ) + .SubmitAsync( iProgressBar ); +``` + +### Steam Cloud + +Write a cloud file + +```csharp + SteamRemoteStorage.FileWrite( "file.txt", fileContents ); +``` + +Read a cloud file + +```csharp + var fileContents = SteamRemoteStorage.ReadFile( "file.txt" ); +``` + +List all files + +```csharp + foreach ( var file in SteamRemoteStorage.Files ) + { + Console.WriteLine( $"{file} ({SteamRemoteStorage.FileSize(file)} {SteamRemoteStorage.FileTime( file )})" ); + } +``` + + +### Steam Inventory + +Get item definitions + +```csharp + foreach ( InventoryDef def in SteamInventory.Definitions ) + { + Console.WriteLine( $"{def.Name}" ); + } +``` + +Get items that are for sale in the item shop + +```csharp + var defs = await SteamInventory.GetDefinitionsWithPricesAsync(); + + foreach ( var def in defs ) + { + Console.WriteLine( $"{def.Name} [{def.LocalPriceFormatted}]" ); + } +``` + +Get a list of your items + +```csharp + var result = await SteamInventory.GetItems(); + + // result is disposable, good manners to dispose after use + using ( result ) + { + var items = result?.GetItems( bWithProperties ); + + foreach ( InventoryItem item in items ) + { + Console.WriteLine( $"{item.Id} / {item.Quantity} / {item.Def.Name} " ); + } + } +``` + +# Getting Started ## Client -Compile the Facepunch.Steamworks project and add the library to your Unity project. To create a client you can do this. +To initialize a client you can do this. ```csharp -var client = new Facepunch.Steamworks.Client( 252490 ); +using Steamworks; + +// ... + +try +{ + SteamClient.Init( 4000 ); +} +catch ( System.Exception e ) +{ + // Couldn't init for some reason (steam is closed etc) +} ``` -Replace 252490 with the appid of your game. This should be a singleton - you should only create one client, right at the start of your game. +Replace 4000 with the appid of your game. You shouldn't call any Steam functions before you initialize. -The client is disposable, so when you're closing your game should probably call.. +When you're done, when you're closing your game, just shutdown. ```csharp -client.Dispose(); +SteamClient.Shutdown(); ``` -Or use it in a using block if you can. - - ## Server To create a server do this. ```csharp -ServerInit options = new ServerInit("GameDirectoryName", "GameDescription"); -``` - -```csharp -var server = new Facepunch.Steamworks.Server(252490, options); -``` - -This will register a secure server for game 252490, any ip, port 28015. Again, more usage in the Facepunch.Steamworks.Test project. - -## Lobby - -To create a Lobby do this. -```csharp -client.Lobby.Create(Steamworks.Lobby.Type.Public, 10); -``` - -Created lobbies are auto-joined, but if you want to find a friend's lobby, you'd call -```csharp -client.LobbyList.Refresh(); -//wait for the callback -client.LobbyList.OnLobbiesUpdated = () => +var serverInit = new SteamServerInit( "gmod", "Garry Mode" ) { - if (client.LobbyList.Finished) - { - foreach (LobbyList.Lobby lobby in client.LobbyList.Lobbies) - { - Console.WriteLine($"Found Lobby: {lobby.Name}"); - } - } + GamePort = 28015, + Secure = true, + QueryPort = 28016 }; -//join a lobby you found -client.Lobby.Join(LobbyList.Lobbies[0]); + +try +{ + Steamworks.SteamServer.Init( 4000, serverInit ); +} +catch ( System.Exception ) +{ + // Couldn't init for some reason (dll errors, blocked ports) +} ``` -Your can find more examples of Lobby functionality in the Lobby.cs file in the test project. Sending chat messages, assinging lobby data and member data, etc. - - -# Unity - -Yeah this works under Unity. That's half the point of it. - -There's another repo with an example project with it working in Unity. You can find it [here](https://github.com/Facepunch/Facepunch.Steamworks.Unity/blob/master/Assets/Scripts/SteamTest.cs). - -The TLDR is before you create the Client or the Server, call this to let Facepunch.Steamworks know which platform we're on - because it can't tell the difference between osx and linux by itself. - -```csharp -Facepunch.Steamworks.Config.ForUnity( Application.platform.ToString() ); -``` - -You'll also want to put steam_api64.dll and steam_appid.txt (on windows 64) in your project root next to Assets, and use an editor script like [this](https://github.com/Facepunch/Facepunch.Steamworks.Unity/blob/master/Assets/Scripts/Editor/CopySteamLibraries.cs) to copy them into standalone builds. - # Help Wanna help? Go for it, pull requests, bug reports, yes, do it. diff --git a/UnityPlugin/Facepunch.Steamworks.dll.meta b/UnityPlugin/Facepunch.Steamworks.dll.meta new file mode 100644 index 0000000..ac818be --- /dev/null +++ b/UnityPlugin/Facepunch.Steamworks.dll.meta @@ -0,0 +1,33 @@ +fileFormatVersion: 2 +guid: a8f68628902ac4949919f2f5865f15c2 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + Windows Store Apps: WindowsStoreApps + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/Facepunch.Steamworks.pdb.meta b/UnityPlugin/Facepunch.Steamworks.pdb.meta new file mode 100644 index 0000000..c16fa0e --- /dev/null +++ b/UnityPlugin/Facepunch.Steamworks.pdb.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: dd29afd67a2b68243b283f848e393b97 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/Facepunch.Steamworks.xml.meta b/UnityPlugin/Facepunch.Steamworks.xml.meta new file mode 100644 index 0000000..f6becc8 --- /dev/null +++ b/UnityPlugin/Facepunch.Steamworks.xml.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 238ade710c967c74bb035e6179469ddd +TextScriptImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin.meta b/UnityPlugin/redistributable_bin.meta new file mode 100644 index 0000000..c544672 --- /dev/null +++ b/UnityPlugin/redistributable_bin.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9eb418beccc204946862a1a8f099ec39 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/linux32.meta b/UnityPlugin/redistributable_bin/linux32.meta new file mode 100644 index 0000000..de7c76e --- /dev/null +++ b/UnityPlugin/redistributable_bin/linux32.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: ce9561d2de976e74684ab44c5fec0813 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/linux32/libsteam_api.so b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so new file mode 100644 index 0000000..348a107 Binary files /dev/null and b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so differ diff --git a/UnityPlugin/redistributable_bin/linux32/libsteam_api.so.meta b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so.meta new file mode 100644 index 0000000..7760b89 --- /dev/null +++ b/UnityPlugin/redistributable_bin/linux32/libsteam_api.so.meta @@ -0,0 +1,89 @@ +fileFormatVersion: 2 +guid: fd99b19e202e95a44ace17e10bac2feb +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 1 + Exclude Linux: 1 + Exclude Linux64: 1 + Exclude LinuxUniversal: 1 + Exclude OSXUniversal: 1 + Exclude Win: 1 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + CPU: AnyCPU + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: LinuxUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/linux64.meta b/UnityPlugin/redistributable_bin/linux64.meta new file mode 100644 index 0000000..2c7346c --- /dev/null +++ b/UnityPlugin/redistributable_bin/linux64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 2b478e6d3d1ef9848b43453c8e68cd0d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/linux64/libsteam_api.so b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so new file mode 100644 index 0000000..eb230a9 Binary files /dev/null and b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so differ diff --git a/UnityPlugin/redistributable_bin/linux64/libsteam_api.so.meta b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so.meta new file mode 100644 index 0000000..5b1fd9a --- /dev/null +++ b/UnityPlugin/redistributable_bin/linux64/libsteam_api.so.meta @@ -0,0 +1,89 @@ +fileFormatVersion: 2 +guid: a3b75fd2a03fb3149b60c2040555c3fe +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux: 1 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 1 + Exclude Win: 0 + Exclude Win64: 0 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: Linux + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: OSXUniversal + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/osx32.meta b/UnityPlugin/redistributable_bin/osx32.meta new file mode 100644 index 0000000..484b36e --- /dev/null +++ b/UnityPlugin/redistributable_bin/osx32.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 93319165ca0834f41b428adbdad19105 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle b/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle new file mode 100644 index 0000000..ce8dc57 Binary files /dev/null and b/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle differ diff --git a/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle.meta b/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle.meta new file mode 100644 index 0000000..c0be5c9 --- /dev/null +++ b/UnityPlugin/redistributable_bin/osx32/libsteam_api.bundle.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: 7d6647fb9d80f5b4f9b2ff1378756bee +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + DefaultValueInitialized: true + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/steam_api.dll b/UnityPlugin/redistributable_bin/steam_api.dll new file mode 100644 index 0000000..060b6b9 Binary files /dev/null and b/UnityPlugin/redistributable_bin/steam_api.dll differ diff --git a/UnityPlugin/redistributable_bin/steam_api.dll.meta b/UnityPlugin/redistributable_bin/steam_api.dll.meta new file mode 100644 index 0000000..eb3a7c4 --- /dev/null +++ b/UnityPlugin/redistributable_bin/steam_api.dll.meta @@ -0,0 +1,89 @@ +fileFormatVersion: 2 +guid: f47308500f9b7734392a75ff281c7457 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude Win: 0 + Exclude Win64: 1 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86 + DefaultValueInitialized: true + OS: Windows + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win64 + second: + enabled: 0 + settings: + CPU: None + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/steam_api.lib b/UnityPlugin/redistributable_bin/steam_api.lib new file mode 100644 index 0000000..07bf145 Binary files /dev/null and b/UnityPlugin/redistributable_bin/steam_api.lib differ diff --git a/UnityPlugin/redistributable_bin/steam_api.lib.meta b/UnityPlugin/redistributable_bin/steam_api.lib.meta new file mode 100644 index 0000000..d2fc3e8 --- /dev/null +++ b/UnityPlugin/redistributable_bin/steam_api.lib.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 3ffd5813d91aefd459583d77d2e49ddd +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/win64.meta b/UnityPlugin/redistributable_bin/win64.meta new file mode 100644 index 0000000..b761a55 --- /dev/null +++ b/UnityPlugin/redistributable_bin/win64.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4080c4017456bde44a6f4b5915b8d27c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.dll b/UnityPlugin/redistributable_bin/win64/steam_api64.dll new file mode 100644 index 0000000..328dade Binary files /dev/null and b/UnityPlugin/redistributable_bin/win64/steam_api64.dll differ diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.dll.meta b/UnityPlugin/redistributable_bin/win64/steam_api64.dll.meta new file mode 100644 index 0000000..d371fcd --- /dev/null +++ b/UnityPlugin/redistributable_bin/win64/steam_api64.dll.meta @@ -0,0 +1,89 @@ +fileFormatVersion: 2 +guid: cf5718c4ee1c31e458f8a58a77f4eef0 +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + '': Any + second: + enabled: 0 + settings: + Exclude Editor: 0 + Exclude Linux: 0 + Exclude Linux64: 0 + Exclude LinuxUniversal: 0 + Exclude OSXUniversal: 0 + Exclude Win: 1 + Exclude Win64: 0 + - first: + Any: + second: + enabled: 1 + settings: {} + - first: + Editor: Editor + second: + enabled: 1 + settings: + CPU: x86_64 + DefaultValueInitialized: true + OS: AnyOS + - first: + Facebook: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Facebook: Win64 + second: + enabled: 0 + settings: + CPU: AnyCPU + - first: + Standalone: Linux + second: + enabled: 1 + settings: + CPU: x86 + - first: + Standalone: Linux64 + second: + enabled: 1 + settings: + CPU: x86_64 + - first: + Standalone: LinuxUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: OSXUniversal + second: + enabled: 1 + settings: + CPU: AnyCPU + - first: + Standalone: Win + second: + enabled: 0 + settings: + CPU: None + - first: + Standalone: Win64 + second: + enabled: 1 + settings: + CPU: AnyCPU + userData: + assetBundleName: + assetBundleVariant: diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.lib b/UnityPlugin/redistributable_bin/win64/steam_api64.lib new file mode 100644 index 0000000..6370681 Binary files /dev/null and b/UnityPlugin/redistributable_bin/win64/steam_api64.lib differ diff --git a/UnityPlugin/redistributable_bin/win64/steam_api64.lib.meta b/UnityPlugin/redistributable_bin/win64/steam_api64.lib.meta new file mode 100644 index 0000000..235d424 --- /dev/null +++ b/UnityPlugin/redistributable_bin/win64/steam_api64.lib.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: b7f47a56d1502a54aac85b9fadc6741e +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: